diff options
1183 files changed, 10445 insertions, 2654 deletions
diff --git a/.clang-format b/.clang-format index 8c015ef..cba23d6 100644 --- a/.clang-format +++ b/.clang-format @@ -20,6 +20,8 @@ SortUsingDeclarations: false SpaceAfterTemplateKeyword: true IncludeBlocks: Regroup IncludeCategories: + - Regex: '^[<"]cmSTL\.hxx' + Priority: -2 - Regex: '^[<"]cmConfigure\.h' Priority: -1 - Regex: '^<queue>' diff --git a/.gitlab/artifacts.yml b/.gitlab/artifacts.yml index c2d28da..be10e24 100644 --- a/.gitlab/artifacts.yml +++ b/.gitlab/artifacts.yml @@ -34,10 +34,12 @@ - build/Tests/CMake*/PseudoMemcheck/purify - build/Tests/CMake*/PseudoMemcheck/memcheck_fail - build/Tests/CMake*/PseudoMemcheck/BC + - build/Tests/CMake*/PseudoMemcheck/cuda-memcheck - build/Tests/CMake*/PseudoMemcheck/valgrind.exe - build/Tests/CMake*/PseudoMemcheck/purify.exe - build/Tests/CMake*/PseudoMemcheck/memcheck_fail.exe - build/Tests/CMake*/PseudoMemcheck/BC.exe + - build/Tests/CMake*/PseudoMemcheck/cuda-memcheck.exe - build/Tests/CMake*/PseudoMemcheck/NoLog - build/Tests/CMake*Lib/*LibTests - build/Tests/CMake*Lib/*LibTests.exe diff --git a/CMakeLists.txt b/CMakeLists.txt index f62c666..2d860d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,6 +108,11 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) endif() endif() +# Inform STL library header wrappers whether to use system versions. +configure_file(${CMake_SOURCE_DIR}/Utilities/std/cmSTL.hxx.in + ${CMake_BINARY_DIR}/Utilities/cmSTL.hxx + @ONLY) + # set the internal encoding of CMake to UTF-8 set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8) diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 9ec9e8f..476a1c6 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -6,7 +6,9 @@ set(CTEST_PROJECT_NAME "CMake") set(CTEST_NIGHTLY_START_TIME "1:00:00 UTC") -set(CTEST_DROP_METHOD "http") +if(NOT CTEST_DROP_METHOD STREQUAL "https") + set(CTEST_DROP_METHOD "http") +endif() set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=CMake") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Help/command/add_compile_definitions.rst b/Help/command/add_compile_definitions.rst index e10aba0..48e33be 100644 --- a/Help/command/add_compile_definitions.rst +++ b/Help/command/add_compile_definitions.rst @@ -1,6 +1,8 @@ add_compile_definitions ----------------------- +.. versionadded:: 3.12 + Add preprocessor definitions to the compilation of source files. .. code-block:: cmake diff --git a/Help/command/add_link_options.rst b/Help/command/add_link_options.rst index faa4afb..f03e7c0 100644 --- a/Help/command/add_link_options.rst +++ b/Help/command/add_link_options.rst @@ -1,6 +1,8 @@ add_link_options ---------------- +.. versionadded:: 3.13 + Add options to the link step for executable, shared library or module library targets in the current directory and below that are added after this command is invoked. diff --git a/Help/command/cmake_language.rst b/Help/command/cmake_language.rst index 0988097..9e98d79 100644 --- a/Help/command/cmake_language.rst +++ b/Help/command/cmake_language.rst @@ -1,6 +1,8 @@ cmake_language -------------- +.. versionadded:: 3.18 + Call meta-operations on CMake commands. Synopsis diff --git a/Help/command/cmake_parse_arguments.rst b/Help/command/cmake_parse_arguments.rst index fcd36d0..8803ec8 100644 --- a/Help/command/cmake_parse_arguments.rst +++ b/Help/command/cmake_parse_arguments.rst @@ -1,6 +1,8 @@ cmake_parse_arguments --------------------- +.. versionadded:: 3.5 + Parse function or macro arguments. .. code-block:: cmake diff --git a/Help/command/configure_file.rst b/Help/command/configure_file.rst index 29e85bd..46d1a05 100644 --- a/Help/command/configure_file.rst +++ b/Help/command/configure_file.rst @@ -7,6 +7,7 @@ Copy a file to another location and modify its contents. configure_file(<input> <output> [COPYONLY] [ESCAPE_QUOTES] [@ONLY] + [NO_SOURCE_PERMISSIONS] [NEWLINE_STYLE [UNIX|DOS|WIN32|LF|CRLF] ]) Copies an ``<input>`` file to an ``<output>`` file and substitutes @@ -82,6 +83,11 @@ The arguments are: Restrict variable replacement to references of the form ``@VAR@``. This is useful for configuring scripts that use ``${VAR}`` syntax. + ``NO_SOURCE_PERMISSIONS`` + Does not transfer the file permissions of the original file to the copy. + The copied file permissions default to the standard 644 value + (-rw-r--r--). + ``NEWLINE_STYLE <style>`` Specify the newline style for the output file. Specify ``UNIX`` or ``LF`` for ``\n`` newlines, or specify diff --git a/Help/command/continue.rst b/Help/command/continue.rst index 31c7089..f62802e 100644 --- a/Help/command/continue.rst +++ b/Help/command/continue.rst @@ -1,6 +1,8 @@ continue -------- +.. versionadded:: 3.2 + Continue to the top of enclosing foreach or while loop. .. code-block:: cmake diff --git a/Help/command/get_property.rst b/Help/command/get_property.rst index 123cd45..0602518 100644 --- a/Help/command/get_property.rst +++ b/Help/command/get_property.rst @@ -10,7 +10,7 @@ Get a property. DIRECTORY [<dir>] | TARGET <target> | SOURCE <source> | - [TARGET_DIRECTORY <target> | DIRECTORY <dir>] | + [DIRECTORY <dir> | TARGET_DIRECTORY <target>] | INSTALL <file> | TEST <test> | CACHE <entry> | @@ -31,18 +31,36 @@ It must be one of the following: Scope defaults to the current directory but another directory (already processed by CMake) may be named by the full or relative path ``<dir>``. + See also the :command:`get_directory_property` command. ``TARGET`` Scope must name one existing target. + See also the :command:`get_target_property` command. ``SOURCE`` - Scope must name one source file. + Scope must name one source file. By default, the source file's property + will be read from the current source directory's scope, but this can be + overridden with one of the following sub-options: + + ``DIRECTORY <dir>`` + The source file property will be read from the ``<dir>`` directory's + scope. CMake must already know about that source directory, either by + having added it through a call to :command:`add_subdirectory` or ``<dir>`` + being the top level source directory. Relative paths are treated as + relative to the current source directory. + + ``TARGET_DIRECTORY <target>`` + The source file property will be read from the directory scope in which + ``<target>`` was created (``<target>`` must therefore already exist). + + See also the :command:`get_source_file_property` command. ``INSTALL`` Scope must name one installed file path. ``TEST`` Scope must name one existing test. + See also the :command:`get_test_property` command. ``CACHE`` Scope must name one cache entry. @@ -50,15 +68,6 @@ It must be one of the following: ``VARIABLE`` Scope is unique and does not accept a name. -In the ``SOURCE`` case, the queried source file scope can be changed by -specifying one of the additional options: ``DIRECTORY`` or ``TARGET_DIRECTORY``. - -``DIRECTORY`` takes a path to a processed directory, and the source file property -will be read from that directory scope. - -``TARGET_DIRECTORY`` takes the name of an existing target. The source file -property will be read from this target's directory scope. - The required ``PROPERTY`` option is immediately followed by the name of the property to get. If the property is not set an empty value is returned, although some properties support inheriting from a parent scope diff --git a/Help/command/get_source_file_property.rst b/Help/command/get_source_file_property.rst index 1060251..76ed776 100644 --- a/Help/command/get_source_file_property.rst +++ b/Help/command/get_source_file_property.rst @@ -5,24 +5,33 @@ Get a property for a source file. .. code-block:: cmake - get_source_file_property(VAR file [TARGET_DIRECTORY <target> | DIRECTORY <dir>] property) + get_source_file_property(<variable> <file> + [DIRECTORY <dir> | TARGET_DIRECTORY <target>] + <property>) Gets a property from a source file. The value of the property is -stored in the variable ``VAR``. If the source property is not found, the -behavior depends on whether it has been defined to be an ``INHERITED`` property -or not (see :command:`define_property`). Non-inherited properties will set -``VAR`` to "NOTFOUND", whereas inherited properties will search the relevant -parent scope as described for the :command:`define_property` command and -if still unable to find the property, ``VAR`` will be set to an empty string. - -The queried source file scope can be changed by specifying one of the -additional options: ``DIRECTORY`` or ``TARGET_DIRECTORY``. - -``DIRECTORY`` takes a path to a processed directory, and the source file property -will be read from that directory scope. - -``TARGET_DIRECTORY`` takes the name of an existing target. The source file -property will be read from this target's directory scope. +stored in the specified ``<variable>``. If the source property is not found, +the behavior depends on whether it has been defined to be an ``INHERITED`` +property or not (see :command:`define_property`). Non-inherited properties +will set ``variable`` to ``NOTFOUND``, whereas inherited properties will search +the relevant parent scope as described for the :command:`define_property` +command and if still unable to find the property, ``variable`` will be set to +an empty string. + +By default, the source file's property will be read from the current source +directory's scope, but this can be overridden with one of the following +sub-options: + +``DIRECTORY <dir>`` + The source file property will be read from the ``<dir>`` directory's + scope. CMake must already know about that source directory, either by + having added it through a call to :command:`add_subdirectory` or ``<dir>`` + being the top level source directory. Relative paths are treated as + relative to the current source directory. + +``TARGET_DIRECTORY <target>`` + The source file property will be read from the directory scope in which + ``<target>`` was created (``<target>`` must therefore already exist). Use :command:`set_source_files_properties` to set property values. Source file properties usually control how the file is built. One property that is diff --git a/Help/command/include_guard.rst b/Help/command/include_guard.rst index 877aa86..dca3b6f 100644 --- a/Help/command/include_guard.rst +++ b/Help/command/include_guard.rst @@ -1,6 +1,8 @@ include_guard ------------- +.. versionadded:: 3.10 + Provides an include guard for the file currently being processed by CMake. .. code-block:: cmake diff --git a/Help/command/install.rst b/Help/command/install.rst index c8df7d9..c11eaf4 100644 --- a/Help/command/install.rst +++ b/Help/command/install.rst @@ -45,6 +45,9 @@ signatures that specify them. The common options are: As absolute paths are not supported by :manual:`cpack <cpack(1)>` installer generators, it is preferable to use relative paths throughout. + In particular, there is no need to make paths absolute by prepending + :variable:`CMAKE_INSTALL_PREFIX`; this prefix is used by default if + the DESTINATION is a relative path. ``PERMISSIONS`` Specify permissions for installed files. Valid permissions are diff --git a/Help/command/set_property.rst b/Help/command/set_property.rst index ccbd635..93c2d9c 100644 --- a/Help/command/set_property.rst +++ b/Help/command/set_property.rst @@ -9,13 +9,13 @@ Set a named property in a given scope. DIRECTORY [<dir>] | TARGET [<target1> ...] | SOURCE [<src1> ...] - [TARGET_DIRECTORY <target1> ...] - [DIRECTORY <dir1> ...] | + [DIRECTORY <dirs> ...] | + [TARGET_DIRECTORY <targets> ...] INSTALL [<file1> ...] | TEST [<test1> ...] | CACHE [<entry1> ...] > [APPEND] [APPEND_STRING] - PROPERTY <name> [value1 ...]) + PROPERTY <name> [<value1> ...]) Sets one property on zero or more objects of a scope. @@ -35,17 +35,23 @@ It must be one of the following: See also the :command:`set_target_properties` command. ``SOURCE`` - Scope may name zero or more source files. Note that source - file properties are by default visible only to targets added in the same - directory (``CMakeLists.txt``). - The file properties can be made visible in a different directory by specifying - one or both of the additional options: ``TARGET_DIRECTORY`` and ``DIRECTORY``. + Scope may name zero or more source files. By default, source file properties + are only visible to targets added in the same directory (``CMakeLists.txt``). + Visibility can be set in other directory scopes using one or both of the + following sub-options: + + ``DIRECTORY <dirs>...`` + The source file property will be set in each of the ``<dirs>`` + directories' scopes. CMake must already know about each of these + source directories, either by having added them through a call to + :command:`add_subdirectory` or it being the top level source directory. + Relative paths are treated as relative to the current source directory. + + ``TARGET_DIRECTORY <targets>...`` + The source file property will be set in each of the directory scopes + where any of the specified ``<targets>`` were created (the ``<targets>`` + must therefore already exist). - ``DIRECTORY`` takes a list of processed directories paths, and sets the file - properties in those directory scopes. - - ``TARGET_DIRECTORY`` takes a list of existing targets. The file - properties will be set in these targets' directory scopes. See also the :command:`set_source_files_properties` command. ``INSTALL`` diff --git a/Help/command/set_source_files_properties.rst b/Help/command/set_source_files_properties.rst index 59d5ba3..9558b40 100644 --- a/Help/command/set_source_files_properties.rst +++ b/Help/command/set_source_files_properties.rst @@ -5,29 +5,33 @@ Source files can have properties that affect how they are built. .. code-block:: cmake - set_source_files_properties([file1 [file2 [...]]] - [TARGET_DIRECTORY <target1> ...] - [DIRECTORY <dir1> ...] - PROPERTIES prop1 value1 - [prop2 value2 [...]]) + set_source_files_properties(<files> ... + [DIRECTORY <dirs> ...] + [TARGET_DIRECTORY <targets> ...] + PROPERTIES <prop1> <value1> + [<prop2> <value2>] ...) Sets properties associated with source files using a key/value paired list. -Note that source file properties are by default visible only to -targets added in the same directory (``CMakeLists.txt``). +By default, source file properties are only visible to targets added in the +same directory (``CMakeLists.txt``). Visibility can be set in other directory +scopes using one or both of the following options: -The file properties can be made visible in a different directory by specifying -one or both of the additional options: ``TARGET_DIRECTORY`` and ``DIRECTORY``. +``DIRECTORY <dirs>...`` + The source file properties will be set in each of the ``<dirs>`` + directories' scopes. CMake must already know about each of these + source directories, either by having added them through a call to + :command:`add_subdirectory` or it being the top level source directory. + Relative paths are treated as relative to the current source directory. -``DIRECTORY`` takes a list of processed directories paths, and sets the file -properties in those directory scopes. - -``TARGET_DIRECTORY`` takes a list of existing targets. The file -properties will be set in these targets' directory scopes. +``TARGET_DIRECTORY <targets>...`` + The source file properties will be set in each of the directory scopes + where any of the specified ``<targets>`` were created (the ``<targets>`` + must therefore already exist). +Use :command:`get_source_file_property` to get property values. See also the :command:`set_property(SOURCE)` command. See :ref:`Source File Properties` for the list of properties known -to CMake. Source file properties are visible only to targets added -in the same directory (``CMakeLists.txt``). +to CMake. diff --git a/Help/command/target_compile_features.rst b/Help/command/target_compile_features.rst index c5401e6..b50be34 100644 --- a/Help/command/target_compile_features.rst +++ b/Help/command/target_compile_features.rst @@ -1,6 +1,8 @@ target_compile_features ----------------------- +.. versionadded:: 3.1 + Add expected compiler features to a target. .. code-block:: cmake diff --git a/Help/command/target_link_directories.rst b/Help/command/target_link_directories.rst index 76da94d..bb75a3d 100644 --- a/Help/command/target_link_directories.rst +++ b/Help/command/target_link_directories.rst @@ -1,6 +1,8 @@ target_link_directories ----------------------- +.. versionadded:: 3.13 + Add link directories to a target. .. code-block:: cmake diff --git a/Help/command/target_link_options.rst b/Help/command/target_link_options.rst index 89038e3..e59e0e1 100644 --- a/Help/command/target_link_options.rst +++ b/Help/command/target_link_options.rst @@ -1,6 +1,8 @@ target_link_options ------------------- +.. versionadded:: 3.13 + Add options to the link step for an executable, shared library or module library target. diff --git a/Help/command/target_precompile_headers.rst b/Help/command/target_precompile_headers.rst index d4280b1..7005180 100644 --- a/Help/command/target_precompile_headers.rst +++ b/Help/command/target_precompile_headers.rst @@ -1,6 +1,8 @@ target_precompile_headers ------------------------- +.. versionadded:: 3.16 + Add a list of header files to precompile. Precompiling header files can speed up compilation by creating a partially diff --git a/Help/command/target_sources.rst b/Help/command/target_sources.rst index 27e737b..856d869 100644 --- a/Help/command/target_sources.rst +++ b/Help/command/target_sources.rst @@ -1,6 +1,8 @@ target_sources -------------- +.. versionadded:: 3.1 + Add sources to a target. .. code-block:: cmake diff --git a/Help/command/variable_watch.rst b/Help/command/variable_watch.rst index ce69bcf..8293f5a 100644 --- a/Help/command/variable_watch.rst +++ b/Help/command/variable_watch.rst @@ -7,9 +7,42 @@ Watch the CMake variable for change. variable_watch(<variable> [<command>]) -If the specified ``<variable>`` changes, a message will be printed -to inform about the change. +If the specified ``<variable>`` changes and no ``<command>`` is given, +a message will be printed to inform about the change. -Additionally, if ``<command>`` is given, this command will be executed. +If ``<command>`` is given, this command will be executed instead. The command will receive the following arguments: ``COMMAND(<variable> <access> <value> <current_list_file> <stack>)`` + +``<variable>`` + Name of the variable being accessed. + +``<access>`` + One of ``READ_ACCESS``, ``UNKNOWN_READ_ACCESS``, ``MODIFIED_ACCESS``, + ``UNKNOWN_MODIFIED_ACCESS``, or ``REMOVED_ACCESS``. The ``UNKNOWN_`` + values are only used when the variable has never been set. Once set, + they are never used again during the same CMake run, even if the + variable is later unset. + +``<value>`` + The value of the variable. On a modification, this is the new + (modified) value of the variable. On removal, the value is empty. + +``<current_list_file>`` + Full path to the file doing the access. + +``<stack>`` + List of absolute paths of all files currently on the stack of file + inclusion, with the bottom-most file first and the currently + processed file (that is, ``current_list_file``) last. + +Note that for some accesses such as :command:`list(APPEND)`, the watcher +is executed twice, first with a read access and then with a write one. +Also note that an :command:`if(DEFINED)` query on the variable does not +register as an access and the watcher is not executed. + +Only non-cache variables can be watched using this command. Access to +cache variables is never watched. However, the existence of a cache +variable ``var`` causes accesses to the non-cache variable ``var`` to +not use the ``UNKNOWN_`` prefix, even if a non-cache variable ``var`` +has never existed. diff --git a/Help/cpack_gen/external.rst b/Help/cpack_gen/external.rst index 406f6be..7ef1071 100644 --- a/Help/cpack_gen/external.rst +++ b/Help/cpack_gen/external.rst @@ -281,3 +281,10 @@ Variables specific to CPack External generator It is invoked after (optional) staging took place and may run an external packaging tool. The script has access to the variables defined by the CPack config file. + +.. variable:: CPACK_EXTERNAL_BUILT_PACKAGES + + The ``CPACK_EXTERNAL_PACKAGE_SCRIPT`` script may set this list variable to the + full paths of generated package files. CPack copy these files from the stage + directory back to the top build directory and possibly produce checksum files + if the :variable:`CPACK_PACKAGE_CHECKSUM` is set. diff --git a/Help/dev/maint.rst b/Help/dev/maint.rst index a1c1a6f..4c2c89f 100644 --- a/Help/dev/maint.rst +++ b/Help/dev/maint.rst @@ -200,6 +200,23 @@ the notes, and revise wording. Then commit with a message such as:: Add section headers similar to the $prev release notes and move each individual bullet into an appropriate section. Revise a few bullets. +Update Sphinx ``versionadded`` directives in documents added since +the previous release by running the `update_versions.py`_ script: + +.. code-block:: shell + + Utilities/Sphinx/update_versions.py --since v$prev.0 --overwrite + +.. _`update_versions.py`: ../../Utilities/Sphinx/update_versions.py + +Commit the changes with a message such as:: + + Help: Update Sphinx versionadded directives for $ver release + + Run the script: + + Utilities/Sphinx/update_versions.py --since v$prev.0 --overwrite + Open a merge request with the ``doc-$ver-relnotes`` branch for review and integration. Further steps may proceed after this has been merged to ``master``. @@ -299,3 +316,28 @@ announcing that post-release development is open:: before staging or merging. .. _`CMake Discourse Forum Development Category`: https://discourse.cmake.org/c/development + +Initial Post-Release Development +-------------------------------- + +Deprecate policies more than 8 release series old by updating the +policy range check in ``cmMakefile::SetPolicy``. +Commit with a message such as:: + + Add deprecation warnings for policies CMP#### and below + + The OLD behaviors of all policies are deprecated, but only by + documentation. Add an explicit deprecation diagnostic for policies + introduced in CMake $OLDVER and below to encourage projects to port + away from setting policies to OLD. + +Update the ``cmake_policy`` version range generated by ``install(EXPORT)`` +in ``cmExportFileGenerator::GeneratePolicyHeaderCode`` to end at the +previous release. We use one release back since we now know all the +policies added for that version. Commit with a message such as:: + + export: Increase maximum policy version in exported files to $prev + + The files generatd by `install(EXPORT)` and `export()` commands + are known to work with policies as of CMake $prev, so enable them + in sufficiently new CMake versions. diff --git a/Help/dev/source.rst b/Help/dev/source.rst index 0ccb8f4..d93e55c 100644 --- a/Help/dev/source.rst +++ b/Help/dev/source.rst @@ -35,6 +35,9 @@ Available features are: * From ``C++14``: + * ``<cm/iomanip>``: + ``cm::quoted`` + * ``<cm/iterator>``: ``cm::make_reverse_iterator``, ``cm::cbegin``, ``cm::cend``, ``cm::rbegin``, ``cm::rend``, ``cm::crbegin``, ``cm::crend`` @@ -53,6 +56,9 @@ Available features are: * ``<cm/algorithm>``: ``cm::clamp`` + * ``cm/filesystem>``: + ``cm::filesystem::path`` + * ``<cm/iterator>``: ``cm::size``, ``cm::empty``, ``cm::data`` diff --git a/Help/envvar/ASM_DIALECT.rst b/Help/envvar/ASM_DIALECT.rst index a06e3cb..768d8fe 100644 --- a/Help/envvar/ASM_DIALECT.rst +++ b/Help/envvar/ASM_DIALECT.rst @@ -1,6 +1,8 @@ ASM<DIALECT> ------------ +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Preferred executable for compiling a specific dialect of assembly language diff --git a/Help/envvar/ASM_DIALECTFLAGS.rst b/Help/envvar/ASM_DIALECTFLAGS.rst index 2e1c6d2..66a75e2 100644 --- a/Help/envvar/ASM_DIALECTFLAGS.rst +++ b/Help/envvar/ASM_DIALECTFLAGS.rst @@ -1,6 +1,8 @@ ASM<DIALECT>FLAGS ----------------- +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Default compilation flags to be used when compiling a specific dialect of an diff --git a/Help/envvar/CC.rst b/Help/envvar/CC.rst index ef12059..7d2b870 100644 --- a/Help/envvar/CC.rst +++ b/Help/envvar/CC.rst @@ -1,6 +1,8 @@ CC -- +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Preferred executable for compiling ``C`` language files. Will only be used by diff --git a/Help/envvar/CCMAKE_COLORS.rst b/Help/envvar/CCMAKE_COLORS.rst index d4750c3..4e76bf8 100644 --- a/Help/envvar/CCMAKE_COLORS.rst +++ b/Help/envvar/CCMAKE_COLORS.rst @@ -1,6 +1,8 @@ CCMAKE_COLORS ------------- +.. versionadded:: 3.18 + Determines what colors are used by the CMake curses interface, when run on a terminal that supports colors. The syntax follows the same conventions as ``LS_COLORS``; diff --git a/Help/envvar/CFLAGS.rst b/Help/envvar/CFLAGS.rst index 190b4f4..31db6a6 100644 --- a/Help/envvar/CFLAGS.rst +++ b/Help/envvar/CFLAGS.rst @@ -1,6 +1,8 @@ CFLAGS ------ +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Default compilation flags to be used when compiling ``C`` files. Will only be diff --git a/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst b/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst index 199ca3e..dbc589a 100644 --- a/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst +++ b/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst @@ -1,6 +1,8 @@ CMAKE_BUILD_PARALLEL_LEVEL -------------------------- +.. versionadded:: 3.12 + .. include:: ENV_VAR.txt Specifies the maximum number of concurrent processes to use when building diff --git a/Help/envvar/CMAKE_CONFIG_TYPE.rst b/Help/envvar/CMAKE_CONFIG_TYPE.rst index 168593d..c207a48 100644 --- a/Help/envvar/CMAKE_CONFIG_TYPE.rst +++ b/Help/envvar/CMAKE_CONFIG_TYPE.rst @@ -1,6 +1,8 @@ CMAKE_CONFIG_TYPE ----------------- +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt The default build configuration for :ref:`Build Tool Mode` and diff --git a/Help/envvar/CMAKE_EXPORT_COMPILE_COMMANDS.rst b/Help/envvar/CMAKE_EXPORT_COMPILE_COMMANDS.rst index e9e0810..9e678be 100644 --- a/Help/envvar/CMAKE_EXPORT_COMPILE_COMMANDS.rst +++ b/Help/envvar/CMAKE_EXPORT_COMPILE_COMMANDS.rst @@ -1,6 +1,8 @@ CMAKE_EXPORT_COMPILE_COMMANDS ----------------------------- +.. versionadded:: 3.17 + .. include:: ENV_VAR.txt The default value for :variable:`CMAKE_EXPORT_COMPILE_COMMANDS` when there diff --git a/Help/envvar/CMAKE_GENERATOR.rst b/Help/envvar/CMAKE_GENERATOR.rst index f2d055f..3488b04 100644 --- a/Help/envvar/CMAKE_GENERATOR.rst +++ b/Help/envvar/CMAKE_GENERATOR.rst @@ -1,6 +1,8 @@ CMAKE_GENERATOR --------------- +.. versionadded:: 3.15 + .. include:: ENV_VAR.txt Specifies the CMake default generator to use when no generator is supplied diff --git a/Help/envvar/CMAKE_GENERATOR_INSTANCE.rst b/Help/envvar/CMAKE_GENERATOR_INSTANCE.rst index 1654fa1..8ca7d80 100644 --- a/Help/envvar/CMAKE_GENERATOR_INSTANCE.rst +++ b/Help/envvar/CMAKE_GENERATOR_INSTANCE.rst @@ -1,6 +1,8 @@ CMAKE_GENERATOR_INSTANCE ------------------------ +.. versionadded:: 3.15 + .. include:: ENV_VAR.txt Default value for :variable:`CMAKE_GENERATOR_INSTANCE` if no Cache entry is diff --git a/Help/envvar/CMAKE_GENERATOR_PLATFORM.rst b/Help/envvar/CMAKE_GENERATOR_PLATFORM.rst index 917b30b..b039845 100644 --- a/Help/envvar/CMAKE_GENERATOR_PLATFORM.rst +++ b/Help/envvar/CMAKE_GENERATOR_PLATFORM.rst @@ -1,6 +1,8 @@ CMAKE_GENERATOR_PLATFORM ------------------------ +.. versionadded:: 3.15 + .. include:: ENV_VAR.txt Default value for :variable:`CMAKE_GENERATOR_PLATFORM` if no Cache entry diff --git a/Help/envvar/CMAKE_GENERATOR_TOOLSET.rst b/Help/envvar/CMAKE_GENERATOR_TOOLSET.rst index 7ac3856..394dd88 100644 --- a/Help/envvar/CMAKE_GENERATOR_TOOLSET.rst +++ b/Help/envvar/CMAKE_GENERATOR_TOOLSET.rst @@ -1,6 +1,8 @@ CMAKE_GENERATOR_TOOLSET ----------------------- +.. versionadded:: 3.15 + .. include:: ENV_VAR.txt Default value for :variable:`CMAKE_GENERATOR_TOOLSET` if no Cache entry diff --git a/Help/envvar/CMAKE_LANG_COMPILER_LAUNCHER.rst b/Help/envvar/CMAKE_LANG_COMPILER_LAUNCHER.rst index 4f91e9a..c384fa1 100644 --- a/Help/envvar/CMAKE_LANG_COMPILER_LAUNCHER.rst +++ b/Help/envvar/CMAKE_LANG_COMPILER_LAUNCHER.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_COMPILER_LAUNCHER ------------------------------ +.. versionadded:: 3.17 + .. include:: ENV_VAR.txt Default compiler launcher to use for the specified language. Will only be used diff --git a/Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst b/Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst index 77ead4d..5babbe5 100644 --- a/Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst +++ b/Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst @@ -1,6 +1,8 @@ CMAKE_MSVCIDE_RUN_PATH ---------------------- +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Extra PATH locations for custom commands when using diff --git a/Help/envvar/CMAKE_NO_VERBOSE.rst b/Help/envvar/CMAKE_NO_VERBOSE.rst index 149efbd..fe733f8 100644 --- a/Help/envvar/CMAKE_NO_VERBOSE.rst +++ b/Help/envvar/CMAKE_NO_VERBOSE.rst @@ -1,6 +1,8 @@ CMAKE_NO_VERBOSE ---------------- +.. versionadded:: 3.14 + Disables verbose output from CMake when :envvar:`VERBOSE` environment variable is set. diff --git a/Help/envvar/CMAKE_OSX_ARCHITECTURES.rst b/Help/envvar/CMAKE_OSX_ARCHITECTURES.rst index ef7d547..4bfa36a 100644 --- a/Help/envvar/CMAKE_OSX_ARCHITECTURES.rst +++ b/Help/envvar/CMAKE_OSX_ARCHITECTURES.rst @@ -1,6 +1,8 @@ CMAKE_OSX_ARCHITECTURES ----------------------- +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Target specific architectures for macOS. diff --git a/Help/envvar/CMAKE_PREFIX_PATH.rst b/Help/envvar/CMAKE_PREFIX_PATH.rst index 276fdd6..e5d6aa1 100644 --- a/Help/envvar/CMAKE_PREFIX_PATH.rst +++ b/Help/envvar/CMAKE_PREFIX_PATH.rst @@ -1,6 +1,8 @@ CMAKE_PREFIX_PATH ----------------- +.. versionadded:: 3.18 + .. include:: ENV_VAR.txt The ``CMAKE_PREFIX_PATH`` environment variable may be set to a list of diff --git a/Help/envvar/CSFLAGS.rst b/Help/envvar/CSFLAGS.rst index 8762982..e8c0a11 100644 --- a/Help/envvar/CSFLAGS.rst +++ b/Help/envvar/CSFLAGS.rst @@ -1,6 +1,8 @@ CSFLAGS ------- +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Preferred executable for compiling ``CSharp`` language files. Will only be diff --git a/Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst b/Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst index e1991b2..b27bc09 100644 --- a/Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst +++ b/Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst @@ -1,6 +1,8 @@ CTEST_INTERACTIVE_DEBUG_MODE ---------------------------- +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Environment variable that will exist and be set to ``1`` when a test executed diff --git a/Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst b/Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst index d8b4262..9c6bd03 100644 --- a/Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst +++ b/Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst @@ -1,6 +1,8 @@ CTEST_OUTPUT_ON_FAILURE ----------------------- +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Boolean environment variable that controls if the output should be logged for diff --git a/Help/envvar/CTEST_PARALLEL_LEVEL.rst b/Help/envvar/CTEST_PARALLEL_LEVEL.rst index fd4936e..a21c783 100644 --- a/Help/envvar/CTEST_PARALLEL_LEVEL.rst +++ b/Help/envvar/CTEST_PARALLEL_LEVEL.rst @@ -1,6 +1,8 @@ CTEST_PARALLEL_LEVEL -------------------- +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Specify the number of tests for CTest to run in parallel. See :manual:`ctest(1)` diff --git a/Help/envvar/CTEST_PROGRESS_OUTPUT.rst b/Help/envvar/CTEST_PROGRESS_OUTPUT.rst index b36a6b8..8c29d7d 100644 --- a/Help/envvar/CTEST_PROGRESS_OUTPUT.rst +++ b/Help/envvar/CTEST_PROGRESS_OUTPUT.rst @@ -1,6 +1,8 @@ CTEST_PROGRESS_OUTPUT --------------------- +.. versionadded:: 3.13 + .. include:: ENV_VAR.txt Boolean environment variable that affects how :manual:`ctest <ctest(1)>` diff --git a/Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst b/Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst index 79dbb79..dffd63d 100644 --- a/Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst +++ b/Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst @@ -1,6 +1,8 @@ CTEST_USE_LAUNCHERS_DEFAULT --------------------------- +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Initializes the :variable:`CTEST_USE_LAUNCHERS` variable if not already defined. diff --git a/Help/envvar/CUDACXX.rst b/Help/envvar/CUDACXX.rst index 10c0f9d..1affab6 100644 --- a/Help/envvar/CUDACXX.rst +++ b/Help/envvar/CUDACXX.rst @@ -1,6 +1,8 @@ CUDACXX ------- +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Preferred executable for compiling ``CUDA`` language files. Will only be used by diff --git a/Help/envvar/CUDAFLAGS.rst b/Help/envvar/CUDAFLAGS.rst index 14c5d84..1f1bde5 100644 --- a/Help/envvar/CUDAFLAGS.rst +++ b/Help/envvar/CUDAFLAGS.rst @@ -1,6 +1,8 @@ CUDAFLAGS --------- +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Default compilation flags to be used when compiling ``CUDA`` files. Will only be diff --git a/Help/envvar/CUDAHOSTCXX.rst b/Help/envvar/CUDAHOSTCXX.rst index b9f65bd..81c1228 100644 --- a/Help/envvar/CUDAHOSTCXX.rst +++ b/Help/envvar/CUDAHOSTCXX.rst @@ -1,6 +1,8 @@ CUDAHOSTCXX ----------- +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Preferred executable for compiling host code when compiling ``CUDA`` diff --git a/Help/envvar/CXX.rst b/Help/envvar/CXX.rst index d655350..df927d5 100644 --- a/Help/envvar/CXX.rst +++ b/Help/envvar/CXX.rst @@ -1,6 +1,8 @@ CXX --- +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Preferred executable for compiling ``CXX`` language files. Will only be used by diff --git a/Help/envvar/CXXFLAGS.rst b/Help/envvar/CXXFLAGS.rst index 460a347..a3cef77 100644 --- a/Help/envvar/CXXFLAGS.rst +++ b/Help/envvar/CXXFLAGS.rst @@ -1,6 +1,8 @@ CXXFLAGS -------- +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Default compilation flags to be used when compiling ``CXX`` (C++) files. Will diff --git a/Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst b/Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst index 6a52d64..7635342 100644 --- a/Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst +++ b/Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst @@ -1,6 +1,8 @@ DASHBOARD_TEST_FROM_CTEST ------------------------- +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Environment variable that will exist when a test executed by :manual:`ctest(1)` diff --git a/Help/envvar/DESTDIR.rst b/Help/envvar/DESTDIR.rst index d2144ae..ee290f2 100644 --- a/Help/envvar/DESTDIR.rst +++ b/Help/envvar/DESTDIR.rst @@ -1,6 +1,8 @@ DESTDIR ------- +.. versionadded:: 3.12 + .. include:: ENV_VAR.txt On UNIX one can use the ``DESTDIR`` mechanism in order to relocate the diff --git a/Help/envvar/FC.rst b/Help/envvar/FC.rst index d6cabbc..f1c26b0 100644 --- a/Help/envvar/FC.rst +++ b/Help/envvar/FC.rst @@ -1,6 +1,8 @@ FC -- +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Preferred executable for compiling ``Fortran`` language files. Will only be used diff --git a/Help/envvar/FFLAGS.rst b/Help/envvar/FFLAGS.rst index 53bffb6..4c1f3d2 100644 --- a/Help/envvar/FFLAGS.rst +++ b/Help/envvar/FFLAGS.rst @@ -1,6 +1,8 @@ FFLAGS ------ +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Default compilation flags to be used when compiling ``Fortran`` files. Will only diff --git a/Help/envvar/LDFLAGS.rst b/Help/envvar/LDFLAGS.rst index 816d6ef..78b34f4 100644 --- a/Help/envvar/LDFLAGS.rst +++ b/Help/envvar/LDFLAGS.rst @@ -1,6 +1,8 @@ LDFLAGS ------- +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Will only be used by CMake on the first configuration to determine the default diff --git a/Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst b/Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst index 662bd03..1558704 100644 --- a/Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst +++ b/Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst @@ -1,6 +1,8 @@ MACOSX_DEPLOYMENT_TARGET ------------------------ +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Specify the minimum version of macOS on which the target binaries are diff --git a/Help/envvar/OBJC.rst b/Help/envvar/OBJC.rst index 30c0d13..2d95806 100644 --- a/Help/envvar/OBJC.rst +++ b/Help/envvar/OBJC.rst @@ -1,6 +1,8 @@ OBJC ---- +.. versionadded:: 3.16.7 + .. include:: ENV_VAR.txt Preferred executable for compiling ``OBJC`` language files. Will only be used diff --git a/Help/envvar/OBJCXX.rst b/Help/envvar/OBJCXX.rst index a72f7e7..71286d9 100644 --- a/Help/envvar/OBJCXX.rst +++ b/Help/envvar/OBJCXX.rst @@ -1,6 +1,8 @@ OBJCXX ------ +.. versionadded:: 3.16.7 + .. include:: ENV_VAR.txt Preferred executable for compiling ``OBJCXX`` language files. Will only be used diff --git a/Help/envvar/PackageName_ROOT.rst b/Help/envvar/PackageName_ROOT.rst index 82b0a06..fc2a1d5 100644 --- a/Help/envvar/PackageName_ROOT.rst +++ b/Help/envvar/PackageName_ROOT.rst @@ -1,6 +1,8 @@ <PackageName>_ROOT ------------------ +.. versionadded:: 3.12.1 + .. include:: ENV_VAR.txt Calls to :command:`find_package(<PackageName>)` will search in prefixes diff --git a/Help/envvar/RC.rst b/Help/envvar/RC.rst index 557520e..3ec1788 100644 --- a/Help/envvar/RC.rst +++ b/Help/envvar/RC.rst @@ -1,6 +1,8 @@ RC -- +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Preferred executable for compiling ``resource`` files. Will only be used by CMake diff --git a/Help/envvar/RCFLAGS.rst b/Help/envvar/RCFLAGS.rst index bc43cb2..f33a9a8 100644 --- a/Help/envvar/RCFLAGS.rst +++ b/Help/envvar/RCFLAGS.rst @@ -1,6 +1,8 @@ RCFLAGS ------- +.. versionadded:: 3.10 + .. include:: ENV_VAR.txt Default compilation flags to be used when compiling ``resource`` files. Will diff --git a/Help/envvar/SWIFTC.rst b/Help/envvar/SWIFTC.rst index b12e51d..ce01ca2 100644 --- a/Help/envvar/SWIFTC.rst +++ b/Help/envvar/SWIFTC.rst @@ -1,6 +1,8 @@ SWIFTC ------ +.. versionadded:: 3.15 + .. include:: ENV_VAR.txt Preferred executable for compiling ``Swift`` language files. Will only be used by diff --git a/Help/envvar/VERBOSE.rst b/Help/envvar/VERBOSE.rst index 2d775a5..5911951 100644 --- a/Help/envvar/VERBOSE.rst +++ b/Help/envvar/VERBOSE.rst @@ -1,6 +1,8 @@ VERBOSE ------- +.. versionadded:: 3.14 + Activates verbose output from CMake and your build tools of choice when you start to actually build your project. diff --git a/Help/generator/Green Hills MULTI.rst b/Help/generator/Green Hills MULTI.rst index dffc679..2246699 100644 --- a/Help/generator/Green Hills MULTI.rst +++ b/Help/generator/Green Hills MULTI.rst @@ -1,6 +1,8 @@ Green Hills MULTI ----------------- +.. versionadded:: 3.3 + Generates Green Hills MULTI project files (experimental, work-in-progress). The buildsystem has predetermined build-configuration settings that can be controlled diff --git a/Help/generator/Ninja Multi-Config.rst b/Help/generator/Ninja Multi-Config.rst index f480eb8..e6c7a1c 100644 --- a/Help/generator/Ninja Multi-Config.rst +++ b/Help/generator/Ninja Multi-Config.rst @@ -1,6 +1,8 @@ Ninja Multi-Config ------------------ +.. versionadded:: 3.17 + Generates multiple ``build-<Config>.ninja`` files. This generator is very much like the :generator:`Ninja` generator, but with diff --git a/Help/generator/Visual Studio 14 2015.rst b/Help/generator/Visual Studio 14 2015.rst index 7383f7a..401845d 100644 --- a/Help/generator/Visual Studio 14 2015.rst +++ b/Help/generator/Visual Studio 14 2015.rst @@ -1,6 +1,8 @@ Visual Studio 14 2015 --------------------- +.. versionadded:: 3.1 + Generates Visual Studio 14 (VS 2015) project files. Project Types diff --git a/Help/generator/Visual Studio 15 2017.rst b/Help/generator/Visual Studio 15 2017.rst index 7e6f0fb..e7baaad 100644 --- a/Help/generator/Visual Studio 15 2017.rst +++ b/Help/generator/Visual Studio 15 2017.rst @@ -1,6 +1,8 @@ Visual Studio 15 2017 --------------------- +.. versionadded:: 3.7.1 + Generates Visual Studio 15 (VS 2017) project files. Project Types diff --git a/Help/generator/Visual Studio 16 2019.rst b/Help/generator/Visual Studio 16 2019.rst index 4aec7f7..3da8091 100644 --- a/Help/generator/Visual Studio 16 2019.rst +++ b/Help/generator/Visual Studio 16 2019.rst @@ -1,6 +1,8 @@ Visual Studio 16 2019 --------------------- +.. versionadded:: 3.14 + Generates Visual Studio 16 (VS 2019) project files. Project Types diff --git a/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt index c911625..a47d5e0 100644 --- a/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt @@ -57,7 +57,11 @@ set_property(TARGET MathFunctions PROPERTY VERSION "1.0.0") set_property(TARGET MathFunctions PROPERTY SOVERSION "1") # install rules -install(TARGETS MathFunctions tutorial_compiler_flags +set(installable_libs MathFunctions tutorial_compiler_flags) +if(TARGET SqrtLibrary) + list(APPEND installable_libs SqrtLibrary) +endif() +install(TARGETS ${installable_libs} DESTINATION lib EXPORT MathFunctionsTargets) install(FILES MathFunctions.h DESTINATION include) diff --git a/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt index e0c0621..0bfe20c 100644 --- a/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt @@ -47,5 +47,9 @@ endif() target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH") # install rules -install(TARGETS MathFunctions DESTINATION lib) +set(installable_libs MathFunctions) +if(TARGET SqrtLibrary) + list(APPEND installable_libs SqrtLibrary) +endif() +install(TARGETS ${installable_libs} DESTINATION lib) install(FILES MathFunctions.h DESTINATION include) diff --git a/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt index 32f5e08..0d287ca 100644 --- a/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt @@ -51,5 +51,9 @@ target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH") # install rules -install(TARGETS MathFunctions DESTINATION lib) +set(installable_libs MathFunctions tutorial_compiler_flags) +if(TARGET SqrtLibrary) + list(APPEND installable_libs SqrtLibrary) +endif() +install(TARGETS ${installable_libs} DESTINATION lib) install(FILES MathFunctions.h DESTINATION include) diff --git a/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt index 720ee64..ea3861c 100644 --- a/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt @@ -53,7 +53,11 @@ target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH") # install rules -install(TARGETS MathFunctions tutorial_compiler_flags +set(installable_libs MathFunctions tutorial_compiler_flags) +if(TARGET SqrtLibrary) + list(APPEND installable_libs SqrtLibrary) +endif() +install(TARGETS ${installable_libs} DESTINATION lib EXPORT MathFunctionsTargets) install(FILES MathFunctions.h DESTINATION include) diff --git a/Help/guide/tutorial/index.rst b/Help/guide/tutorial/index.rst index 6e26de9..e7ea290 100644 --- a/Help/guide/tutorial/index.rst +++ b/Help/guide/tutorial/index.rst @@ -675,9 +675,9 @@ The first step is to update the starting section of the top-level Now that we have made MathFunctions always be used, we will need to update the logic of that library. So, in ``MathFunctions/CMakeLists.txt`` we need to -create a SqrtLibrary that will conditionally be built when ``USE_MYMATH`` is -enabled. Now, since this is a tutorial, we are going to explicitly require -that SqrtLibrary is built statically. +create a SqrtLibrary that will conditionally be built and installed when +``USE_MYMATH`` is enabled. Now, since this is a tutorial, we are going to +explicitly require that SqrtLibrary is built statically. The end result is that ``MathFunctions/CMakeLists.txt`` should look like: @@ -703,7 +703,7 @@ Finally, update ``MathFunctions/MathFunctions.h`` to use dll export defines: .. literalinclude:: Step10/MathFunctions/MathFunctions.h :language: c++ -At this point, if you build everything, you will notice that linking fails +At this point, if you build everything, you may notice that linking fails as we are combining a static library without position independent code with a library that has position independent code. The solution to this is to explicitly set the :prop_tgt:`POSITION_INDEPENDENT_CODE` target property of diff --git a/Help/manual/cmake-file-api.7.rst b/Help/manual/cmake-file-api.7.rst index cc50952..34edc56 100644 --- a/Help/manual/cmake-file-api.7.rst +++ b/Help/manual/cmake-file-api.7.rst @@ -425,7 +425,7 @@ Version 1 does not exist to avoid confusion with that from { "kind": "codemodel", - "version": { "major": 2, "minor": 1 }, + "version": { "major": 2, "minor": 2 }, "paths": { "source": "/path/to/top-level-source-dir", "build": "/path/to/top-level-build-dir" @@ -869,6 +869,26 @@ with members: A string specifying the language (e.g. ``C``, ``CXX``, ``Fortran``) of the toolchain is used to compile the source file. + ``languageStandard`` + Optional member that is present when the language standard is set + explicitly (e.g. via :prop_tgt:`CXX_STANDARD`) or implicitly by + compile features. Each entry is a JSON object with two members: + + ``backtraces`` + Optional member that is present when a CMake language backtrace to + the ``<LANG>_STANDARD`` setting is available. If the language + standard was set implicitly by compile features those are used as + the backtrace(s). It's possible for multiple compile features to + require the same language standard so there could be multiple + backtraces. The value is a JSON array with each entry being an + unsigned integer 0-based index into the ``backtraceGraph`` + member's ``nodes`` array. + + ``standard`` + String representing the language standard. + + This field was added in codemodel version 2.2. + ``compileCommandFragments`` Optional member that is present when fragments of the compiler command line invocation are available. The value is a JSON array of entries diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index 124da44..935f557 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -105,10 +105,11 @@ Variable Queries ``$<TARGET_EXISTS:target>`` ``1`` if ``target`` exists, else ``0``. -``$<CONFIG:cfg>`` - ``1`` if config is ``cfg``, else ``0``. This is a case-insensitive comparison. - The mapping in :prop_tgt:`MAP_IMPORTED_CONFIG_<CONFIG>` is also considered by - this expression when it is evaluated on a property on an :prop_tgt:`IMPORTED` +``$<CONFIG:cfgs>`` + ``1`` if config is any one of the entires in ``cfgs``, else ``0``. This is a + case-insensitive comparison. The mapping in + :prop_tgt:`MAP_IMPORTED_CONFIG_<CONFIG>` is also considered by this + expression when it is evaluated on a property on an :prop_tgt:`IMPORTED` target. ``$<PLATFORM_ID:platform_ids>`` where ``platform_ids`` is a comma-separated list. diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index e98038a..3ceb1df 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -57,6 +57,14 @@ Policies Introduced by CMake 3.18 .. toctree:: :maxdepth: 1 + CMP0109: find_program() requires permission to execute but not to read. </policy/CMP0109> + +Policies Introduced by CMake 3.18 +================================= + +.. toctree:: + :maxdepth: 1 + CMP0108: A target cannot link to itself through an alias. </policy/CMP0108> CMP0107: An ALIAS target cannot overwrite another target. </policy/CMP0107> CMP0106: The Documentation module is removed. </policy/CMP0106> diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index 9becfc6..d5fe34c 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -341,9 +341,9 @@ Options Print a warning when an uninitialized variable is used. ``--warn-unused-vars`` - Warn about unused variables. - - Find variables that are declared or set, but not used. + Does nothing. In CMake versions 3.2 and below this enabled warnings about + unused variables. In CMake versions 3.3 through 3.18 the option was broken. + In CMake 3.19 and above the option has been removed. ``--no-warn-unused-cli`` Don't warn about command line options. @@ -450,6 +450,9 @@ The options are: ``--component <comp>`` Component-based install. Only install component ``<comp>``. +``--default-directory-permissions <permissions>`` + Default directory install permissions. Permissions in format ``<u=rwx,g=rx,o=rx>``. + ``--prefix <prefix>`` Override the installation prefix, :variable:`CMAKE_INSTALL_PREFIX`. @@ -566,7 +569,8 @@ Available commands are: ``compare_files [--ignore-eol] <file1> <file2>`` Check if ``<file1>`` is same as ``<file2>``. If files are the same, - then returns ``0``, if not it returns ``1``. The ``--ignore-eol`` option + then returns ``0``, if not it returns ``1``. In case of invalid + arguments, it retruns 2. The ``--ignore-eol`` option implies line-wise comparison and ignores LF/CRLF differences. ``copy <file>... <destination>`` diff --git a/Help/module/CPackArchive.rst b/Help/module/CPackArchive.rst index 8616098..f5d6da4 100644 --- a/Help/module/CPackArchive.rst +++ b/Help/module/CPackArchive.rst @@ -1,4 +1,6 @@ CPackArchive ------------ +.. versionadded:: 3.9 + The documentation for the CPack Archive generator has moved here: :cpack_gen:`CPack Archive Generator` diff --git a/Help/module/CPackFreeBSD.rst b/Help/module/CPackFreeBSD.rst index 69701b8..7ae6164 100644 --- a/Help/module/CPackFreeBSD.rst +++ b/Help/module/CPackFreeBSD.rst @@ -1,4 +1,6 @@ CPackFreeBSD ------------ +.. versionadded:: 3.10 + The documentation for the CPack FreeBSD generator has moved here: :cpack_gen:`CPack FreeBSD Generator` diff --git a/Help/module/CPackNuGet.rst b/Help/module/CPackNuGet.rst index 4f39b3a..bbed7f9 100644 --- a/Help/module/CPackNuGet.rst +++ b/Help/module/CPackNuGet.rst @@ -1,4 +1,6 @@ CPackNuGet ---------- +.. versionadded:: 3.12 + The documentation for the CPack NuGet generator has moved here: :cpack_gen:`CPack NuGet Generator` diff --git a/Help/module/CPackProductBuild.rst b/Help/module/CPackProductBuild.rst index 8cd9198..e12cd32 100644 --- a/Help/module/CPackProductBuild.rst +++ b/Help/module/CPackProductBuild.rst @@ -1,4 +1,6 @@ CPackProductBuild ----------------- +.. versionadded:: 3.7 + The documentation for the CPack productbuild generator has moved here: :cpack_gen:`CPack productbuild Generator` diff --git a/Help/policy/CMP0051.rst b/Help/policy/CMP0051.rst index 6b679e5..053bc97 100644 --- a/Help/policy/CMP0051.rst +++ b/Help/policy/CMP0051.rst @@ -1,6 +1,8 @@ CMP0051 ------- +.. versionadded:: 3.1 + List TARGET_OBJECTS in SOURCES target property. CMake 3.0 and lower did not include the ``TARGET_OBJECTS`` diff --git a/Help/policy/CMP0052.rst b/Help/policy/CMP0052.rst index ee2e6e8..c75f9ab 100644 --- a/Help/policy/CMP0052.rst +++ b/Help/policy/CMP0052.rst @@ -1,6 +1,8 @@ CMP0052 ------- +.. versionadded:: 3.1 + Reject source and build dirs in installed :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES`. diff --git a/Help/policy/CMP0053.rst b/Help/policy/CMP0053.rst index 032b3e5..9b18b2d 100644 --- a/Help/policy/CMP0053.rst +++ b/Help/policy/CMP0053.rst @@ -1,6 +1,8 @@ CMP0053 ------- +.. versionadded:: 3.1 + Simplify variable reference and escape sequence evaluation. CMake 3.1 introduced a much faster implementation of evaluation of the diff --git a/Help/policy/CMP0054.rst b/Help/policy/CMP0054.rst index 1e000a6..c7ae019 100644 --- a/Help/policy/CMP0054.rst +++ b/Help/policy/CMP0054.rst @@ -1,6 +1,8 @@ CMP0054 ------- +.. versionadded:: 3.1 + Only interpret :command:`if` arguments as variables or keywords when unquoted. CMake 3.1 and above no longer implicitly dereference variables or diff --git a/Help/policy/CMP0055.rst b/Help/policy/CMP0055.rst index bc5ad08..47cac8e 100644 --- a/Help/policy/CMP0055.rst +++ b/Help/policy/CMP0055.rst @@ -1,6 +1,8 @@ CMP0055 ------- +.. versionadded:: 3.2 + Strict checking for the :command:`break` command. CMake 3.1 and lower allowed calls to the :command:`break` command diff --git a/Help/policy/CMP0056.rst b/Help/policy/CMP0056.rst index 834da84..628a6a1 100644 --- a/Help/policy/CMP0056.rst +++ b/Help/policy/CMP0056.rst @@ -1,6 +1,8 @@ CMP0056 ------- +.. versionadded:: 3.2 + Honor link flags in :command:`try_compile` source-file signature. The :command:`try_compile` command source-file signature generates a diff --git a/Help/policy/CMP0057.rst b/Help/policy/CMP0057.rst index 83db186..76aebfb 100644 --- a/Help/policy/CMP0057.rst +++ b/Help/policy/CMP0057.rst @@ -1,6 +1,8 @@ CMP0057 ------- +.. versionadded:: 3.3 + Support new :command:`if` IN_LIST operator. CMake 3.3 adds support for the new IN_LIST operator. diff --git a/Help/policy/CMP0058.rst b/Help/policy/CMP0058.rst index 05efd48..06cc74b 100644 --- a/Help/policy/CMP0058.rst +++ b/Help/policy/CMP0058.rst @@ -1,6 +1,8 @@ CMP0058 ------- +.. versionadded:: 3.3 + Ninja requires custom command byproducts to be explicit. When an intermediate file generated during the build is consumed diff --git a/Help/policy/CMP0059.rst b/Help/policy/CMP0059.rst index bce982e..6317d05 100644 --- a/Help/policy/CMP0059.rst +++ b/Help/policy/CMP0059.rst @@ -1,6 +1,8 @@ CMP0059 ------- +.. versionadded:: 3.3 + Do not treat ``DEFINITIONS`` as a built-in directory property. CMake 3.3 and above no longer make a list of definitions available through diff --git a/Help/policy/CMP0060.rst b/Help/policy/CMP0060.rst index 98ac2cf..09257d1 100644 --- a/Help/policy/CMP0060.rst +++ b/Help/policy/CMP0060.rst @@ -1,6 +1,8 @@ CMP0060 ------- +.. versionadded:: 3.3 + Link libraries by full path even in implicit directories. Policy :policy:`CMP0003` was introduced with the intention of always diff --git a/Help/policy/CMP0061.rst b/Help/policy/CMP0061.rst index 57e4161..aca551d 100644 --- a/Help/policy/CMP0061.rst +++ b/Help/policy/CMP0061.rst @@ -1,6 +1,8 @@ CMP0061 ------- +.. versionadded:: 3.3 + CTest does not by default tell ``make`` to ignore errors (``-i``). The :command:`ctest_build` and :command:`build_command` commands no diff --git a/Help/policy/CMP0062.rst b/Help/policy/CMP0062.rst index 0db7aaf..01e93f0 100644 --- a/Help/policy/CMP0062.rst +++ b/Help/policy/CMP0062.rst @@ -1,6 +1,8 @@ CMP0062 ------- +.. versionadded:: 3.3 + Disallow :command:`install` of :command:`export` result. The :command:`export()` command generates a file containing diff --git a/Help/policy/CMP0063.rst b/Help/policy/CMP0063.rst index d736d06..fec3ad8 100644 --- a/Help/policy/CMP0063.rst +++ b/Help/policy/CMP0063.rst @@ -1,6 +1,8 @@ CMP0063 ------- +.. versionadded:: 3.3 + Honor visibility properties for all target types. The :prop_tgt:`<LANG>_VISIBILITY_PRESET` and diff --git a/Help/policy/CMP0064.rst b/Help/policy/CMP0064.rst index e9a061b..0c20c13 100644 --- a/Help/policy/CMP0064.rst +++ b/Help/policy/CMP0064.rst @@ -1,6 +1,8 @@ CMP0064 ------- +.. versionadded:: 3.4 + Recognize ``TEST`` as a operator for the :command:`if` command. The ``TEST`` operator was added to the :command:`if` command to determine if a diff --git a/Help/policy/CMP0065.rst b/Help/policy/CMP0065.rst index b820aad..8968b91 100644 --- a/Help/policy/CMP0065.rst +++ b/Help/policy/CMP0065.rst @@ -1,6 +1,8 @@ CMP0065 ------- +.. versionadded:: 3.4 + Do not add flags to export symbols from executables without the :prop_tgt:`ENABLE_EXPORTS` target property. diff --git a/Help/policy/CMP0066.rst b/Help/policy/CMP0066.rst index e110ae1..b08430f 100644 --- a/Help/policy/CMP0066.rst +++ b/Help/policy/CMP0066.rst @@ -1,6 +1,8 @@ CMP0066 ------- +.. versionadded:: 3.7 + Honor per-config flags in :command:`try_compile` source-file signature. The source file signature of the :command:`try_compile` command uses the value diff --git a/Help/policy/CMP0067.rst b/Help/policy/CMP0067.rst index f802787..8358bb2 100644 --- a/Help/policy/CMP0067.rst +++ b/Help/policy/CMP0067.rst @@ -1,6 +1,8 @@ CMP0067 ------- +.. versionadded:: 3.8 + Honor language standard in :command:`try_compile` source-file signature. The :command:`try_compile` source file signature is intended to allow diff --git a/Help/policy/CMP0068.rst b/Help/policy/CMP0068.rst index 978a6e3..5d2a4b1 100644 --- a/Help/policy/CMP0068.rst +++ b/Help/policy/CMP0068.rst @@ -1,6 +1,8 @@ CMP0068 ------- +.. versionadded:: 3.9 + ``RPATH`` settings on macOS do not affect ``install_name``. CMake 3.9 and newer remove any effect the following settings may have on the diff --git a/Help/policy/CMP0069.rst b/Help/policy/CMP0069.rst index 0d5ddfd..eafac45 100644 --- a/Help/policy/CMP0069.rst +++ b/Help/policy/CMP0069.rst @@ -1,6 +1,8 @@ CMP0069 ------- +.. versionadded:: 3.9 + :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION` is enforced when enabled. CMake 3.9 and newer prefer to add IPO flags whenever the diff --git a/Help/policy/CMP0070.rst b/Help/policy/CMP0070.rst index 0fb3617..c880d1f 100644 --- a/Help/policy/CMP0070.rst +++ b/Help/policy/CMP0070.rst @@ -1,6 +1,8 @@ CMP0070 ------- +.. versionadded:: 3.10 + Define :command:`file(GENERATE)` behavior for relative paths. CMake 3.10 and newer define that relative paths given to ``INPUT`` and diff --git a/Help/policy/CMP0071.rst b/Help/policy/CMP0071.rst index 855ecf0..700d3b0 100644 --- a/Help/policy/CMP0071.rst +++ b/Help/policy/CMP0071.rst @@ -1,6 +1,8 @@ CMP0071 ------- +.. versionadded:: 3.10 + Let :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` process :prop_sf:`GENERATED` files. diff --git a/Help/policy/CMP0072.rst b/Help/policy/CMP0072.rst index 3abbad7..1dcdfef 100644 --- a/Help/policy/CMP0072.rst +++ b/Help/policy/CMP0072.rst @@ -1,6 +1,8 @@ CMP0072 ------- +.. versionadded:: 3.11 + :module:`FindOpenGL` prefers GLVND by default when available. The :module:`FindOpenGL` module provides an ``OpenGL::GL`` target and an diff --git a/Help/policy/CMP0073.rst b/Help/policy/CMP0073.rst index 9bfa0e9..8f0345c 100644 --- a/Help/policy/CMP0073.rst +++ b/Help/policy/CMP0073.rst @@ -1,6 +1,8 @@ CMP0073 ------- +.. versionadded:: 3.12 + Do not produce legacy ``_LIB_DEPENDS`` cache entries. Ancient CMake versions once used ``<tgt>_LIB_DEPENDS`` cache entries to diff --git a/Help/policy/CMP0074.rst b/Help/policy/CMP0074.rst index 63ebf7b..863bbb2 100644 --- a/Help/policy/CMP0074.rst +++ b/Help/policy/CMP0074.rst @@ -1,6 +1,8 @@ CMP0074 ------- +.. versionadded:: 3.12 + :command:`find_package` uses ``<PackageName>_ROOT`` variables. In CMake 3.12 and above the :command:`find_package(<PackageName>)` command now diff --git a/Help/policy/CMP0075.rst b/Help/policy/CMP0075.rst index aa5c3f7..4213782 100644 --- a/Help/policy/CMP0075.rst +++ b/Help/policy/CMP0075.rst @@ -1,6 +1,8 @@ CMP0075 ------- +.. versionadded:: 3.12 + Include file check macros honor ``CMAKE_REQUIRED_LIBRARIES``. In CMake 3.12 and above, the diff --git a/Help/policy/CMP0076.rst b/Help/policy/CMP0076.rst index dd25f80..edca742 100644 --- a/Help/policy/CMP0076.rst +++ b/Help/policy/CMP0076.rst @@ -1,6 +1,8 @@ CMP0076 ------- +.. versionadded:: 3.13 + The :command:`target_sources` command converts relative paths to absolute. In CMake 3.13 and above, the :command:`target_sources` command now converts diff --git a/Help/policy/CMP0077.rst b/Help/policy/CMP0077.rst index 44797b6..174cde9 100644 --- a/Help/policy/CMP0077.rst +++ b/Help/policy/CMP0077.rst @@ -1,6 +1,8 @@ CMP0077 ------- +.. versionadded:: 3.13 + :command:`option` honors normal variables. The :command:`option` command is typically used to create a cache entry diff --git a/Help/policy/CMP0078.rst b/Help/policy/CMP0078.rst index 2e97934..89fdb0b 100644 --- a/Help/policy/CMP0078.rst +++ b/Help/policy/CMP0078.rst @@ -1,6 +1,8 @@ CMP0078 ------- +.. versionadded:: 3.13 + :module:`UseSWIG` generates standard target names. Starting with CMake 3.13, :module:`UseSWIG` generates now standard target diff --git a/Help/policy/CMP0079.rst b/Help/policy/CMP0079.rst index 0244d6c..01aa08d 100644 --- a/Help/policy/CMP0079.rst +++ b/Help/policy/CMP0079.rst @@ -1,6 +1,8 @@ CMP0079 ------- +.. versionadded:: 3.13 + :command:`target_link_libraries` allows use with targets in other directories. Prior to CMake 3.13 the :command:`target_link_libraries` command did not diff --git a/Help/policy/CMP0080.rst b/Help/policy/CMP0080.rst index 5ce9591..789efea 100644 --- a/Help/policy/CMP0080.rst +++ b/Help/policy/CMP0080.rst @@ -1,6 +1,8 @@ CMP0080 ------- +.. versionadded:: 3.13 + :module:`BundleUtilities` cannot be included at configure time. The macros provided by :module:`BundleUtilities` are intended to be invoked diff --git a/Help/policy/CMP0081.rst b/Help/policy/CMP0081.rst index d3b2872..d1573dd 100644 --- a/Help/policy/CMP0081.rst +++ b/Help/policy/CMP0081.rst @@ -1,6 +1,8 @@ CMP0081 ------- +.. versionadded:: 3.13 + Relative paths not allowed in :prop_tgt:`LINK_DIRECTORIES` target property. CMake 3.12 and lower allowed the :prop_dir:`LINK_DIRECTORIES` directory diff --git a/Help/policy/CMP0082.rst b/Help/policy/CMP0082.rst index d887616..25c9580 100644 --- a/Help/policy/CMP0082.rst +++ b/Help/policy/CMP0082.rst @@ -1,6 +1,8 @@ CMP0082 ------- +.. versionadded:: 3.14 + Install rules from :command:`add_subdirectory` calls are interleaved with those in caller. diff --git a/Help/policy/CMP0083.rst b/Help/policy/CMP0083.rst index e0b09cf..7518ee3 100644 --- a/Help/policy/CMP0083.rst +++ b/Help/policy/CMP0083.rst @@ -1,6 +1,8 @@ CMP0083 ------- +.. versionadded:: 3.14 + To control generation of Position Independent Executable (``PIE``) or not, some flags are required at link time. diff --git a/Help/policy/CMP0084.rst b/Help/policy/CMP0084.rst index 713d295..9547701 100644 --- a/Help/policy/CMP0084.rst +++ b/Help/policy/CMP0084.rst @@ -1,6 +1,8 @@ CMP0084 ------- +.. versionadded:: 3.14 + The :module:`FindQt` module does not exist for :command:`find_package`. The existence of :module:`FindQt` means that for Qt upstream to provide diff --git a/Help/policy/CMP0085.rst b/Help/policy/CMP0085.rst index d9ec9a2..d90c72f 100644 --- a/Help/policy/CMP0085.rst +++ b/Help/policy/CMP0085.rst @@ -1,6 +1,8 @@ CMP0085 ------- +.. versionadded:: 3.14 + ``$<IN_LIST:...>`` handles empty list items. In CMake 3.13 and lower, the ``$<IN_LIST:...>`` generator expression always diff --git a/Help/policy/CMP0086.rst b/Help/policy/CMP0086.rst index 4a9e8b8..725b502 100644 --- a/Help/policy/CMP0086.rst +++ b/Help/policy/CMP0086.rst @@ -1,6 +1,8 @@ CMP0086 ------- +.. versionadded:: 3.14 + :module:`UseSWIG` honors ``SWIG_MODULE_NAME`` via ``-module`` flag. Starting with CMake 3.14, :module:`UseSWIG` passes option diff --git a/Help/policy/CMP0087.rst b/Help/policy/CMP0087.rst index 4c45b99..4a65506 100644 --- a/Help/policy/CMP0087.rst +++ b/Help/policy/CMP0087.rst @@ -1,6 +1,8 @@ CMP0087 ------- +.. versionadded:: 3.14 + :command:`install(CODE)` and :command:`install(SCRIPT)` support generator expressions. diff --git a/Help/policy/CMP0088.rst b/Help/policy/CMP0088.rst index 82c04ef..1840a58 100644 --- a/Help/policy/CMP0088.rst +++ b/Help/policy/CMP0088.rst @@ -1,6 +1,8 @@ CMP0088 ------- +.. versionadded:: 3.14 + :module:`FindBISON` runs bison in :variable:`CMAKE_CURRENT_BINARY_DIR` when executing. diff --git a/Help/policy/CMP0089.rst b/Help/policy/CMP0089.rst index 029de55..e3fc77a 100644 --- a/Help/policy/CMP0089.rst +++ b/Help/policy/CMP0089.rst @@ -1,6 +1,8 @@ CMP0089 ------- +.. versionadded:: 3.15 + Compiler id for IBM Clang-based XL compilers is now ``XLClang``. CMake 3.15 and above recognize that IBM's Clang-based XL compilers diff --git a/Help/policy/CMP0090.rst b/Help/policy/CMP0090.rst index 720c17c..58dd999 100644 --- a/Help/policy/CMP0090.rst +++ b/Help/policy/CMP0090.rst @@ -1,6 +1,8 @@ CMP0090 ------- +.. versionadded:: 3.15 + :command:`export(PACKAGE)` does not populate package registry by default. In CMake 3.14 and below the :command:`export(PACKAGE)` command populated the diff --git a/Help/policy/CMP0091.rst b/Help/policy/CMP0091.rst index 1a5878a..ffc0ade 100644 --- a/Help/policy/CMP0091.rst +++ b/Help/policy/CMP0091.rst @@ -1,6 +1,8 @@ CMP0091 ------- +.. versionadded:: 3.15 + MSVC runtime library flags are selected by an abstraction. Compilers targeting the MSVC ABI have flags to select the MSVC runtime library. diff --git a/Help/policy/CMP0092.rst b/Help/policy/CMP0092.rst index 8d3a288..66e3f3de 100644 --- a/Help/policy/CMP0092.rst +++ b/Help/policy/CMP0092.rst @@ -1,6 +1,8 @@ CMP0092 ------- +.. versionadded:: 3.15 + MSVC warning flags are not in :variable:`CMAKE_<LANG>_FLAGS` by default. When using MSVC-like compilers in CMake 3.14 and below, warning flags diff --git a/Help/policy/CMP0093.rst b/Help/policy/CMP0093.rst index 0ffc493..4a9955f 100644 --- a/Help/policy/CMP0093.rst +++ b/Help/policy/CMP0093.rst @@ -1,6 +1,8 @@ CMP0093 ------- +.. versionadded:: 3.15 + :module:`FindBoost` reports ``Boost_VERSION`` in ``x.y.z`` format. In CMake 3.14 and below the module would report the Boost version diff --git a/Help/policy/CMP0094.rst b/Help/policy/CMP0094.rst index 836f30f..1b57658 100644 --- a/Help/policy/CMP0094.rst +++ b/Help/policy/CMP0094.rst @@ -1,6 +1,8 @@ CMP0094 ------- +.. versionadded:: 3.15 + Modules :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython` use ``LOCATION`` for lookup strategy. diff --git a/Help/policy/CMP0095.rst b/Help/policy/CMP0095.rst index 4c56a05..ebdbab6 100644 --- a/Help/policy/CMP0095.rst +++ b/Help/policy/CMP0095.rst @@ -1,6 +1,8 @@ CMP0095 ------- +.. versionadded:: 3.16 + ``RPATH`` entries are properly escaped in the intermediary CMake install script. In CMake 3.15 and earlier, ``RPATH`` entries set via diff --git a/Help/policy/CMP0096.rst b/Help/policy/CMP0096.rst index 8eaf0f9..8fd6f72 100644 --- a/Help/policy/CMP0096.rst +++ b/Help/policy/CMP0096.rst @@ -1,6 +1,8 @@ CMP0096 ------- +.. versionadded:: 3.16 + The :command:`project` command preserves leading zeros in version components. When a ``VERSION <major>[.<minor>[.<patch>[.<tweak>]]]]`` argument is given diff --git a/Help/policy/CMP0097.rst b/Help/policy/CMP0097.rst index 4840aa6..2240874 100644 --- a/Help/policy/CMP0097.rst +++ b/Help/policy/CMP0097.rst @@ -1,6 +1,8 @@ CMP0097 ------- +.. versionadded:: 3.16 + :command:`ExternalProject_Add` with ``GIT_SUBMODULES ""`` initializes no submodules. diff --git a/Help/policy/CMP0098.rst b/Help/policy/CMP0098.rst index 6d1443b..e793380 100644 --- a/Help/policy/CMP0098.rst +++ b/Help/policy/CMP0098.rst @@ -1,6 +1,8 @@ CMP0098 ------- +.. versionadded:: 3.17 + :module:`FindFLEX` runs ``flex`` in directory :variable:`CMAKE_CURRENT_BINARY_DIR` when executing. diff --git a/Help/policy/CMP0099.rst b/Help/policy/CMP0099.rst index c897e7b..0c64949 100644 --- a/Help/policy/CMP0099.rst +++ b/Help/policy/CMP0099.rst @@ -1,6 +1,8 @@ CMP0099 ------- +.. versionadded:: 3.17 + Target link properties :prop_tgt:`INTERFACE_LINK_OPTIONS`, :prop_tgt:`INTERFACE_LINK_DIRECTORIES` and :prop_tgt:`INTERFACE_LINK_DEPENDS` are now transitive over private dependencies of static libraries. diff --git a/Help/policy/CMP0100.rst b/Help/policy/CMP0100.rst index b24d013..730fa82 100644 --- a/Help/policy/CMP0100.rst +++ b/Help/policy/CMP0100.rst @@ -1,6 +1,8 @@ CMP0100 ------- +.. versionadded:: 3.17 + Let :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` process header files that end with a ``.hh`` extension. diff --git a/Help/policy/CMP0101.rst b/Help/policy/CMP0101.rst index 9941acf..f02bccc 100644 --- a/Help/policy/CMP0101.rst +++ b/Help/policy/CMP0101.rst @@ -1,6 +1,8 @@ CMP0101 ------- +.. versionadded:: 3.17 + :command:`target_compile_options` now honors ``BEFORE`` keyword in all scopes. In CMake 3.16 and below the :command:`target_compile_options` ignores the diff --git a/Help/policy/CMP0102.rst b/Help/policy/CMP0102.rst index 9859006..78b5584 100644 --- a/Help/policy/CMP0102.rst +++ b/Help/policy/CMP0102.rst @@ -1,6 +1,8 @@ CMP0102 ------- +.. versionadded:: 3.17 + The :command:`mark_as_advanced` command no longer creates a cache entry if one does not already exist. diff --git a/Help/policy/CMP0103.rst b/Help/policy/CMP0103.rst index 223e0cb..b5f44d1 100644 --- a/Help/policy/CMP0103.rst +++ b/Help/policy/CMP0103.rst @@ -1,6 +1,8 @@ CMP0103 ------- +.. versionadded:: 3.18 + Multiple calls to :command:`export` command with same ``FILE`` without ``APPEND`` is no longer allowed. diff --git a/Help/policy/CMP0104.rst b/Help/policy/CMP0104.rst index 8516716..7c7a16e 100644 --- a/Help/policy/CMP0104.rst +++ b/Help/policy/CMP0104.rst @@ -1,6 +1,8 @@ CMP0104 ------- +.. versionadded:: 3.18 + Initialize :variable:`CMAKE_CUDA_ARCHITECTURES` when :variable:`CMAKE_CUDA_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` is ``NVIDIA``. Raise an error if :prop_tgt:`CUDA_ARCHITECTURES` is empty. diff --git a/Help/policy/CMP0105.rst b/Help/policy/CMP0105.rst index 19a1edb..097a59a 100644 --- a/Help/policy/CMP0105.rst +++ b/Help/policy/CMP0105.rst @@ -1,6 +1,8 @@ CMP0105 ------- +.. versionadded:: 3.18 + :prop_tgt:`LINK_OPTIONS` and :prop_tgt:`INTERFACE_LINK_OPTIONS` target properties are now used for the device link step. diff --git a/Help/policy/CMP0106.rst b/Help/policy/CMP0106.rst index e34d15a..18a6635 100644 --- a/Help/policy/CMP0106.rst +++ b/Help/policy/CMP0106.rst @@ -1,6 +1,8 @@ CMP0106 ------- +.. versionadded:: 3.18 + The :module:`Documentation` module is removed. The :module:`Documentation` was added as a support mechanism for the VTK diff --git a/Help/policy/CMP0107.rst b/Help/policy/CMP0107.rst index 111bef7..da5ae06 100644 --- a/Help/policy/CMP0107.rst +++ b/Help/policy/CMP0107.rst @@ -1,6 +1,8 @@ CMP0107 ------- +.. versionadded:: 3.18 + It is not allowed to create an ``ALIAS`` target with the same name as an another target. diff --git a/Help/policy/CMP0108.rst b/Help/policy/CMP0108.rst index 0d54cfa..4d1091d 100644 --- a/Help/policy/CMP0108.rst +++ b/Help/policy/CMP0108.rst @@ -1,6 +1,8 @@ CMP0108 ------- +.. versionadded:: 3.18 + A target is not allowed to link to itself even through an ``ALIAS`` target. In CMake 3.17 and below, a target can link to a target aliased to itself. diff --git a/Help/policy/CMP0109.rst b/Help/policy/CMP0109.rst new file mode 100644 index 0000000..f86287f --- /dev/null +++ b/Help/policy/CMP0109.rst @@ -0,0 +1,24 @@ +CMP0109 +------- + +.. versionadded:: 3.19 + +:command:`find_program` requires permission to execute but not to read. + +In CMake 3.18 and below, the :command:`find_program` command on UNIX +would find files that are readable without requiring execute permission, +and would not find files that are executable without read permission. +In CMake 3.19 and above, ``find_program`` now prefers to require execute +permission but not read permission. This policy provides compatibility +with projects that have not been updated to expect the new behavior. + +The ``OLD`` behavior for this policy is for ``find_program`` to require +read permission but not execute permission. +The ``NEW`` behavior for this policy is for ``find_program`` to require +execute permission but not read permission. + +This policy was introduced in CMake version 3.19. CMake version |release| +warns when the policy is not set and uses ``OLD`` behavior. Use the +:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly. + +.. include:: DEPRECATED.txt diff --git a/Help/prop_dir/ADDITIONAL_CLEAN_FILES.rst b/Help/prop_dir/ADDITIONAL_CLEAN_FILES.rst index 051d22a..6097d14 100644 --- a/Help/prop_dir/ADDITIONAL_CLEAN_FILES.rst +++ b/Help/prop_dir/ADDITIONAL_CLEAN_FILES.rst @@ -1,6 +1,8 @@ ADDITIONAL_CLEAN_FILES ---------------------- +.. versionadded:: 3.15 + A :ref:`;-list <CMake Language Lists>` of files or directories that will be removed as a part of the global ``clean`` target. It is useful for specifying generated files or directories that are used by multiple targets diff --git a/Help/prop_dir/BINARY_DIR.rst b/Help/prop_dir/BINARY_DIR.rst index 597c79a..fcf9d17 100644 --- a/Help/prop_dir/BINARY_DIR.rst +++ b/Help/prop_dir/BINARY_DIR.rst @@ -1,5 +1,7 @@ BINARY_DIR ---------- +.. versionadded:: 3.7 + This read-only directory property reports absolute path to the binary directory corresponding to the source on which it is read. diff --git a/Help/prop_dir/BUILDSYSTEM_TARGETS.rst b/Help/prop_dir/BUILDSYSTEM_TARGETS.rst index 04bb56e..5c5893d 100644 --- a/Help/prop_dir/BUILDSYSTEM_TARGETS.rst +++ b/Help/prop_dir/BUILDSYSTEM_TARGETS.rst @@ -1,6 +1,8 @@ BUILDSYSTEM_TARGETS ------------------- +.. versionadded:: 3.7 + This read-only directory property contains a :ref:`semicolon-separated list <CMake Language Lists>` of buildsystem targets added in the directory by calls to the :command:`add_library`, :command:`add_executable`, diff --git a/Help/prop_dir/LABELS.rst b/Help/prop_dir/LABELS.rst index de27d90..bf14368 100644 --- a/Help/prop_dir/LABELS.rst +++ b/Help/prop_dir/LABELS.rst @@ -1,6 +1,8 @@ LABELS ------ +.. versionadded:: 3.10 + Specify a list of text labels associated with a directory and all of its subdirectories. This is equivalent to setting the :prop_tgt:`LABELS` target property and the :prop_test:`LABELS` test property on all targets and tests in diff --git a/Help/prop_dir/LINK_OPTIONS.rst b/Help/prop_dir/LINK_OPTIONS.rst index f229ba6..3a5c72f 100644 --- a/Help/prop_dir/LINK_OPTIONS.rst +++ b/Help/prop_dir/LINK_OPTIONS.rst @@ -1,6 +1,8 @@ LINK_OPTIONS ------------ +.. versionadded:: 3.13 + List of options to use for the link step of shared library, module and executable targets as well as the device link step. diff --git a/Help/prop_dir/SOURCE_DIR.rst b/Help/prop_dir/SOURCE_DIR.rst index ac98c3b..d73707d 100644 --- a/Help/prop_dir/SOURCE_DIR.rst +++ b/Help/prop_dir/SOURCE_DIR.rst @@ -1,5 +1,7 @@ SOURCE_DIR ---------- +.. versionadded:: 3.7 + This read-only directory property reports absolute path to the source directory on which it is read. diff --git a/Help/prop_dir/SUBDIRECTORIES.rst b/Help/prop_dir/SUBDIRECTORIES.rst index 6a0ac80..71ea496 100644 --- a/Help/prop_dir/SUBDIRECTORIES.rst +++ b/Help/prop_dir/SUBDIRECTORIES.rst @@ -1,6 +1,8 @@ SUBDIRECTORIES -------------- +.. versionadded:: 3.7 + This read-only directory property contains a :ref:`semicolon-separated list <CMake Language Lists>` of subdirectories processed so far by the :command:`add_subdirectory` or :command:`subdirs` commands. Each entry is diff --git a/Help/prop_dir/TESTS.rst b/Help/prop_dir/TESTS.rst index 1c9f6e5..294be17 100644 --- a/Help/prop_dir/TESTS.rst +++ b/Help/prop_dir/TESTS.rst @@ -1,6 +1,8 @@ TESTS ----- +.. versionadded:: 3.12 + List of tests. This read-only property holds a diff --git a/Help/prop_dir/TEST_INCLUDE_FILES.rst b/Help/prop_dir/TEST_INCLUDE_FILES.rst index c3e4602..f9a66f4 100644 --- a/Help/prop_dir/TEST_INCLUDE_FILES.rst +++ b/Help/prop_dir/TEST_INCLUDE_FILES.rst @@ -1,6 +1,8 @@ TEST_INCLUDE_FILES ------------------ +.. versionadded:: 3.10 + A list of cmake files that will be included when ctest is run. If you specify ``TEST_INCLUDE_FILES``, those files will be included and diff --git a/Help/prop_dir/VS_STARTUP_PROJECT.rst b/Help/prop_dir/VS_STARTUP_PROJECT.rst index 2680dfa..8a0c3c8 100644 --- a/Help/prop_dir/VS_STARTUP_PROJECT.rst +++ b/Help/prop_dir/VS_STARTUP_PROJECT.rst @@ -1,6 +1,8 @@ VS_STARTUP_PROJECT ------------------ +.. versionadded:: 3.6 + Specify the default startup project in a Visual Studio solution. The :ref:`Visual Studio Generators` create a ``.sln`` file for each directory diff --git a/Help/prop_gbl/AUTOGEN_SOURCE_GROUP.rst b/Help/prop_gbl/AUTOGEN_SOURCE_GROUP.rst index d294eb1..2e32320 100644 --- a/Help/prop_gbl/AUTOGEN_SOURCE_GROUP.rst +++ b/Help/prop_gbl/AUTOGEN_SOURCE_GROUP.rst @@ -1,6 +1,8 @@ AUTOGEN_SOURCE_GROUP -------------------- +.. versionadded:: 3.9 + Name of the :command:`source_group` for :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTORCC` generated files. diff --git a/Help/prop_gbl/AUTOMOC_SOURCE_GROUP.rst b/Help/prop_gbl/AUTOMOC_SOURCE_GROUP.rst index 2455dc7..a266fde 100644 --- a/Help/prop_gbl/AUTOMOC_SOURCE_GROUP.rst +++ b/Help/prop_gbl/AUTOMOC_SOURCE_GROUP.rst @@ -1,6 +1,8 @@ AUTOMOC_SOURCE_GROUP -------------------- +.. versionadded:: 3.9 + Name of the :command:`source_group` for :prop_tgt:`AUTOMOC` generated files. When set this is used instead of :prop_gbl:`AUTOGEN_SOURCE_GROUP` for diff --git a/Help/prop_gbl/AUTORCC_SOURCE_GROUP.rst b/Help/prop_gbl/AUTORCC_SOURCE_GROUP.rst index 65ea95b..54ebabb 100644 --- a/Help/prop_gbl/AUTORCC_SOURCE_GROUP.rst +++ b/Help/prop_gbl/AUTORCC_SOURCE_GROUP.rst @@ -1,6 +1,8 @@ AUTORCC_SOURCE_GROUP -------------------- +.. versionadded:: 3.9 + Name of the :command:`source_group` for :prop_tgt:`AUTORCC` generated files. When set this is used instead of :prop_gbl:`AUTOGEN_SOURCE_GROUP` for diff --git a/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst index 44e37fe..e8e3148 100644 --- a/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst +++ b/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst @@ -1,6 +1,8 @@ CMAKE_CUDA_KNOWN_FEATURES ------------------------- +.. versionadded:: 3.17 + List of CUDA features known to this version of CMake. The features listed in this global property may be known to be available to the diff --git a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst index b921c6b..9b53282 100644 --- a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst +++ b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst @@ -1,6 +1,8 @@ CMAKE_CXX_KNOWN_FEATURES ------------------------ +.. versionadded:: 3.1 + List of C++ features known to this version of CMake. The features listed in this global property may be known to be available to the diff --git a/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst index e5f896e..7166381 100644 --- a/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst +++ b/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst @@ -1,6 +1,8 @@ CMAKE_C_KNOWN_FEATURES ---------------------- +.. versionadded:: 3.1 + List of C features known to this version of CMake. The features listed in this global property may be known to be available to the diff --git a/Help/prop_gbl/CMAKE_ROLE.rst b/Help/prop_gbl/CMAKE_ROLE.rst index 27512fa..3f4492f 100644 --- a/Help/prop_gbl/CMAKE_ROLE.rst +++ b/Help/prop_gbl/CMAKE_ROLE.rst @@ -1,6 +1,8 @@ CMAKE_ROLE ---------- +.. versionadded:: 3.14 + Tells what mode the current running script is in. Could be one of several values: diff --git a/Help/prop_gbl/ECLIPSE_EXTRA_CPROJECT_CONTENTS.rst b/Help/prop_gbl/ECLIPSE_EXTRA_CPROJECT_CONTENTS.rst index 50c41a9..2f110a7 100644 --- a/Help/prop_gbl/ECLIPSE_EXTRA_CPROJECT_CONTENTS.rst +++ b/Help/prop_gbl/ECLIPSE_EXTRA_CPROJECT_CONTENTS.rst @@ -1,6 +1,8 @@ ECLIPSE_EXTRA_CPROJECT_CONTENTS ------------------------------- +.. versionadded:: 3.12 + Additional contents to be inserted into the generated Eclipse cproject file. The cproject file defines the CDT specific information. Some third party IDE's diff --git a/Help/prop_gbl/FIND_LIBRARY_USE_LIB32_PATHS.rst b/Help/prop_gbl/FIND_LIBRARY_USE_LIB32_PATHS.rst index 8396026..f6cad66 100644 --- a/Help/prop_gbl/FIND_LIBRARY_USE_LIB32_PATHS.rst +++ b/Help/prop_gbl/FIND_LIBRARY_USE_LIB32_PATHS.rst @@ -1,6 +1,8 @@ FIND_LIBRARY_USE_LIB32_PATHS ---------------------------- +.. versionadded:: 3.7 + Whether the :command:`find_library` command should automatically search ``lib32`` directories. diff --git a/Help/prop_gbl/FIND_LIBRARY_USE_LIBX32_PATHS.rst b/Help/prop_gbl/FIND_LIBRARY_USE_LIBX32_PATHS.rst index b87b09b..851f859 100644 --- a/Help/prop_gbl/FIND_LIBRARY_USE_LIBX32_PATHS.rst +++ b/Help/prop_gbl/FIND_LIBRARY_USE_LIBX32_PATHS.rst @@ -1,6 +1,8 @@ FIND_LIBRARY_USE_LIBX32_PATHS ----------------------------- +.. versionadded:: 3.9 + Whether the :command:`find_library` command should automatically search ``libx32`` directories. diff --git a/Help/prop_gbl/GENERATOR_IS_MULTI_CONFIG.rst b/Help/prop_gbl/GENERATOR_IS_MULTI_CONFIG.rst index b8ec8a6..6f1a9e1 100644 --- a/Help/prop_gbl/GENERATOR_IS_MULTI_CONFIG.rst +++ b/Help/prop_gbl/GENERATOR_IS_MULTI_CONFIG.rst @@ -1,6 +1,8 @@ GENERATOR_IS_MULTI_CONFIG ------------------------- +.. versionadded:: 3.9 + Read-only property that is true on multi-configuration generators. True when using a multi-configuration generator diff --git a/Help/prop_gbl/TARGET_MESSAGES.rst b/Help/prop_gbl/TARGET_MESSAGES.rst index 275b074..bb91772 100644 --- a/Help/prop_gbl/TARGET_MESSAGES.rst +++ b/Help/prop_gbl/TARGET_MESSAGES.rst @@ -1,6 +1,8 @@ TARGET_MESSAGES --------------- +.. versionadded:: 3.4 + Specify whether to report the completion of each target. This property specifies whether :ref:`Makefile Generators` should diff --git a/Help/prop_gbl/XCODE_EMIT_EFFECTIVE_PLATFORM_NAME.rst b/Help/prop_gbl/XCODE_EMIT_EFFECTIVE_PLATFORM_NAME.rst index 9500443..392b704 100644 --- a/Help/prop_gbl/XCODE_EMIT_EFFECTIVE_PLATFORM_NAME.rst +++ b/Help/prop_gbl/XCODE_EMIT_EFFECTIVE_PLATFORM_NAME.rst @@ -1,6 +1,8 @@ XCODE_EMIT_EFFECTIVE_PLATFORM_NAME ---------------------------------- +.. versionadded:: 3.8 + Control emission of ``EFFECTIVE_PLATFORM_NAME`` by the :generator:`Xcode` generator. diff --git a/Help/prop_inst/CPACK_DESKTOP_SHORTCUTS.rst b/Help/prop_inst/CPACK_DESKTOP_SHORTCUTS.rst index 729ab60..55e9a20 100644 --- a/Help/prop_inst/CPACK_DESKTOP_SHORTCUTS.rst +++ b/Help/prop_inst/CPACK_DESKTOP_SHORTCUTS.rst @@ -1,6 +1,8 @@ CPACK_DESKTOP_SHORTCUTS ----------------------- +.. versionadded:: 3.3 + Species a list of shortcut names that should be created on the `Desktop` for this file. diff --git a/Help/prop_inst/CPACK_NEVER_OVERWRITE.rst b/Help/prop_inst/CPACK_NEVER_OVERWRITE.rst index 4789e25..12eef9e 100644 --- a/Help/prop_inst/CPACK_NEVER_OVERWRITE.rst +++ b/Help/prop_inst/CPACK_NEVER_OVERWRITE.rst @@ -1,6 +1,8 @@ CPACK_NEVER_OVERWRITE --------------------- +.. versionadded:: 3.1 + Request that this file not be overwritten on install or reinstall. The property is currently only supported by the :cpack_gen:`CPack WIX Generator`. diff --git a/Help/prop_inst/CPACK_PERMANENT.rst b/Help/prop_inst/CPACK_PERMANENT.rst index 985de0d..e89c552 100644 --- a/Help/prop_inst/CPACK_PERMANENT.rst +++ b/Help/prop_inst/CPACK_PERMANENT.rst @@ -1,6 +1,8 @@ CPACK_PERMANENT --------------- +.. versionadded:: 3.1 + Request that this file not be removed on uninstall. The property is currently only supported by the :cpack_gen:`CPack WIX Generator`. diff --git a/Help/prop_inst/CPACK_STARTUP_SHORTCUTS.rst b/Help/prop_inst/CPACK_STARTUP_SHORTCUTS.rst index d9208b9..e896acd 100644 --- a/Help/prop_inst/CPACK_STARTUP_SHORTCUTS.rst +++ b/Help/prop_inst/CPACK_STARTUP_SHORTCUTS.rst @@ -1,6 +1,8 @@ CPACK_STARTUP_SHORTCUTS ----------------------- +.. versionadded:: 3.3 + Species a list of shortcut names that should be created in the `Startup` folder for this file. diff --git a/Help/prop_inst/CPACK_START_MENU_SHORTCUTS.rst b/Help/prop_inst/CPACK_START_MENU_SHORTCUTS.rst index 092334a..fb8807f 100644 --- a/Help/prop_inst/CPACK_START_MENU_SHORTCUTS.rst +++ b/Help/prop_inst/CPACK_START_MENU_SHORTCUTS.rst @@ -1,6 +1,8 @@ CPACK_START_MENU_SHORTCUTS -------------------------- +.. versionadded:: 3.3 + Species a list of shortcut names that should be created in the `Start Menu` for this file. diff --git a/Help/prop_inst/CPACK_WIX_ACL.rst b/Help/prop_inst/CPACK_WIX_ACL.rst index c88f426..8b4fb5c 100644 --- a/Help/prop_inst/CPACK_WIX_ACL.rst +++ b/Help/prop_inst/CPACK_WIX_ACL.rst @@ -1,6 +1,8 @@ CPACK_WIX_ACL ------------- +.. versionadded:: 3.1 + Specifies access permissions for files or directories installed by a WiX installer. diff --git a/Help/prop_sf/COMPILE_OPTIONS.rst b/Help/prop_sf/COMPILE_OPTIONS.rst index 537dcec..a694c3e 100644 --- a/Help/prop_sf/COMPILE_OPTIONS.rst +++ b/Help/prop_sf/COMPILE_OPTIONS.rst @@ -1,6 +1,8 @@ COMPILE_OPTIONS --------------- +.. versionadded:: 3.11 + List of additional options to pass to the compiler. This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options diff --git a/Help/prop_sf/Fortran_PREPROCESS.rst b/Help/prop_sf/Fortran_PREPROCESS.rst index 25ea827..548a97b 100644 --- a/Help/prop_sf/Fortran_PREPROCESS.rst +++ b/Help/prop_sf/Fortran_PREPROCESS.rst @@ -1,6 +1,8 @@ Fortran_PREPROCESS ------------------ +.. versionadded:: 3.18 + Control whether the Fortran source file should be unconditionally preprocessed. If unset or empty, rely on the compiler to determine whether the file diff --git a/Help/prop_sf/INCLUDE_DIRECTORIES.rst b/Help/prop_sf/INCLUDE_DIRECTORIES.rst index 23de70e..89ffd15 100644 --- a/Help/prop_sf/INCLUDE_DIRECTORIES.rst +++ b/Help/prop_sf/INCLUDE_DIRECTORIES.rst @@ -1,6 +1,8 @@ INCLUDE_DIRECTORIES ------------------- +.. versionadded:: 3.11 + List of preprocessor include file search directories. This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of paths diff --git a/Help/prop_sf/SKIP_AUTOGEN.rst b/Help/prop_sf/SKIP_AUTOGEN.rst index f31185a..2173f59 100644 --- a/Help/prop_sf/SKIP_AUTOGEN.rst +++ b/Help/prop_sf/SKIP_AUTOGEN.rst @@ -1,6 +1,8 @@ SKIP_AUTOGEN ------------ +.. versionadded:: 3.8 + Exclude the source file from :prop_tgt:`AUTOMOC`, :prop_tgt:`AUTOUIC` and :prop_tgt:`AUTORCC` processing (for Qt projects). diff --git a/Help/prop_sf/SKIP_AUTOMOC.rst b/Help/prop_sf/SKIP_AUTOMOC.rst index a929448..e92cfe0 100644 --- a/Help/prop_sf/SKIP_AUTOMOC.rst +++ b/Help/prop_sf/SKIP_AUTOMOC.rst @@ -1,6 +1,8 @@ SKIP_AUTOMOC ------------ +.. versionadded:: 3.8 + Exclude the source file from :prop_tgt:`AUTOMOC` processing (for Qt projects). For broader exclusion control see :prop_sf:`SKIP_AUTOGEN`. diff --git a/Help/prop_sf/SKIP_AUTORCC.rst b/Help/prop_sf/SKIP_AUTORCC.rst index bccccfc..2829c25 100644 --- a/Help/prop_sf/SKIP_AUTORCC.rst +++ b/Help/prop_sf/SKIP_AUTORCC.rst @@ -1,6 +1,8 @@ SKIP_AUTORCC ------------ +.. versionadded:: 3.8 + Exclude the source file from :prop_tgt:`AUTORCC` processing (for Qt projects). For broader exclusion control see :prop_sf:`SKIP_AUTOGEN`. diff --git a/Help/prop_sf/SKIP_AUTOUIC.rst b/Help/prop_sf/SKIP_AUTOUIC.rst index 8c962db..ae9725a 100644 --- a/Help/prop_sf/SKIP_AUTOUIC.rst +++ b/Help/prop_sf/SKIP_AUTOUIC.rst @@ -1,6 +1,8 @@ SKIP_AUTOUIC ------------ +.. versionadded:: 3.8 + Exclude the source file from :prop_tgt:`AUTOUIC` processing (for Qt projects). :prop_sf:`SKIP_AUTOUIC` can be set on C++ header and source files and on diff --git a/Help/prop_sf/SKIP_PRECOMPILE_HEADERS.rst b/Help/prop_sf/SKIP_PRECOMPILE_HEADERS.rst index 0031da3..660de3f 100644 --- a/Help/prop_sf/SKIP_PRECOMPILE_HEADERS.rst +++ b/Help/prop_sf/SKIP_PRECOMPILE_HEADERS.rst @@ -1,6 +1,8 @@ SKIP_PRECOMPILE_HEADERS ----------------------- +.. versionadded:: 3.16 + Is this source file skipped by :prop_tgt:`PRECOMPILE_HEADERS` feature. This property helps with build problems that one would run into diff --git a/Help/prop_sf/SKIP_UNITY_BUILD_INCLUSION.rst b/Help/prop_sf/SKIP_UNITY_BUILD_INCLUSION.rst index 6d1e60d..ae526ac 100644 --- a/Help/prop_sf/SKIP_UNITY_BUILD_INCLUSION.rst +++ b/Help/prop_sf/SKIP_UNITY_BUILD_INCLUSION.rst @@ -1,6 +1,8 @@ SKIP_UNITY_BUILD_INCLUSION -------------------------- +.. versionadded:: 3.16 + Setting this property to true ensures the source file will be skipped by unity builds when its associated target has its :prop_tgt:`UNITY_BUILD` property set to true. The source file will instead be compiled on its own diff --git a/Help/prop_sf/Swift_DEPENDENCIES_FILE.rst b/Help/prop_sf/Swift_DEPENDENCIES_FILE.rst index faac2df..a90c7eb 100644 --- a/Help/prop_sf/Swift_DEPENDENCIES_FILE.rst +++ b/Help/prop_sf/Swift_DEPENDENCIES_FILE.rst @@ -1,5 +1,7 @@ Swift_DEPENDENCIES_FILE ----------------------- +.. versionadded:: 3.15 + This property sets the path for the Swift dependency file (swiftdeps) for the source. If one is not specified, it will default to ``<OBJECT>.swiftdeps``. diff --git a/Help/prop_sf/Swift_DIAGNOSTICS_FILE.rst b/Help/prop_sf/Swift_DIAGNOSTICS_FILE.rst index 5bf5d59..47d5ac3 100644 --- a/Help/prop_sf/Swift_DIAGNOSTICS_FILE.rst +++ b/Help/prop_sf/Swift_DIAGNOSTICS_FILE.rst @@ -1,4 +1,6 @@ Swift_DIAGNOSTICS_FILE ---------------------- +.. versionadded:: 3.15 + This property controls where the Swift diagnostics are serialized. diff --git a/Help/prop_sf/UNITY_GROUP.rst b/Help/prop_sf/UNITY_GROUP.rst index ec6b0f6..9c18b70 100644 --- a/Help/prop_sf/UNITY_GROUP.rst +++ b/Help/prop_sf/UNITY_GROUP.rst @@ -1,5 +1,7 @@ UNITY_GROUP ----------- +.. versionadded:: 3.18 + This property controls which *bucket* the source will be part of when the :prop_tgt:`UNITY_BUILD_MODE` is set to ``GROUP``. diff --git a/Help/prop_sf/VS_COPY_TO_OUT_DIR.rst b/Help/prop_sf/VS_COPY_TO_OUT_DIR.rst index 16c8d83..ebc3061 100644 --- a/Help/prop_sf/VS_COPY_TO_OUT_DIR.rst +++ b/Help/prop_sf/VS_COPY_TO_OUT_DIR.rst @@ -1,6 +1,8 @@ VS_COPY_TO_OUT_DIR ------------------ +.. versionadded:: 3.8 + Sets the ``<CopyToOutputDirectory>`` tag for a source file in a Visual Studio project file. Valid values are ``Never``, ``Always`` and ``PreserveNewest``. diff --git a/Help/prop_sf/VS_CSHARP_tagname.rst b/Help/prop_sf/VS_CSHARP_tagname.rst index 91c4a06..75720f8 100644 --- a/Help/prop_sf/VS_CSHARP_tagname.rst +++ b/Help/prop_sf/VS_CSHARP_tagname.rst @@ -1,6 +1,8 @@ VS_CSHARP_<tagname> ------------------- +.. versionadded:: 3.8 + Visual Studio and CSharp source-file-specific configuration. Tell the :manual:`Visual Studio generators <cmake-generators(7)>` diff --git a/Help/prop_sf/VS_DEPLOYMENT_CONTENT.rst b/Help/prop_sf/VS_DEPLOYMENT_CONTENT.rst index 6a38478..ee49b27 100644 --- a/Help/prop_sf/VS_DEPLOYMENT_CONTENT.rst +++ b/Help/prop_sf/VS_DEPLOYMENT_CONTENT.rst @@ -1,6 +1,8 @@ VS_DEPLOYMENT_CONTENT --------------------- +.. versionadded:: 3.1 + Mark a source file as content for deployment with a Windows Phone or Windows Store application when built with a :manual:`Visual Studio generators <cmake-generators(7)>`. diff --git a/Help/prop_sf/VS_DEPLOYMENT_LOCATION.rst b/Help/prop_sf/VS_DEPLOYMENT_LOCATION.rst index 2ce22fc..b170544 100644 --- a/Help/prop_sf/VS_DEPLOYMENT_LOCATION.rst +++ b/Help/prop_sf/VS_DEPLOYMENT_LOCATION.rst @@ -1,6 +1,8 @@ VS_DEPLOYMENT_LOCATION ---------------------- +.. versionadded:: 3.1 + Specifies the deployment location for a content source file with a Windows Phone or Windows Store application when built with a :manual:`Visual Studio generators <cmake-generators(7)>`. diff --git a/Help/prop_sf/VS_INCLUDE_IN_VSIX.rst b/Help/prop_sf/VS_INCLUDE_IN_VSIX.rst index db470ef..16c56bf 100644 --- a/Help/prop_sf/VS_INCLUDE_IN_VSIX.rst +++ b/Help/prop_sf/VS_INCLUDE_IN_VSIX.rst @@ -1,6 +1,8 @@ VS_INCLUDE_IN_VSIX ------------------ +.. versionadded:: 3.8 + Boolean property to specify if the file should be included within a VSIX (Visual Studio Integration Extension) extension package. This is needed for development of Visual Studio extensions. diff --git a/Help/prop_sf/VS_RESOURCE_GENERATOR.rst b/Help/prop_sf/VS_RESOURCE_GENERATOR.rst index 97e5aac..c5bb4f6 100644 --- a/Help/prop_sf/VS_RESOURCE_GENERATOR.rst +++ b/Help/prop_sf/VS_RESOURCE_GENERATOR.rst @@ -1,6 +1,8 @@ VS_RESOURCE_GENERATOR --------------------- +.. versionadded:: 3.8 + This property allows to specify the resource generator to be used on this file. It defaults to ``PublicResXFileCodeGenerator`` if not set. diff --git a/Help/prop_sf/VS_SETTINGS.rst b/Help/prop_sf/VS_SETTINGS.rst index 50034fb..322f5a6 100644 --- a/Help/prop_sf/VS_SETTINGS.rst +++ b/Help/prop_sf/VS_SETTINGS.rst @@ -1,6 +1,8 @@ VS_SETTINGS ----------- +.. versionadded:: 3.18 + Set any item metadata on a non-built file. Takes a list of ``Key=Value`` pairs. Tells the Visual Studio generator to set diff --git a/Help/prop_sf/VS_SHADER_DISABLE_OPTIMIZATIONS.rst b/Help/prop_sf/VS_SHADER_DISABLE_OPTIMIZATIONS.rst index 446dd26..6fb6778 100644 --- a/Help/prop_sf/VS_SHADER_DISABLE_OPTIMIZATIONS.rst +++ b/Help/prop_sf/VS_SHADER_DISABLE_OPTIMIZATIONS.rst @@ -1,6 +1,8 @@ VS_SHADER_DISABLE_OPTIMIZATIONS ------------------------------- +.. versionadded:: 3.11 + Disable compiler optimizations for an ``.hlsl`` source file. This adds the ``-Od`` flag to the command line for the FxCompiler tool. Specify the value ``true`` for this property to disable compiler optimizations. diff --git a/Help/prop_sf/VS_SHADER_ENABLE_DEBUG.rst b/Help/prop_sf/VS_SHADER_ENABLE_DEBUG.rst index c0e60a3..9c8f9d7 100644 --- a/Help/prop_sf/VS_SHADER_ENABLE_DEBUG.rst +++ b/Help/prop_sf/VS_SHADER_ENABLE_DEBUG.rst @@ -1,6 +1,8 @@ VS_SHADER_ENABLE_DEBUG ---------------------- +.. versionadded:: 3.11 + Enable debugging information for an ``.hlsl`` source file. This adds the ``-Zi`` flag to the command line for the FxCompiler tool. Specify the value ``true`` to generate debugging information for the compiled shader. diff --git a/Help/prop_sf/VS_SHADER_ENTRYPOINT.rst b/Help/prop_sf/VS_SHADER_ENTRYPOINT.rst index fe3471f..4b311ba 100644 --- a/Help/prop_sf/VS_SHADER_ENTRYPOINT.rst +++ b/Help/prop_sf/VS_SHADER_ENTRYPOINT.rst @@ -1,5 +1,7 @@ VS_SHADER_ENTRYPOINT -------------------- +.. versionadded:: 3.1 + Specifies the name of the entry point for the shader of a ``.hlsl`` source file. diff --git a/Help/prop_sf/VS_SHADER_FLAGS.rst b/Help/prop_sf/VS_SHADER_FLAGS.rst index 0a53afd..07f8497 100644 --- a/Help/prop_sf/VS_SHADER_FLAGS.rst +++ b/Help/prop_sf/VS_SHADER_FLAGS.rst @@ -1,4 +1,6 @@ VS_SHADER_FLAGS --------------- +.. versionadded:: 3.2 + Set additional Visual Studio shader flags of a ``.hlsl`` source file. diff --git a/Help/prop_sf/VS_SHADER_MODEL.rst b/Help/prop_sf/VS_SHADER_MODEL.rst index b1cf0df..072df89 100644 --- a/Help/prop_sf/VS_SHADER_MODEL.rst +++ b/Help/prop_sf/VS_SHADER_MODEL.rst @@ -1,5 +1,7 @@ VS_SHADER_MODEL --------------- +.. versionadded:: 3.1 + Specifies the shader model of a ``.hlsl`` source file. Some shader types can only be used with recent shader models diff --git a/Help/prop_sf/VS_SHADER_OBJECT_FILE_NAME.rst b/Help/prop_sf/VS_SHADER_OBJECT_FILE_NAME.rst index 093bcc6..3647a5e 100644 --- a/Help/prop_sf/VS_SHADER_OBJECT_FILE_NAME.rst +++ b/Help/prop_sf/VS_SHADER_OBJECT_FILE_NAME.rst @@ -1,6 +1,8 @@ VS_SHADER_OBJECT_FILE_NAME -------------------------- +.. versionadded:: 3.12 + Specifies a file name for the compiled shader object file for an ``.hlsl`` source file. This adds the ``-Fo`` flag to the command line for the FxCompiler tool. diff --git a/Help/prop_sf/VS_SHADER_OUTPUT_HEADER_FILE.rst b/Help/prop_sf/VS_SHADER_OUTPUT_HEADER_FILE.rst index e6763d3..4113a16 100644 --- a/Help/prop_sf/VS_SHADER_OUTPUT_HEADER_FILE.rst +++ b/Help/prop_sf/VS_SHADER_OUTPUT_HEADER_FILE.rst @@ -1,5 +1,7 @@ VS_SHADER_OUTPUT_HEADER_FILE ---------------------------- +.. versionadded:: 3.10 + Set filename for output header file containing object code of a ``.hlsl`` source file. diff --git a/Help/prop_sf/VS_SHADER_TYPE.rst b/Help/prop_sf/VS_SHADER_TYPE.rst index f104837..3fb7e60 100644 --- a/Help/prop_sf/VS_SHADER_TYPE.rst +++ b/Help/prop_sf/VS_SHADER_TYPE.rst @@ -1,4 +1,6 @@ VS_SHADER_TYPE -------------- +.. versionadded:: 3.1 + Set the Visual Studio shader type of a ``.hlsl`` source file. diff --git a/Help/prop_sf/VS_SHADER_VARIABLE_NAME.rst b/Help/prop_sf/VS_SHADER_VARIABLE_NAME.rst index 1a5e369..3361b40 100644 --- a/Help/prop_sf/VS_SHADER_VARIABLE_NAME.rst +++ b/Help/prop_sf/VS_SHADER_VARIABLE_NAME.rst @@ -1,5 +1,7 @@ VS_SHADER_VARIABLE_NAME ----------------------- +.. versionadded:: 3.10 + Set name of variable in header file containing object code of a ``.hlsl`` source file. diff --git a/Help/prop_sf/VS_TOOL_OVERRIDE.rst b/Help/prop_sf/VS_TOOL_OVERRIDE.rst index 8bdc5ca..b2f4112 100644 --- a/Help/prop_sf/VS_TOOL_OVERRIDE.rst +++ b/Help/prop_sf/VS_TOOL_OVERRIDE.rst @@ -1,5 +1,7 @@ VS_TOOL_OVERRIDE ---------------- +.. versionadded:: 3.7 + Override the default Visual Studio tool that will be applied to the source file with a new tool not based on the extension of the file. diff --git a/Help/prop_sf/VS_XAML_TYPE.rst b/Help/prop_sf/VS_XAML_TYPE.rst index 1a274ba..612b07b 100644 --- a/Help/prop_sf/VS_XAML_TYPE.rst +++ b/Help/prop_sf/VS_XAML_TYPE.rst @@ -1,6 +1,8 @@ VS_XAML_TYPE ------------ +.. versionadded:: 3.3 + Mark a Extensible Application Markup Language (XAML) source file as a different type than the default ``Page``. The most common usage would be to set the default ``App.xaml`` file as diff --git a/Help/prop_sf/XCODE_EXPLICIT_FILE_TYPE.rst b/Help/prop_sf/XCODE_EXPLICIT_FILE_TYPE.rst index b8cf946..5a50d7d 100644 --- a/Help/prop_sf/XCODE_EXPLICIT_FILE_TYPE.rst +++ b/Help/prop_sf/XCODE_EXPLICIT_FILE_TYPE.rst @@ -1,6 +1,8 @@ XCODE_EXPLICIT_FILE_TYPE ------------------------ +.. versionadded:: 3.1 + Set the :generator:`Xcode` ``explicitFileType`` attribute on its reference to a source file. CMake computes a default based on file extension but can be told explicitly with this property. diff --git a/Help/prop_sf/XCODE_FILE_ATTRIBUTES.rst b/Help/prop_sf/XCODE_FILE_ATTRIBUTES.rst index 4c93f44..ba51e00 100644 --- a/Help/prop_sf/XCODE_FILE_ATTRIBUTES.rst +++ b/Help/prop_sf/XCODE_FILE_ATTRIBUTES.rst @@ -1,6 +1,8 @@ XCODE_FILE_ATTRIBUTES --------------------- +.. versionadded:: 3.7 + Add values to the :generator:`Xcode` ``ATTRIBUTES`` setting on its reference to a source file. Among other things, this can be used to set the role on a ``.mig`` file:: diff --git a/Help/prop_sf/XCODE_LAST_KNOWN_FILE_TYPE.rst b/Help/prop_sf/XCODE_LAST_KNOWN_FILE_TYPE.rst index b21891f..0b84e31 100644 --- a/Help/prop_sf/XCODE_LAST_KNOWN_FILE_TYPE.rst +++ b/Help/prop_sf/XCODE_LAST_KNOWN_FILE_TYPE.rst @@ -1,6 +1,8 @@ XCODE_LAST_KNOWN_FILE_TYPE -------------------------- +.. versionadded:: 3.1 + Set the :generator:`Xcode` ``lastKnownFileType`` attribute on its reference to a source file. CMake computes a default based on file extension but can be told explicitly with this property. diff --git a/Help/prop_test/DISABLED.rst b/Help/prop_test/DISABLED.rst index 1d469e8..cbf07a5 100644 --- a/Help/prop_test/DISABLED.rst +++ b/Help/prop_test/DISABLED.rst @@ -1,6 +1,8 @@ DISABLED -------- +.. versionadded:: 3.9 + If set to ``True``, the test will be skipped and its status will be 'Not Run'. A ``DISABLED`` test will not be counted in the total number of tests and its completion status will be reported to CDash as ``Disabled``. diff --git a/Help/prop_test/FIXTURES_CLEANUP.rst b/Help/prop_test/FIXTURES_CLEANUP.rst index 3075b4d..aa043da 100644 --- a/Help/prop_test/FIXTURES_CLEANUP.rst +++ b/Help/prop_test/FIXTURES_CLEANUP.rst @@ -1,6 +1,8 @@ FIXTURES_CLEANUP ---------------- +.. versionadded:: 3.7 + Specifies a list of fixtures for which the test is to be treated as a cleanup test. These fixture names are distinct from test case names and are not required to have any similarity to the names of tests associated with them. diff --git a/Help/prop_test/FIXTURES_REQUIRED.rst b/Help/prop_test/FIXTURES_REQUIRED.rst index e3f60c4..d92808a 100644 --- a/Help/prop_test/FIXTURES_REQUIRED.rst +++ b/Help/prop_test/FIXTURES_REQUIRED.rst @@ -1,6 +1,8 @@ FIXTURES_REQUIRED ----------------- +.. versionadded:: 3.7 + Specifies a list of fixtures the test requires. Fixture names are case sensitive and they are not required to have any similarity to test names. diff --git a/Help/prop_test/FIXTURES_SETUP.rst b/Help/prop_test/FIXTURES_SETUP.rst index fdb21cc..04a09d8 100644 --- a/Help/prop_test/FIXTURES_SETUP.rst +++ b/Help/prop_test/FIXTURES_SETUP.rst @@ -1,6 +1,8 @@ FIXTURES_SETUP -------------- +.. versionadded:: 3.7 + Specifies a list of fixtures for which the test is to be treated as a setup test. These fixture names are distinct from test case names and are not required to have any similarity to the names of tests associated with them. diff --git a/Help/prop_test/PROCESSOR_AFFINITY.rst b/Help/prop_test/PROCESSOR_AFFINITY.rst index 38ec179..f48a69c 100644 --- a/Help/prop_test/PROCESSOR_AFFINITY.rst +++ b/Help/prop_test/PROCESSOR_AFFINITY.rst @@ -1,6 +1,8 @@ PROCESSOR_AFFINITY ------------------ +.. versionadded:: 3.12 + Set to a true value to ask CTest to launch the test process with CPU affinity for a fixed set of processors. If enabled and supported for the current platform, CTest will choose a set of processors to place in the CPU affinity diff --git a/Help/prop_test/RESOURCE_GROUPS.rst b/Help/prop_test/RESOURCE_GROUPS.rst index 63c56ce..26c8fa2 100644 --- a/Help/prop_test/RESOURCE_GROUPS.rst +++ b/Help/prop_test/RESOURCE_GROUPS.rst @@ -1,6 +1,8 @@ RESOURCE_GROUPS --------------- +.. versionadded:: 3.16 + Specify resources required by a test, grouped in a way that is meaningful to the test. See :ref:`resource allocation <ctest-resource-allocation>` for more information on how this property integrates into the CTest resource diff --git a/Help/prop_test/SKIP_REGULAR_EXPRESSION.rst b/Help/prop_test/SKIP_REGULAR_EXPRESSION.rst index 2c6d980..46c4363 100644 --- a/Help/prop_test/SKIP_REGULAR_EXPRESSION.rst +++ b/Help/prop_test/SKIP_REGULAR_EXPRESSION.rst @@ -1,6 +1,8 @@ SKIP_REGULAR_EXPRESSION ----------------------- +.. versionadded:: 3.16 + If the output matches this regular expression the test will be marked as skipped. If set, if the output matches one of specified regular expressions, diff --git a/Help/prop_test/TIMEOUT_AFTER_MATCH.rst b/Help/prop_test/TIMEOUT_AFTER_MATCH.rst index d607992..726dcab 100644 --- a/Help/prop_test/TIMEOUT_AFTER_MATCH.rst +++ b/Help/prop_test/TIMEOUT_AFTER_MATCH.rst @@ -1,6 +1,8 @@ TIMEOUT_AFTER_MATCH ------------------- +.. versionadded:: 3.6 + Change a test's timeout duration after a matching line is encountered in its output. diff --git a/Help/prop_tgt/ADDITIONAL_CLEAN_FILES.rst b/Help/prop_tgt/ADDITIONAL_CLEAN_FILES.rst index 3b9d965..dc87d23 100644 --- a/Help/prop_tgt/ADDITIONAL_CLEAN_FILES.rst +++ b/Help/prop_tgt/ADDITIONAL_CLEAN_FILES.rst @@ -1,6 +1,8 @@ ADDITIONAL_CLEAN_FILES ---------------------- +.. versionadded:: 3.15 + A :ref:`;-list <CMake Language Lists>` of files or directories that will be removed as a part of the global ``clean`` target. It can be used to specify files and directories that are generated as part of building the target or diff --git a/Help/prop_tgt/AIX_EXPORT_ALL_SYMBOLS.rst b/Help/prop_tgt/AIX_EXPORT_ALL_SYMBOLS.rst index 15ddc0b..de98fdf 100644 --- a/Help/prop_tgt/AIX_EXPORT_ALL_SYMBOLS.rst +++ b/Help/prop_tgt/AIX_EXPORT_ALL_SYMBOLS.rst @@ -1,6 +1,8 @@ AIX_EXPORT_ALL_SYMBOLS ---------------------- +.. versionadded:: 3.17 + On AIX, CMake automatically exports all symbols from shared libraries, and from executables with the :prop_tgt:`ENABLE_EXPORTS` target property set. Explicitly disable this boolean property to suppress the behavior and diff --git a/Help/prop_tgt/ALIAS_GLOBAL.rst b/Help/prop_tgt/ALIAS_GLOBAL.rst index 8854f57..a8859c6 100644 --- a/Help/prop_tgt/ALIAS_GLOBAL.rst +++ b/Help/prop_tgt/ALIAS_GLOBAL.rst @@ -1,6 +1,8 @@ ALIAS_GLOBAL ------------ +.. versionadded:: 3.18 + Read-only property indicating of whether an :ref:`ALIAS target <Alias Targets>` is globally visible. diff --git a/Help/prop_tgt/ANDROID_ANT_ADDITIONAL_OPTIONS.rst b/Help/prop_tgt/ANDROID_ANT_ADDITIONAL_OPTIONS.rst index af6b405..eceb17d 100644 --- a/Help/prop_tgt/ANDROID_ANT_ADDITIONAL_OPTIONS.rst +++ b/Help/prop_tgt/ANDROID_ANT_ADDITIONAL_OPTIONS.rst @@ -1,6 +1,8 @@ ANDROID_ANT_ADDITIONAL_OPTIONS ------------------------------ +.. versionadded:: 3.4 + Set the additional options for Android Ant build system. This is a string value containing all command line options for the Ant build. This property is initialized by the value of the diff --git a/Help/prop_tgt/ANDROID_API.rst b/Help/prop_tgt/ANDROID_API.rst index 63464d7..7664f18 100644 --- a/Help/prop_tgt/ANDROID_API.rst +++ b/Help/prop_tgt/ANDROID_API.rst @@ -1,6 +1,8 @@ ANDROID_API ----------- +.. versionadded:: 3.1 + When :ref:`Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio Edition`, this property sets the Android target API version (e.g. ``15``). The version number must be a positive decimal integer. This property is diff --git a/Help/prop_tgt/ANDROID_API_MIN.rst b/Help/prop_tgt/ANDROID_API_MIN.rst index 773ab3f..7ca2455 100644 --- a/Help/prop_tgt/ANDROID_API_MIN.rst +++ b/Help/prop_tgt/ANDROID_API_MIN.rst @@ -1,6 +1,8 @@ ANDROID_API_MIN --------------- +.. versionadded:: 3.2 + Set the Android MIN API version (e.g. ``9``). The version number must be a positive decimal integer. This property is initialized by the value of the :variable:`CMAKE_ANDROID_API_MIN` variable if it is set diff --git a/Help/prop_tgt/ANDROID_ARCH.rst b/Help/prop_tgt/ANDROID_ARCH.rst index 3e07e5a..94b76dd 100644 --- a/Help/prop_tgt/ANDROID_ARCH.rst +++ b/Help/prop_tgt/ANDROID_ARCH.rst @@ -1,6 +1,8 @@ ANDROID_ARCH ------------ +.. versionadded:: 3.4 + When :ref:`Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio Edition`, this property sets the Android target architecture. diff --git a/Help/prop_tgt/ANDROID_ASSETS_DIRECTORIES.rst b/Help/prop_tgt/ANDROID_ASSETS_DIRECTORIES.rst index 764a582..b09a8b7 100644 --- a/Help/prop_tgt/ANDROID_ASSETS_DIRECTORIES.rst +++ b/Help/prop_tgt/ANDROID_ASSETS_DIRECTORIES.rst @@ -1,6 +1,8 @@ ANDROID_ASSETS_DIRECTORIES -------------------------- +.. versionadded:: 3.4 + Set the Android assets directories to copy into the main assets folder before build. This a string property that contains the directory paths separated by semicolon. diff --git a/Help/prop_tgt/ANDROID_GUI.rst b/Help/prop_tgt/ANDROID_GUI.rst index 92e2041..cc022db 100644 --- a/Help/prop_tgt/ANDROID_GUI.rst +++ b/Help/prop_tgt/ANDROID_GUI.rst @@ -1,6 +1,8 @@ ANDROID_GUI ----------- +.. versionadded:: 3.1 + When :ref:`Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio Edition`, this property specifies whether to build an executable as an application package on Android. diff --git a/Help/prop_tgt/ANDROID_JAR_DEPENDENCIES.rst b/Help/prop_tgt/ANDROID_JAR_DEPENDENCIES.rst index 42937c1..9880daf 100644 --- a/Help/prop_tgt/ANDROID_JAR_DEPENDENCIES.rst +++ b/Help/prop_tgt/ANDROID_JAR_DEPENDENCIES.rst @@ -1,6 +1,8 @@ ANDROID_JAR_DEPENDENCIES ------------------------ +.. versionadded:: 3.4 + Set the Android property that specifies JAR dependencies. This is a string value property. This property is initialized by the value of the :variable:`CMAKE_ANDROID_JAR_DEPENDENCIES` diff --git a/Help/prop_tgt/ANDROID_JAR_DIRECTORIES.rst b/Help/prop_tgt/ANDROID_JAR_DIRECTORIES.rst index 54f0a8f..6fef50b 100644 --- a/Help/prop_tgt/ANDROID_JAR_DIRECTORIES.rst +++ b/Help/prop_tgt/ANDROID_JAR_DIRECTORIES.rst @@ -1,6 +1,8 @@ ANDROID_JAR_DIRECTORIES ----------------------- +.. versionadded:: 3.4 + Set the Android property that specifies directories to search for the JAR libraries. diff --git a/Help/prop_tgt/ANDROID_JAVA_SOURCE_DIR.rst b/Help/prop_tgt/ANDROID_JAVA_SOURCE_DIR.rst index 90ef1ce..9ea9884 100644 --- a/Help/prop_tgt/ANDROID_JAVA_SOURCE_DIR.rst +++ b/Help/prop_tgt/ANDROID_JAVA_SOURCE_DIR.rst @@ -1,6 +1,8 @@ ANDROID_JAVA_SOURCE_DIR ----------------------- +.. versionadded:: 3.4 + Set the Android property that defines the Java source code root directories. This a string property that contains the directory paths separated by semicolon. This property is initialized by the value of the diff --git a/Help/prop_tgt/ANDROID_NATIVE_LIB_DEPENDENCIES.rst b/Help/prop_tgt/ANDROID_NATIVE_LIB_DEPENDENCIES.rst index 759a37b..3aa741f 100644 --- a/Help/prop_tgt/ANDROID_NATIVE_LIB_DEPENDENCIES.rst +++ b/Help/prop_tgt/ANDROID_NATIVE_LIB_DEPENDENCIES.rst @@ -1,6 +1,8 @@ ANDROID_NATIVE_LIB_DEPENDENCIES ------------------------------- +.. versionadded:: 3.4 + Set the Android property that specifies the .so dependencies. This is a string property. diff --git a/Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst b/Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst index d0cd29d..98200d9 100644 --- a/Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst +++ b/Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst @@ -1,6 +1,8 @@ ANDROID_NATIVE_LIB_DIRECTORIES ------------------------------ +.. versionadded:: 3.4 + Set the Android property that specifies directories to search for the ``.so`` libraries. diff --git a/Help/prop_tgt/ANDROID_PROCESS_MAX.rst b/Help/prop_tgt/ANDROID_PROCESS_MAX.rst index 847acae..0b6aba7 100644 --- a/Help/prop_tgt/ANDROID_PROCESS_MAX.rst +++ b/Help/prop_tgt/ANDROID_PROCESS_MAX.rst @@ -1,6 +1,8 @@ ANDROID_PROCESS_MAX ------------------- +.. versionadded:: 3.4 + Set the Android property that defines the maximum number of a parallel Android NDK compiler processes (e.g. ``4``). This property is initialized by the value of the diff --git a/Help/prop_tgt/ANDROID_PROGUARD.rst b/Help/prop_tgt/ANDROID_PROGUARD.rst index dafc51e..b5ce166 100644 --- a/Help/prop_tgt/ANDROID_PROGUARD.rst +++ b/Help/prop_tgt/ANDROID_PROGUARD.rst @@ -1,6 +1,8 @@ ANDROID_PROGUARD ---------------- +.. versionadded:: 3.4 + When this property is set to true that enables the ProGuard tool to shrink, optimize, and obfuscate the code by removing unused code and renaming classes, fields, and methods with semantically obscure names. diff --git a/Help/prop_tgt/ANDROID_PROGUARD_CONFIG_PATH.rst b/Help/prop_tgt/ANDROID_PROGUARD_CONFIG_PATH.rst index 0e929d1..6ac59d8 100644 --- a/Help/prop_tgt/ANDROID_PROGUARD_CONFIG_PATH.rst +++ b/Help/prop_tgt/ANDROID_PROGUARD_CONFIG_PATH.rst @@ -1,6 +1,8 @@ ANDROID_PROGUARD_CONFIG_PATH ---------------------------- +.. versionadded:: 3.4 + Set the Android property that specifies the location of the ProGuard config file. Leave empty to use the default one. This a string property that contains the path to ProGuard config file. diff --git a/Help/prop_tgt/ANDROID_SECURE_PROPS_PATH.rst b/Help/prop_tgt/ANDROID_SECURE_PROPS_PATH.rst index 9533f1a..f2ffa2e 100644 --- a/Help/prop_tgt/ANDROID_SECURE_PROPS_PATH.rst +++ b/Help/prop_tgt/ANDROID_SECURE_PROPS_PATH.rst @@ -1,6 +1,8 @@ ANDROID_SECURE_PROPS_PATH ------------------------- +.. versionadded:: 3.4 + Set the Android property that states the location of the secure properties file. This is a string property that contains the file path. This property is initialized by the value of the diff --git a/Help/prop_tgt/ANDROID_SKIP_ANT_STEP.rst b/Help/prop_tgt/ANDROID_SKIP_ANT_STEP.rst index 6361896..1a54bce 100644 --- a/Help/prop_tgt/ANDROID_SKIP_ANT_STEP.rst +++ b/Help/prop_tgt/ANDROID_SKIP_ANT_STEP.rst @@ -1,6 +1,8 @@ ANDROID_SKIP_ANT_STEP --------------------- +.. versionadded:: 3.4 + Set the Android property that defines whether or not to skip the Ant build step. This is a boolean property initialized by the value of the :variable:`CMAKE_ANDROID_SKIP_ANT_STEP` variable if it is set when a target is created. diff --git a/Help/prop_tgt/ANDROID_STL_TYPE.rst b/Help/prop_tgt/ANDROID_STL_TYPE.rst index 386e96e..c83712b 100644 --- a/Help/prop_tgt/ANDROID_STL_TYPE.rst +++ b/Help/prop_tgt/ANDROID_STL_TYPE.rst @@ -1,6 +1,8 @@ ANDROID_STL_TYPE ---------------- +.. versionadded:: 3.4 + When :ref:`Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio Edition`, this property specifies the type of STL support for the project. This is a string property that could set to the one of the following values: diff --git a/Help/prop_tgt/AUTOGEN_BUILD_DIR.rst b/Help/prop_tgt/AUTOGEN_BUILD_DIR.rst index 909b14c..ff42ae8 100644 --- a/Help/prop_tgt/AUTOGEN_BUILD_DIR.rst +++ b/Help/prop_tgt/AUTOGEN_BUILD_DIR.rst @@ -1,6 +1,8 @@ AUTOGEN_BUILD_DIR ----------------- +.. versionadded:: 3.9 + Directory where :prop_tgt:`AUTOMOC`, :prop_tgt:`AUTOUIC` and :prop_tgt:`AUTORCC` generate files for the target. diff --git a/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst b/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst index 022bab5..563190a 100644 --- a/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst +++ b/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst @@ -1,6 +1,8 @@ AUTOGEN_ORIGIN_DEPENDS ---------------------- +.. versionadded:: 3.14 + Switch for forwarding origin target dependencies to the corresponding ``_autogen`` target. diff --git a/Help/prop_tgt/AUTOGEN_PARALLEL.rst b/Help/prop_tgt/AUTOGEN_PARALLEL.rst index 968b619..663b54e 100644 --- a/Help/prop_tgt/AUTOGEN_PARALLEL.rst +++ b/Help/prop_tgt/AUTOGEN_PARALLEL.rst @@ -1,6 +1,8 @@ AUTOGEN_PARALLEL ---------------- +.. versionadded:: 3.11 + Number of parallel ``moc`` or ``uic`` processes to start when using :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`. diff --git a/Help/prop_tgt/AUTOMOC_COMPILER_PREDEFINES.rst b/Help/prop_tgt/AUTOMOC_COMPILER_PREDEFINES.rst index 57a647f..8998284 100644 --- a/Help/prop_tgt/AUTOMOC_COMPILER_PREDEFINES.rst +++ b/Help/prop_tgt/AUTOMOC_COMPILER_PREDEFINES.rst @@ -1,6 +1,8 @@ AUTOMOC_COMPILER_PREDEFINES --------------------------- +.. versionadded:: 3.10 + Boolean value used by :prop_tgt:`AUTOMOC` to determine if the compiler pre definitions file ``moc_predefs.h`` should be generated. diff --git a/Help/prop_tgt/AUTOMOC_DEPEND_FILTERS.rst b/Help/prop_tgt/AUTOMOC_DEPEND_FILTERS.rst index 6eda26c..1f31700 100644 --- a/Help/prop_tgt/AUTOMOC_DEPEND_FILTERS.rst +++ b/Help/prop_tgt/AUTOMOC_DEPEND_FILTERS.rst @@ -1,6 +1,8 @@ AUTOMOC_DEPEND_FILTERS ---------------------- +.. versionadded:: 3.9 + Filter definitions used by :prop_tgt:`AUTOMOC` to extract file names from a source file that are registered as additional dependencies for the ``moc`` file of the source file. diff --git a/Help/prop_tgt/AUTOMOC_EXECUTABLE.rst b/Help/prop_tgt/AUTOMOC_EXECUTABLE.rst index 6b66ce8..f4b8396 100644 --- a/Help/prop_tgt/AUTOMOC_EXECUTABLE.rst +++ b/Help/prop_tgt/AUTOMOC_EXECUTABLE.rst @@ -1,6 +1,8 @@ AUTOMOC_EXECUTABLE ------------------ +.. versionadded:: 3.14 + :prop_tgt:`AUTOMOC_EXECUTABLE` is file path pointing to the ``moc`` executable to use for :prop_tgt:`AUTOMOC` enabled files. Setting this property will make CMake skip the automatic detection of the diff --git a/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst b/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst index 5329bba..a53810d 100644 --- a/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst +++ b/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst @@ -1,6 +1,8 @@ AUTOMOC_MACRO_NAMES ------------------- +.. versionadded:: 3.10 + A :ref:`semicolon-separated list <CMake Language Lists>` list of macro names used by :prop_tgt:`AUTOMOC` to determine if a C++ file needs to be processed by ``moc``. diff --git a/Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst b/Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst index 3e3059d..4f85c16 100644 --- a/Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst +++ b/Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst @@ -1,6 +1,8 @@ AUTOMOC_PATH_PREFIX ------------------- +.. versionadded:: 3.16 + When this property is ``ON``, CMake will generate the ``-p`` path prefix option for ``moc`` on :prop_tgt:`AUTOMOC` enabled Qt targets. diff --git a/Help/prop_tgt/AUTORCC_EXECUTABLE.rst b/Help/prop_tgt/AUTORCC_EXECUTABLE.rst index ca0fbd7..4f85fba 100644 --- a/Help/prop_tgt/AUTORCC_EXECUTABLE.rst +++ b/Help/prop_tgt/AUTORCC_EXECUTABLE.rst @@ -1,6 +1,8 @@ AUTORCC_EXECUTABLE ------------------ +.. versionadded:: 3.14 + :prop_tgt:`AUTORCC_EXECUTABLE` is file path pointing to the ``rcc`` executable to use for :prop_tgt:`AUTORCC` enabled files. Setting this property will make CMake skip the automatic detection of the diff --git a/Help/prop_tgt/AUTOUIC_EXECUTABLE.rst b/Help/prop_tgt/AUTOUIC_EXECUTABLE.rst index 03bd554..5966326 100644 --- a/Help/prop_tgt/AUTOUIC_EXECUTABLE.rst +++ b/Help/prop_tgt/AUTOUIC_EXECUTABLE.rst @@ -1,6 +1,8 @@ AUTOUIC_EXECUTABLE ------------------ +.. versionadded:: 3.14 + :prop_tgt:`AUTOUIC_EXECUTABLE` is file path pointing to the ``uic`` executable to use for :prop_tgt:`AUTOUIC` enabled files. Setting this property will make CMake skip the automatic detection of the diff --git a/Help/prop_tgt/AUTOUIC_SEARCH_PATHS.rst b/Help/prop_tgt/AUTOUIC_SEARCH_PATHS.rst index 96d9f89..87fea48 100644 --- a/Help/prop_tgt/AUTOUIC_SEARCH_PATHS.rst +++ b/Help/prop_tgt/AUTOUIC_SEARCH_PATHS.rst @@ -1,6 +1,8 @@ AUTOUIC_SEARCH_PATHS -------------------- +.. versionadded:: 3.9 + Search path list used by :prop_tgt:`AUTOUIC` to find included ``.ui`` files. diff --git a/Help/prop_tgt/BINARY_DIR.rst b/Help/prop_tgt/BINARY_DIR.rst index 246f7e6..beab12c 100644 --- a/Help/prop_tgt/BINARY_DIR.rst +++ b/Help/prop_tgt/BINARY_DIR.rst @@ -1,6 +1,8 @@ BINARY_DIR ---------- +.. versionadded:: 3.4 + This read-only property reports the value of the :variable:`CMAKE_CURRENT_BINARY_DIR` variable in the directory in which the target was defined. diff --git a/Help/prop_tgt/BUILD_RPATH.rst b/Help/prop_tgt/BUILD_RPATH.rst index d978b94..1f917a5 100644 --- a/Help/prop_tgt/BUILD_RPATH.rst +++ b/Help/prop_tgt/BUILD_RPATH.rst @@ -1,6 +1,8 @@ BUILD_RPATH ----------- +.. versionadded:: 3.8 + A :ref:`semicolon-separated list <CMake Language Lists>` specifying runtime path (``RPATH``) entries to add to binaries linked in the build tree (for platforms that support it). The entries will *not* be used for binaries in the install diff --git a/Help/prop_tgt/BUILD_RPATH_USE_ORIGIN.rst b/Help/prop_tgt/BUILD_RPATH_USE_ORIGIN.rst index 3378797..2cdfa0d 100644 --- a/Help/prop_tgt/BUILD_RPATH_USE_ORIGIN.rst +++ b/Help/prop_tgt/BUILD_RPATH_USE_ORIGIN.rst @@ -1,6 +1,8 @@ BUILD_RPATH_USE_ORIGIN ---------------------- +.. versionadded:: 3.14 + Whether to use relative paths for the build ``RPATH``. This property is initialized by the value of the variable diff --git a/Help/prop_tgt/BUILD_WITH_INSTALL_NAME_DIR.rst b/Help/prop_tgt/BUILD_WITH_INSTALL_NAME_DIR.rst index bbb9a24..073dce5 100644 --- a/Help/prop_tgt/BUILD_WITH_INSTALL_NAME_DIR.rst +++ b/Help/prop_tgt/BUILD_WITH_INSTALL_NAME_DIR.rst @@ -1,6 +1,8 @@ BUILD_WITH_INSTALL_NAME_DIR --------------------------- +.. versionadded:: 3.9 + ``BUILD_WITH_INSTALL_NAME_DIR`` is a boolean specifying whether the macOS ``install_name`` of a target in the build tree uses the directory given by :prop_tgt:`INSTALL_NAME_DIR`. This setting only applies to targets on macOS. diff --git a/Help/prop_tgt/COMMON_LANGUAGE_RUNTIME.rst b/Help/prop_tgt/COMMON_LANGUAGE_RUNTIME.rst index 052ac6d..adfa6f7 100644 --- a/Help/prop_tgt/COMMON_LANGUAGE_RUNTIME.rst +++ b/Help/prop_tgt/COMMON_LANGUAGE_RUNTIME.rst @@ -1,6 +1,8 @@ COMMON_LANGUAGE_RUNTIME ----------------------- +.. versionadded:: 3.12 + By setting this target property, the target is configured to build with ``C++/CLI`` support. diff --git a/Help/prop_tgt/COMPILE_FEATURES.rst b/Help/prop_tgt/COMPILE_FEATURES.rst index 46aec4f..9b937ed 100644 --- a/Help/prop_tgt/COMPILE_FEATURES.rst +++ b/Help/prop_tgt/COMPILE_FEATURES.rst @@ -1,6 +1,8 @@ COMPILE_FEATURES ---------------- +.. versionadded:: 3.1 + Compiler features enabled for this target. The list of features in this property are a subset of the features listed diff --git a/Help/prop_tgt/COMPILE_PDB_NAME.rst b/Help/prop_tgt/COMPILE_PDB_NAME.rst index 24a9f62..b76afeb 100644 --- a/Help/prop_tgt/COMPILE_PDB_NAME.rst +++ b/Help/prop_tgt/COMPILE_PDB_NAME.rst @@ -1,6 +1,8 @@ COMPILE_PDB_NAME ---------------- +.. versionadded:: 3.1 + Output name for the MS debug symbol ``.pdb`` file generated by the compiler while building source files. diff --git a/Help/prop_tgt/COMPILE_PDB_NAME_CONFIG.rst b/Help/prop_tgt/COMPILE_PDB_NAME_CONFIG.rst index e4077f5..4c9825d 100644 --- a/Help/prop_tgt/COMPILE_PDB_NAME_CONFIG.rst +++ b/Help/prop_tgt/COMPILE_PDB_NAME_CONFIG.rst @@ -1,6 +1,8 @@ COMPILE_PDB_NAME_<CONFIG> ------------------------- +.. versionadded:: 3.1 + Per-configuration output name for the MS debug symbol ``.pdb`` file generated by the compiler while building source files. diff --git a/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY.rst b/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY.rst index 34f49be..3f3df66 100644 --- a/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY.rst +++ b/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY.rst @@ -1,6 +1,8 @@ COMPILE_PDB_OUTPUT_DIRECTORY ---------------------------- +.. versionadded:: 3.1 + Output directory for the MS debug symbol ``.pdb`` file generated by the compiler while building source files. diff --git a/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst b/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst index f261756..c25c2fc 100644 --- a/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst +++ b/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst @@ -1,6 +1,8 @@ COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG> ------------------------------------- +.. versionadded:: 3.1 + Per-configuration output directory for the MS debug symbol ``.pdb`` file generated by the compiler while building source files. diff --git a/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst b/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst index 87c5978..d7fb9b1 100644 --- a/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst +++ b/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst @@ -1,6 +1,8 @@ CROSSCOMPILING_EMULATOR ----------------------- +.. versionadded:: 3.3 + Use the given emulator to run executables created when crosscompiling. This command will be added as a prefix to :command:`add_test`, :command:`add_custom_command`, and :command:`add_custom_target` commands diff --git a/Help/prop_tgt/CUDA_ARCHITECTURES.rst b/Help/prop_tgt/CUDA_ARCHITECTURES.rst index bae3c6f..d56b769 100644 --- a/Help/prop_tgt/CUDA_ARCHITECTURES.rst +++ b/Help/prop_tgt/CUDA_ARCHITECTURES.rst @@ -1,6 +1,8 @@ CUDA_ARCHITECTURES ------------------ +.. versionadded:: 3.18 + List of architectures to generate device code for. An architecture can be suffixed by either ``-real`` or ``-virtual`` to specify diff --git a/Help/prop_tgt/CUDA_EXTENSIONS.rst b/Help/prop_tgt/CUDA_EXTENSIONS.rst index 098ca3c..2ddba0b 100644 --- a/Help/prop_tgt/CUDA_EXTENSIONS.rst +++ b/Help/prop_tgt/CUDA_EXTENSIONS.rst @@ -1,6 +1,8 @@ CUDA_EXTENSIONS --------------- +.. versionadded:: 3.8 + Boolean specifying whether compiler specific extensions are requested. This property specifies whether compiler specific extensions should be diff --git a/Help/prop_tgt/CUDA_PTX_COMPILATION.rst b/Help/prop_tgt/CUDA_PTX_COMPILATION.rst index 0ee372b..4e90afe 100644 --- a/Help/prop_tgt/CUDA_PTX_COMPILATION.rst +++ b/Help/prop_tgt/CUDA_PTX_COMPILATION.rst @@ -1,6 +1,8 @@ CUDA_PTX_COMPILATION -------------------- +.. versionadded:: 3.9 + Compile CUDA sources to ``.ptx`` files instead of ``.obj`` files within :ref:`Object Libraries`. diff --git a/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst b/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst index dae960f..819ce3e 100644 --- a/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst +++ b/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst @@ -1,6 +1,8 @@ CUDA_RESOLVE_DEVICE_SYMBOLS --------------------------- +.. versionadded:: 3.9 + CUDA only: Enables device linking for the specific library target where required. diff --git a/Help/prop_tgt/CUDA_RUNTIME_LIBRARY.rst b/Help/prop_tgt/CUDA_RUNTIME_LIBRARY.rst index 11b344c..e937fc6 100644 --- a/Help/prop_tgt/CUDA_RUNTIME_LIBRARY.rst +++ b/Help/prop_tgt/CUDA_RUNTIME_LIBRARY.rst @@ -1,6 +1,8 @@ CUDA_RUNTIME_LIBRARY -------------------- +.. versionadded:: 3.17 + Select the CUDA runtime library for use by compilers targeting the CUDA language. The allowed case insensitive values are: diff --git a/Help/prop_tgt/CUDA_SEPARABLE_COMPILATION.rst b/Help/prop_tgt/CUDA_SEPARABLE_COMPILATION.rst index d306d7f..32222f9 100644 --- a/Help/prop_tgt/CUDA_SEPARABLE_COMPILATION.rst +++ b/Help/prop_tgt/CUDA_SEPARABLE_COMPILATION.rst @@ -1,6 +1,8 @@ CUDA_SEPARABLE_COMPILATION -------------------------- +.. versionadded:: 3.8 + CUDA only: Enables separate compilation of device code If set this will enable separable compilation for all CUDA files for diff --git a/Help/prop_tgt/CUDA_STANDARD.rst b/Help/prop_tgt/CUDA_STANDARD.rst index 6d6774e..fcc4725 100644 --- a/Help/prop_tgt/CUDA_STANDARD.rst +++ b/Help/prop_tgt/CUDA_STANDARD.rst @@ -1,6 +1,8 @@ CUDA_STANDARD ------------- +.. versionadded:: 3.8 + The CUDA/C++ standard whose features are requested to build this target. This property specifies the CUDA/C++ standard whose features are requested diff --git a/Help/prop_tgt/CUDA_STANDARD_REQUIRED.rst b/Help/prop_tgt/CUDA_STANDARD_REQUIRED.rst index b2d5b28..b923800 100644 --- a/Help/prop_tgt/CUDA_STANDARD_REQUIRED.rst +++ b/Help/prop_tgt/CUDA_STANDARD_REQUIRED.rst @@ -1,6 +1,8 @@ CUDA_STANDARD_REQUIRED ---------------------- +.. versionadded:: 3.8 + Boolean describing whether the value of :prop_tgt:`CUDA_STANDARD` is a requirement. If this property is set to ``ON``, then the value of the diff --git a/Help/prop_tgt/CXX_EXTENSIONS.rst b/Help/prop_tgt/CXX_EXTENSIONS.rst index 280bb3a..bda531e 100644 --- a/Help/prop_tgt/CXX_EXTENSIONS.rst +++ b/Help/prop_tgt/CXX_EXTENSIONS.rst @@ -1,6 +1,8 @@ CXX_EXTENSIONS -------------- +.. versionadded:: 3.1 + Boolean specifying whether compiler specific extensions are requested. This property specifies whether compiler specific extensions should be diff --git a/Help/prop_tgt/CXX_STANDARD.rst b/Help/prop_tgt/CXX_STANDARD.rst index ccc0147..f322ffe 100644 --- a/Help/prop_tgt/CXX_STANDARD.rst +++ b/Help/prop_tgt/CXX_STANDARD.rst @@ -1,6 +1,8 @@ CXX_STANDARD ------------ +.. versionadded:: 3.1 + The C++ standard whose features are requested to build this target. This property specifies the C++ standard whose features are requested diff --git a/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst b/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst index 697d7f6..2ea2215 100644 --- a/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst +++ b/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst @@ -1,6 +1,8 @@ CXX_STANDARD_REQUIRED --------------------- +.. versionadded:: 3.1 + Boolean describing whether the value of :prop_tgt:`CXX_STANDARD` is a requirement. If this property is set to ``ON``, then the value of the diff --git a/Help/prop_tgt/C_EXTENSIONS.rst b/Help/prop_tgt/C_EXTENSIONS.rst index 05b14ce..b2abb46 100644 --- a/Help/prop_tgt/C_EXTENSIONS.rst +++ b/Help/prop_tgt/C_EXTENSIONS.rst @@ -1,6 +1,8 @@ C_EXTENSIONS ------------ +.. versionadded:: 3.1 + Boolean specifying whether compiler specific extensions are requested. This property specifies whether compiler specific extensions should be diff --git a/Help/prop_tgt/C_STANDARD.rst b/Help/prop_tgt/C_STANDARD.rst index 6a05139..999a9e7 100644 --- a/Help/prop_tgt/C_STANDARD.rst +++ b/Help/prop_tgt/C_STANDARD.rst @@ -1,6 +1,8 @@ C_STANDARD ---------- +.. versionadded:: 3.1 + The C standard whose features are requested to build this target. This property specifies the C standard whose features are requested diff --git a/Help/prop_tgt/C_STANDARD_REQUIRED.rst b/Help/prop_tgt/C_STANDARD_REQUIRED.rst index acfad98..c1b58a0 100644 --- a/Help/prop_tgt/C_STANDARD_REQUIRED.rst +++ b/Help/prop_tgt/C_STANDARD_REQUIRED.rst @@ -1,6 +1,8 @@ C_STANDARD_REQUIRED ------------------- +.. versionadded:: 3.1 + Boolean describing whether the value of :prop_tgt:`C_STANDARD` is a requirement. If this property is set to ``ON``, then the value of the diff --git a/Help/prop_tgt/DEPLOYMENT_ADDITIONAL_FILES.rst b/Help/prop_tgt/DEPLOYMENT_ADDITIONAL_FILES.rst index 5e9c191..f11fe7c 100644 --- a/Help/prop_tgt/DEPLOYMENT_ADDITIONAL_FILES.rst +++ b/Help/prop_tgt/DEPLOYMENT_ADDITIONAL_FILES.rst @@ -1,6 +1,8 @@ DEPLOYMENT_ADDITIONAL_FILES --------------------------- +.. versionadded:: 3.13 + Set the WinCE project ``AdditionalFiles`` in ``DeploymentTool`` in ``.vcproj`` files generated by the :generator:`Visual Studio 9 2008` generator. This is useful when you want to debug on remote WinCE device. diff --git a/Help/prop_tgt/DEPLOYMENT_REMOTE_DIRECTORY.rst b/Help/prop_tgt/DEPLOYMENT_REMOTE_DIRECTORY.rst index 368768a..0680238 100644 --- a/Help/prop_tgt/DEPLOYMENT_REMOTE_DIRECTORY.rst +++ b/Help/prop_tgt/DEPLOYMENT_REMOTE_DIRECTORY.rst @@ -1,6 +1,8 @@ DEPLOYMENT_REMOTE_DIRECTORY --------------------------- +.. versionadded:: 3.6 + Set the WinCE project ``RemoteDirectory`` in ``DeploymentTool`` and ``RemoteExecutable`` in ``DebuggerTool`` in ``.vcproj`` files generated by the :generator:`Visual Studio 9 2008` generator. diff --git a/Help/prop_tgt/DEPRECATION.rst b/Help/prop_tgt/DEPRECATION.rst index fef2e2e..45ca848 100644 --- a/Help/prop_tgt/DEPRECATION.rst +++ b/Help/prop_tgt/DEPRECATION.rst @@ -1,6 +1,8 @@ DEPRECATION ----------- +.. versionadded:: 3.17 + Deprecation message from imported target's developer. ``DEPRECATION`` is the message regarding a deprecation status to be displayed diff --git a/Help/prop_tgt/DISABLE_PRECOMPILE_HEADERS.rst b/Help/prop_tgt/DISABLE_PRECOMPILE_HEADERS.rst index 4cef023..7b3826b 100644 --- a/Help/prop_tgt/DISABLE_PRECOMPILE_HEADERS.rst +++ b/Help/prop_tgt/DISABLE_PRECOMPILE_HEADERS.rst @@ -1,6 +1,8 @@ DISABLE_PRECOMPILE_HEADERS -------------------------- +.. versionadded:: 3.16 + Disables the precompilation of header files specified by :prop_tgt:`PRECOMPILE_HEADERS` property. diff --git a/Help/prop_tgt/DOTNET_TARGET_FRAMEWORK.rst b/Help/prop_tgt/DOTNET_TARGET_FRAMEWORK.rst index 8698eb6..3ba4e25 100644 --- a/Help/prop_tgt/DOTNET_TARGET_FRAMEWORK.rst +++ b/Help/prop_tgt/DOTNET_TARGET_FRAMEWORK.rst @@ -1,6 +1,8 @@ DOTNET_TARGET_FRAMEWORK ----------------------- +.. versionadded:: 3.17 + Specify the .NET target framework. Used to specify the .NET target framework for C++/CLI and C#. For diff --git a/Help/prop_tgt/DOTNET_TARGET_FRAMEWORK_VERSION.rst b/Help/prop_tgt/DOTNET_TARGET_FRAMEWORK_VERSION.rst index b33f4fb..fbd1aab 100644 --- a/Help/prop_tgt/DOTNET_TARGET_FRAMEWORK_VERSION.rst +++ b/Help/prop_tgt/DOTNET_TARGET_FRAMEWORK_VERSION.rst @@ -1,6 +1,8 @@ DOTNET_TARGET_FRAMEWORK_VERSION ------------------------------- +.. versionadded:: 3.12 + Specify the .NET target framework version. Used to specify the .NET target framework version for C++/CLI and C#. diff --git a/Help/prop_tgt/EXPORT_PROPERTIES.rst b/Help/prop_tgt/EXPORT_PROPERTIES.rst index bcf47a6..34c054f 100644 --- a/Help/prop_tgt/EXPORT_PROPERTIES.rst +++ b/Help/prop_tgt/EXPORT_PROPERTIES.rst @@ -1,6 +1,8 @@ EXPORT_PROPERTIES ----------------- +.. versionadded:: 3.12 + List additional properties to export for a target. This property contains a list of property names that should be exported by diff --git a/Help/prop_tgt/FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst b/Help/prop_tgt/FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst index 243c0cd..84d0c1e 100644 --- a/Help/prop_tgt/FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst +++ b/Help/prop_tgt/FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst @@ -1,6 +1,8 @@ FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG> --------------------------------------- +.. versionadded:: 3.18 + Postfix to append to the framework file name for configuration ``<CONFIG>``, when using a multi-config generator (like Xcode and Ninja Multi-Config). diff --git a/Help/prop_tgt/FRAMEWORK_VERSION.rst b/Help/prop_tgt/FRAMEWORK_VERSION.rst index c2ae7b9..38b8137 100644 --- a/Help/prop_tgt/FRAMEWORK_VERSION.rst +++ b/Help/prop_tgt/FRAMEWORK_VERSION.rst @@ -1,6 +1,8 @@ FRAMEWORK_VERSION ----------------- +.. versionadded:: 3.4 + Version of a framework created using the :prop_tgt:`FRAMEWORK` target property (e.g. ``A``). diff --git a/Help/prop_tgt/Fortran_PREPROCESS.rst b/Help/prop_tgt/Fortran_PREPROCESS.rst index 47a15c0..e7e2fba 100644 --- a/Help/prop_tgt/Fortran_PREPROCESS.rst +++ b/Help/prop_tgt/Fortran_PREPROCESS.rst @@ -1,6 +1,8 @@ Fortran_PREPROCESS ------------------ +.. versionadded:: 3.18 + Control whether the Fortran source file should be unconditionally preprocessed. diff --git a/Help/prop_tgt/GHS_INTEGRITY_APP.rst b/Help/prop_tgt/GHS_INTEGRITY_APP.rst index b669781..cccd087 100644 --- a/Help/prop_tgt/GHS_INTEGRITY_APP.rst +++ b/Help/prop_tgt/GHS_INTEGRITY_APP.rst @@ -1,6 +1,8 @@ GHS_INTEGRITY_APP ----------------- +.. versionadded:: 3.14 + ``ON`` / ``OFF`` boolean to determine if an executable target should be treated as an `Integrity Application`. diff --git a/Help/prop_tgt/GHS_NO_SOURCE_GROUP_FILE.rst b/Help/prop_tgt/GHS_NO_SOURCE_GROUP_FILE.rst index 11ce0b22..fe6b8e6 100644 --- a/Help/prop_tgt/GHS_NO_SOURCE_GROUP_FILE.rst +++ b/Help/prop_tgt/GHS_NO_SOURCE_GROUP_FILE.rst @@ -1,6 +1,8 @@ GHS_NO_SOURCE_GROUP_FILE ------------------------ +.. versionadded:: 3.14 + ``ON`` / ``OFF`` boolean to control if the project file for a target should be one single file or multiple files. diff --git a/Help/prop_tgt/IMPORTED_COMMON_LANGUAGE_RUNTIME.rst b/Help/prop_tgt/IMPORTED_COMMON_LANGUAGE_RUNTIME.rst index 99e3bc4..8c20e07 100644 --- a/Help/prop_tgt/IMPORTED_COMMON_LANGUAGE_RUNTIME.rst +++ b/Help/prop_tgt/IMPORTED_COMMON_LANGUAGE_RUNTIME.rst @@ -1,6 +1,8 @@ IMPORTED_COMMON_LANGUAGE_RUNTIME -------------------------------- +.. versionadded:: 3.12 + Property to define if the target uses ``C++/CLI``. Ignored for non-imported targets. diff --git a/Help/prop_tgt/IMPORTED_GLOBAL.rst b/Help/prop_tgt/IMPORTED_GLOBAL.rst index 1a9129f..176127f 100644 --- a/Help/prop_tgt/IMPORTED_GLOBAL.rst +++ b/Help/prop_tgt/IMPORTED_GLOBAL.rst @@ -1,6 +1,8 @@ IMPORTED_GLOBAL --------------- +.. versionadded:: 3.11 + Indication of whether an :ref:`IMPORTED target <Imported Targets>` is globally visible. diff --git a/Help/prop_tgt/IMPORTED_LIBNAME.rst b/Help/prop_tgt/IMPORTED_LIBNAME.rst index 1943dba..7a83906 100644 --- a/Help/prop_tgt/IMPORTED_LIBNAME.rst +++ b/Help/prop_tgt/IMPORTED_LIBNAME.rst @@ -1,6 +1,8 @@ IMPORTED_LIBNAME ---------------- +.. versionadded:: 3.8 + Specify the link library name for an :ref:`imported <Imported Targets>` :ref:`Interface Library <Interface Libraries>`. diff --git a/Help/prop_tgt/IMPORTED_LIBNAME_CONFIG.rst b/Help/prop_tgt/IMPORTED_LIBNAME_CONFIG.rst index a28b838..df64769 100644 --- a/Help/prop_tgt/IMPORTED_LIBNAME_CONFIG.rst +++ b/Help/prop_tgt/IMPORTED_LIBNAME_CONFIG.rst @@ -1,6 +1,8 @@ IMPORTED_LIBNAME_<CONFIG> ------------------------- +.. versionadded:: 3.8 + <CONFIG>-specific version of :prop_tgt:`IMPORTED_LIBNAME` property. Configuration names correspond to those provided by the project from diff --git a/Help/prop_tgt/IMPORTED_OBJECTS.rst b/Help/prop_tgt/IMPORTED_OBJECTS.rst index 50a329f..bbbcd86 100644 --- a/Help/prop_tgt/IMPORTED_OBJECTS.rst +++ b/Help/prop_tgt/IMPORTED_OBJECTS.rst @@ -1,6 +1,8 @@ IMPORTED_OBJECTS ---------------- +.. versionadded:: 3.9 + A :ref:`semicolon-separated list <CMake Language Lists>` of absolute paths to the object files on disk for an :ref:`imported <Imported targets>` :ref:`object library <object libraries>`. diff --git a/Help/prop_tgt/IMPORTED_OBJECTS_CONFIG.rst b/Help/prop_tgt/IMPORTED_OBJECTS_CONFIG.rst index 4419ed1..b12ca38 100644 --- a/Help/prop_tgt/IMPORTED_OBJECTS_CONFIG.rst +++ b/Help/prop_tgt/IMPORTED_OBJECTS_CONFIG.rst @@ -1,6 +1,8 @@ IMPORTED_OBJECTS_<CONFIG> ------------------------- +.. versionadded:: 3.9 + <CONFIG>-specific version of :prop_tgt:`IMPORTED_OBJECTS` property. Configuration names correspond to those provided by the project from diff --git a/Help/prop_tgt/INSTALL_REMOVE_ENVIRONMENT_RPATH.rst b/Help/prop_tgt/INSTALL_REMOVE_ENVIRONMENT_RPATH.rst index 72dcaa0..f41e41c 100644 --- a/Help/prop_tgt/INSTALL_REMOVE_ENVIRONMENT_RPATH.rst +++ b/Help/prop_tgt/INSTALL_REMOVE_ENVIRONMENT_RPATH.rst @@ -1,6 +1,8 @@ INSTALL_REMOVE_ENVIRONMENT_RPATH -------------------------------- +.. versionadded:: 3.16 + Controls whether toolchain-defined rpaths should be removed during installation. When a target is being installed, CMake may need to rewrite its rpath diff --git a/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst b/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst index 31b594f..0db3b0c 100644 --- a/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst +++ b/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst @@ -1,6 +1,8 @@ INTERFACE_COMPILE_FEATURES -------------------------- +.. versionadded:: 3.1 + .. |property_name| replace:: compile features .. |command_name| replace:: :command:`target_compile_features` .. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_COMPILE_FEATURES`` diff --git a/Help/prop_tgt/INTERFACE_LINK_DEPENDS.rst b/Help/prop_tgt/INTERFACE_LINK_DEPENDS.rst index 790554d..9c8275d 100644 --- a/Help/prop_tgt/INTERFACE_LINK_DEPENDS.rst +++ b/Help/prop_tgt/INTERFACE_LINK_DEPENDS.rst @@ -1,6 +1,8 @@ INTERFACE_LINK_DEPENDS ---------------------- +.. versionadded:: 3.13 + Additional public interface files on which a target binary depends for linking. This property is supported only by :generator:`Ninja` and diff --git a/Help/prop_tgt/INTERFACE_LINK_DIRECTORIES.rst b/Help/prop_tgt/INTERFACE_LINK_DIRECTORIES.rst index 56a4ec0..de1dabb 100644 --- a/Help/prop_tgt/INTERFACE_LINK_DIRECTORIES.rst +++ b/Help/prop_tgt/INTERFACE_LINK_DIRECTORIES.rst @@ -1,6 +1,8 @@ INTERFACE_LINK_DIRECTORIES -------------------------- +.. versionadded:: 3.13 + .. |property_name| replace:: link directories .. |command_name| replace:: :command:`target_link_directories` .. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_LINK_DIRECTORIES`` diff --git a/Help/prop_tgt/INTERFACE_LINK_OPTIONS.rst b/Help/prop_tgt/INTERFACE_LINK_OPTIONS.rst index c293b98..4245fe9 100644 --- a/Help/prop_tgt/INTERFACE_LINK_OPTIONS.rst +++ b/Help/prop_tgt/INTERFACE_LINK_OPTIONS.rst @@ -1,6 +1,8 @@ INTERFACE_LINK_OPTIONS ---------------------- +.. versionadded:: 3.13 + .. |property_name| replace:: link options .. |command_name| replace:: :command:`target_link_options` .. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_LINK_OPTIONS`` diff --git a/Help/prop_tgt/INTERFACE_PRECOMPILE_HEADERS.rst b/Help/prop_tgt/INTERFACE_PRECOMPILE_HEADERS.rst index e285407..2299264 100644 --- a/Help/prop_tgt/INTERFACE_PRECOMPILE_HEADERS.rst +++ b/Help/prop_tgt/INTERFACE_PRECOMPILE_HEADERS.rst @@ -1,6 +1,8 @@ INTERFACE_PRECOMPILE_HEADERS ---------------------------- +.. versionadded:: 3.16 + List of interface header files to precompile into consuming targets. Targets may populate this property to publish the header files diff --git a/Help/prop_tgt/INTERFACE_SOURCES.rst b/Help/prop_tgt/INTERFACE_SOURCES.rst index a224b68..759c482 100644 --- a/Help/prop_tgt/INTERFACE_SOURCES.rst +++ b/Help/prop_tgt/INTERFACE_SOURCES.rst @@ -1,6 +1,8 @@ INTERFACE_SOURCES ----------------- +.. versionadded:: 3.1 + List of interface sources to compile into consuming targets. Targets may populate this property to publish the sources diff --git a/Help/prop_tgt/IOS_INSTALL_COMBINED.rst b/Help/prop_tgt/IOS_INSTALL_COMBINED.rst index 59f67a7..23a86e6 100644 --- a/Help/prop_tgt/IOS_INSTALL_COMBINED.rst +++ b/Help/prop_tgt/IOS_INSTALL_COMBINED.rst @@ -1,6 +1,8 @@ IOS_INSTALL_COMBINED -------------------- +.. versionadded:: 3.5 + Build a combined (device and simulator) target when installing. When this property is set to set to false (which is the default) then it will diff --git a/Help/prop_tgt/JOB_POOL_PRECOMPILE_HEADER.rst b/Help/prop_tgt/JOB_POOL_PRECOMPILE_HEADER.rst index ece28a4..42cace0 100644 --- a/Help/prop_tgt/JOB_POOL_PRECOMPILE_HEADER.rst +++ b/Help/prop_tgt/JOB_POOL_PRECOMPILE_HEADER.rst @@ -1,6 +1,8 @@ JOB_POOL_PRECOMPILE_HEADER -------------------------- +.. versionadded:: 3.17 + Ninja only: Pool used for generating pre-compiled headers. The number of parallel compile processes could be limited by defining diff --git a/Help/prop_tgt/LANG_CLANG_TIDY.rst b/Help/prop_tgt/LANG_CLANG_TIDY.rst index 2bfef66..7fc2372 100644 --- a/Help/prop_tgt/LANG_CLANG_TIDY.rst +++ b/Help/prop_tgt/LANG_CLANG_TIDY.rst @@ -1,6 +1,8 @@ <LANG>_CLANG_TIDY ----------------- +.. versionadded:: 3.6 + This property is implemented only when ``<LANG>`` is ``C`` or ``CXX``. Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a command diff --git a/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst b/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst index a6f2b24..77ae1f6 100644 --- a/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst +++ b/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst @@ -1,6 +1,8 @@ <LANG>_COMPILER_LAUNCHER ------------------------ +.. versionadded:: 3.4 + This property is implemented only when ``<LANG>`` is ``C``, ``CXX``, ``Fortran``, ``OBJC``, ``OBJCXX``, or ``CUDA``. diff --git a/Help/prop_tgt/LANG_CPPCHECK.rst b/Help/prop_tgt/LANG_CPPCHECK.rst index 60785d0..80acbc0 100644 --- a/Help/prop_tgt/LANG_CPPCHECK.rst +++ b/Help/prop_tgt/LANG_CPPCHECK.rst @@ -1,6 +1,8 @@ <LANG>_CPPCHECK --------------- +.. versionadded:: 3.10 + This property is supported only when ``<LANG>`` is ``C`` or ``CXX``. Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a command line diff --git a/Help/prop_tgt/LANG_CPPLINT.rst b/Help/prop_tgt/LANG_CPPLINT.rst index 9944c88..be6db46 100644 --- a/Help/prop_tgt/LANG_CPPLINT.rst +++ b/Help/prop_tgt/LANG_CPPLINT.rst @@ -1,6 +1,8 @@ <LANG>_CPPLINT -------------- +.. versionadded:: 3.8 + This property is supported only when ``<LANG>`` is ``C`` or ``CXX``. Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a command line diff --git a/Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst b/Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst index 35220e4..eebef56 100644 --- a/Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst +++ b/Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst @@ -1,6 +1,8 @@ <LANG>_INCLUDE_WHAT_YOU_USE --------------------------- +.. versionadded:: 3.3 + This property is implemented only when ``<LANG>`` is ``C`` or ``CXX``. Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a command diff --git a/Help/prop_tgt/LINK_DIRECTORIES.rst b/Help/prop_tgt/LINK_DIRECTORIES.rst index c2905b3..67be494 100644 --- a/Help/prop_tgt/LINK_DIRECTORIES.rst +++ b/Help/prop_tgt/LINK_DIRECTORIES.rst @@ -1,6 +1,8 @@ LINK_DIRECTORIES ---------------- +.. versionadded:: 3.13 + List of directories to use for the link step of shared library, module and executable targets. diff --git a/Help/prop_tgt/LINK_OPTIONS.rst b/Help/prop_tgt/LINK_OPTIONS.rst index ff3ee87..8c0dfc4 100644 --- a/Help/prop_tgt/LINK_OPTIONS.rst +++ b/Help/prop_tgt/LINK_OPTIONS.rst @@ -1,6 +1,8 @@ LINK_OPTIONS ------------ +.. versionadded:: 3.13 + List of options to use for the link step of shared library, module and executable targets as well as the device link step. Targets that are static libraries need to use the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property. diff --git a/Help/prop_tgt/LINK_WHAT_YOU_USE.rst b/Help/prop_tgt/LINK_WHAT_YOU_USE.rst index 32d6edb..2ed93ad 100644 --- a/Help/prop_tgt/LINK_WHAT_YOU_USE.rst +++ b/Help/prop_tgt/LINK_WHAT_YOU_USE.rst @@ -1,6 +1,8 @@ LINK_WHAT_YOU_USE --------------------------- +.. versionadded:: 3.7 + This is a boolean option that when set to ``TRUE`` will automatically run ``ldd -r -u`` on the target after it is linked. In addition, the linker flag ``-Wl,--no-as-needed`` will be passed to the target with the link command so diff --git a/Help/prop_tgt/MACHO_COMPATIBILITY_VERSION.rst b/Help/prop_tgt/MACHO_COMPATIBILITY_VERSION.rst index 26d5cc8..a24b255 100644 --- a/Help/prop_tgt/MACHO_COMPATIBILITY_VERSION.rst +++ b/Help/prop_tgt/MACHO_COMPATIBILITY_VERSION.rst @@ -1,6 +1,8 @@ MACHO_COMPATIBILITY_VERSION --------------------------- +.. versionadded:: 3.17 + What compatibility version number is this target for Mach-O binaries. For shared libraries on Mach-O systems (e.g. macOS, iOS) diff --git a/Help/prop_tgt/MACHO_CURRENT_VERSION.rst b/Help/prop_tgt/MACHO_CURRENT_VERSION.rst index 9afb356..530f79b 100644 --- a/Help/prop_tgt/MACHO_CURRENT_VERSION.rst +++ b/Help/prop_tgt/MACHO_CURRENT_VERSION.rst @@ -1,6 +1,8 @@ MACHO_CURRENT_VERSION --------------------- +.. versionadded:: 3.17 + What current version number is this target for Mach-O binaries. For shared libraries on Mach-O systems (e.g. macOS, iOS) diff --git a/Help/prop_tgt/MANUALLY_ADDED_DEPENDENCIES.rst b/Help/prop_tgt/MANUALLY_ADDED_DEPENDENCIES.rst index c12ea14..72871b3 100644 --- a/Help/prop_tgt/MANUALLY_ADDED_DEPENDENCIES.rst +++ b/Help/prop_tgt/MANUALLY_ADDED_DEPENDENCIES.rst @@ -1,6 +1,8 @@ MANUALLY_ADDED_DEPENDENCIES --------------------------- +.. versionadded:: 3.8 + Get manually added dependencies to other top-level targets. This read-only property can be used to query all dependencies that diff --git a/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst b/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst index 73792de..9b978b2 100644 --- a/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst +++ b/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst @@ -1,6 +1,8 @@ MSVC_RUNTIME_LIBRARY -------------------- +.. versionadded:: 3.15 + Select the MSVC runtime library for use by compilers targeting the MSVC ABI. The allowed values are: diff --git a/Help/prop_tgt/OBJCXX_EXTENSIONS.rst b/Help/prop_tgt/OBJCXX_EXTENSIONS.rst index 9f9d804..8a254f2 100644 --- a/Help/prop_tgt/OBJCXX_EXTENSIONS.rst +++ b/Help/prop_tgt/OBJCXX_EXTENSIONS.rst @@ -1,6 +1,8 @@ OBJCXX_EXTENSIONS ----------------- +.. versionadded:: 3.16 + Boolean specifying whether compiler specific extensions are requested. This property specifies whether compiler specific extensions should be diff --git a/Help/prop_tgt/OBJCXX_STANDARD.rst b/Help/prop_tgt/OBJCXX_STANDARD.rst index 3c925dc..1067153 100644 --- a/Help/prop_tgt/OBJCXX_STANDARD.rst +++ b/Help/prop_tgt/OBJCXX_STANDARD.rst @@ -1,6 +1,8 @@ OBJCXX_STANDARD --------------- +.. versionadded:: 3.16 + The ObjC++ standard whose features are requested to build this target. This property specifies the ObjC++ standard whose features are requested diff --git a/Help/prop_tgt/OBJCXX_STANDARD_REQUIRED.rst b/Help/prop_tgt/OBJCXX_STANDARD_REQUIRED.rst index c330abf..3cee740 100644 --- a/Help/prop_tgt/OBJCXX_STANDARD_REQUIRED.rst +++ b/Help/prop_tgt/OBJCXX_STANDARD_REQUIRED.rst @@ -1,6 +1,8 @@ OBJCXX_STANDARD_REQUIRED ------------------------ +.. versionadded:: 3.16 + Boolean describing whether the value of :prop_tgt:`OBJCXX_STANDARD` is a requirement. If this property is set to ``ON``, then the value of the diff --git a/Help/prop_tgt/OBJC_EXTENSIONS.rst b/Help/prop_tgt/OBJC_EXTENSIONS.rst index 2de9e48..ef1c754 100644 --- a/Help/prop_tgt/OBJC_EXTENSIONS.rst +++ b/Help/prop_tgt/OBJC_EXTENSIONS.rst @@ -1,6 +1,8 @@ OBJC_EXTENSIONS --------------- +.. versionadded:: 3.16 + Boolean specifying whether compiler specific extensions are requested. This property specifies whether compiler specific extensions should be diff --git a/Help/prop_tgt/OBJC_STANDARD.rst b/Help/prop_tgt/OBJC_STANDARD.rst index d1e1b24..2143ff9 100644 --- a/Help/prop_tgt/OBJC_STANDARD.rst +++ b/Help/prop_tgt/OBJC_STANDARD.rst @@ -1,6 +1,8 @@ OBJC_STANDARD ------------- +.. versionadded:: 3.16 + The OBJC standard whose features are requested to build this target. This property specifies the OBJC standard whose features are requested diff --git a/Help/prop_tgt/OBJC_STANDARD_REQUIRED.rst b/Help/prop_tgt/OBJC_STANDARD_REQUIRED.rst index 8cf377c..11547c8 100644 --- a/Help/prop_tgt/OBJC_STANDARD_REQUIRED.rst +++ b/Help/prop_tgt/OBJC_STANDARD_REQUIRED.rst @@ -1,6 +1,8 @@ OBJC_STANDARD_REQUIRED ---------------------- +.. versionadded:: 3.16 + Boolean describing whether the value of :prop_tgt:`OBJC_STANDARD` is a requirement. If this property is set to ``ON``, then the value of the diff --git a/Help/prop_tgt/PCH_WARN_INVALID.rst b/Help/prop_tgt/PCH_WARN_INVALID.rst index 96e1abd..2d5ec55 100644 --- a/Help/prop_tgt/PCH_WARN_INVALID.rst +++ b/Help/prop_tgt/PCH_WARN_INVALID.rst @@ -1,6 +1,8 @@ PCH_WARN_INVALID ---------------- +.. versionadded:: 3.18 + When this property is set to true, the precompile header compiler options will contain a compiler flag which should warn about invalid precompiled headers e.g. ``-Winvalid-pch`` for GNU compiler. diff --git a/Help/prop_tgt/PRECOMPILE_HEADERS.rst b/Help/prop_tgt/PRECOMPILE_HEADERS.rst index 9e70b65..af27947 100644 --- a/Help/prop_tgt/PRECOMPILE_HEADERS.rst +++ b/Help/prop_tgt/PRECOMPILE_HEADERS.rst @@ -1,6 +1,8 @@ PRECOMPILE_HEADERS ------------------ +.. versionadded:: 3.16 + List of header files to precompile. This property holds a :ref:`semicolon-separated list <CMake Language Lists>` diff --git a/Help/prop_tgt/PRECOMPILE_HEADERS_REUSE_FROM.rst b/Help/prop_tgt/PRECOMPILE_HEADERS_REUSE_FROM.rst index 9c3e7ea..6f5635b 100644 --- a/Help/prop_tgt/PRECOMPILE_HEADERS_REUSE_FROM.rst +++ b/Help/prop_tgt/PRECOMPILE_HEADERS_REUSE_FROM.rst @@ -1,6 +1,8 @@ PRECOMPILE_HEADERS_REUSE_FROM ----------------------------- +.. versionadded:: 3.16 + Target from which to reuse the precompiled headers build artifact. See the second signature of :command:`target_precompile_headers` command diff --git a/Help/prop_tgt/SOURCE_DIR.rst b/Help/prop_tgt/SOURCE_DIR.rst index b25813b..78ce220 100644 --- a/Help/prop_tgt/SOURCE_DIR.rst +++ b/Help/prop_tgt/SOURCE_DIR.rst @@ -1,6 +1,8 @@ SOURCE_DIR ---------- +.. versionadded:: 3.4 + This read-only property reports the value of the :variable:`CMAKE_CURRENT_SOURCE_DIR` variable in the directory in which the target was defined. diff --git a/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst b/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst index d05fda4..2f4a3ba 100644 --- a/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst +++ b/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst @@ -1,6 +1,8 @@ STATIC_LIBRARY_OPTIONS ---------------------- +.. versionadded:: 3.13 + Archiver (or MSVC librarian) flags for a static library target. Targets that are shared libraries, modules, or executables need to use the :prop_tgt:`LINK_OPTIONS` target property. diff --git a/Help/prop_tgt/Swift_DEPENDENCIES_FILE.rst b/Help/prop_tgt/Swift_DEPENDENCIES_FILE.rst index 46c9a1d..0f944b6 100644 --- a/Help/prop_tgt/Swift_DEPENDENCIES_FILE.rst +++ b/Help/prop_tgt/Swift_DEPENDENCIES_FILE.rst @@ -1,5 +1,7 @@ Swift_DEPENDENCIES_FILE ----------------------- +.. versionadded:: 3.15 + This property sets the path for the Swift dependency file (swiftdep) for the target. If one is not specified, it will default to ``<TARGET>.swiftdeps``. diff --git a/Help/prop_tgt/Swift_LANGUAGE_VERSION.rst b/Help/prop_tgt/Swift_LANGUAGE_VERSION.rst index 7579447..afc6b31 100644 --- a/Help/prop_tgt/Swift_LANGUAGE_VERSION.rst +++ b/Help/prop_tgt/Swift_LANGUAGE_VERSION.rst @@ -1,6 +1,8 @@ Swift_LANGUAGE_VERSION ---------------------- +.. versionadded:: 3.16 + This property sets the language version for the Swift sources in the target. If one is not specified, it will default to ``<CMAKE_Swift_LANGUAGE_VERSION>`` if specified, otherwise it is the latest version supported by the compiler. diff --git a/Help/prop_tgt/Swift_MODULE_DIRECTORY.rst b/Help/prop_tgt/Swift_MODULE_DIRECTORY.rst index d404251..a6484f2 100644 --- a/Help/prop_tgt/Swift_MODULE_DIRECTORY.rst +++ b/Help/prop_tgt/Swift_MODULE_DIRECTORY.rst @@ -1,6 +1,8 @@ Swift_MODULE_DIRECTORY ---------------------- +.. versionadded:: 3.15 + Specify output directory for Swift modules provided by the target. If the target contains Swift source files, this specifies the directory in which diff --git a/Help/prop_tgt/Swift_MODULE_NAME.rst b/Help/prop_tgt/Swift_MODULE_NAME.rst index 2866020..d941b54 100644 --- a/Help/prop_tgt/Swift_MODULE_NAME.rst +++ b/Help/prop_tgt/Swift_MODULE_NAME.rst @@ -1,5 +1,7 @@ Swift_MODULE_NAME ----------------- +.. versionadded:: 3.15 + This property specifies the name of the Swift module. It is defaulted to the name of the target. diff --git a/Help/prop_tgt/UNITY_BUILD.rst b/Help/prop_tgt/UNITY_BUILD.rst index e140952..04cede6 100644 --- a/Help/prop_tgt/UNITY_BUILD.rst +++ b/Help/prop_tgt/UNITY_BUILD.rst @@ -1,6 +1,8 @@ UNITY_BUILD ----------- +.. versionadded:: 3.16 + When this property is set to true, the target source files will be combined into batches for faster compilation. This is done by creating a (set of) unity sources which ``#include`` the original sources, then compiling these diff --git a/Help/prop_tgt/UNITY_BUILD_BATCH_SIZE.rst b/Help/prop_tgt/UNITY_BUILD_BATCH_SIZE.rst index 44ffe27..3886ec9 100644 --- a/Help/prop_tgt/UNITY_BUILD_BATCH_SIZE.rst +++ b/Help/prop_tgt/UNITY_BUILD_BATCH_SIZE.rst @@ -1,6 +1,8 @@ UNITY_BUILD_BATCH_SIZE ---------------------- +.. versionadded:: 3.16 + Specifies the maximum number of source files that can be combined into any one unity source file when unity builds are enabled by the :prop_tgt:`UNITY_BUILD` target property. The original source files will be distributed across as many diff --git a/Help/prop_tgt/UNITY_BUILD_CODE_AFTER_INCLUDE.rst b/Help/prop_tgt/UNITY_BUILD_CODE_AFTER_INCLUDE.rst index 7231b61..ac2b19c 100644 --- a/Help/prop_tgt/UNITY_BUILD_CODE_AFTER_INCLUDE.rst +++ b/Help/prop_tgt/UNITY_BUILD_CODE_AFTER_INCLUDE.rst @@ -1,6 +1,8 @@ UNITY_BUILD_CODE_AFTER_INCLUDE ------------------------------ +.. versionadded:: 3.16 + Code snippet which is included verbatim by the :prop_tgt:`UNITY_BUILD` feature just after every ``#include`` statement in the generated unity source files. For example: diff --git a/Help/prop_tgt/UNITY_BUILD_CODE_BEFORE_INCLUDE.rst b/Help/prop_tgt/UNITY_BUILD_CODE_BEFORE_INCLUDE.rst index 7ed6fa1..6f0d56b 100644 --- a/Help/prop_tgt/UNITY_BUILD_CODE_BEFORE_INCLUDE.rst +++ b/Help/prop_tgt/UNITY_BUILD_CODE_BEFORE_INCLUDE.rst @@ -1,6 +1,8 @@ UNITY_BUILD_CODE_BEFORE_INCLUDE ------------------------------- +.. versionadded:: 3.16 + Code snippet which is included verbatim by the :prop_tgt:`UNITY_BUILD` feature just before every ``#include`` statement in the generated unity source files. For example: diff --git a/Help/prop_tgt/UNITY_BUILD_MODE.rst b/Help/prop_tgt/UNITY_BUILD_MODE.rst index 1ebab23..003451e 100644 --- a/Help/prop_tgt/UNITY_BUILD_MODE.rst +++ b/Help/prop_tgt/UNITY_BUILD_MODE.rst @@ -1,6 +1,8 @@ UNITY_BUILD_MODE ---------------- +.. versionadded:: 3.18 + CMake provides different algorithms for selecting which sources are grouped together into a *bucket*. Selection is decided by this property, which has the following acceptable values: diff --git a/Help/prop_tgt/VS_CONFIGURATION_TYPE.rst b/Help/prop_tgt/VS_CONFIGURATION_TYPE.rst index 640bed5..4adffd4 100644 --- a/Help/prop_tgt/VS_CONFIGURATION_TYPE.rst +++ b/Help/prop_tgt/VS_CONFIGURATION_TYPE.rst @@ -1,6 +1,8 @@ VS_CONFIGURATION_TYPE --------------------- +.. versionadded:: 3.6 + Visual Studio project configuration type. Sets the ``ConfigurationType`` attribute for a generated Visual Studio project. diff --git a/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst b/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst index ba5fd0a..58476d6 100644 --- a/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst +++ b/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst @@ -1,6 +1,8 @@ VS_DEBUGGER_COMMAND ------------------- +.. versionadded:: 3.12 + Sets the local debugger command for Visual Studio C++ targets. The property value may use :manual:`generator expressions <cmake-generator-expressions(7)>`. diff --git a/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst b/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst index 06ef5d5..6c26601 100644 --- a/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst +++ b/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst @@ -1,6 +1,8 @@ VS_DEBUGGER_COMMAND_ARGUMENTS ----------------------------- +.. versionadded:: 3.13 + Sets the local debugger command line arguments for Visual Studio C++ targets. The property value may use :manual:`generator expressions <cmake-generator-expressions(7)>`. diff --git a/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst b/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst index f55ac7b..2f59a82 100644 --- a/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst +++ b/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst @@ -1,6 +1,8 @@ VS_DEBUGGER_ENVIRONMENT ----------------------- +.. versionadded:: 3.13 + Sets the local debugger environment for Visual Studio C++ targets. The property value may use :manual:`generator expressions <cmake-generator-expressions(7)>`. diff --git a/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst b/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst index 008bbf6..c163abf 100644 --- a/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst +++ b/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst @@ -1,6 +1,8 @@ VS_DEBUGGER_WORKING_DIRECTORY ----------------------------- +.. versionadded:: 3.8 + Sets the local debugger working directory for Visual Studio C++ targets. The property value may use :manual:`generator expressions <cmake-generator-expressions(7)>`. diff --git a/Help/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION.rst b/Help/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION.rst index 19d1620..5fd23e1 100644 --- a/Help/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION.rst +++ b/Help/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION.rst @@ -1,6 +1,8 @@ VS_DESKTOP_EXTENSIONS_VERSION ----------------------------- +.. versionadded:: 3.4 + Visual Studio Windows 10 Desktop Extensions Version Specifies the version of the Desktop Extensions that should be included in the diff --git a/Help/prop_tgt/VS_DOTNET_DOCUMENTATION_FILE.rst b/Help/prop_tgt/VS_DOTNET_DOCUMENTATION_FILE.rst index 1bc361c..a388256 100644 --- a/Help/prop_tgt/VS_DOTNET_DOCUMENTATION_FILE.rst +++ b/Help/prop_tgt/VS_DOTNET_DOCUMENTATION_FILE.rst @@ -1,6 +1,8 @@ VS_DOTNET_DOCUMENTATION_FILE ---------------------------- +.. versionadded:: 3.17 + Visual Studio managed project .NET documentation output Sets the target XML documentation file output. diff --git a/Help/prop_tgt/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname.rst b/Help/prop_tgt/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname.rst index ab311ea..5b9caee 100644 --- a/Help/prop_tgt/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname.rst +++ b/Help/prop_tgt/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname.rst @@ -1,6 +1,8 @@ VS_DOTNET_REFERENCEPROP_<refname>_TAG_<tagname> ----------------------------------------------- +.. versionadded:: 3.10 + Defines an XML property ``<tagname>`` for a .NET reference ``<refname>``. diff --git a/Help/prop_tgt/VS_DOTNET_REFERENCES_COPY_LOCAL.rst b/Help/prop_tgt/VS_DOTNET_REFERENCES_COPY_LOCAL.rst index 7641ba5..556fa8a 100644 --- a/Help/prop_tgt/VS_DOTNET_REFERENCES_COPY_LOCAL.rst +++ b/Help/prop_tgt/VS_DOTNET_REFERENCES_COPY_LOCAL.rst @@ -1,6 +1,8 @@ VS_DOTNET_REFERENCES_COPY_LOCAL ------------------------------- +.. versionadded:: 3.8 + Sets the **Copy Local** property for all .NET hint references in the target Boolean property to enable/disable copying of .NET hint references to diff --git a/Help/prop_tgt/VS_DOTNET_REFERENCE_refname.rst b/Help/prop_tgt/VS_DOTNET_REFERENCE_refname.rst index 5814005..9c4d34a 100644 --- a/Help/prop_tgt/VS_DOTNET_REFERENCE_refname.rst +++ b/Help/prop_tgt/VS_DOTNET_REFERENCE_refname.rst @@ -1,6 +1,8 @@ VS_DOTNET_REFERENCE_<refname> ----------------------------- +.. versionadded:: 3.8 + Visual Studio managed project .NET reference with name ``<refname>`` and hint path. diff --git a/Help/prop_tgt/VS_DPI_AWARE.rst b/Help/prop_tgt/VS_DPI_AWARE.rst index 82640cc..47ce1ce 100644 --- a/Help/prop_tgt/VS_DPI_AWARE.rst +++ b/Help/prop_tgt/VS_DPI_AWARE.rst @@ -1,6 +1,8 @@ VS_DPI_AWARE ------------ +.. versionadded:: 3.16 + Set the Manifest Tool -> Input and Output -> DPI Awareness in the Visual Studio target project properties. diff --git a/Help/prop_tgt/VS_IOT_EXTENSIONS_VERSION.rst b/Help/prop_tgt/VS_IOT_EXTENSIONS_VERSION.rst index 27c8a3d..ca6a3ca 100644 --- a/Help/prop_tgt/VS_IOT_EXTENSIONS_VERSION.rst +++ b/Help/prop_tgt/VS_IOT_EXTENSIONS_VERSION.rst @@ -1,6 +1,8 @@ VS_IOT_EXTENSIONS_VERSION ------------------------- +.. versionadded:: 3.4 + Visual Studio Windows 10 IoT Extensions Version Specifies the version of the IoT Extensions that should be included in the diff --git a/Help/prop_tgt/VS_IOT_STARTUP_TASK.rst b/Help/prop_tgt/VS_IOT_STARTUP_TASK.rst index add50cb..259055d 100644 --- a/Help/prop_tgt/VS_IOT_STARTUP_TASK.rst +++ b/Help/prop_tgt/VS_IOT_STARTUP_TASK.rst @@ -1,6 +1,8 @@ VS_IOT_STARTUP_TASK ------------------- +.. versionadded:: 3.4 + Visual Studio Windows 10 IoT Continuous Background Task Specifies that the target should be compiled as a Continuous Background Task library. diff --git a/Help/prop_tgt/VS_JUST_MY_CODE_DEBUGGING.rst b/Help/prop_tgt/VS_JUST_MY_CODE_DEBUGGING.rst index 42fb8ad..724bd2f 100644 --- a/Help/prop_tgt/VS_JUST_MY_CODE_DEBUGGING.rst +++ b/Help/prop_tgt/VS_JUST_MY_CODE_DEBUGGING.rst @@ -1,6 +1,8 @@ VS_JUST_MY_CODE_DEBUGGING ------------------------- +.. versionadded:: 3.15 + Enable Just My Code with Visual Studio debugger. Supported on :ref:`Visual Studio Generators` for VS 2010 and higher, diff --git a/Help/prop_tgt/VS_MOBILE_EXTENSIONS_VERSION.rst b/Help/prop_tgt/VS_MOBILE_EXTENSIONS_VERSION.rst index be3c9a0..b307e84 100644 --- a/Help/prop_tgt/VS_MOBILE_EXTENSIONS_VERSION.rst +++ b/Help/prop_tgt/VS_MOBILE_EXTENSIONS_VERSION.rst @@ -1,6 +1,8 @@ VS_MOBILE_EXTENSIONS_VERSION ---------------------------- +.. versionadded:: 3.4 + Visual Studio Windows 10 Mobile Extensions Version Specifies the version of the Mobile Extensions that should be included in the diff --git a/Help/prop_tgt/VS_NO_SOLUTION_DEPLOY.rst b/Help/prop_tgt/VS_NO_SOLUTION_DEPLOY.rst index ffcbde5..bf6ac10 100644 --- a/Help/prop_tgt/VS_NO_SOLUTION_DEPLOY.rst +++ b/Help/prop_tgt/VS_NO_SOLUTION_DEPLOY.rst @@ -1,6 +1,8 @@ VS_NO_SOLUTION_DEPLOY --------------------- +.. versionadded:: 3.15 + Specify that the target should not be marked for deployment to a Windows CE or Windows Phone device in the generated Visual Studio solution. diff --git a/Help/prop_tgt/VS_PACKAGE_REFERENCES.rst b/Help/prop_tgt/VS_PACKAGE_REFERENCES.rst index 5a0465b..ec17567 100644 --- a/Help/prop_tgt/VS_PACKAGE_REFERENCES.rst +++ b/Help/prop_tgt/VS_PACKAGE_REFERENCES.rst @@ -1,6 +1,8 @@ VS_PACKAGE_REFERENCES --------------------- +.. versionadded:: 3.15 + Visual Studio package references for nuget. Adds one or more semicolon-delimited package references to a generated diff --git a/Help/prop_tgt/VS_PLATFORM_TOOLSET.rst b/Help/prop_tgt/VS_PLATFORM_TOOLSET.rst index f8f2e8e..27a92d6 100644 --- a/Help/prop_tgt/VS_PLATFORM_TOOLSET.rst +++ b/Help/prop_tgt/VS_PLATFORM_TOOLSET.rst @@ -1,6 +1,8 @@ VS_PLATFORM_TOOLSET ------------------- +.. versionadded:: 3.18 + Overrides the platform toolset used to build a target. Only supported when the compiler used by the given toolset is the diff --git a/Help/prop_tgt/VS_PROJECT_IMPORT.rst b/Help/prop_tgt/VS_PROJECT_IMPORT.rst index 569c8ea..f5e9698 100644 --- a/Help/prop_tgt/VS_PROJECT_IMPORT.rst +++ b/Help/prop_tgt/VS_PROJECT_IMPORT.rst @@ -1,6 +1,8 @@ VS_PROJECT_IMPORT ----------------- +.. versionadded:: 3.15 + Visual Studio managed project imports Adds to a generated Visual Studio project one or more semicolon-delimited paths diff --git a/Help/prop_tgt/VS_SDK_REFERENCES.rst b/Help/prop_tgt/VS_SDK_REFERENCES.rst index 99987f5..9a082e7 100644 --- a/Help/prop_tgt/VS_SDK_REFERENCES.rst +++ b/Help/prop_tgt/VS_SDK_REFERENCES.rst @@ -1,6 +1,8 @@ VS_SDK_REFERENCES ----------------- +.. versionadded:: 3.7 + Visual Studio project SDK references. Specify a :ref:`semicolon-separated list <CMake Language Lists>` of SDK references to be added to a generated Visual Studio project, e.g. diff --git a/Help/prop_tgt/VS_SOLUTION_DEPLOY.rst b/Help/prop_tgt/VS_SOLUTION_DEPLOY.rst index eef848f..e56f411 100644 --- a/Help/prop_tgt/VS_SOLUTION_DEPLOY.rst +++ b/Help/prop_tgt/VS_SOLUTION_DEPLOY.rst @@ -1,6 +1,8 @@ VS_SOLUTION_DEPLOY ------------------ +.. versionadded:: 3.18 + Specify that the target should be marked for deployment when not targeting Windows CE, Windows Phone or a Windows Store application. diff --git a/Help/prop_tgt/VS_SOURCE_SETTINGS_tool.rst b/Help/prop_tgt/VS_SOURCE_SETTINGS_tool.rst index 738a912..b5a76fc 100644 --- a/Help/prop_tgt/VS_SOURCE_SETTINGS_tool.rst +++ b/Help/prop_tgt/VS_SOURCE_SETTINGS_tool.rst @@ -1,6 +1,8 @@ VS_SOURCE_SETTINGS_<tool> ------------------------- +.. versionadded:: 3.18 + Set any item metadata on all non-built files that use <tool>. Takes a list of ``Key=Value`` pairs. Tells the Visual Studio generator diff --git a/Help/prop_tgt/VS_USER_PROPS.rst b/Help/prop_tgt/VS_USER_PROPS.rst index 1be222b..8f2a105 100644 --- a/Help/prop_tgt/VS_USER_PROPS.rst +++ b/Help/prop_tgt/VS_USER_PROPS.rst @@ -1,6 +1,8 @@ VS_USER_PROPS ------------- +.. versionadded:: 3.8 + Sets the user props file to be included in the visual studio C++ project file. The standard path is ``$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props``, which is diff --git a/Help/prop_tgt/VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION.rst b/Help/prop_tgt/VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION.rst index 1ad7a71..50cf203 100644 --- a/Help/prop_tgt/VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION.rst +++ b/Help/prop_tgt/VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION.rst @@ -1,6 +1,8 @@ VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION -------------------------------------- +.. versionadded:: 3.4 + Visual Studio Windows Target Platform Minimum Version For Windows 10. Specifies the minimum version of the OS that is being diff --git a/Help/prop_tgt/VS_WINRT_COMPONENT.rst b/Help/prop_tgt/VS_WINRT_COMPONENT.rst index e160bd6..8b4aaf7 100644 --- a/Help/prop_tgt/VS_WINRT_COMPONENT.rst +++ b/Help/prop_tgt/VS_WINRT_COMPONENT.rst @@ -1,6 +1,8 @@ VS_WINRT_COMPONENT ------------------ +.. versionadded:: 3.1 + Mark a target as a Windows Runtime component for the Visual Studio generator. Compile the target with ``C++/CX`` language extensions for Windows Runtime. For ``SHARED`` and ``MODULE`` libraries, this also defines the diff --git a/Help/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.rst b/Help/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.rst index 86711bf..00f32f6 100644 --- a/Help/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.rst +++ b/Help/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.rst @@ -1,6 +1,8 @@ WINDOWS_EXPORT_ALL_SYMBOLS -------------------------- +.. versionadded:: 3.4 + This property is implemented only for MS-compatible tools on Windows. Enable this boolean property to automatically create a module definition diff --git a/Help/prop_tgt/XCODE_EXPLICIT_FILE_TYPE.rst b/Help/prop_tgt/XCODE_EXPLICIT_FILE_TYPE.rst index dc92902..e01a034 100644 --- a/Help/prop_tgt/XCODE_EXPLICIT_FILE_TYPE.rst +++ b/Help/prop_tgt/XCODE_EXPLICIT_FILE_TYPE.rst @@ -1,6 +1,8 @@ XCODE_EXPLICIT_FILE_TYPE ------------------------ +.. versionadded:: 3.8 + Set the Xcode ``explicitFileType`` attribute on its reference to a target. CMake computes a default based on target type but can be told explicitly with this property. diff --git a/Help/prop_tgt/XCODE_GENERATE_SCHEME.rst b/Help/prop_tgt/XCODE_GENERATE_SCHEME.rst index c32b4de..06a3cf9 100644 --- a/Help/prop_tgt/XCODE_GENERATE_SCHEME.rst +++ b/Help/prop_tgt/XCODE_GENERATE_SCHEME.rst @@ -1,6 +1,8 @@ XCODE_GENERATE_SCHEME --------------------- +.. versionadded:: 3.15 + If enabled, the :generator:`Xcode` generator will generate schema files. These are useful to invoke analyze, archive, build-for-testing and test actions from the command line. diff --git a/Help/prop_tgt/XCODE_PRODUCT_TYPE.rst b/Help/prop_tgt/XCODE_PRODUCT_TYPE.rst index f4ef5c0..17a9c3f 100644 --- a/Help/prop_tgt/XCODE_PRODUCT_TYPE.rst +++ b/Help/prop_tgt/XCODE_PRODUCT_TYPE.rst @@ -1,6 +1,8 @@ XCODE_PRODUCT_TYPE ------------------ +.. versionadded:: 3.8 + Set the Xcode ``productType`` attribute on its reference to a target. CMake computes a default based on target type but can be told explicitly with this property. diff --git a/Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER.rst b/Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER.rst index cc9bac2..c72ec06 100644 --- a/Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER.rst +++ b/Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER.rst @@ -1,6 +1,8 @@ XCODE_SCHEME_ADDRESS_SANITIZER ------------------------------ +.. versionadded:: 3.13 + Whether to enable ``Address Sanitizer`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst b/Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst index 37a043a..293b5d4 100644 --- a/Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst +++ b/Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst @@ -1,6 +1,8 @@ XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN ----------------------------------------------- +.. versionadded:: 3.13 + Whether to enable ``Detect use of stack after return`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/prop_tgt/XCODE_SCHEME_ARGUMENTS.rst b/Help/prop_tgt/XCODE_SCHEME_ARGUMENTS.rst index 1f228e3..2bfcb41 100644 --- a/Help/prop_tgt/XCODE_SCHEME_ARGUMENTS.rst +++ b/Help/prop_tgt/XCODE_SCHEME_ARGUMENTS.rst @@ -1,6 +1,8 @@ XCODE_SCHEME_ARGUMENTS ---------------------- +.. versionadded:: 3.13 + Specify command line arguments that should be added to the Arguments section of the generated Xcode scheme. diff --git a/Help/prop_tgt/XCODE_SCHEME_DEBUG_AS_ROOT.rst b/Help/prop_tgt/XCODE_SCHEME_DEBUG_AS_ROOT.rst index 5407e80..2523deb 100644 --- a/Help/prop_tgt/XCODE_SCHEME_DEBUG_AS_ROOT.rst +++ b/Help/prop_tgt/XCODE_SCHEME_DEBUG_AS_ROOT.rst @@ -1,6 +1,8 @@ XCODE_SCHEME_DEBUG_AS_ROOT -------------------------- +.. versionadded:: 3.15 + Whether to debug the target as 'root'. Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property diff --git a/Help/prop_tgt/XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING.rst b/Help/prop_tgt/XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING.rst index 9afeedd..bbcae35 100644 --- a/Help/prop_tgt/XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING.rst +++ b/Help/prop_tgt/XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING.rst @@ -1,6 +1,8 @@ XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING -------------------------------------- +.. versionadded:: 3.16 + Whether to enable ``Allow debugging when using document Versions Browser`` in the Options section of the generated Xcode scheme. diff --git a/Help/prop_tgt/XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst b/Help/prop_tgt/XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst index 1a6fcfd..3d315a2 100644 --- a/Help/prop_tgt/XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst +++ b/Help/prop_tgt/XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst @@ -1,6 +1,8 @@ XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER ---------------------------------------- +.. versionadded:: 3.13 + Whether to disable the ``Main Thread Checker`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst b/Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst index 9224022..2ca20f7 100644 --- a/Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst +++ b/Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst @@ -1,6 +1,8 @@ XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS ---------------------------------- +.. versionadded:: 3.13 + Whether to enable ``Dynamic Library Loads`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst b/Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst index 203c803..278c9ef 100644 --- a/Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst +++ b/Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst @@ -1,6 +1,8 @@ XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE ------------------------------------- +.. versionadded:: 3.13 + Whether to enable ``Dynamic Linker API usage`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/prop_tgt/XCODE_SCHEME_ENVIRONMENT.rst b/Help/prop_tgt/XCODE_SCHEME_ENVIRONMENT.rst index c6d875e..16542f8 100644 --- a/Help/prop_tgt/XCODE_SCHEME_ENVIRONMENT.rst +++ b/Help/prop_tgt/XCODE_SCHEME_ENVIRONMENT.rst @@ -1,6 +1,8 @@ XCODE_SCHEME_ENVIRONMENT ------------------------ +.. versionadded:: 3.13 + Specify environment variables that should be added to the Arguments section of the generated Xcode scheme. diff --git a/Help/prop_tgt/XCODE_SCHEME_EXECUTABLE.rst b/Help/prop_tgt/XCODE_SCHEME_EXECUTABLE.rst index 104841b..b453f10 100644 --- a/Help/prop_tgt/XCODE_SCHEME_EXECUTABLE.rst +++ b/Help/prop_tgt/XCODE_SCHEME_EXECUTABLE.rst @@ -1,6 +1,8 @@ XCODE_SCHEME_EXECUTABLE ----------------------- +.. versionadded:: 3.13 + Specify path to executable in the Info section of the generated Xcode scheme. If not set the schema generator will select the current target if it is actually executable. diff --git a/Help/prop_tgt/XCODE_SCHEME_GUARD_MALLOC.rst b/Help/prop_tgt/XCODE_SCHEME_GUARD_MALLOC.rst index c4e83da..4b242a2 100644 --- a/Help/prop_tgt/XCODE_SCHEME_GUARD_MALLOC.rst +++ b/Help/prop_tgt/XCODE_SCHEME_GUARD_MALLOC.rst @@ -1,6 +1,8 @@ XCODE_SCHEME_GUARD_MALLOC ------------------------------ +.. versionadded:: 3.13 + Whether to enable ``Guard Malloc`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/prop_tgt/XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst b/Help/prop_tgt/XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst index 73992c3..2a813aa 100644 --- a/Help/prop_tgt/XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst +++ b/Help/prop_tgt/XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst @@ -1,6 +1,8 @@ XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP ------------------------------------- +.. versionadded:: 3.13 + Whether to enable the ``Main Thread Checker`` option ``Pause on issues`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/prop_tgt/XCODE_SCHEME_MALLOC_GUARD_EDGES.rst b/Help/prop_tgt/XCODE_SCHEME_MALLOC_GUARD_EDGES.rst index ca761c0..750da74 100644 --- a/Help/prop_tgt/XCODE_SCHEME_MALLOC_GUARD_EDGES.rst +++ b/Help/prop_tgt/XCODE_SCHEME_MALLOC_GUARD_EDGES.rst @@ -1,6 +1,8 @@ XCODE_SCHEME_MALLOC_GUARD_EDGES ------------------------------- +.. versionadded:: 3.13 + Whether to enable ``Malloc Guard Edges`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/prop_tgt/XCODE_SCHEME_MALLOC_SCRIBBLE.rst b/Help/prop_tgt/XCODE_SCHEME_MALLOC_SCRIBBLE.rst index c5ddb95..4ebd21b 100644 --- a/Help/prop_tgt/XCODE_SCHEME_MALLOC_SCRIBBLE.rst +++ b/Help/prop_tgt/XCODE_SCHEME_MALLOC_SCRIBBLE.rst @@ -1,6 +1,8 @@ XCODE_SCHEME_MALLOC_SCRIBBLE ------------------------------ +.. versionadded:: 3.13 + Whether to enable ``Malloc Scribble`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/prop_tgt/XCODE_SCHEME_MALLOC_STACK.rst b/Help/prop_tgt/XCODE_SCHEME_MALLOC_STACK.rst index 170f33d..5afe34e 100644 --- a/Help/prop_tgt/XCODE_SCHEME_MALLOC_STACK.rst +++ b/Help/prop_tgt/XCODE_SCHEME_MALLOC_STACK.rst @@ -1,6 +1,8 @@ XCODE_SCHEME_MALLOC_STACK ------------------------- +.. versionadded:: 3.13 + Whether to enable ``Malloc Stack`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER.rst b/Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER.rst index bb70141..cc774c4 100644 --- a/Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER.rst +++ b/Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER.rst @@ -1,6 +1,8 @@ XCODE_SCHEME_THREAD_SANITIZER ----------------------------- +.. versionadded:: 3.13 + Whether to enable ``Thread Sanitizer`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER_STOP.rst b/Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER_STOP.rst index 5deadb1..3bb2596 100644 --- a/Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER_STOP.rst +++ b/Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER_STOP.rst @@ -1,6 +1,8 @@ XCODE_SCHEME_THREAD_SANITIZER_STOP ---------------------------------- +.. versionadded:: 3.13 + Whether to enable ``Thread Sanitizer - Pause on issues`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst b/Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst index 0cd823d..1146130 100644 --- a/Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst +++ b/Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst @@ -1,6 +1,8 @@ XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER ------------------------------------------ +.. versionadded:: 3.13 + Whether to enable ``Undefined Behavior Sanitizer`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst b/Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst index d1a9bca..358f298 100644 --- a/Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst +++ b/Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst @@ -1,6 +1,8 @@ XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP ----------------------------------------------- +.. versionadded:: 3.13 + Whether to enable ``Undefined Behavior Sanitizer`` option ``Pause on issues`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/prop_tgt/XCODE_SCHEME_WORKING_DIRECTORY.rst b/Help/prop_tgt/XCODE_SCHEME_WORKING_DIRECTORY.rst index f538f1d..d8d56fc 100644 --- a/Help/prop_tgt/XCODE_SCHEME_WORKING_DIRECTORY.rst +++ b/Help/prop_tgt/XCODE_SCHEME_WORKING_DIRECTORY.rst @@ -1,6 +1,8 @@ XCODE_SCHEME_WORKING_DIRECTORY ------------------------------ +.. versionadded:: 3.17 + Specify the ``Working Directory`` of the *Run* and *Profile* actions in the generated Xcode scheme. In case the value contains generator expressions those are evaluated. diff --git a/Help/prop_tgt/XCODE_SCHEME_ZOMBIE_OBJECTS.rst b/Help/prop_tgt/XCODE_SCHEME_ZOMBIE_OBJECTS.rst index 6e70e8b..6030109 100644 --- a/Help/prop_tgt/XCODE_SCHEME_ZOMBIE_OBJECTS.rst +++ b/Help/prop_tgt/XCODE_SCHEME_ZOMBIE_OBJECTS.rst @@ -1,6 +1,8 @@ XCODE_SCHEME_ZOMBIE_OBJECTS ------------------------------ +.. versionadded:: 3.13 + Whether to enable ``Zombie Objects`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/prop_tgt/XCTEST.rst b/Help/prop_tgt/XCTEST.rst index eb47e60..67e9a70 100644 --- a/Help/prop_tgt/XCTEST.rst +++ b/Help/prop_tgt/XCTEST.rst @@ -1,6 +1,8 @@ XCTEST ------ +.. versionadded:: 3.3 + This target is a XCTest CFBundle on the Mac. This property will usually get set via the :command:`xctest_add_bundle` diff --git a/Help/release/dev/0-sample-topic.rst b/Help/release/dev/0-sample-topic.rst new file mode 100644 index 0000000..e4cc01e --- /dev/null +++ b/Help/release/dev/0-sample-topic.rst @@ -0,0 +1,7 @@ +0-sample-topic +-------------- + +* This is a sample release note for the change in a topic. + Developers should add similar notes for each topic branch + making a noteworthy change. Each document should be named + and titled to match the topic name to avoid merge conflicts. diff --git a/Help/release/dev/CPACK_EXTERNAL_BUILT_PACKAGES.rst b/Help/release/dev/CPACK_EXTERNAL_BUILT_PACKAGES.rst new file mode 100644 index 0000000..af446d2 --- /dev/null +++ b/Help/release/dev/CPACK_EXTERNAL_BUILT_PACKAGES.rst @@ -0,0 +1,4 @@ +CPACK_EXTERNAL_BUILT_PACKAGES +----------------------------- + +* :cpack_gen:`CPack External Generator` learned the :variable:`CPACK_EXTERNAL_BUILT_PACKAGES` variable. diff --git a/Help/release/dev/FindSDL-update.rst b/Help/release/dev/FindSDL-update.rst new file mode 100644 index 0000000..a85d2b9 --- /dev/null +++ b/Help/release/dev/FindSDL-update.rst @@ -0,0 +1,11 @@ +FindSDL-update +-------------- + +* The :module:`FindSDL` module now provides: + + * imported target ``SDL::SDL``, + + * result variables ``SDL_LIBRARIES`` and ``SDL_INCLUDE_DIRS``, + + * version variables ``SDL_VERSION``, ``SDL_VERSION_MAJOR`` + ``SDL_VERSION_MINOR``, and ``SDL_VERSION_PATCH``. diff --git a/Help/release/dev/FindTIFF-tiffxx.rst b/Help/release/dev/FindTIFF-tiffxx.rst new file mode 100644 index 0000000..656d38f --- /dev/null +++ b/Help/release/dev/FindTIFF-tiffxx.rst @@ -0,0 +1,5 @@ +FindTIFF-tiffxx +--------------- + +* The :module:`FindTIFF` module gained a ``CXX`` component to + find the ``tiffxx`` library containing C++ bindings. diff --git a/Help/release/dev/FindVulkan-glslc.rst b/Help/release/dev/FindVulkan-glslc.rst new file mode 100644 index 0000000..246bc8f --- /dev/null +++ b/Help/release/dev/FindVulkan-glslc.rst @@ -0,0 +1,10 @@ +FindVulkan-glslc +---------------- + +* The :module:`FindVulkan` module gained a new output variable + ``Vulkan_GLSLC_EXECUTABLE`` which contains the path to the + GLSL SPIR-V compiler. + +* The :module:`FindVulkan` module gained a new target + ``Vulkan::glslc`` which contains the path to the + GLSL SPIR-V compiler. diff --git a/Help/release/dev/configure_file-permission-control.rst b/Help/release/dev/configure_file-permission-control.rst new file mode 100644 index 0000000..54b52b7 --- /dev/null +++ b/Help/release/dev/configure_file-permission-control.rst @@ -0,0 +1,5 @@ +configure_file-permission-control +--------------------------------- + +* The :command:`configure_file` command gained a ``NO_SOURCE_PERMISSIONS`` + option to suppress copying the input file's permissions to the output file. diff --git a/Help/release/dev/cpack-pre-and-post-build-scripts.rst b/Help/release/dev/cpack-pre-and-post-build-scripts.rst new file mode 100644 index 0000000..bf7958b --- /dev/null +++ b/Help/release/dev/cpack-pre-and-post-build-scripts.rst @@ -0,0 +1,5 @@ +cpack-pre-and-post-build-scripts +-------------------------------- + +* CPack learned the :variable:`CPACK_PRE_BUILD_SCRIPTS`, :variable:`CPACK_POST_BUILD_SCRIPTS`, + and :variable:`CPACK_PACKAGE_FILES` variables. diff --git a/Help/release/dev/ctest-cuda-memcheck.rst b/Help/release/dev/ctest-cuda-memcheck.rst new file mode 100644 index 0000000..f8f861a --- /dev/null +++ b/Help/release/dev/ctest-cuda-memcheck.rst @@ -0,0 +1,8 @@ +CTest +----- + +* :manual:`ctest(1)` gained support for cuda-memcheck as ``CTEST_MEMORYCHECK_COMMAND``. + The different tools (memcheck, racecheck, synccheck, initcheck) supplied by + cuda-memcheck can be selected by setting the appropriate flags using the + ``CTEST_MEMORYCHECK_COMMAND_OPTIONS`` variable. + The default flags are `--tool memcheck --leak-check full`. diff --git a/Help/release/dev/deprecate-policy-old.rst b/Help/release/dev/deprecate-policy-old.rst new file mode 100644 index 0000000..1dc01cc --- /dev/null +++ b/Help/release/dev/deprecate-policy-old.rst @@ -0,0 +1,13 @@ +deprecate-policy-old +-------------------- + +* An explicit deprecation diagnostic was added for policy ``CMP0071`` + (``CMP0071`` 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. + +* Compatibility with versions of CMake older than 2.8.12 is now deprecated + and will be removed from a future version. Calls to + :command:`cmake_minimum_required` or :command:`cmake_policy` that set + the policy version to an older value now issue a deprecation diagnostic. diff --git a/Help/release/dev/fileapi-codemodel-2.2.rst b/Help/release/dev/fileapi-codemodel-2.2.rst new file mode 100644 index 0000000..5954df6 --- /dev/null +++ b/Help/release/dev/fileapi-codemodel-2.2.rst @@ -0,0 +1,7 @@ +fileapi-codemodel-2.2 +--------------------- + +* The :manual:`cmake-file-api(7)` "codemodel" version 2 ``version`` field has + been updated to 2.2. +* The :manual:`cmake-file-api(7)` "codemodel" version 2 "target" object gained + a new ``languageStandard`` field in the ``compileGroups`` objects. diff --git a/Help/release/dev/find_program-exe-no-read.rst b/Help/release/dev/find_program-exe-no-read.rst new file mode 100644 index 0000000..161b5db --- /dev/null +++ b/Help/release/dev/find_program-exe-no-read.rst @@ -0,0 +1,5 @@ +find_program-exe-no-read +------------------------ + +* The :command:`find_program` command now requires permission to execute + but not to read the file found. See policy :policy:`CMP0109`. diff --git a/Help/release/dev/install-default-directory-permissions.rst b/Help/release/dev/install-default-directory-permissions.rst new file mode 100644 index 0000000..27cffee --- /dev/null +++ b/Help/release/dev/install-default-directory-permissions.rst @@ -0,0 +1,5 @@ +install-default-directory-permissions +------------------------------------- + +* The ``--install`` argument of the :manual:`cmake(1)` command line tool gained a + ``--default-directory-permissions`` argument. diff --git a/Help/release/dev/remove-cmake-gui-qt4.rst b/Help/release/dev/remove-cmake-gui-qt4.rst new file mode 100644 index 0000000..2b29b75 --- /dev/null +++ b/Help/release/dev/remove-cmake-gui-qt4.rst @@ -0,0 +1,5 @@ +remove-cmake-gui-qt4 +-------------------- + +* :manual:`cmake-gui(1)` now requires Qt5. Support for compiling with Qt4 has + been removed. diff --git a/Help/release/dev/remove-warn-unused-vars.rst b/Help/release/dev/remove-warn-unused-vars.rst new file mode 100644 index 0000000..7a06e91 --- /dev/null +++ b/Help/release/dev/remove-warn-unused-vars.rst @@ -0,0 +1,6 @@ +remove-warn-unused-vars +----------------------- + +* The :manual:`cmake(1)` command-line option ``--warn-unused-vars`` has + been removed and is now silently ignored. The option has not worked + correctly since CMake 3.3. diff --git a/Help/release/dev/visual-studio-android.rst b/Help/release/dev/visual-studio-android.rst new file mode 100644 index 0000000..4e1a110 --- /dev/null +++ b/Help/release/dev/visual-studio-android.rst @@ -0,0 +1,7 @@ +visual-studio-android +--------------------- + +* The :ref:`Visual Studio Generators` for Visual Studio 2015 and above gained + support for the Visual Studio Tools for Android. This allows you to set + :variable:`CMAKE_SYSTEM_NAME` to `Android` to generate `.vcxproj` files for + the Android tools. diff --git a/Help/release/index.rst b/Help/release/index.rst index 4578b3a..cdc3e8b 100644 --- a/Help/release/index.rst +++ b/Help/release/index.rst @@ -7,6 +7,8 @@ CMake Release Notes This file should include the adjacent "dev.txt" file in development versions but not in release versions. +.. include:: dev.txt + Releases ======== diff --git a/Help/variable/ANDROID.rst b/Help/variable/ANDROID.rst index fede4ca..68dccf2 100644 --- a/Help/variable/ANDROID.rst +++ b/Help/variable/ANDROID.rst @@ -1,5 +1,7 @@ ANDROID ------- +.. versionadded:: 3.7 + Set to ``1`` when the target system (:variable:`CMAKE_SYSTEM_NAME`) is ``Android``. diff --git a/Help/variable/CACHE.rst b/Help/variable/CACHE.rst index 2cef27e..d5489c8 100644 --- a/Help/variable/CACHE.rst +++ b/Help/variable/CACHE.rst @@ -1,6 +1,8 @@ CACHE ----- +.. versionadded:: 3.13 + Operator to read cache variables. Use the syntax ``$CACHE{VAR}`` to read cache entry ``VAR``. diff --git a/Help/variable/CMAKE_AIX_EXPORT_ALL_SYMBOLS.rst b/Help/variable/CMAKE_AIX_EXPORT_ALL_SYMBOLS.rst index c64dd48..699fe0f 100644 --- a/Help/variable/CMAKE_AIX_EXPORT_ALL_SYMBOLS.rst +++ b/Help/variable/CMAKE_AIX_EXPORT_ALL_SYMBOLS.rst @@ -1,6 +1,8 @@ CMAKE_AIX_EXPORT_ALL_SYMBOLS ---------------------------- +.. versionadded:: 3.17 + Default value for :prop_tgt:`AIX_EXPORT_ALL_SYMBOLS` target property. This variable is used to initialize the property on each target as it is created. diff --git a/Help/variable/CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS.rst b/Help/variable/CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS.rst index 8862ba9..2d6b4b9 100644 --- a/Help/variable/CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS.rst +++ b/Help/variable/CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS.rst @@ -1,5 +1,7 @@ CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS ------------------------------------ +.. versionadded:: 3.4 + Default value for the :prop_tgt:`ANDROID_ANT_ADDITIONAL_OPTIONS` target property. See that target property for additional information. diff --git a/Help/variable/CMAKE_ANDROID_API.rst b/Help/variable/CMAKE_ANDROID_API.rst index c07a05a..4388bf2 100644 --- a/Help/variable/CMAKE_ANDROID_API.rst +++ b/Help/variable/CMAKE_ANDROID_API.rst @@ -1,6 +1,8 @@ CMAKE_ANDROID_API ----------------- +.. versionadded:: 3.1 + When :ref:`Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio Edition`, this variable may be set to specify the default value for the :prop_tgt:`ANDROID_API` target property. See that target property for diff --git a/Help/variable/CMAKE_ANDROID_API_MIN.rst b/Help/variable/CMAKE_ANDROID_API_MIN.rst index 0246c75..a0d2ab4 100644 --- a/Help/variable/CMAKE_ANDROID_API_MIN.rst +++ b/Help/variable/CMAKE_ANDROID_API_MIN.rst @@ -1,5 +1,7 @@ CMAKE_ANDROID_API_MIN --------------------- +.. versionadded:: 3.2 + Default value for the :prop_tgt:`ANDROID_API_MIN` target property. See that target property for additional information. diff --git a/Help/variable/CMAKE_ANDROID_ARCH.rst b/Help/variable/CMAKE_ANDROID_ARCH.rst index b91ca57..9f12742 100644 --- a/Help/variable/CMAKE_ANDROID_ARCH.rst +++ b/Help/variable/CMAKE_ANDROID_ARCH.rst @@ -1,6 +1,8 @@ CMAKE_ANDROID_ARCH ------------------ +.. versionadded:: 3.4 + When :ref:`Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio Edition`, this variable may be set to specify the default value for the :prop_tgt:`ANDROID_ARCH` target property. See that target property for diff --git a/Help/variable/CMAKE_ANDROID_ARCH_ABI.rst b/Help/variable/CMAKE_ANDROID_ARCH_ABI.rst index 0a3ed3c..5a2e3ec 100644 --- a/Help/variable/CMAKE_ANDROID_ARCH_ABI.rst +++ b/Help/variable/CMAKE_ANDROID_ARCH_ABI.rst @@ -1,6 +1,8 @@ CMAKE_ANDROID_ARCH_ABI ---------------------- +.. versionadded:: 3.7 + When :ref:`Cross Compiling for Android`, this variable specifies the target architecture and ABI to be used. Valid values are: diff --git a/Help/variable/CMAKE_ANDROID_ARM_MODE.rst b/Help/variable/CMAKE_ANDROID_ARM_MODE.rst index ad3c37c..973ff7e 100644 --- a/Help/variable/CMAKE_ANDROID_ARM_MODE.rst +++ b/Help/variable/CMAKE_ANDROID_ARM_MODE.rst @@ -1,6 +1,8 @@ CMAKE_ANDROID_ARM_MODE ---------------------- +.. versionadded:: 3.7 + When :ref:`Cross Compiling for Android` and :variable:`CMAKE_ANDROID_ARCH_ABI` is set to one of the ``armeabi`` architectures, set ``CMAKE_ANDROID_ARM_MODE`` to ``ON`` to target 32-bit ARM processors (``-marm``). Otherwise, the diff --git a/Help/variable/CMAKE_ANDROID_ARM_NEON.rst b/Help/variable/CMAKE_ANDROID_ARM_NEON.rst index 4b7ae03..6b9cf08 100644 --- a/Help/variable/CMAKE_ANDROID_ARM_NEON.rst +++ b/Help/variable/CMAKE_ANDROID_ARM_NEON.rst @@ -1,6 +1,8 @@ CMAKE_ANDROID_ARM_NEON ---------------------- +.. versionadded:: 3.7 + When :ref:`Cross Compiling for Android` and :variable:`CMAKE_ANDROID_ARCH_ABI` is set to ``armeabi-v7a`` set ``CMAKE_ANDROID_ARM_NEON`` to ``ON`` to target ARM NEON devices. diff --git a/Help/variable/CMAKE_ANDROID_ASSETS_DIRECTORIES.rst b/Help/variable/CMAKE_ANDROID_ASSETS_DIRECTORIES.rst index c372fe4..3de2be4 100644 --- a/Help/variable/CMAKE_ANDROID_ASSETS_DIRECTORIES.rst +++ b/Help/variable/CMAKE_ANDROID_ASSETS_DIRECTORIES.rst @@ -1,5 +1,7 @@ CMAKE_ANDROID_ASSETS_DIRECTORIES -------------------------------- +.. versionadded:: 3.4 + Default value for the :prop_tgt:`ANDROID_ASSETS_DIRECTORIES` target property. See that target property for additional information. diff --git a/Help/variable/CMAKE_ANDROID_GUI.rst b/Help/variable/CMAKE_ANDROID_GUI.rst index 1755375..821bbee 100644 --- a/Help/variable/CMAKE_ANDROID_GUI.rst +++ b/Help/variable/CMAKE_ANDROID_GUI.rst @@ -1,5 +1,7 @@ CMAKE_ANDROID_GUI ----------------- +.. versionadded:: 3.1 + Default value for the :prop_tgt:`ANDROID_GUI` target property of executables. See that target property for additional information. diff --git a/Help/variable/CMAKE_ANDROID_JAR_DEPENDENCIES.rst b/Help/variable/CMAKE_ANDROID_JAR_DEPENDENCIES.rst index 451a929..80ab842 100644 --- a/Help/variable/CMAKE_ANDROID_JAR_DEPENDENCIES.rst +++ b/Help/variable/CMAKE_ANDROID_JAR_DEPENDENCIES.rst @@ -1,5 +1,7 @@ CMAKE_ANDROID_JAR_DEPENDENCIES ------------------------------ +.. versionadded:: 3.4 + Default value for the :prop_tgt:`ANDROID_JAR_DEPENDENCIES` target property. See that target property for additional information. diff --git a/Help/variable/CMAKE_ANDROID_JAR_DIRECTORIES.rst b/Help/variable/CMAKE_ANDROID_JAR_DIRECTORIES.rst index af83e34..4d148d8 100644 --- a/Help/variable/CMAKE_ANDROID_JAR_DIRECTORIES.rst +++ b/Help/variable/CMAKE_ANDROID_JAR_DIRECTORIES.rst @@ -1,5 +1,7 @@ CMAKE_ANDROID_JAR_DIRECTORIES ----------------------------- +.. versionadded:: 3.4 + Default value for the :prop_tgt:`ANDROID_JAR_DIRECTORIES` target property. See that target property for additional information. diff --git a/Help/variable/CMAKE_ANDROID_JAVA_SOURCE_DIR.rst b/Help/variable/CMAKE_ANDROID_JAVA_SOURCE_DIR.rst index 3dc05e0..021baa0 100644 --- a/Help/variable/CMAKE_ANDROID_JAVA_SOURCE_DIR.rst +++ b/Help/variable/CMAKE_ANDROID_JAVA_SOURCE_DIR.rst @@ -1,5 +1,7 @@ CMAKE_ANDROID_JAVA_SOURCE_DIR ----------------------------- +.. versionadded:: 3.4 + Default value for the :prop_tgt:`ANDROID_JAVA_SOURCE_DIR` target property. See that target property for additional information. diff --git a/Help/variable/CMAKE_ANDROID_NATIVE_LIB_DEPENDENCIES.rst b/Help/variable/CMAKE_ANDROID_NATIVE_LIB_DEPENDENCIES.rst index 4191907..41d4cc3 100644 --- a/Help/variable/CMAKE_ANDROID_NATIVE_LIB_DEPENDENCIES.rst +++ b/Help/variable/CMAKE_ANDROID_NATIVE_LIB_DEPENDENCIES.rst @@ -1,5 +1,7 @@ CMAKE_ANDROID_NATIVE_LIB_DEPENDENCIES ------------------------------------- +.. versionadded:: 3.4 + Default value for the :prop_tgt:`ANDROID_NATIVE_LIB_DEPENDENCIES` target property. See that target property for additional information. diff --git a/Help/variable/CMAKE_ANDROID_NATIVE_LIB_DIRECTORIES.rst b/Help/variable/CMAKE_ANDROID_NATIVE_LIB_DIRECTORIES.rst index 7cb9527..e87547d 100644 --- a/Help/variable/CMAKE_ANDROID_NATIVE_LIB_DIRECTORIES.rst +++ b/Help/variable/CMAKE_ANDROID_NATIVE_LIB_DIRECTORIES.rst @@ -1,5 +1,7 @@ CMAKE_ANDROID_NATIVE_LIB_DIRECTORIES ------------------------------------ +.. versionadded:: 3.4 + Default value for the :prop_tgt:`ANDROID_NATIVE_LIB_DIRECTORIES` target property. See that target property for additional information. diff --git a/Help/variable/CMAKE_ANDROID_NDK.rst b/Help/variable/CMAKE_ANDROID_NDK.rst index d241dd0..72ac99e 100644 --- a/Help/variable/CMAKE_ANDROID_NDK.rst +++ b/Help/variable/CMAKE_ANDROID_NDK.rst @@ -1,6 +1,8 @@ CMAKE_ANDROID_NDK ----------------- +.. versionadded:: 3.7 + When :ref:`Cross Compiling for Android with the NDK`, this variable holds the absolute path to the root directory of the NDK. The directory must contain a ``platforms`` subdirectory holding the ``android-<api>`` diff --git a/Help/variable/CMAKE_ANDROID_NDK_DEPRECATED_HEADERS.rst b/Help/variable/CMAKE_ANDROID_NDK_DEPRECATED_HEADERS.rst index 8ea1257..40a5c1a 100644 --- a/Help/variable/CMAKE_ANDROID_NDK_DEPRECATED_HEADERS.rst +++ b/Help/variable/CMAKE_ANDROID_NDK_DEPRECATED_HEADERS.rst @@ -1,6 +1,8 @@ CMAKE_ANDROID_NDK_DEPRECATED_HEADERS ------------------------------------ +.. versionadded:: 3.9 + When :ref:`Cross Compiling for Android with the NDK`, this variable may be set to specify whether to use the deprecated per-api-level headers instead of the unified headers. diff --git a/Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG.rst b/Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG.rst index 207019a..9d61fa4 100644 --- a/Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG.rst +++ b/Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG.rst @@ -1,6 +1,8 @@ CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG ------------------------------------ +.. versionadded:: 3.7.1 + When :ref:`Cross Compiling for Android with the NDK`, this variable provides the NDK's "host tag" used to construct the path to prebuilt toolchains that run on the host. diff --git a/Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION.rst b/Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION.rst index 22808e3..15fe18f 100644 --- a/Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION.rst +++ b/Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION.rst @@ -1,6 +1,8 @@ CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION ----------------------------------- +.. versionadded:: 3.7 + When :ref:`Cross Compiling for Android with the NDK`, this variable may be set to specify the version of the toolchain to be used as the compiler. diff --git a/Help/variable/CMAKE_ANDROID_PROCESS_MAX.rst b/Help/variable/CMAKE_ANDROID_PROCESS_MAX.rst index 19fb527..be241c2 100644 --- a/Help/variable/CMAKE_ANDROID_PROCESS_MAX.rst +++ b/Help/variable/CMAKE_ANDROID_PROCESS_MAX.rst @@ -1,5 +1,7 @@ CMAKE_ANDROID_PROCESS_MAX ------------------------- +.. versionadded:: 3.4 + Default value for the :prop_tgt:`ANDROID_PROCESS_MAX` target property. See that target property for additional information. diff --git a/Help/variable/CMAKE_ANDROID_PROGUARD.rst b/Help/variable/CMAKE_ANDROID_PROGUARD.rst index b8fdd46..bb001d3 100644 --- a/Help/variable/CMAKE_ANDROID_PROGUARD.rst +++ b/Help/variable/CMAKE_ANDROID_PROGUARD.rst @@ -1,5 +1,7 @@ CMAKE_ANDROID_PROGUARD ---------------------- +.. versionadded:: 3.4 + Default value for the :prop_tgt:`ANDROID_PROGUARD` target property. See that target property for additional information. diff --git a/Help/variable/CMAKE_ANDROID_PROGUARD_CONFIG_PATH.rst b/Help/variable/CMAKE_ANDROID_PROGUARD_CONFIG_PATH.rst index 8dea009..6fd4067 100644 --- a/Help/variable/CMAKE_ANDROID_PROGUARD_CONFIG_PATH.rst +++ b/Help/variable/CMAKE_ANDROID_PROGUARD_CONFIG_PATH.rst @@ -1,5 +1,7 @@ CMAKE_ANDROID_PROGUARD_CONFIG_PATH ---------------------------------- +.. versionadded:: 3.4 + Default value for the :prop_tgt:`ANDROID_PROGUARD_CONFIG_PATH` target property. See that target property for additional information. diff --git a/Help/variable/CMAKE_ANDROID_SECURE_PROPS_PATH.rst b/Help/variable/CMAKE_ANDROID_SECURE_PROPS_PATH.rst index 69a4d0b..9f5743e 100644 --- a/Help/variable/CMAKE_ANDROID_SECURE_PROPS_PATH.rst +++ b/Help/variable/CMAKE_ANDROID_SECURE_PROPS_PATH.rst @@ -1,5 +1,7 @@ CMAKE_ANDROID_SECURE_PROPS_PATH ------------------------------- +.. versionadded:: 3.4 + Default value for the :prop_tgt:`ANDROID_SECURE_PROPS_PATH` target property. See that target property for additional information. diff --git a/Help/variable/CMAKE_ANDROID_SKIP_ANT_STEP.rst b/Help/variable/CMAKE_ANDROID_SKIP_ANT_STEP.rst index 0a96df9..588769b 100644 --- a/Help/variable/CMAKE_ANDROID_SKIP_ANT_STEP.rst +++ b/Help/variable/CMAKE_ANDROID_SKIP_ANT_STEP.rst @@ -1,5 +1,7 @@ CMAKE_ANDROID_SKIP_ANT_STEP --------------------------- +.. versionadded:: 3.4 + Default value for the :prop_tgt:`ANDROID_SKIP_ANT_STEP` target property. See that target property for additional information. diff --git a/Help/variable/CMAKE_ANDROID_STANDALONE_TOOLCHAIN.rst b/Help/variable/CMAKE_ANDROID_STANDALONE_TOOLCHAIN.rst index ea62cab..3ca89f5 100644 --- a/Help/variable/CMAKE_ANDROID_STANDALONE_TOOLCHAIN.rst +++ b/Help/variable/CMAKE_ANDROID_STANDALONE_TOOLCHAIN.rst @@ -1,6 +1,8 @@ CMAKE_ANDROID_STANDALONE_TOOLCHAIN ---------------------------------- +.. versionadded:: 3.7 + When :ref:`Cross Compiling for Android with a Standalone Toolchain`, this variable holds the absolute path to the root directory of the toolchain. The specified directory must contain a ``sysroot`` subdirectory. diff --git a/Help/variable/CMAKE_ANDROID_STL_TYPE.rst b/Help/variable/CMAKE_ANDROID_STL_TYPE.rst index d174575..3778181 100644 --- a/Help/variable/CMAKE_ANDROID_STL_TYPE.rst +++ b/Help/variable/CMAKE_ANDROID_STL_TYPE.rst @@ -1,6 +1,8 @@ CMAKE_ANDROID_STL_TYPE ---------------------- +.. versionadded:: 3.4 + When :ref:`Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio Edition`, this variable may be set to specify the default value for the :prop_tgt:`ANDROID_STL_TYPE` target property. See that target property diff --git a/Help/variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CONFIG.rst b/Help/variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CONFIG.rst index 94c2b6e..d8bd82c 100644 --- a/Help/variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CONFIG.rst +++ b/Help/variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CONFIG.rst @@ -1,6 +1,8 @@ CMAKE_ARCHIVE_OUTPUT_DIRECTORY_<CONFIG> --------------------------------------- +.. versionadded:: 3.3 + Where to put all the :ref:`ARCHIVE <Archive Output Artifacts>` target files when built for a specific configuration. diff --git a/Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst b/Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst index 1398e78..c24e462 100644 --- a/Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst +++ b/Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst @@ -1,6 +1,8 @@ CMAKE_AUTOGEN_ORIGIN_DEPENDS ---------------------------- +.. versionadded:: 3.14 + Switch for forwarding origin target dependencies to the corresponding ``_autogen`` targets. diff --git a/Help/variable/CMAKE_AUTOGEN_PARALLEL.rst b/Help/variable/CMAKE_AUTOGEN_PARALLEL.rst index dd9499a..2ada012 100644 --- a/Help/variable/CMAKE_AUTOGEN_PARALLEL.rst +++ b/Help/variable/CMAKE_AUTOGEN_PARALLEL.rst @@ -1,6 +1,8 @@ CMAKE_AUTOGEN_PARALLEL ---------------------- +.. versionadded:: 3.11 + Number of parallel ``moc`` or ``uic`` processes to start when using :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`. diff --git a/Help/variable/CMAKE_AUTOGEN_VERBOSE.rst b/Help/variable/CMAKE_AUTOGEN_VERBOSE.rst index bad9cf2..f77ed6a 100644 --- a/Help/variable/CMAKE_AUTOGEN_VERBOSE.rst +++ b/Help/variable/CMAKE_AUTOGEN_VERBOSE.rst @@ -1,6 +1,8 @@ CMAKE_AUTOGEN_VERBOSE --------------------- +.. versionadded:: 3.13 + Sets the verbosity of :prop_tgt:`AUTOMOC`, :prop_tgt:`AUTOUIC` and :prop_tgt:`AUTORCC`. A positive integer value or a true boolean value lets the ``AUTO*`` generators output additional processing information. diff --git a/Help/variable/CMAKE_AUTOMOC_COMPILER_PREDEFINES.rst b/Help/variable/CMAKE_AUTOMOC_COMPILER_PREDEFINES.rst index 7e1c53d..f1b03a0 100644 --- a/Help/variable/CMAKE_AUTOMOC_COMPILER_PREDEFINES.rst +++ b/Help/variable/CMAKE_AUTOMOC_COMPILER_PREDEFINES.rst @@ -1,6 +1,8 @@ CMAKE_AUTOMOC_COMPILER_PREDEFINES --------------------------------- +.. versionadded:: 3.10 + This variable is used to initialize the :prop_tgt:`AUTOMOC_COMPILER_PREDEFINES` property on all the targets. See that target property for additional information. diff --git a/Help/variable/CMAKE_AUTOMOC_DEPEND_FILTERS.rst b/Help/variable/CMAKE_AUTOMOC_DEPEND_FILTERS.rst index 5c3662d..2c1551a 100644 --- a/Help/variable/CMAKE_AUTOMOC_DEPEND_FILTERS.rst +++ b/Help/variable/CMAKE_AUTOMOC_DEPEND_FILTERS.rst @@ -1,6 +1,8 @@ CMAKE_AUTOMOC_DEPEND_FILTERS ---------------------------- +.. versionadded:: 3.9 + Filter definitions used by :variable:`CMAKE_AUTOMOC` to extract file names from source code as additional dependencies for the ``moc`` file. diff --git a/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst b/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst index ba1b9d2..8e34df2 100644 --- a/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst +++ b/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst @@ -1,6 +1,8 @@ CMAKE_AUTOMOC_MACRO_NAMES ---------------------------- +.. versionadded:: 3.10 + :ref:`Semicolon-separated list <CMake Language Lists>` list of macro names used by :variable:`CMAKE_AUTOMOC` to determine if a C++ file needs to be processed by ``moc``. diff --git a/Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst b/Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst index dca0b06..07a6cc8 100644 --- a/Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst +++ b/Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst @@ -1,6 +1,8 @@ CMAKE_AUTOMOC_PATH_PREFIX ------------------------- +.. versionadded:: 3.16 + Whether to generate the ``-p`` path prefix option for ``moc`` on :prop_tgt:`AUTOMOC` enabled Qt targets. diff --git a/Help/variable/CMAKE_AUTOUIC_SEARCH_PATHS.rst b/Help/variable/CMAKE_AUTOUIC_SEARCH_PATHS.rst index aa132bf..0262368 100644 --- a/Help/variable/CMAKE_AUTOUIC_SEARCH_PATHS.rst +++ b/Help/variable/CMAKE_AUTOUIC_SEARCH_PATHS.rst @@ -1,6 +1,8 @@ CMAKE_AUTOUIC_SEARCH_PATHS -------------------------- +.. versionadded:: 3.9 + Search path list used by :variable:`CMAKE_AUTOUIC` to find included ``.ui`` files. diff --git a/Help/variable/CMAKE_BUILD_RPATH.rst b/Help/variable/CMAKE_BUILD_RPATH.rst index f5d53b8..7a8ace7 100644 --- a/Help/variable/CMAKE_BUILD_RPATH.rst +++ b/Help/variable/CMAKE_BUILD_RPATH.rst @@ -1,6 +1,8 @@ CMAKE_BUILD_RPATH ----------------- +.. versionadded:: 3.8 + :ref:`Semicolon-separated list <CMake Language Lists>` specifying runtime path (``RPATH``) entries to add to binaries linked in the build tree (for platforms that support it). The entries will *not* be used for binaries in the install diff --git a/Help/variable/CMAKE_BUILD_RPATH_USE_ORIGIN.rst b/Help/variable/CMAKE_BUILD_RPATH_USE_ORIGIN.rst index e34ede6..ecd9278 100644 --- a/Help/variable/CMAKE_BUILD_RPATH_USE_ORIGIN.rst +++ b/Help/variable/CMAKE_BUILD_RPATH_USE_ORIGIN.rst @@ -1,6 +1,8 @@ CMAKE_BUILD_RPATH_USE_ORIGIN ---------------------------- +.. versionadded:: 3.14 + Whether to use relative paths for the build ``RPATH``. This is used to initialize the :prop_tgt:`BUILD_RPATH_USE_ORIGIN` target diff --git a/Help/variable/CMAKE_BUILD_WITH_INSTALL_NAME_DIR.rst b/Help/variable/CMAKE_BUILD_WITH_INSTALL_NAME_DIR.rst index 30d5d3b..5ba775c 100644 --- a/Help/variable/CMAKE_BUILD_WITH_INSTALL_NAME_DIR.rst +++ b/Help/variable/CMAKE_BUILD_WITH_INSTALL_NAME_DIR.rst @@ -1,6 +1,8 @@ CMAKE_BUILD_WITH_INSTALL_NAME_DIR --------------------------------- +.. versionadded:: 3.9 + Whether to use :prop_tgt:`INSTALL_NAME_DIR` on targets in the build tree. This variable is used to initialize the :prop_tgt:`BUILD_WITH_INSTALL_NAME_DIR` diff --git a/Help/variable/CMAKE_CODEBLOCKS_COMPILER_ID.rst b/Help/variable/CMAKE_CODEBLOCKS_COMPILER_ID.rst index ad2709d..0b2b0a0 100644 --- a/Help/variable/CMAKE_CODEBLOCKS_COMPILER_ID.rst +++ b/Help/variable/CMAKE_CODEBLOCKS_COMPILER_ID.rst @@ -1,6 +1,8 @@ CMAKE_CODEBLOCKS_COMPILER_ID ---------------------------- +.. versionadded:: 3.11 + Change the compiler id in the generated CodeBlocks project files. CodeBlocks uses its own compiler id string which differs from diff --git a/Help/variable/CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES.rst b/Help/variable/CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES.rst index 80ffce3..dbb8606 100644 --- a/Help/variable/CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES.rst +++ b/Help/variable/CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES.rst @@ -1,6 +1,8 @@ CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES --------------------------------------- +.. versionadded:: 3.10 + Change the way the CodeBlocks generator creates project files. If this variable evaluates to ``ON`` the generator excludes from diff --git a/Help/variable/CMAKE_CODELITE_USE_TARGETS.rst b/Help/variable/CMAKE_CODELITE_USE_TARGETS.rst index 33cdf6c..21af5f7 100644 --- a/Help/variable/CMAKE_CODELITE_USE_TARGETS.rst +++ b/Help/variable/CMAKE_CODELITE_USE_TARGETS.rst @@ -1,6 +1,8 @@ CMAKE_CODELITE_USE_TARGETS -------------------------- +.. versionadded:: 3.7 + Change the way the CodeLite generator creates projectfiles. If this variable evaluates to ``ON`` at the end of the top-level diff --git a/Help/variable/CMAKE_COMPILER_IS_GNUCC.rst b/Help/variable/CMAKE_COMPILER_IS_GNUCC.rst index a40667e..91cf848 100644 --- a/Help/variable/CMAKE_COMPILER_IS_GNUCC.rst +++ b/Help/variable/CMAKE_COMPILER_IS_GNUCC.rst @@ -1,5 +1,7 @@ CMAKE_COMPILER_IS_GNUCC ----------------------- +.. versionadded:: 3.7 + True if the ``C`` compiler is GNU. Use :variable:`CMAKE_C_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` instead. diff --git a/Help/variable/CMAKE_COMPILER_IS_GNUCXX.rst b/Help/variable/CMAKE_COMPILER_IS_GNUCXX.rst index f1f5cf7..e67718a 100644 --- a/Help/variable/CMAKE_COMPILER_IS_GNUCXX.rst +++ b/Help/variable/CMAKE_COMPILER_IS_GNUCXX.rst @@ -1,5 +1,7 @@ CMAKE_COMPILER_IS_GNUCXX ------------------------ +.. versionadded:: 3.7 + True if the C++ (``CXX``) compiler is GNU. Use :variable:`CMAKE_CXX_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` instead. diff --git a/Help/variable/CMAKE_COMPILER_IS_GNUG77.rst b/Help/variable/CMAKE_COMPILER_IS_GNUG77.rst index 3d6dab4..f69c01a 100644 --- a/Help/variable/CMAKE_COMPILER_IS_GNUG77.rst +++ b/Help/variable/CMAKE_COMPILER_IS_GNUG77.rst @@ -1,5 +1,7 @@ CMAKE_COMPILER_IS_GNUG77 ------------------------ +.. versionadded:: 3.7 + True if the ``Fortran`` compiler is GNU. Use :variable:`CMAKE_Fortran_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` instead. diff --git a/Help/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY.rst b/Help/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY.rst index ea33c7d..11f52c7 100644 --- a/Help/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY.rst +++ b/Help/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY.rst @@ -1,6 +1,8 @@ CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ---------------------------------- +.. versionadded:: 3.1 + Output directory for MS debug symbol ``.pdb`` files generated by the compiler while building source files. diff --git a/Help/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst b/Help/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst index fdeb9ab..99d0bdc 100644 --- a/Help/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst +++ b/Help/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst @@ -1,6 +1,8 @@ CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG> ------------------------------------------- +.. versionadded:: 3.1 + Per-configuration output directory for MS debug symbol ``.pdb`` files generated by the compiler while building source files. diff --git a/Help/variable/CMAKE_CPACK_COMMAND.rst b/Help/variable/CMAKE_CPACK_COMMAND.rst index 559108a..3a81d68 100644 --- a/Help/variable/CMAKE_CPACK_COMMAND.rst +++ b/Help/variable/CMAKE_CPACK_COMMAND.rst @@ -1,6 +1,8 @@ CMAKE_CPACK_COMMAND ------------------- +.. versionadded:: 3.13 + Full path to :manual:`cpack(1)` command installed with CMake. This is the full path to the CPack executable :manual:`cpack(1)` which is diff --git a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst index 1d013b7..815da00 100644 --- a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst +++ b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst @@ -1,6 +1,8 @@ CMAKE_CROSSCOMPILING_EMULATOR ----------------------------- +.. versionadded:: 3.3 + This variable is only used when :variable:`CMAKE_CROSSCOMPILING` is on. It should point to a command on the host system that can run executable built for the target system. diff --git a/Help/variable/CMAKE_CROSS_CONFIGS.rst b/Help/variable/CMAKE_CROSS_CONFIGS.rst index 94157f3..be921d6 100644 --- a/Help/variable/CMAKE_CROSS_CONFIGS.rst +++ b/Help/variable/CMAKE_CROSS_CONFIGS.rst @@ -1,6 +1,8 @@ CMAKE_CROSS_CONFIGS ------------------- +.. versionadded:: 3.17 + Specifies a :ref:`semicolon-separated list <CMake Language Lists>` of configurations available from all ``build-<Config>.ninja`` files in the :generator:`Ninja Multi-Config` generator. This variable activates diff --git a/Help/variable/CMAKE_CTEST_ARGUMENTS.rst b/Help/variable/CMAKE_CTEST_ARGUMENTS.rst index 0940b46..4dfc8fe 100644 --- a/Help/variable/CMAKE_CTEST_ARGUMENTS.rst +++ b/Help/variable/CMAKE_CTEST_ARGUMENTS.rst @@ -1,6 +1,8 @@ CMAKE_CTEST_ARGUMENTS --------------------- +.. versionadded:: 3.17 + Set this to a :ref:`semicolon-separated list <CMake Language Lists>` of command-line arguments to pass to :manual:`ctest(1)` when running tests through the ``test`` (or ``RUN_TESTS``) target of the generated build system. diff --git a/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst b/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst index 149bffa..985040d 100644 --- a/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst +++ b/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst @@ -1,6 +1,8 @@ CMAKE_CUDA_ARCHITECTURES ------------------------ +.. versionadded:: 3.18 + Default value for :prop_tgt:`CUDA_ARCHITECTURES` property of targets. This is initialized as follows depending on :variable:`CMAKE_CUDA_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>`: diff --git a/Help/variable/CMAKE_CUDA_COMPILE_FEATURES.rst b/Help/variable/CMAKE_CUDA_COMPILE_FEATURES.rst index 2cd2650..c1c270c 100644 --- a/Help/variable/CMAKE_CUDA_COMPILE_FEATURES.rst +++ b/Help/variable/CMAKE_CUDA_COMPILE_FEATURES.rst @@ -1,6 +1,8 @@ CMAKE_CUDA_COMPILE_FEATURES --------------------------- +.. versionadded:: 3.17 + List of features known to the CUDA compiler These features are known to be available for use with the CUDA compiler. This diff --git a/Help/variable/CMAKE_CUDA_EXTENSIONS.rst b/Help/variable/CMAKE_CUDA_EXTENSIONS.rst index 4fe758e..b86c0ea 100644 --- a/Help/variable/CMAKE_CUDA_EXTENSIONS.rst +++ b/Help/variable/CMAKE_CUDA_EXTENSIONS.rst @@ -1,6 +1,8 @@ CMAKE_CUDA_EXTENSIONS --------------------- +.. versionadded:: 3.8 + Default value for :prop_tgt:`CUDA_EXTENSIONS` property of targets. This variable is used to initialize the :prop_tgt:`CUDA_EXTENSIONS` diff --git a/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst b/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst index 6d34c5c..34512b4 100644 --- a/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst +++ b/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst @@ -1,6 +1,8 @@ CMAKE_CUDA_HOST_COMPILER ------------------------ +.. versionadded:: 3.10 + Executable to use when compiling host code when compiling ``CUDA`` language files. Maps to the ``nvcc -ccbin`` option. Will only be used by CMake on the first configuration to determine a valid host compiler for ``CUDA``. After a valid diff --git a/Help/variable/CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS.rst b/Help/variable/CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS.rst index fc835cd..474baee 100644 --- a/Help/variable/CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS.rst +++ b/Help/variable/CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS.rst @@ -1,6 +1,8 @@ CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS --------------------------------- +.. versionadded:: 3.16 + Default value for :prop_tgt:`CUDA_RESOLVE_DEVICE_SYMBOLS` target property. This variable is used to initialize the property on each target as it is created. diff --git a/Help/variable/CMAKE_CUDA_RUNTIME_LIBRARY.rst b/Help/variable/CMAKE_CUDA_RUNTIME_LIBRARY.rst index e3205d3..69b9d93 100644 --- a/Help/variable/CMAKE_CUDA_RUNTIME_LIBRARY.rst +++ b/Help/variable/CMAKE_CUDA_RUNTIME_LIBRARY.rst @@ -1,6 +1,8 @@ CMAKE_CUDA_RUNTIME_LIBRARY -------------------------- +.. versionadded:: 3.17 + Select the CUDA runtime library for use when compiling and linking CUDA. This variable is used to initialize the :prop_tgt:`CUDA_RUNTIME_LIBRARY` property on all targets as they are created. diff --git a/Help/variable/CMAKE_CUDA_SEPARABLE_COMPILATION.rst b/Help/variable/CMAKE_CUDA_SEPARABLE_COMPILATION.rst index eef92fb..3dbaef9 100644 --- a/Help/variable/CMAKE_CUDA_SEPARABLE_COMPILATION.rst +++ b/Help/variable/CMAKE_CUDA_SEPARABLE_COMPILATION.rst @@ -1,6 +1,8 @@ CMAKE_CUDA_SEPARABLE_COMPILATION -------------------------------- +.. versionadded:: 3.11 + Default value for :prop_tgt:`CUDA_SEPARABLE_COMPILATION` target property. This variable is used to initialize the property on each target as it is created. diff --git a/Help/variable/CMAKE_CUDA_STANDARD.rst b/Help/variable/CMAKE_CUDA_STANDARD.rst index 6c23031..798ab1e 100644 --- a/Help/variable/CMAKE_CUDA_STANDARD.rst +++ b/Help/variable/CMAKE_CUDA_STANDARD.rst @@ -1,6 +1,8 @@ CMAKE_CUDA_STANDARD ------------------- +.. versionadded:: 3.8 + Default value for :prop_tgt:`CUDA_STANDARD` property of targets. This variable is used to initialize the :prop_tgt:`CUDA_STANDARD` diff --git a/Help/variable/CMAKE_CUDA_STANDARD_REQUIRED.rst b/Help/variable/CMAKE_CUDA_STANDARD_REQUIRED.rst index 935d605..ae2f52f 100644 --- a/Help/variable/CMAKE_CUDA_STANDARD_REQUIRED.rst +++ b/Help/variable/CMAKE_CUDA_STANDARD_REQUIRED.rst @@ -1,6 +1,8 @@ CMAKE_CUDA_STANDARD_REQUIRED ---------------------------- +.. versionadded:: 3.8 + Default value for :prop_tgt:`CUDA_STANDARD_REQUIRED` property of targets. This variable is used to initialize the :prop_tgt:`CUDA_STANDARD_REQUIRED` diff --git a/Help/variable/CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES.rst b/Help/variable/CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES.rst index 7de50a5..e586dab 100644 --- a/Help/variable/CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES.rst +++ b/Help/variable/CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES.rst @@ -1,6 +1,8 @@ CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES -------------------------------------- +.. versionadded:: 3.8 + When the ``CUDA`` language has been enabled, this provides a :ref:`semicolon-separated list <CMake Language Lists>` of include directories provided by the CUDA Toolkit. The value may be useful for C++ source files diff --git a/Help/variable/CMAKE_CURRENT_FUNCTION.rst b/Help/variable/CMAKE_CURRENT_FUNCTION.rst index fb7f610..5d1a4e9 100644 --- a/Help/variable/CMAKE_CURRENT_FUNCTION.rst +++ b/Help/variable/CMAKE_CURRENT_FUNCTION.rst @@ -1,6 +1,8 @@ CMAKE_CURRENT_FUNCTION ---------------------- +.. versionadded:: 3.17 + When executing code inside a :command:`function`, this variable contains the name of the current function. It can be useful for diagnostic or debug messages. diff --git a/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_DIR.rst b/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_DIR.rst index 44ae1e5..f8f553d 100644 --- a/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_DIR.rst +++ b/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_DIR.rst @@ -1,6 +1,8 @@ CMAKE_CURRENT_FUNCTION_LIST_DIR ------------------------------- +.. versionadded:: 3.17 + When executing code inside a :command:`function`, this variable contains the full directory of the listfile that defined the current function. diff --git a/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_FILE.rst b/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_FILE.rst index c737af9..437dfec 100644 --- a/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_FILE.rst +++ b/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_FILE.rst @@ -1,6 +1,8 @@ CMAKE_CURRENT_FUNCTION_LIST_FILE -------------------------------- +.. versionadded:: 3.17 + When executing code inside a :command:`function`, this variable contains the full path to the listfile that defined the current function. diff --git a/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_LINE.rst b/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_LINE.rst index ad6282e..2fc7012 100644 --- a/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_LINE.rst +++ b/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_LINE.rst @@ -1,6 +1,8 @@ CMAKE_CURRENT_FUNCTION_LIST_LINE -------------------------------- +.. versionadded:: 3.17 + When executing code inside a :command:`function`, this variable contains the line number in the listfile where the current function was defined. diff --git a/Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst b/Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst index 5c59f95..8fcfbae 100644 --- a/Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst +++ b/Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst @@ -1,6 +1,8 @@ CMAKE_CXX_COMPILE_FEATURES -------------------------- +.. versionadded:: 3.1 + List of features known to the C++ compiler These features are known to be available for use with the C++ compiler. This diff --git a/Help/variable/CMAKE_CXX_EXTENSIONS.rst b/Help/variable/CMAKE_CXX_EXTENSIONS.rst index 4a92425..ea8c4be 100644 --- a/Help/variable/CMAKE_CXX_EXTENSIONS.rst +++ b/Help/variable/CMAKE_CXX_EXTENSIONS.rst @@ -1,6 +1,8 @@ CMAKE_CXX_EXTENSIONS -------------------- +.. versionadded:: 3.1 + Default value for :prop_tgt:`CXX_EXTENSIONS` property of targets. This variable is used to initialize the :prop_tgt:`CXX_EXTENSIONS` diff --git a/Help/variable/CMAKE_CXX_STANDARD.rst b/Help/variable/CMAKE_CXX_STANDARD.rst index 8a8bdff..8ef8c80 100644 --- a/Help/variable/CMAKE_CXX_STANDARD.rst +++ b/Help/variable/CMAKE_CXX_STANDARD.rst @@ -1,6 +1,8 @@ CMAKE_CXX_STANDARD ------------------ +.. versionadded:: 3.1 + Default value for :prop_tgt:`CXX_STANDARD` property of targets. This variable is used to initialize the :prop_tgt:`CXX_STANDARD` diff --git a/Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst b/Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst index 4c71058..f7b2ae9 100644 --- a/Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst +++ b/Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst @@ -1,6 +1,8 @@ CMAKE_CXX_STANDARD_REQUIRED --------------------------- +.. versionadded:: 3.1 + Default value for :prop_tgt:`CXX_STANDARD_REQUIRED` property of targets. This variable is used to initialize the :prop_tgt:`CXX_STANDARD_REQUIRED` diff --git a/Help/variable/CMAKE_C_COMPILE_FEATURES.rst b/Help/variable/CMAKE_C_COMPILE_FEATURES.rst index 8d1eca0..2b306a3 100644 --- a/Help/variable/CMAKE_C_COMPILE_FEATURES.rst +++ b/Help/variable/CMAKE_C_COMPILE_FEATURES.rst @@ -1,6 +1,8 @@ CMAKE_C_COMPILE_FEATURES ------------------------ +.. versionadded:: 3.1 + List of features known to the C compiler These features are known to be available for use with the C compiler. This diff --git a/Help/variable/CMAKE_C_EXTENSIONS.rst b/Help/variable/CMAKE_C_EXTENSIONS.rst index fa510d4..fce8fc7 100644 --- a/Help/variable/CMAKE_C_EXTENSIONS.rst +++ b/Help/variable/CMAKE_C_EXTENSIONS.rst @@ -1,6 +1,8 @@ CMAKE_C_EXTENSIONS ------------------ +.. versionadded:: 3.1 + Default value for :prop_tgt:`C_EXTENSIONS` property of targets. This variable is used to initialize the :prop_tgt:`C_EXTENSIONS` diff --git a/Help/variable/CMAKE_C_STANDARD.rst b/Help/variable/CMAKE_C_STANDARD.rst index b55e00c..64ef8ce 100644 --- a/Help/variable/CMAKE_C_STANDARD.rst +++ b/Help/variable/CMAKE_C_STANDARD.rst @@ -1,6 +1,8 @@ CMAKE_C_STANDARD ---------------- +.. versionadded:: 3.1 + Default value for :prop_tgt:`C_STANDARD` property of targets. This variable is used to initialize the :prop_tgt:`C_STANDARD` diff --git a/Help/variable/CMAKE_C_STANDARD_REQUIRED.rst b/Help/variable/CMAKE_C_STANDARD_REQUIRED.rst index 7f70f6e..e70b6bd 100644 --- a/Help/variable/CMAKE_C_STANDARD_REQUIRED.rst +++ b/Help/variable/CMAKE_C_STANDARD_REQUIRED.rst @@ -1,6 +1,8 @@ CMAKE_C_STANDARD_REQUIRED ------------------------- +.. versionadded:: 3.1 + Default value for :prop_tgt:`C_STANDARD_REQUIRED` property of targets. This variable is used to initialize the :prop_tgt:`C_STANDARD_REQUIRED` diff --git a/Help/variable/CMAKE_DEFAULT_BUILD_TYPE.rst b/Help/variable/CMAKE_DEFAULT_BUILD_TYPE.rst index aa4f82d..cadbf3a 100644 --- a/Help/variable/CMAKE_DEFAULT_BUILD_TYPE.rst +++ b/Help/variable/CMAKE_DEFAULT_BUILD_TYPE.rst @@ -1,6 +1,8 @@ CMAKE_DEFAULT_BUILD_TYPE ------------------------ +.. versionadded:: 3.17 + Specifies the configuration to use by default in a ``build.ninja`` file in the :generator:`Ninja Multi-Config` generator. If this variable is specified, ``build.ninja`` uses build rules from ``build-<Config>.ninja`` by default. All diff --git a/Help/variable/CMAKE_DEFAULT_CONFIGS.rst b/Help/variable/CMAKE_DEFAULT_CONFIGS.rst index 84c642a..65a5f0d 100644 --- a/Help/variable/CMAKE_DEFAULT_CONFIGS.rst +++ b/Help/variable/CMAKE_DEFAULT_CONFIGS.rst @@ -1,6 +1,8 @@ CMAKE_DEFAULT_CONFIGS --------------------- +.. versionadded:: 3.17 + Specifies a :ref:`semicolon-separated list <CMake Language Lists>` of configurations to build for a target in ``build.ninja`` if no ``:<Config>`` suffix is specified in the :generator:`Ninja Multi-Config` generator. If it is set to ``all``, all diff --git a/Help/variable/CMAKE_DEPENDS_IN_PROJECT_ONLY.rst b/Help/variable/CMAKE_DEPENDS_IN_PROJECT_ONLY.rst index 7179071..bfe9402 100644 --- a/Help/variable/CMAKE_DEPENDS_IN_PROJECT_ONLY.rst +++ b/Help/variable/CMAKE_DEPENDS_IN_PROJECT_ONLY.rst @@ -1,6 +1,8 @@ CMAKE_DEPENDS_IN_PROJECT_ONLY ----------------------------- +.. versionadded:: 3.6 + When set to ``TRUE`` in a directory, the build system produced by the :ref:`Makefile Generators` is set up to only consider dependencies on source files that appear either in the source or in the binary directories. Changes diff --git a/Help/variable/CMAKE_DIRECTORY_LABELS.rst b/Help/variable/CMAKE_DIRECTORY_LABELS.rst index 2a6c410..81d6dd1 100644 --- a/Help/variable/CMAKE_DIRECTORY_LABELS.rst +++ b/Help/variable/CMAKE_DIRECTORY_LABELS.rst @@ -1,6 +1,8 @@ CMAKE_DIRECTORY_LABELS ----------------------- +.. versionadded:: 3.10 + Specify labels for the current directory. This is used to initialize the :prop_dir:`LABELS` directory property. diff --git a/Help/variable/CMAKE_DISABLE_PRECOMPILE_HEADERS.rst b/Help/variable/CMAKE_DISABLE_PRECOMPILE_HEADERS.rst index 7c30ede..cf52776 100644 --- a/Help/variable/CMAKE_DISABLE_PRECOMPILE_HEADERS.rst +++ b/Help/variable/CMAKE_DISABLE_PRECOMPILE_HEADERS.rst @@ -1,6 +1,8 @@ CMAKE_DISABLE_PRECOMPILE_HEADERS -------------------------------- +.. versionadded:: 3.16 + Default value for :prop_tgt:`DISABLE_PRECOMPILE_HEADERS` of targets. By default ``CMAKE_DISABLE_PRECOMPILE_HEADERS`` is ``OFF``. diff --git a/Help/variable/CMAKE_DOTNET_TARGET_FRAMEWORK.rst b/Help/variable/CMAKE_DOTNET_TARGET_FRAMEWORK.rst index 8edcd1e..29249d6 100644 --- a/Help/variable/CMAKE_DOTNET_TARGET_FRAMEWORK.rst +++ b/Help/variable/CMAKE_DOTNET_TARGET_FRAMEWORK.rst @@ -1,6 +1,8 @@ CMAKE_DOTNET_TARGET_FRAMEWORK ----------------------------- +.. versionadded:: 3.17 + Default value for :prop_tgt:`DOTNET_TARGET_FRAMEWORK` property of targets. diff --git a/Help/variable/CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION.rst b/Help/variable/CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION.rst index c2eef9e..fc3c360 100644 --- a/Help/variable/CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION.rst +++ b/Help/variable/CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION.rst @@ -1,6 +1,8 @@ CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION ------------------------------------- +.. versionadded:: 3.12 + Default value for :prop_tgt:`DOTNET_TARGET_FRAMEWORK_VERSION` property of targets. diff --git a/Help/variable/CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES.rst b/Help/variable/CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES.rst index 331aae8..548c563 100644 --- a/Help/variable/CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES.rst +++ b/Help/variable/CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES.rst @@ -1,6 +1,8 @@ CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES --------------------------------------- +.. versionadded:: 3.6 + This cache variable is used by the Eclipse project generator. See :manual:`cmake-generators(7)`. diff --git a/Help/variable/CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT.rst b/Help/variable/CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT.rst index 7b4367d..fc28ebb 100644 --- a/Help/variable/CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT.rst +++ b/Help/variable/CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT.rst @@ -1,6 +1,8 @@ CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT ------------------------------------- +.. versionadded:: 3.6 + This cache variable is used by the Eclipse project generator. See :manual:`cmake-generators(7)`. diff --git a/Help/variable/CMAKE_ECLIPSE_MAKE_ARGUMENTS.rst b/Help/variable/CMAKE_ECLIPSE_MAKE_ARGUMENTS.rst index 6e8a408..90e36f5 100644 --- a/Help/variable/CMAKE_ECLIPSE_MAKE_ARGUMENTS.rst +++ b/Help/variable/CMAKE_ECLIPSE_MAKE_ARGUMENTS.rst @@ -1,6 +1,8 @@ CMAKE_ECLIPSE_MAKE_ARGUMENTS ---------------------------- +.. versionadded:: 3.6 + This cache variable is used by the Eclipse project generator. See :manual:`cmake-generators(7)`. diff --git a/Help/variable/CMAKE_ECLIPSE_RESOURCE_ENCODING.rst b/Help/variable/CMAKE_ECLIPSE_RESOURCE_ENCODING.rst index 314efe5..492acd8 100644 --- a/Help/variable/CMAKE_ECLIPSE_RESOURCE_ENCODING.rst +++ b/Help/variable/CMAKE_ECLIPSE_RESOURCE_ENCODING.rst @@ -1,6 +1,8 @@ CMAKE_ECLIPSE_RESOURCE_ENCODING ------------------------------- +.. versionadded:: 3.16 + This cache variable tells the :generator:`Eclipse CDT4` project generator to set the resource encoding to the given value in generated project files. If no value is given, no encoding will be set. diff --git a/Help/variable/CMAKE_ECLIPSE_VERSION.rst b/Help/variable/CMAKE_ECLIPSE_VERSION.rst index 8cc7882..db65d89 100644 --- a/Help/variable/CMAKE_ECLIPSE_VERSION.rst +++ b/Help/variable/CMAKE_ECLIPSE_VERSION.rst @@ -1,6 +1,8 @@ CMAKE_ECLIPSE_VERSION --------------------- +.. versionadded:: 3.6 + This cache variable is used by the Eclipse project generator. See :manual:`cmake-generators(7)`. diff --git a/Help/variable/CMAKE_ENABLE_EXPORTS.rst b/Help/variable/CMAKE_ENABLE_EXPORTS.rst index 8848da1..9f43de3 100644 --- a/Help/variable/CMAKE_ENABLE_EXPORTS.rst +++ b/Help/variable/CMAKE_ENABLE_EXPORTS.rst @@ -1,6 +1,8 @@ CMAKE_ENABLE_EXPORTS -------------------- +.. versionadded:: 3.4 + Specify whether executables export symbols for loadable modules. This variable is used to initialize the :prop_tgt:`ENABLE_EXPORTS` target diff --git a/Help/variable/CMAKE_EXECUTE_PROCESS_COMMAND_ECHO.rst b/Help/variable/CMAKE_EXECUTE_PROCESS_COMMAND_ECHO.rst index 76561d8..90a16c3 100644 --- a/Help/variable/CMAKE_EXECUTE_PROCESS_COMMAND_ECHO.rst +++ b/Help/variable/CMAKE_EXECUTE_PROCESS_COMMAND_ECHO.rst @@ -1,6 +1,8 @@ CMAKE_EXECUTE_PROCESS_COMMAND_ECHO ---------------------------------- +.. versionadded:: 3.15 + If this variable is set to ``STDERR``, ``STDOUT`` or ``NONE`` then commands in :command:`execute_process` calls will be printed to either stderr or stdout or not at all. diff --git a/Help/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG_INIT.rst b/Help/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG_INIT.rst index 592a369..4d2718a 100644 --- a/Help/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG_INIT.rst +++ b/Help/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG_INIT.rst @@ -1,6 +1,8 @@ CMAKE_EXE_LINKER_FLAGS_<CONFIG>_INIT ------------------------------------ +.. versionadded:: 3.7 + Value used to initialize the :variable:`CMAKE_EXE_LINKER_FLAGS_<CONFIG>` cache entry the first time a build tree is configured. This variable is meant to be set by a :variable:`toolchain file diff --git a/Help/variable/CMAKE_EXE_LINKER_FLAGS_INIT.rst b/Help/variable/CMAKE_EXE_LINKER_FLAGS_INIT.rst index 0b8afe4..6e3927c 100644 --- a/Help/variable/CMAKE_EXE_LINKER_FLAGS_INIT.rst +++ b/Help/variable/CMAKE_EXE_LINKER_FLAGS_INIT.rst @@ -1,6 +1,8 @@ CMAKE_EXE_LINKER_FLAGS_INIT --------------------------- +.. versionadded:: 3.7 + Value used to initialize the :variable:`CMAKE_EXE_LINKER_FLAGS` cache entry the first time a build tree is configured. This variable is meant to be set by a :variable:`toolchain file diff --git a/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst b/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst index 6d2450b..724f309 100644 --- a/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst +++ b/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst @@ -1,6 +1,8 @@ CMAKE_EXPORT_COMPILE_COMMANDS ----------------------------- +.. versionadded:: 3.5 + Enable/Disable output of compile commands during generation. If enabled, generates a ``compile_commands.json`` file containing the exact diff --git a/Help/variable/CMAKE_EXPORT_NO_PACKAGE_REGISTRY.rst b/Help/variable/CMAKE_EXPORT_NO_PACKAGE_REGISTRY.rst index 768ed64..5772490 100644 --- a/Help/variable/CMAKE_EXPORT_NO_PACKAGE_REGISTRY.rst +++ b/Help/variable/CMAKE_EXPORT_NO_PACKAGE_REGISTRY.rst @@ -1,6 +1,8 @@ CMAKE_EXPORT_NO_PACKAGE_REGISTRY -------------------------------- +.. versionadded:: 3.1 + Disable the :command:`export(PACKAGE)` command when :policy:`CMP0090` is not set to ``NEW``. diff --git a/Help/variable/CMAKE_EXPORT_PACKAGE_REGISTRY.rst b/Help/variable/CMAKE_EXPORT_PACKAGE_REGISTRY.rst index 3476a19..663639b 100644 --- a/Help/variable/CMAKE_EXPORT_PACKAGE_REGISTRY.rst +++ b/Help/variable/CMAKE_EXPORT_PACKAGE_REGISTRY.rst @@ -1,6 +1,8 @@ CMAKE_EXPORT_PACKAGE_REGISTRY ----------------------------- +.. versionadded:: 3.15 + Enables the :command:`export(PACKAGE)` command when :policy:`CMP0090` is set to ``NEW``. diff --git a/Help/variable/CMAKE_FIND_APPBUNDLE.rst b/Help/variable/CMAKE_FIND_APPBUNDLE.rst index 7a05fac..17563f3 100644 --- a/Help/variable/CMAKE_FIND_APPBUNDLE.rst +++ b/Help/variable/CMAKE_FIND_APPBUNDLE.rst @@ -1,6 +1,8 @@ CMAKE_FIND_APPBUNDLE -------------------- +.. versionadded:: 3.4 + This variable affects how ``find_*`` commands choose between macOS Application Bundles and unix-style package components. diff --git a/Help/variable/CMAKE_FIND_DEBUG_MODE.rst b/Help/variable/CMAKE_FIND_DEBUG_MODE.rst index f5fd8ce..8f2a82f 100644 --- a/Help/variable/CMAKE_FIND_DEBUG_MODE.rst +++ b/Help/variable/CMAKE_FIND_DEBUG_MODE.rst @@ -1,6 +1,8 @@ CMAKE_FIND_DEBUG_MODE --------------------- +.. versionadded:: 3.17 + Print extra find call information for the following commands to standard error: diff --git a/Help/variable/CMAKE_FIND_FRAMEWORK.rst b/Help/variable/CMAKE_FIND_FRAMEWORK.rst index 4d5078f..3b62cda 100644 --- a/Help/variable/CMAKE_FIND_FRAMEWORK.rst +++ b/Help/variable/CMAKE_FIND_FRAMEWORK.rst @@ -1,6 +1,8 @@ CMAKE_FIND_FRAMEWORK -------------------- +.. versionadded:: 3.4 + This variable affects how ``find_*`` commands choose between macOS Frameworks and unix-style package components. diff --git a/Help/variable/CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX.rst b/Help/variable/CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX.rst index ada8955..ca2ad7f 100644 --- a/Help/variable/CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX.rst +++ b/Help/variable/CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX.rst @@ -1,6 +1,8 @@ CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX ------------------------------------ +.. versionadded:: 3.9 + Specify a ``<suffix>`` to tell the :command:`find_library` command to search in a ``lib<suffix>`` directory before each ``lib`` directory that would normally be searched. diff --git a/Help/variable/CMAKE_FIND_PACKAGE_NAME.rst b/Help/variable/CMAKE_FIND_PACKAGE_NAME.rst index bd1a30f..fc1fd43 100644 --- a/Help/variable/CMAKE_FIND_PACKAGE_NAME.rst +++ b/Help/variable/CMAKE_FIND_PACKAGE_NAME.rst @@ -1,6 +1,8 @@ CMAKE_FIND_PACKAGE_NAME ----------------------- +.. versionadded:: 3.1.1 + Defined by the :command:`find_package` command while loading a find module to record the caller-specified package name. See command documentation for details. diff --git a/Help/variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY.rst b/Help/variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY.rst index 4ee9d8b..8d86a94 100644 --- a/Help/variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY.rst +++ b/Help/variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY.rst @@ -1,6 +1,8 @@ CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY -------------------------------------- +.. versionadded:: 3.1 + .. deprecated:: 3.16 Use the :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY` variable instead. diff --git a/Help/variable/CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY.rst b/Help/variable/CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY.rst index 107c183..cc67f08 100644 --- a/Help/variable/CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY.rst +++ b/Help/variable/CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY.rst @@ -1,6 +1,8 @@ CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY --------------------------------------------- +.. versionadded:: 3.1 + .. deprecated:: 3.16 Use the :variable:`CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY` variable instead. diff --git a/Help/variable/CMAKE_FIND_PACKAGE_PREFER_CONFIG.rst b/Help/variable/CMAKE_FIND_PACKAGE_PREFER_CONFIG.rst index db658a1..ba81529 100644 --- a/Help/variable/CMAKE_FIND_PACKAGE_PREFER_CONFIG.rst +++ b/Help/variable/CMAKE_FIND_PACKAGE_PREFER_CONFIG.rst @@ -1,6 +1,8 @@ CMAKE_FIND_PACKAGE_PREFER_CONFIG --------------------------------- +.. versionadded:: 3.15 + Tell :command:`find_package` to try "Config" mode before "Module" mode if no mode was specified. diff --git a/Help/variable/CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS.rst b/Help/variable/CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS.rst index dfbde20..86d75e7 100644 --- a/Help/variable/CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS.rst +++ b/Help/variable/CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS.rst @@ -1,6 +1,8 @@ CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS ----------------------------------- +.. versionadded:: 3.14 + Set to ``TRUE`` to tell :command:`find_package` calls to resolve symbolic links in the value of ``<PackageName>_DIR``. diff --git a/Help/variable/CMAKE_FIND_PACKAGE_SORT_DIRECTION.rst b/Help/variable/CMAKE_FIND_PACKAGE_SORT_DIRECTION.rst index 99e4ec1..98c2a8f 100644 --- a/Help/variable/CMAKE_FIND_PACKAGE_SORT_DIRECTION.rst +++ b/Help/variable/CMAKE_FIND_PACKAGE_SORT_DIRECTION.rst @@ -1,6 +1,8 @@ CMAKE_FIND_PACKAGE_SORT_DIRECTION --------------------------------- +.. versionadded:: 3.7 + The sorting direction used by :variable:`CMAKE_FIND_PACKAGE_SORT_ORDER`. It can assume one of the following values: diff --git a/Help/variable/CMAKE_FIND_PACKAGE_SORT_ORDER.rst b/Help/variable/CMAKE_FIND_PACKAGE_SORT_ORDER.rst index ba5f3a8..1725ba1 100644 --- a/Help/variable/CMAKE_FIND_PACKAGE_SORT_ORDER.rst +++ b/Help/variable/CMAKE_FIND_PACKAGE_SORT_ORDER.rst @@ -1,6 +1,8 @@ CMAKE_FIND_PACKAGE_SORT_ORDER ----------------------------- +.. versionadded:: 3.7 + The default order for sorting packages found using :command:`find_package`. It can assume one of the following values: diff --git a/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst b/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst index 957e956..de1bad7 100644 --- a/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst +++ b/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst @@ -1,6 +1,8 @@ CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH ------------------------------------- +.. versionadded:: 3.16 + Controls the default behavior of the following commands for whether or not to search paths provided by cmake-specific environment variables: diff --git a/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst b/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst index d2bdb09..47ce3a3 100644 --- a/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst +++ b/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst @@ -1,6 +1,8 @@ CMAKE_FIND_USE_CMAKE_PATH ------------------------- +.. versionadded:: 3.16 + Controls the default behavior of the following commands for whether or not to search paths provided by cmake-specific cache variables: diff --git a/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst b/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst index b99081d..2fd00df 100644 --- a/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst +++ b/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst @@ -1,6 +1,8 @@ CMAKE_FIND_USE_CMAKE_SYSTEM_PATH -------------------------------- +.. versionadded:: 3.16 + Controls the default behavior of the following commands for whether or not to search paths provided by platform-specific cmake variables: diff --git a/Help/variable/CMAKE_FIND_USE_PACKAGE_REGISTRY.rst b/Help/variable/CMAKE_FIND_USE_PACKAGE_REGISTRY.rst index 7c7ca36..3127206 100644 --- a/Help/variable/CMAKE_FIND_USE_PACKAGE_REGISTRY.rst +++ b/Help/variable/CMAKE_FIND_USE_PACKAGE_REGISTRY.rst @@ -1,6 +1,8 @@ CMAKE_FIND_USE_PACKAGE_REGISTRY ------------------------------- +.. versionadded:: 3.16 + Controls the default behavior of the :command:`find_package` command for whether or not to search paths provided by the :ref:`User Package Registry`. diff --git a/Help/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.rst b/Help/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.rst index e7f5b0f..64e5c6d 100644 --- a/Help/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.rst +++ b/Help/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.rst @@ -1,6 +1,8 @@ CMAKE_FIND_USE_PACKAGE_ROOT_PATH -------------------------------- +.. versionadded:: 3.16 + Controls the default behavior of the following commands for whether or not to search paths provided by :variable:`<PackageName>_ROOT` variables: diff --git a/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst b/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst index fbaba5a..a0a86e4 100644 --- a/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst +++ b/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst @@ -1,6 +1,8 @@ CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH -------------------------------------- +.. versionadded:: 3.16 + Controls the default behavior of the following commands for whether or not to search paths provided by standard system environment variables: diff --git a/Help/variable/CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY.rst b/Help/variable/CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY.rst index cb4eec5..504b7e8 100644 --- a/Help/variable/CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY.rst +++ b/Help/variable/CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY.rst @@ -1,6 +1,8 @@ CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY -------------------------------------- +.. versionadded:: 3.16 + Controls searching the :ref:`System Package Registry` by the :command:`find_package` command. diff --git a/Help/variable/CMAKE_FOLDER.rst b/Help/variable/CMAKE_FOLDER.rst index 50a2b88..37f137c 100644 --- a/Help/variable/CMAKE_FOLDER.rst +++ b/Help/variable/CMAKE_FOLDER.rst @@ -1,6 +1,8 @@ CMAKE_FOLDER ------------ +.. versionadded:: 3.12 + Set the folder name. Use to organize targets in an IDE. This variable is used to initialize the :prop_tgt:`FOLDER` property on all the diff --git a/Help/variable/CMAKE_FRAMEWORK.rst b/Help/variable/CMAKE_FRAMEWORK.rst index 591041c..37385bf 100644 --- a/Help/variable/CMAKE_FRAMEWORK.rst +++ b/Help/variable/CMAKE_FRAMEWORK.rst @@ -1,6 +1,8 @@ CMAKE_FRAMEWORK --------------- +.. versionadded:: 3.15 + Default value for :prop_tgt:`FRAMEWORK` of targets. This variable is used to initialize the :prop_tgt:`FRAMEWORK` property on diff --git a/Help/variable/CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst b/Help/variable/CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst index 5c7cd23..47fb66e 100644 --- a/Help/variable/CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst +++ b/Help/variable/CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst @@ -1,6 +1,8 @@ CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG> --------------------------------------------- +.. versionadded:: 3.18 + Default framework filename postfix under configuration ``<CONFIG>`` when using a multi-config generator. diff --git a/Help/variable/CMAKE_Fortran_PREPROCESS.rst b/Help/variable/CMAKE_Fortran_PREPROCESS.rst index 74b2d8b..7d405f3 100644 --- a/Help/variable/CMAKE_Fortran_PREPROCESS.rst +++ b/Help/variable/CMAKE_Fortran_PREPROCESS.rst @@ -1,6 +1,8 @@ CMAKE_Fortran_PREPROCESS ------------------------ +.. versionadded:: 3.18 + Default value for :prop_tgt:`Fortran_PREPROCESS` of targets. This variable is used to initialize the :prop_tgt:`Fortran_PREPROCESS` diff --git a/Help/variable/CMAKE_GENERATOR_INSTANCE.rst b/Help/variable/CMAKE_GENERATOR_INSTANCE.rst index 3657ed4..5858d7a 100644 --- a/Help/variable/CMAKE_GENERATOR_INSTANCE.rst +++ b/Help/variable/CMAKE_GENERATOR_INSTANCE.rst @@ -1,6 +1,8 @@ CMAKE_GENERATOR_INSTANCE ------------------------ +.. versionadded:: 3.11 + Generator-specific instance specification provided by user. Some CMake generators support selection of an instance of the native build diff --git a/Help/variable/CMAKE_GENERATOR_PLATFORM.rst b/Help/variable/CMAKE_GENERATOR_PLATFORM.rst index 2c115a3..b17d83a 100644 --- a/Help/variable/CMAKE_GENERATOR_PLATFORM.rst +++ b/Help/variable/CMAKE_GENERATOR_PLATFORM.rst @@ -1,6 +1,8 @@ CMAKE_GENERATOR_PLATFORM ------------------------ +.. versionadded:: 3.1 + Generator-specific target platform specification provided by user. Some CMake generators support a target platform name to be given diff --git a/Help/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE.rst b/Help/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE.rst index b6768a1..0e8ae5e 100644 --- a/Help/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE.rst +++ b/Help/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE.rst @@ -1,6 +1,8 @@ CMAKE_GHS_NO_SOURCE_GROUP_FILE ------------------------------ +.. versionadded:: 3.14 + ``ON`` / ``OFF`` boolean to control if the project file for a target should be one single file or multiple files. Refer to :prop_tgt:`GHS_NO_SOURCE_GROUP_FILE` for further details. diff --git a/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst index 8587742..96e9907 100644 --- a/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst +++ b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst @@ -1,6 +1,8 @@ CMAKE_GLOBAL_AUTOGEN_TARGET --------------------------- +.. versionadded:: 3.14 + Switch to enable generation of a global ``autogen`` target. When :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET` is enabled, a custom target diff --git a/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.rst b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.rst index c86a5d0..4af4bc3 100644 --- a/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.rst +++ b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.rst @@ -1,6 +1,8 @@ CMAKE_GLOBAL_AUTOGEN_TARGET_NAME -------------------------------- +.. versionadded:: 3.14 + Change the name of the global ``autogen`` target. When :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET` is enabled, a global custom target diff --git a/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET.rst b/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET.rst index f92128c..efea5be 100644 --- a/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET.rst +++ b/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET.rst @@ -1,6 +1,8 @@ CMAKE_GLOBAL_AUTORCC_TARGET --------------------------- +.. versionadded:: 3.14 + Switch to enable generation of a global ``autorcc`` target. When :variable:`CMAKE_GLOBAL_AUTORCC_TARGET` is enabled, a custom target diff --git a/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME.rst b/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME.rst index c6e05de..4d2e313 100644 --- a/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME.rst +++ b/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME.rst @@ -1,6 +1,8 @@ CMAKE_GLOBAL_AUTORCC_TARGET_NAME -------------------------------- +.. versionadded:: 3.14 + Change the name of the global ``autorcc`` target. When :variable:`CMAKE_GLOBAL_AUTORCC_TARGET` is enabled, a global custom target diff --git a/Help/variable/CMAKE_HOST_SOLARIS.rst b/Help/variable/CMAKE_HOST_SOLARIS.rst index 82b5d69..7054acd 100644 --- a/Help/variable/CMAKE_HOST_SOLARIS.rst +++ b/Help/variable/CMAKE_HOST_SOLARIS.rst @@ -1,6 +1,8 @@ CMAKE_HOST_SOLARIS ------------------ +.. versionadded:: 3.6 + ``True`` for Oracle Solaris operating systems. Set to ``true`` when the host system is Oracle Solaris. diff --git a/Help/variable/CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS.rst b/Help/variable/CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS.rst index f994fbe..aad99e4 100644 --- a/Help/variable/CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS.rst +++ b/Help/variable/CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS.rst @@ -1,6 +1,8 @@ CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS ------------------------------------------- +.. versionadded:: 3.11 + Default permissions for directories created implicitly during installation of files by :command:`install` and :command:`file(INSTALL)`. diff --git a/Help/variable/CMAKE_INSTALL_MESSAGE.rst b/Help/variable/CMAKE_INSTALL_MESSAGE.rst index 304df26..4f39cfe 100644 --- a/Help/variable/CMAKE_INSTALL_MESSAGE.rst +++ b/Help/variable/CMAKE_INSTALL_MESSAGE.rst @@ -1,6 +1,8 @@ CMAKE_INSTALL_MESSAGE --------------------- +.. versionadded:: 3.1 + Specify verbosity of installation script code generated by the :command:`install` command (using the :command:`file(INSTALL)` command). For paths that are newly installed or updated, installation diff --git a/Help/variable/CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT.rst b/Help/variable/CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT.rst index 2a5842d..93cc319 100644 --- a/Help/variable/CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT.rst +++ b/Help/variable/CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT.rst @@ -1,6 +1,8 @@ CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT ------------------------------------------- +.. versionadded:: 3.7.1 + CMake sets this variable to a ``TRUE`` value when the :variable:`CMAKE_INSTALL_PREFIX` has just been initialized to its default value, typically on the first run of CMake within diff --git a/Help/variable/CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH.rst b/Help/variable/CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH.rst index 76ca3da..c86e433 100644 --- a/Help/variable/CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH.rst +++ b/Help/variable/CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH.rst @@ -1,6 +1,8 @@ CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH -------------------------------------- +.. versionadded:: 3.16 + Sets the default for whether toolchain-defined rpaths should be removed during installation. diff --git a/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION.rst b/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION.rst index b0cbb62..cf7da76 100644 --- a/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION.rst +++ b/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION.rst @@ -1,6 +1,8 @@ CMAKE_INTERPROCEDURAL_OPTIMIZATION ---------------------------------- +.. versionadded:: 3.9 + Default value for :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION` of targets. This variable is used to initialize the :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION` diff --git a/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst b/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst index b291102..5b3ee77 100644 --- a/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst +++ b/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst @@ -1,6 +1,8 @@ CMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG> ------------------------------------------- +.. versionadded:: 3.9 + Default value for :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION_<CONFIG>` of targets. This variable is used to initialize the :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION_<CONFIG>` diff --git a/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst b/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst index c5cb9b6..cd7fd8d 100644 --- a/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst +++ b/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst @@ -1,6 +1,8 @@ CMAKE_IOS_INSTALL_COMBINED -------------------------- +.. versionadded:: 3.5 + Default value for :prop_tgt:`IOS_INSTALL_COMBINED` of targets. This variable is used to initialize the :prop_tgt:`IOS_INSTALL_COMBINED` diff --git a/Help/variable/CMAKE_JOB_POOLS.rst b/Help/variable/CMAKE_JOB_POOLS.rst index 72b50b4..43d3c84 100644 --- a/Help/variable/CMAKE_JOB_POOLS.rst +++ b/Help/variable/CMAKE_JOB_POOLS.rst @@ -1,6 +1,8 @@ CMAKE_JOB_POOLS --------------- +.. versionadded:: 3.11 + If the :prop_gbl:`JOB_POOLS` global property is not set, the value of this variable is used in its place. See :prop_gbl:`JOB_POOLS` for additional information. diff --git a/Help/variable/CMAKE_JOB_POOL_PRECOMPILE_HEADER.rst b/Help/variable/CMAKE_JOB_POOL_PRECOMPILE_HEADER.rst index f9467b3..1a6f66a 100644 --- a/Help/variable/CMAKE_JOB_POOL_PRECOMPILE_HEADER.rst +++ b/Help/variable/CMAKE_JOB_POOL_PRECOMPILE_HEADER.rst @@ -1,6 +1,8 @@ CMAKE_JOB_POOL_PRECOMPILE_HEADER -------------------------------- +.. versionadded:: 3.17 + This variable is used to initialize the :prop_tgt:`JOB_POOL_PRECOMPILE_HEADER` property on all the targets. See :prop_tgt:`JOB_POOL_PRECOMPILE_HEADER` for additional information. diff --git a/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_MACHINE.rst b/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_MACHINE.rst index d336364..f539277 100644 --- a/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_MACHINE.rst +++ b/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_MACHINE.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_ANDROID_TOOLCHAIN_MACHINE -------------------------------------- +.. versionadded:: 3.7.1 + When :ref:`Cross Compiling for Android` this variable contains the toolchain binutils machine name (e.g. ``gcc -dumpmachine``). The binutils typically have a ``<machine>-`` prefix on their name. diff --git a/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_PREFIX.rst b/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_PREFIX.rst index db04af3..ff072ca 100644 --- a/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_PREFIX.rst +++ b/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_PREFIX.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_ANDROID_TOOLCHAIN_PREFIX ------------------------------------- +.. versionadded:: 3.7 + When :ref:`Cross Compiling for Android` this variable contains the absolute path prefixing the toolchain GNU compiler and its binutils. diff --git a/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_SUFFIX.rst b/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_SUFFIX.rst index 159eb22..d595280 100644 --- a/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_SUFFIX.rst +++ b/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_SUFFIX.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_ANDROID_TOOLCHAIN_SUFFIX ------------------------------------- +.. versionadded:: 3.7 + When :ref:`Cross Compiling for Android` this variable contains the host platform suffix of the toolchain GNU compiler and its binutils. diff --git a/Help/variable/CMAKE_LANG_CLANG_TIDY.rst b/Help/variable/CMAKE_LANG_CLANG_TIDY.rst index bd49de3..78f0f6a 100644 --- a/Help/variable/CMAKE_LANG_CLANG_TIDY.rst +++ b/Help/variable/CMAKE_LANG_CLANG_TIDY.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_CLANG_TIDY ----------------------- +.. versionadded:: 3.6 + Default value for :prop_tgt:`<LANG>_CLANG_TIDY` target property when ``<LANG>`` is ``C`` or ``CXX``. diff --git a/Help/variable/CMAKE_LANG_COMPILER_AR.rst b/Help/variable/CMAKE_LANG_COMPILER_AR.rst index b83a1d4..74f2758 100644 --- a/Help/variable/CMAKE_LANG_COMPILER_AR.rst +++ b/Help/variable/CMAKE_LANG_COMPILER_AR.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_COMPILER_AR ------------------------ +.. versionadded:: 3.9 + A wrapper around ``ar`` adding the appropriate ``--plugin`` option for the compiler. diff --git a/Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst index 054c648..8057566 100644 --- a/Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst +++ b/Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID ------------------------------------- +.. versionadded:: 3.10 + An internal variable subject to change. This is used to identify the variant of a compiler based on its target diff --git a/Help/variable/CMAKE_LANG_COMPILER_LAUNCHER.rst b/Help/variable/CMAKE_LANG_COMPILER_LAUNCHER.rst index c76e2d0..98634c2 100644 --- a/Help/variable/CMAKE_LANG_COMPILER_LAUNCHER.rst +++ b/Help/variable/CMAKE_LANG_COMPILER_LAUNCHER.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_COMPILER_LAUNCHER ------------------------------ +.. versionadded:: 3.4 + Default value for :prop_tgt:`<LANG>_COMPILER_LAUNCHER` target property. This variable is used to initialize the property on each target as it is created. This is done only when ``<LANG>`` is ``C``, ``CXX``, ``Fortran``, diff --git a/Help/variable/CMAKE_LANG_COMPILER_PREDEFINES_COMMAND.rst b/Help/variable/CMAKE_LANG_COMPILER_PREDEFINES_COMMAND.rst index e050f43..935329a 100644 --- a/Help/variable/CMAKE_LANG_COMPILER_PREDEFINES_COMMAND.rst +++ b/Help/variable/CMAKE_LANG_COMPILER_PREDEFINES_COMMAND.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND ---------------------------------------- +.. versionadded:: 3.10 + Command that outputs the compiler pre definitions. See :prop_tgt:`AUTOMOC` which uses diff --git a/Help/variable/CMAKE_LANG_COMPILER_RANLIB.rst b/Help/variable/CMAKE_LANG_COMPILER_RANLIB.rst index 945160b..1d10b55 100644 --- a/Help/variable/CMAKE_LANG_COMPILER_RANLIB.rst +++ b/Help/variable/CMAKE_LANG_COMPILER_RANLIB.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_COMPILER_RANLIB ---------------------------- +.. versionadded:: 3.9 + A wrapper around ``ranlib`` adding the appropriate ``--plugin`` option for the compiler. diff --git a/Help/variable/CMAKE_LANG_COMPILER_VERSION_INTERNAL.rst b/Help/variable/CMAKE_LANG_COMPILER_VERSION_INTERNAL.rst index c3cd980..596a989 100644 --- a/Help/variable/CMAKE_LANG_COMPILER_VERSION_INTERNAL.rst +++ b/Help/variable/CMAKE_LANG_COMPILER_VERSION_INTERNAL.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_COMPILER_VERSION_INTERNAL -------------------------------------- +.. versionadded:: 3.10 + An internal variable subject to change. This is used to identify the variant of a compiler based on an internal diff --git a/Help/variable/CMAKE_LANG_CPPCHECK.rst b/Help/variable/CMAKE_LANG_CPPCHECK.rst index 50b478f..5ae5faf 100644 --- a/Help/variable/CMAKE_LANG_CPPCHECK.rst +++ b/Help/variable/CMAKE_LANG_CPPCHECK.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_CPPCHECK --------------------- +.. versionadded:: 3.10 + Default value for :prop_tgt:`<LANG>_CPPCHECK` target property. This variable is used to initialize the property on each target as it is created. This is done only when ``<LANG>`` is ``C`` or ``CXX``. diff --git a/Help/variable/CMAKE_LANG_CPPLINT.rst b/Help/variable/CMAKE_LANG_CPPLINT.rst index 3b6f452..ab7b0fc 100644 --- a/Help/variable/CMAKE_LANG_CPPLINT.rst +++ b/Help/variable/CMAKE_LANG_CPPLINT.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_CPPLINT -------------------- +.. versionadded:: 3.8 + Default value for :prop_tgt:`<LANG>_CPPLINT` target property. This variable is used to initialize the property on each target as it is created. This is done only when ``<LANG>`` is ``C`` or ``CXX``. diff --git a/Help/variable/CMAKE_LANG_FLAGS_CONFIG.rst b/Help/variable/CMAKE_LANG_FLAGS_CONFIG.rst index 1dbd036..628b62b 100644 --- a/Help/variable/CMAKE_LANG_FLAGS_CONFIG.rst +++ b/Help/variable/CMAKE_LANG_FLAGS_CONFIG.rst @@ -1,4 +1,6 @@ CMAKE_<LANG>_FLAGS_<CONFIG> --------------------------- +.. versionadded:: 3.11 + Flags for language ``<LANG>`` when building for the ``<CONFIG>`` configuration. diff --git a/Help/variable/CMAKE_LANG_FLAGS_CONFIG_INIT.rst b/Help/variable/CMAKE_LANG_FLAGS_CONFIG_INIT.rst index 1eb5b3f..17669a2 100644 --- a/Help/variable/CMAKE_LANG_FLAGS_CONFIG_INIT.rst +++ b/Help/variable/CMAKE_LANG_FLAGS_CONFIG_INIT.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_FLAGS_<CONFIG>_INIT -------------------------------- +.. versionadded:: 3.11 + Value used to initialize the :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>` cache entry the first time a build tree is configured for language ``<LANG>``. This variable is meant to be set by a :variable:`toolchain file diff --git a/Help/variable/CMAKE_LANG_FLAGS_DEBUG_INIT.rst b/Help/variable/CMAKE_LANG_FLAGS_DEBUG_INIT.rst index de7fcfc..49c9e99 100644 --- a/Help/variable/CMAKE_LANG_FLAGS_DEBUG_INIT.rst +++ b/Help/variable/CMAKE_LANG_FLAGS_DEBUG_INIT.rst @@ -1,5 +1,7 @@ CMAKE_<LANG>_FLAGS_DEBUG_INIT ----------------------------- +.. versionadded:: 3.7 + This variable is the ``Debug`` variant of the :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>_INIT` variable. diff --git a/Help/variable/CMAKE_LANG_FLAGS_INIT.rst b/Help/variable/CMAKE_LANG_FLAGS_INIT.rst index 4a034e8..67ff2cb 100644 --- a/Help/variable/CMAKE_LANG_FLAGS_INIT.rst +++ b/Help/variable/CMAKE_LANG_FLAGS_INIT.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_FLAGS_INIT ----------------------- +.. versionadded:: 3.7 + Value used to initialize the :variable:`CMAKE_<LANG>_FLAGS` cache entry the first time a build tree is configured for language ``<LANG>``. This variable is meant to be set by a :variable:`toolchain file diff --git a/Help/variable/CMAKE_LANG_FLAGS_MINSIZEREL_INIT.rst b/Help/variable/CMAKE_LANG_FLAGS_MINSIZEREL_INIT.rst index 1e7003c..3600909 100644 --- a/Help/variable/CMAKE_LANG_FLAGS_MINSIZEREL_INIT.rst +++ b/Help/variable/CMAKE_LANG_FLAGS_MINSIZEREL_INIT.rst @@ -1,5 +1,7 @@ CMAKE_<LANG>_FLAGS_MINSIZEREL_INIT ---------------------------------- +.. versionadded:: 3.7 + This variable is the ``MinSizeRel`` variant of the :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>_INIT` variable. diff --git a/Help/variable/CMAKE_LANG_FLAGS_RELEASE_INIT.rst b/Help/variable/CMAKE_LANG_FLAGS_RELEASE_INIT.rst index e7c73fe..e889852 100644 --- a/Help/variable/CMAKE_LANG_FLAGS_RELEASE_INIT.rst +++ b/Help/variable/CMAKE_LANG_FLAGS_RELEASE_INIT.rst @@ -1,5 +1,7 @@ CMAKE_<LANG>_FLAGS_RELEASE_INIT ------------------------------- +.. versionadded:: 3.7 + This variable is the ``Release`` variant of the :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>_INIT` variable. diff --git a/Help/variable/CMAKE_LANG_FLAGS_RELWITHDEBINFO_INIT.rst b/Help/variable/CMAKE_LANG_FLAGS_RELWITHDEBINFO_INIT.rst index 3ab3975..b42caee 100644 --- a/Help/variable/CMAKE_LANG_FLAGS_RELWITHDEBINFO_INIT.rst +++ b/Help/variable/CMAKE_LANG_FLAGS_RELWITHDEBINFO_INIT.rst @@ -1,5 +1,7 @@ CMAKE_<LANG>_FLAGS_RELWITHDEBINFO_INIT -------------------------------------- +.. versionadded:: 3.7 + This variable is the ``RelWithDebInfo`` variant of the :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>_INIT` variable. diff --git a/Help/variable/CMAKE_LANG_INCLUDE_WHAT_YOU_USE.rst b/Help/variable/CMAKE_LANG_INCLUDE_WHAT_YOU_USE.rst index 2c8028a..be6c210 100644 --- a/Help/variable/CMAKE_LANG_INCLUDE_WHAT_YOU_USE.rst +++ b/Help/variable/CMAKE_LANG_INCLUDE_WHAT_YOU_USE.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_INCLUDE_WHAT_YOU_USE --------------------------------- +.. versionadded:: 3.3 + Default value for :prop_tgt:`<LANG>_INCLUDE_WHAT_YOU_USE` target property. This variable is used to initialize the property on each target as it is created. This is done only when ``<LANG>`` is ``C`` or ``CXX``. diff --git a/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG.rst b/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG.rst index df51407..471c351 100644 --- a/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG.rst +++ b/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_LINKER_WRAPPER_FLAG -------------------------------- +.. versionadded:: 3.13 + Defines the syntax of compiler driver option to pass options to the linker tool. It will be used to translate the ``LINKER:`` prefix in the link options (see :command:`add_link_options` and :command:`target_link_options`). diff --git a/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG_SEP.rst b/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG_SEP.rst index faf1481..a3895af 100644 --- a/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG_SEP.rst +++ b/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG_SEP.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_LINKER_WRAPPER_FLAG_SEP ------------------------------------ +.. versionadded:: 3.13 + This variable is used with :variable:`CMAKE_<LANG>_LINKER_WRAPPER_FLAG` variable to format ``LINKER:`` prefix in the link options (see :command:`add_link_options` and :command:`target_link_options`). diff --git a/Help/variable/CMAKE_LANG_LINK_LIBRARY_FILE_FLAG.rst b/Help/variable/CMAKE_LANG_LINK_LIBRARY_FILE_FLAG.rst index d54f080..23ece88 100644 --- a/Help/variable/CMAKE_LANG_LINK_LIBRARY_FILE_FLAG.rst +++ b/Help/variable/CMAKE_LANG_LINK_LIBRARY_FILE_FLAG.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_LINK_LIBRARY_FILE_FLAG ----------------------------------- +.. versionadded:: 3.16 + Language-specific flag to be used to link a library specified by a path to its file. diff --git a/Help/variable/CMAKE_LANG_LINK_LIBRARY_FLAG.rst b/Help/variable/CMAKE_LANG_LINK_LIBRARY_FLAG.rst index d7bb0d8..0f528db 100644 --- a/Help/variable/CMAKE_LANG_LINK_LIBRARY_FLAG.rst +++ b/Help/variable/CMAKE_LANG_LINK_LIBRARY_FLAG.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_LINK_LIBRARY_FLAG ------------------------------ +.. versionadded:: 3.16 + Flag to be used to link a library into a shared library or executable. This flag will be used to specify a library to link to a shared library or an diff --git a/Help/variable/CMAKE_LANG_LINK_LIBRARY_SUFFIX.rst b/Help/variable/CMAKE_LANG_LINK_LIBRARY_SUFFIX.rst index a378657..359e29f 100644 --- a/Help/variable/CMAKE_LANG_LINK_LIBRARY_SUFFIX.rst +++ b/Help/variable/CMAKE_LANG_LINK_LIBRARY_SUFFIX.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_LINK_LIBRARY_SUFFIX -------------------------------- +.. versionadded:: 3.16 + Language-specific suffix for libraries that you link to. The suffix to use for the end of a library filename, ``.lib`` on Windows. diff --git a/Help/variable/CMAKE_LANG_STANDARD_INCLUDE_DIRECTORIES.rst b/Help/variable/CMAKE_LANG_STANDARD_INCLUDE_DIRECTORIES.rst index c8e3d57..24aca8b 100644 --- a/Help/variable/CMAKE_LANG_STANDARD_INCLUDE_DIRECTORIES.rst +++ b/Help/variable/CMAKE_LANG_STANDARD_INCLUDE_DIRECTORIES.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES ----------------------------------------- +.. versionadded:: 3.6 + Include directories to be used for every source file compiled with the ``<LANG>`` compiler. This is meant for specification of system include directories needed by the language for the current platform. diff --git a/Help/variable/CMAKE_LANG_STANDARD_LIBRARIES.rst b/Help/variable/CMAKE_LANG_STANDARD_LIBRARIES.rst index ba6df93..d5f3351 100644 --- a/Help/variable/CMAKE_LANG_STANDARD_LIBRARIES.rst +++ b/Help/variable/CMAKE_LANG_STANDARD_LIBRARIES.rst @@ -1,6 +1,8 @@ CMAKE_<LANG>_STANDARD_LIBRARIES ------------------------------- +.. versionadded:: 3.6 + Libraries linked into every executable and shared library linked for language ``<LANG>``. This is meant for specification of system libraries needed by the language for the current platform. diff --git a/Help/variable/CMAKE_LIBRARY_OUTPUT_DIRECTORY_CONFIG.rst b/Help/variable/CMAKE_LIBRARY_OUTPUT_DIRECTORY_CONFIG.rst index e069cdd..08f95c4 100644 --- a/Help/variable/CMAKE_LIBRARY_OUTPUT_DIRECTORY_CONFIG.rst +++ b/Help/variable/CMAKE_LIBRARY_OUTPUT_DIRECTORY_CONFIG.rst @@ -1,6 +1,8 @@ CMAKE_LIBRARY_OUTPUT_DIRECTORY_<CONFIG> --------------------------------------- +.. versionadded:: 3.3 + Where to put all the :ref:`LIBRARY <Library Output Artifacts>` target files when built for a specific configuration. diff --git a/Help/variable/CMAKE_LINK_DIRECTORIES_BEFORE.rst b/Help/variable/CMAKE_LINK_DIRECTORIES_BEFORE.rst index 026ca35..f120866 100644 --- a/Help/variable/CMAKE_LINK_DIRECTORIES_BEFORE.rst +++ b/Help/variable/CMAKE_LINK_DIRECTORIES_BEFORE.rst @@ -1,6 +1,8 @@ CMAKE_LINK_DIRECTORIES_BEFORE ----------------------------- +.. versionadded:: 3.13 + Whether to append or prepend directories by default in :command:`link_directories`. diff --git a/Help/variable/CMAKE_LINK_SEARCH_END_STATIC.rst b/Help/variable/CMAKE_LINK_SEARCH_END_STATIC.rst index 54cdaaa..f4ccc04 100644 --- a/Help/variable/CMAKE_LINK_SEARCH_END_STATIC.rst +++ b/Help/variable/CMAKE_LINK_SEARCH_END_STATIC.rst @@ -1,6 +1,8 @@ CMAKE_LINK_SEARCH_END_STATIC ---------------------------- +.. versionadded:: 3.4 + End a link line such that static system libraries are used. Some linkers support switches such as ``-Bstatic`` and ``-Bdynamic`` to diff --git a/Help/variable/CMAKE_LINK_SEARCH_START_STATIC.rst b/Help/variable/CMAKE_LINK_SEARCH_START_STATIC.rst index 0d52a31..2025c72 100644 --- a/Help/variable/CMAKE_LINK_SEARCH_START_STATIC.rst +++ b/Help/variable/CMAKE_LINK_SEARCH_START_STATIC.rst @@ -1,6 +1,8 @@ CMAKE_LINK_SEARCH_START_STATIC ------------------------------ +.. versionadded:: 3.4 + Assume the linker looks for static libraries by default. Some linkers support switches such as ``-Bstatic`` and ``-Bdynamic`` to diff --git a/Help/variable/CMAKE_LINK_WHAT_YOU_USE.rst b/Help/variable/CMAKE_LINK_WHAT_YOU_USE.rst index 90c4d3f..06b3aa8 100644 --- a/Help/variable/CMAKE_LINK_WHAT_YOU_USE.rst +++ b/Help/variable/CMAKE_LINK_WHAT_YOU_USE.rst @@ -1,6 +1,8 @@ CMAKE_LINK_WHAT_YOU_USE --------------------------------- +.. versionadded:: 3.7 + Default value for :prop_tgt:`LINK_WHAT_YOU_USE` target property. This variable is used to initialize the property on each target as it is created. diff --git a/Help/variable/CMAKE_MATCH_COUNT.rst b/Help/variable/CMAKE_MATCH_COUNT.rst index 355e834..deeec8b 100644 --- a/Help/variable/CMAKE_MATCH_COUNT.rst +++ b/Help/variable/CMAKE_MATCH_COUNT.rst @@ -1,6 +1,8 @@ CMAKE_MATCH_COUNT ----------------- +.. versionadded:: 3.2 + The number of matches with the last regular expression. When a regular expression match is used, CMake fills in diff --git a/Help/variable/CMAKE_MATCH_n.rst b/Help/variable/CMAKE_MATCH_n.rst index c7dd623..a92788e 100644 --- a/Help/variable/CMAKE_MATCH_n.rst +++ b/Help/variable/CMAKE_MATCH_n.rst @@ -1,6 +1,8 @@ CMAKE_MATCH_<n> --------------- +.. versionadded:: 3.9 + Capture group ``<n>`` matched by the last regular expression, for groups 0 through 9. Group 0 is the entire match. Groups 1 through 9 are the subexpressions captured by ``()`` syntax. diff --git a/Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst b/Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst index 7110b16..59c60d3 100644 --- a/Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst +++ b/Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst @@ -1,6 +1,8 @@ CMAKE_MAXIMUM_RECURSION_DEPTH ----------------------------- +.. versionadded:: 3.14 + Maximum recursion depth for CMake scripts. It is intended to be set on the command line with ``-DCMAKE_MAXIMUM_RECURSION_DEPTH=<x>``, or within ``CMakeLists.txt`` by projects that require a large recursion depth. Projects diff --git a/Help/variable/CMAKE_MESSAGE_CONTEXT.rst b/Help/variable/CMAKE_MESSAGE_CONTEXT.rst index 6b4ca40..41ace43 100644 --- a/Help/variable/CMAKE_MESSAGE_CONTEXT.rst +++ b/Help/variable/CMAKE_MESSAGE_CONTEXT.rst @@ -1,6 +1,8 @@ CMAKE_MESSAGE_CONTEXT --------------------- +.. versionadded:: 3.17 + When enabled by the :manual:`cmake <cmake(1)>` ``--log-context`` command line option or the :variable:`CMAKE_MESSAGE_CONTEXT_SHOW` variable, the :command:`message` command converts the ``CMAKE_MESSAGE_CONTEXT`` list into a diff --git a/Help/variable/CMAKE_MESSAGE_CONTEXT_SHOW.rst b/Help/variable/CMAKE_MESSAGE_CONTEXT_SHOW.rst index 7ec218e..382e9ff 100644 --- a/Help/variable/CMAKE_MESSAGE_CONTEXT_SHOW.rst +++ b/Help/variable/CMAKE_MESSAGE_CONTEXT_SHOW.rst @@ -1,6 +1,8 @@ CMAKE_MESSAGE_CONTEXT_SHOW -------------------------- +.. versionadded:: 3.17 + Setting this variable to true enables showing a context with each line logged by the :command:`message` command (see :variable:`CMAKE_MESSAGE_CONTEXT` for how the context itself is specified). diff --git a/Help/variable/CMAKE_MESSAGE_INDENT.rst b/Help/variable/CMAKE_MESSAGE_INDENT.rst index 7e44a4c..c6263d2 100644 --- a/Help/variable/CMAKE_MESSAGE_INDENT.rst +++ b/Help/variable/CMAKE_MESSAGE_INDENT.rst @@ -1,6 +1,8 @@ CMAKE_MESSAGE_INDENT -------------------- +.. versionadded:: 3.16 + The :command:`message` command joins the strings from this list and for log levels of ``NOTICE`` and below, it prepends the resultant string to each line of the message. diff --git a/Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst b/Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst index 1d4cfe6..3b45d1d 100644 --- a/Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst +++ b/Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst @@ -1,6 +1,8 @@ CMAKE_MESSAGE_LOG_LEVEL ----------------------- +.. versionadded:: 3.17 + When set, this variable specifies the logging level used by the :command:`message` command. Valid values are the same as those for the ``--log-level`` command line option of the :manual:`cmake(1)` program. diff --git a/Help/variable/CMAKE_MODULE_LINKER_FLAGS_CONFIG_INIT.rst b/Help/variable/CMAKE_MODULE_LINKER_FLAGS_CONFIG_INIT.rst index 3279014..e8a6401 100644 --- a/Help/variable/CMAKE_MODULE_LINKER_FLAGS_CONFIG_INIT.rst +++ b/Help/variable/CMAKE_MODULE_LINKER_FLAGS_CONFIG_INIT.rst @@ -1,6 +1,8 @@ CMAKE_MODULE_LINKER_FLAGS_<CONFIG>_INIT --------------------------------------- +.. versionadded:: 3.7 + Value used to initialize the :variable:`CMAKE_MODULE_LINKER_FLAGS_<CONFIG>` cache entry the first time a build tree is configured. This variable is meant to be set by a :variable:`toolchain file diff --git a/Help/variable/CMAKE_MODULE_LINKER_FLAGS_INIT.rst b/Help/variable/CMAKE_MODULE_LINKER_FLAGS_INIT.rst index 91b39f6..d59e9bf 100644 --- a/Help/variable/CMAKE_MODULE_LINKER_FLAGS_INIT.rst +++ b/Help/variable/CMAKE_MODULE_LINKER_FLAGS_INIT.rst @@ -1,6 +1,8 @@ CMAKE_MODULE_LINKER_FLAGS_INIT ------------------------------ +.. versionadded:: 3.7 + Value used to initialize the :variable:`CMAKE_MODULE_LINKER_FLAGS` cache entry the first time a build tree is configured. This variable is meant to be set by a :variable:`toolchain file diff --git a/Help/variable/CMAKE_MSVCIDE_RUN_PATH.rst b/Help/variable/CMAKE_MSVCIDE_RUN_PATH.rst index 22e727f..721ceaa 100644 --- a/Help/variable/CMAKE_MSVCIDE_RUN_PATH.rst +++ b/Help/variable/CMAKE_MSVCIDE_RUN_PATH.rst @@ -1,6 +1,8 @@ CMAKE_MSVCIDE_RUN_PATH ---------------------- +.. versionadded:: 3.10 + Extra PATH locations that should be used when executing :command:`add_custom_command` or :command:`add_custom_target` when using the :generator:`Visual Studio 9 2008` (or above) generator. This allows diff --git a/Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst b/Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst index 8b54e7e..14806e6 100644 --- a/Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst +++ b/Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst @@ -1,6 +1,8 @@ CMAKE_MSVC_RUNTIME_LIBRARY -------------------------- +.. versionadded:: 3.15 + Select the MSVC runtime library for use by compilers targeting the MSVC ABI. This variable is used to initialize the :prop_tgt:`MSVC_RUNTIME_LIBRARY` property on all targets as they are created. It is also propagated by diff --git a/Help/variable/CMAKE_NETRC.rst b/Help/variable/CMAKE_NETRC.rst index 903ec31..2c64a81 100644 --- a/Help/variable/CMAKE_NETRC.rst +++ b/Help/variable/CMAKE_NETRC.rst @@ -1,6 +1,8 @@ CMAKE_NETRC ----------- +.. versionadded:: 3.11 + This variable is used to initialize the ``NETRC`` option for :command:`file(DOWNLOAD)` and :command:`file(UPLOAD)` commands and the module :module:`ExternalProject`. See those commands for additional diff --git a/Help/variable/CMAKE_NETRC_FILE.rst b/Help/variable/CMAKE_NETRC_FILE.rst index 0f09afe..97a645e 100644 --- a/Help/variable/CMAKE_NETRC_FILE.rst +++ b/Help/variable/CMAKE_NETRC_FILE.rst @@ -1,6 +1,8 @@ CMAKE_NETRC_FILE ---------------- +.. versionadded:: 3.11 + This variable is used to initialize the ``NETRC_FILE`` option for :command:`file(DOWNLOAD)` and :command:`file(UPLOAD)` commands and the module :module:`ExternalProject`. See those commands for additional diff --git a/Help/variable/CMAKE_NINJA_OUTPUT_PATH_PREFIX.rst b/Help/variable/CMAKE_NINJA_OUTPUT_PATH_PREFIX.rst index 64091aa..a8c4035 100644 --- a/Help/variable/CMAKE_NINJA_OUTPUT_PATH_PREFIX.rst +++ b/Help/variable/CMAKE_NINJA_OUTPUT_PATH_PREFIX.rst @@ -1,6 +1,8 @@ CMAKE_NINJA_OUTPUT_PATH_PREFIX ------------------------------ +.. versionadded:: 3.6 + Set output files path prefix for the :generator:`Ninja` generator. Every output files listed in the generated ``build.ninja`` will be diff --git a/Help/variable/CMAKE_OBJCXX_EXTENSIONS.rst b/Help/variable/CMAKE_OBJCXX_EXTENSIONS.rst index 8afa6f2..b5225ea 100644 --- a/Help/variable/CMAKE_OBJCXX_EXTENSIONS.rst +++ b/Help/variable/CMAKE_OBJCXX_EXTENSIONS.rst @@ -1,6 +1,8 @@ CMAKE_OBJCXX_EXTENSIONS ----------------------- +.. versionadded:: 3.16 + Default value for :prop_tgt:`OBJCXX_EXTENSIONS` property of targets. This variable is used to initialize the :prop_tgt:`OBJCXX_EXTENSIONS` diff --git a/Help/variable/CMAKE_OBJCXX_STANDARD.rst b/Help/variable/CMAKE_OBJCXX_STANDARD.rst index 4e5016a..98e4624 100644 --- a/Help/variable/CMAKE_OBJCXX_STANDARD.rst +++ b/Help/variable/CMAKE_OBJCXX_STANDARD.rst @@ -1,6 +1,8 @@ CMAKE_OBJCXX_STANDARD --------------------- +.. versionadded:: 3.16 + Default value for :prop_tgt:`OBJCXX_STANDARD` property of targets. This variable is used to initialize the :prop_tgt:`OBJCXX_STANDARD` diff --git a/Help/variable/CMAKE_OBJCXX_STANDARD_REQUIRED.rst b/Help/variable/CMAKE_OBJCXX_STANDARD_REQUIRED.rst index 3a0602a..4b5e77c 100644 --- a/Help/variable/CMAKE_OBJCXX_STANDARD_REQUIRED.rst +++ b/Help/variable/CMAKE_OBJCXX_STANDARD_REQUIRED.rst @@ -1,6 +1,8 @@ CMAKE_OBJCXX_STANDARD_REQUIRED ------------------------------ +.. versionadded:: 3.16 + Default value for :prop_tgt:`OBJCXX_STANDARD_REQUIRED` property of targets. This variable is used to initialize the :prop_tgt:`OBJCXX_STANDARD_REQUIRED` diff --git a/Help/variable/CMAKE_OBJC_EXTENSIONS.rst b/Help/variable/CMAKE_OBJC_EXTENSIONS.rst index d9619d8..d6e3c7d 100644 --- a/Help/variable/CMAKE_OBJC_EXTENSIONS.rst +++ b/Help/variable/CMAKE_OBJC_EXTENSIONS.rst @@ -1,6 +1,8 @@ CMAKE_OBJC_EXTENSIONS --------------------- +.. versionadded:: 3.16 + Default value for :prop_tgt:`OBJC_EXTENSIONS` property of targets. This variable is used to initialize the :prop_tgt:`OBJC_EXTENSIONS` diff --git a/Help/variable/CMAKE_OBJC_STANDARD.rst b/Help/variable/CMAKE_OBJC_STANDARD.rst index 976c441..fde367d 100644 --- a/Help/variable/CMAKE_OBJC_STANDARD.rst +++ b/Help/variable/CMAKE_OBJC_STANDARD.rst @@ -1,6 +1,8 @@ CMAKE_OBJC_STANDARD ------------------- +.. versionadded:: 3.16 + Default value for :prop_tgt:`OBJC_STANDARD` property of targets. This variable is used to initialize the :prop_tgt:`OBJC_STANDARD` diff --git a/Help/variable/CMAKE_OBJC_STANDARD_REQUIRED.rst b/Help/variable/CMAKE_OBJC_STANDARD_REQUIRED.rst index 5c02096..8d26d95 100644 --- a/Help/variable/CMAKE_OBJC_STANDARD_REQUIRED.rst +++ b/Help/variable/CMAKE_OBJC_STANDARD_REQUIRED.rst @@ -1,6 +1,8 @@ CMAKE_OBJC_STANDARD_REQUIRED ---------------------------- +.. versionadded:: 3.16 + Default value for :prop_tgt:`OBJC_STANDARD_REQUIRED` property of targets. This variable is used to initialize the :prop_tgt:`OBJC_STANDARD_REQUIRED` diff --git a/Help/variable/CMAKE_PCH_WARN_INVALID.rst b/Help/variable/CMAKE_PCH_WARN_INVALID.rst index e152abd..457a428 100644 --- a/Help/variable/CMAKE_PCH_WARN_INVALID.rst +++ b/Help/variable/CMAKE_PCH_WARN_INVALID.rst @@ -1,5 +1,7 @@ CMAKE_PCH_WARN_INVALID ---------------------- +.. versionadded:: 3.18 + This variable is used to initialize the :prop_tgt:`PCH_WARN_INVALID` property of targets when they are created. diff --git a/Help/variable/CMAKE_PROJECT_DESCRIPTION.rst b/Help/variable/CMAKE_PROJECT_DESCRIPTION.rst index 51b0592..95cbe40 100644 --- a/Help/variable/CMAKE_PROJECT_DESCRIPTION.rst +++ b/Help/variable/CMAKE_PROJECT_DESCRIPTION.rst @@ -1,6 +1,8 @@ CMAKE_PROJECT_DESCRIPTION ------------------------- +.. versionadded:: 3.9 + The description of the top level project. This variable holds the description of the project as specified in the top diff --git a/Help/variable/CMAKE_PROJECT_HOMEPAGE_URL.rst b/Help/variable/CMAKE_PROJECT_HOMEPAGE_URL.rst index ee0bf7c..4c5debe 100644 --- a/Help/variable/CMAKE_PROJECT_HOMEPAGE_URL.rst +++ b/Help/variable/CMAKE_PROJECT_HOMEPAGE_URL.rst @@ -1,6 +1,8 @@ CMAKE_PROJECT_HOMEPAGE_URL -------------------------- +.. versionadded:: 3.12 + The homepage URL of the top level project. This variable holds the homepage URL of the project as specified in the top diff --git a/Help/variable/CMAKE_PROJECT_INCLUDE.rst b/Help/variable/CMAKE_PROJECT_INCLUDE.rst index 5835264..41d9e5d 100644 --- a/Help/variable/CMAKE_PROJECT_INCLUDE.rst +++ b/Help/variable/CMAKE_PROJECT_INCLUDE.rst @@ -1,6 +1,8 @@ CMAKE_PROJECT_INCLUDE --------------------- +.. versionadded:: 3.15 + A CMake language file or module to be included as the last step of all :command:`project` command calls. This is intended for injecting custom code into project builds without modifying their source. diff --git a/Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst b/Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst index 280c14a..c2fd0f8 100644 --- a/Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst +++ b/Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst @@ -1,6 +1,8 @@ CMAKE_PROJECT_INCLUDE_BEFORE ---------------------------- +.. versionadded:: 3.15 + A CMake language file or module to be included as the first step of all :command:`project` command calls. This is intended for injecting custom code into project builds without modifying their source. diff --git a/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.rst b/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.rst index db1432d..39abb12 100644 --- a/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.rst +++ b/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.rst @@ -1,6 +1,8 @@ CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE_BEFORE ------------------------------------------- +.. versionadded:: 3.17 + A CMake language file or module to be included as the first step of any :command:`project` command calls that specify ``<PROJECT-NAME>`` as the project name. This is intended for injecting custom code into project builds without diff --git a/Help/variable/CMAKE_PROJECT_VERSION.rst b/Help/variable/CMAKE_PROJECT_VERSION.rst index 4f8f556..450c136 100644 --- a/Help/variable/CMAKE_PROJECT_VERSION.rst +++ b/Help/variable/CMAKE_PROJECT_VERSION.rst @@ -1,6 +1,8 @@ CMAKE_PROJECT_VERSION --------------------- +.. versionadded:: 3.12 + The version of the top level project. This variable holds the version of the project as specified in the top diff --git a/Help/variable/CMAKE_PROJECT_VERSION_MAJOR.rst b/Help/variable/CMAKE_PROJECT_VERSION_MAJOR.rst index f1001ac..c7511e7 100644 --- a/Help/variable/CMAKE_PROJECT_VERSION_MAJOR.rst +++ b/Help/variable/CMAKE_PROJECT_VERSION_MAJOR.rst @@ -1,6 +1,8 @@ CMAKE_PROJECT_VERSION_MAJOR --------------------------- +.. versionadded:: 3.12 + The major version of the top level project. This variable holds the major version of the project as specified in the top diff --git a/Help/variable/CMAKE_PROJECT_VERSION_MINOR.rst b/Help/variable/CMAKE_PROJECT_VERSION_MINOR.rst index 13202be..dd91dcf 100644 --- a/Help/variable/CMAKE_PROJECT_VERSION_MINOR.rst +++ b/Help/variable/CMAKE_PROJECT_VERSION_MINOR.rst @@ -1,6 +1,8 @@ CMAKE_PROJECT_VERSION_MINOR --------------------------- +.. versionadded:: 3.12 + The minor version of the top level project. This variable holds the minor version of the project as specified in the top diff --git a/Help/variable/CMAKE_PROJECT_VERSION_PATCH.rst b/Help/variable/CMAKE_PROJECT_VERSION_PATCH.rst index b8570d9..61fd1f3 100644 --- a/Help/variable/CMAKE_PROJECT_VERSION_PATCH.rst +++ b/Help/variable/CMAKE_PROJECT_VERSION_PATCH.rst @@ -1,6 +1,8 @@ CMAKE_PROJECT_VERSION_PATCH --------------------------- +.. versionadded:: 3.12 + The patch version of the top level project. This variable holds the patch version of the project as specified in the top diff --git a/Help/variable/CMAKE_PROJECT_VERSION_TWEAK.rst b/Help/variable/CMAKE_PROJECT_VERSION_TWEAK.rst index e1ad4be..0deae8b 100644 --- a/Help/variable/CMAKE_PROJECT_VERSION_TWEAK.rst +++ b/Help/variable/CMAKE_PROJECT_VERSION_TWEAK.rst @@ -1,6 +1,8 @@ CMAKE_PROJECT_VERSION_TWEAK --------------------------- +.. versionadded:: 3.12 + The tweak version of the top level project. This variable holds the tweak version of the project as specified in the top diff --git a/Help/variable/CMAKE_RULE_MESSAGES.rst b/Help/variable/CMAKE_RULE_MESSAGES.rst index 7460a81..39be2e9 100644 --- a/Help/variable/CMAKE_RULE_MESSAGES.rst +++ b/Help/variable/CMAKE_RULE_MESSAGES.rst @@ -1,6 +1,8 @@ CMAKE_RULE_MESSAGES ------------------- +.. versionadded:: 3.13 + Specify whether to report a message for each make rule. If set in the cache it is used to initialize the value of the :prop_gbl:`RULE_MESSAGES` property. diff --git a/Help/variable/CMAKE_RUNTIME_OUTPUT_DIRECTORY_CONFIG.rst b/Help/variable/CMAKE_RUNTIME_OUTPUT_DIRECTORY_CONFIG.rst index 080dea6..c9c55c5 100644 --- a/Help/variable/CMAKE_RUNTIME_OUTPUT_DIRECTORY_CONFIG.rst +++ b/Help/variable/CMAKE_RUNTIME_OUTPUT_DIRECTORY_CONFIG.rst @@ -1,6 +1,8 @@ CMAKE_RUNTIME_OUTPUT_DIRECTORY_<CONFIG> --------------------------------------- +.. versionadded:: 3.3 + Where to put all the :ref:`RUNTIME <Runtime Output Artifacts>` target files when built for a specific configuration. diff --git a/Help/variable/CMAKE_SHARED_LINKER_FLAGS_CONFIG_INIT.rst b/Help/variable/CMAKE_SHARED_LINKER_FLAGS_CONFIG_INIT.rst index 185df38..7f3dec7 100644 --- a/Help/variable/CMAKE_SHARED_LINKER_FLAGS_CONFIG_INIT.rst +++ b/Help/variable/CMAKE_SHARED_LINKER_FLAGS_CONFIG_INIT.rst @@ -1,6 +1,8 @@ CMAKE_SHARED_LINKER_FLAGS_<CONFIG>_INIT --------------------------------------- +.. versionadded:: 3.7 + Value used to initialize the :variable:`CMAKE_SHARED_LINKER_FLAGS_<CONFIG>` cache entry the first time a build tree is configured. This variable is meant to be set by a :variable:`toolchain file diff --git a/Help/variable/CMAKE_SHARED_LINKER_FLAGS_INIT.rst b/Help/variable/CMAKE_SHARED_LINKER_FLAGS_INIT.rst index cb819a7..6d51afe 100644 --- a/Help/variable/CMAKE_SHARED_LINKER_FLAGS_INIT.rst +++ b/Help/variable/CMAKE_SHARED_LINKER_FLAGS_INIT.rst @@ -1,6 +1,8 @@ CMAKE_SHARED_LINKER_FLAGS_INIT ------------------------------ +.. versionadded:: 3.7 + Value used to initialize the :variable:`CMAKE_SHARED_LINKER_FLAGS` cache entry the first time a build tree is configured. This variable is meant to be set by a :variable:`toolchain file diff --git a/Help/variable/CMAKE_STATIC_LINKER_FLAGS_CONFIG_INIT.rst b/Help/variable/CMAKE_STATIC_LINKER_FLAGS_CONFIG_INIT.rst index a49d1cb..5e65ef2 100644 --- a/Help/variable/CMAKE_STATIC_LINKER_FLAGS_CONFIG_INIT.rst +++ b/Help/variable/CMAKE_STATIC_LINKER_FLAGS_CONFIG_INIT.rst @@ -1,6 +1,8 @@ CMAKE_STATIC_LINKER_FLAGS_<CONFIG>_INIT --------------------------------------- +.. versionadded:: 3.7 + Value used to initialize the :variable:`CMAKE_STATIC_LINKER_FLAGS_<CONFIG>` cache entry the first time a build tree is configured. This variable is meant to be set by a :variable:`toolchain file diff --git a/Help/variable/CMAKE_STATIC_LINKER_FLAGS_INIT.rst b/Help/variable/CMAKE_STATIC_LINKER_FLAGS_INIT.rst index 113ca71..cbf681c 100644 --- a/Help/variable/CMAKE_STATIC_LINKER_FLAGS_INIT.rst +++ b/Help/variable/CMAKE_STATIC_LINKER_FLAGS_INIT.rst @@ -1,6 +1,8 @@ CMAKE_STATIC_LINKER_FLAGS_INIT ------------------------------ +.. versionadded:: 3.7 + Value used to initialize the :variable:`CMAKE_STATIC_LINKER_FLAGS` cache entry the first time a build tree is configured. This variable is meant to be set by a :variable:`toolchain file diff --git a/Help/variable/CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS.rst b/Help/variable/CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS.rst index 02c8663..5c1c8d1 100644 --- a/Help/variable/CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS.rst +++ b/Help/variable/CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS.rst @@ -1,6 +1,8 @@ CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS --------------------------------- +.. versionadded:: 3.8 + This variable contains a list of env vars as a list of tokens with the syntax ``var=value``. diff --git a/Help/variable/CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE.rst b/Help/variable/CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE.rst index d654425..28b0dbd 100644 --- a/Help/variable/CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE.rst +++ b/Help/variable/CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE.rst @@ -1,6 +1,8 @@ CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE --------------------------------------- +.. versionadded:: 3.8 + If this variable evaluates to ``ON`` at the end of the top-level ``CMakeLists.txt`` file, the :generator:`Sublime Text 2` extra generator excludes the build tree from the ``.sublime-project`` if it is inside the diff --git a/Help/variable/CMAKE_SUPPRESS_REGENERATION.rst b/Help/variable/CMAKE_SUPPRESS_REGENERATION.rst index 96184dd..48490ff 100644 --- a/Help/variable/CMAKE_SUPPRESS_REGENERATION.rst +++ b/Help/variable/CMAKE_SUPPRESS_REGENERATION.rst @@ -1,6 +1,8 @@ CMAKE_SUPPRESS_REGENERATION --------------------------- +.. versionadded:: 3.12 + If ``CMAKE_SUPPRESS_REGENERATION`` is ``OFF``, which is default, then CMake adds a special target on which all other targets depend that checks the build system and optionally re-runs CMake to regenerate the build system when diff --git a/Help/variable/CMAKE_SYSROOT_COMPILE.rst b/Help/variable/CMAKE_SYSROOT_COMPILE.rst index e96c62b..4aea48e 100644 --- a/Help/variable/CMAKE_SYSROOT_COMPILE.rst +++ b/Help/variable/CMAKE_SYSROOT_COMPILE.rst @@ -1,6 +1,8 @@ CMAKE_SYSROOT_COMPILE --------------------- +.. versionadded:: 3.9 + Path to pass to the compiler in the ``--sysroot`` flag when compiling source files. This is the same as :variable:`CMAKE_SYSROOT` but is used only for compiling sources and not linking. diff --git a/Help/variable/CMAKE_SYSROOT_LINK.rst b/Help/variable/CMAKE_SYSROOT_LINK.rst index 88b48ef..9749b7b 100644 --- a/Help/variable/CMAKE_SYSROOT_LINK.rst +++ b/Help/variable/CMAKE_SYSROOT_LINK.rst @@ -1,6 +1,8 @@ CMAKE_SYSROOT_LINK ------------------ +.. versionadded:: 3.9 + Path to pass to the compiler in the ``--sysroot`` flag when linking. This is the same as :variable:`CMAKE_SYSROOT` but is used only for linking and not compiling sources. diff --git a/Help/variable/CMAKE_SYSTEM_APPBUNDLE_PATH.rst b/Help/variable/CMAKE_SYSTEM_APPBUNDLE_PATH.rst index 666af46..06a99a8 100644 --- a/Help/variable/CMAKE_SYSTEM_APPBUNDLE_PATH.rst +++ b/Help/variable/CMAKE_SYSTEM_APPBUNDLE_PATH.rst @@ -1,6 +1,8 @@ CMAKE_SYSTEM_APPBUNDLE_PATH --------------------------- +.. versionadded:: 3.4 + Search path for macOS application bundles used by the :command:`find_program`, and :command:`find_package` commands. By default it contains the standard directories for the current system. It is *not* intended to be modified by diff --git a/Help/variable/CMAKE_SYSTEM_FRAMEWORK_PATH.rst b/Help/variable/CMAKE_SYSTEM_FRAMEWORK_PATH.rst index 14ba18e..1a402c1 100644 --- a/Help/variable/CMAKE_SYSTEM_FRAMEWORK_PATH.rst +++ b/Help/variable/CMAKE_SYSTEM_FRAMEWORK_PATH.rst @@ -1,6 +1,8 @@ CMAKE_SYSTEM_FRAMEWORK_PATH --------------------------- +.. versionadded:: 3.4 + Search path for macOS frameworks used by the :command:`find_library`, :command:`find_package`, :command:`find_path`, and :command:`find_file` commands. By default it contains the standard directories for the diff --git a/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst b/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst index b4a74eb..fce6fa7 100644 --- a/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst +++ b/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst @@ -1,6 +1,8 @@ CMAKE_Swift_LANGUAGE_VERSION ---------------------------- +.. versionadded:: 3.7 + Set to the Swift language version number. If not set, the oldest legacy version known to be available in the host Xcode version is assumed: diff --git a/Help/variable/CMAKE_Swift_MODULE_DIRECTORY.rst b/Help/variable/CMAKE_Swift_MODULE_DIRECTORY.rst index b11253b..3694973 100644 --- a/Help/variable/CMAKE_Swift_MODULE_DIRECTORY.rst +++ b/Help/variable/CMAKE_Swift_MODULE_DIRECTORY.rst @@ -1,6 +1,8 @@ CMAKE_Swift_MODULE_DIRECTORY ---------------------------- +.. versionadded:: 3.15 + Swift module output directory. This variable is used to initialise the :prop_tgt:`Swift_MODULE_DIRECTORY` diff --git a/Help/variable/CMAKE_Swift_NUM_THREADS.rst b/Help/variable/CMAKE_Swift_NUM_THREADS.rst index cb33678..e1dafb0 100644 --- a/Help/variable/CMAKE_Swift_NUM_THREADS.rst +++ b/Help/variable/CMAKE_Swift_NUM_THREADS.rst @@ -1,6 +1,8 @@ CMAKE_Swift_NUM_THREADS ----------------------- +.. versionadded:: 3.15.1 + Number of threads for parallel compilation for Swift targets. This variable controls the number of parallel jobs that the swift driver creates diff --git a/Help/variable/CMAKE_TRY_COMPILE_PLATFORM_VARIABLES.rst b/Help/variable/CMAKE_TRY_COMPILE_PLATFORM_VARIABLES.rst index 0f96787..d178513 100644 --- a/Help/variable/CMAKE_TRY_COMPILE_PLATFORM_VARIABLES.rst +++ b/Help/variable/CMAKE_TRY_COMPILE_PLATFORM_VARIABLES.rst @@ -1,6 +1,8 @@ CMAKE_TRY_COMPILE_PLATFORM_VARIABLES ------------------------------------ +.. versionadded:: 3.6 + List of variables that the :command:`try_compile` command source file signature must propagate into the test project in order to target the same platform as the host project. diff --git a/Help/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.rst b/Help/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.rst index 5fa8dfc..b60539f 100644 --- a/Help/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.rst +++ b/Help/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.rst @@ -1,6 +1,8 @@ CMAKE_TRY_COMPILE_TARGET_TYPE ----------------------------- +.. versionadded:: 3.6 + Type of target generated for :command:`try_compile` calls using the source file signature. Valid values are: diff --git a/Help/variable/CMAKE_UNITY_BUILD.rst b/Help/variable/CMAKE_UNITY_BUILD.rst index a86cd67..54a781a 100644 --- a/Help/variable/CMAKE_UNITY_BUILD.rst +++ b/Help/variable/CMAKE_UNITY_BUILD.rst @@ -1,6 +1,8 @@ CMAKE_UNITY_BUILD ----------------- +.. versionadded:: 3.16 + This variable is used to initialize the :prop_tgt:`UNITY_BUILD` property of targets when they are created. Setting it to true enables batch compilation of multiple sources within each target. diff --git a/Help/variable/CMAKE_UNITY_BUILD_BATCH_SIZE.rst b/Help/variable/CMAKE_UNITY_BUILD_BATCH_SIZE.rst index 7988d4b..7733fe8 100644 --- a/Help/variable/CMAKE_UNITY_BUILD_BATCH_SIZE.rst +++ b/Help/variable/CMAKE_UNITY_BUILD_BATCH_SIZE.rst @@ -1,6 +1,8 @@ CMAKE_UNITY_BUILD_BATCH_SIZE ---------------------------- +.. versionadded:: 3.16 + This variable is used to initialize the :prop_tgt:`UNITY_BUILD_BATCH_SIZE` property of targets when they are created. It specifies the default upper limit on the number of source files that may be combined in any one unity diff --git a/Help/variable/CMAKE_VS_GLOBALS.rst b/Help/variable/CMAKE_VS_GLOBALS.rst index 83777b6..d4514fe 100644 --- a/Help/variable/CMAKE_VS_GLOBALS.rst +++ b/Help/variable/CMAKE_VS_GLOBALS.rst @@ -1,6 +1,8 @@ CMAKE_VS_GLOBALS ---------------- +.. versionadded:: 3.13 + List of ``Key=Value`` records to be set per target as target properties :prop_tgt:`VS_GLOBAL_<variable>` with ``variable=Key`` and value ``Value``. diff --git a/Help/variable/CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD.rst b/Help/variable/CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD.rst index f54472a..ace94e4 100644 --- a/Help/variable/CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD.rst +++ b/Help/variable/CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD.rst @@ -1,6 +1,8 @@ CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD ----------------------------------------- +.. versionadded:: 3.3 + Include ``INSTALL`` target to default build. In Visual Studio solution, by default the ``INSTALL`` target will not be part diff --git a/Help/variable/CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD.rst b/Help/variable/CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD.rst index 693ba45..ab4d0fa 100644 --- a/Help/variable/CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD.rst +++ b/Help/variable/CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD.rst @@ -1,6 +1,8 @@ CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD ----------------------------------------- +.. versionadded:: 3.8 + Include ``PACKAGE`` target to default build. In Visual Studio solution, by default the ``PACKAGE`` target will not be part diff --git a/Help/variable/CMAKE_VS_JUST_MY_CODE_DEBUGGING.rst b/Help/variable/CMAKE_VS_JUST_MY_CODE_DEBUGGING.rst index 546cdf4..0a02a32 100644 --- a/Help/variable/CMAKE_VS_JUST_MY_CODE_DEBUGGING.rst +++ b/Help/variable/CMAKE_VS_JUST_MY_CODE_DEBUGGING.rst @@ -1,6 +1,8 @@ CMAKE_VS_JUST_MY_CODE_DEBUGGING ------------------------------- +.. versionadded:: 3.15 + Enable Just My Code with Visual Studio debugger. This variable is used to initialize the :prop_tgt:`VS_JUST_MY_CODE_DEBUGGING` diff --git a/Help/variable/CMAKE_VS_NsightTegra_VERSION.rst b/Help/variable/CMAKE_VS_NsightTegra_VERSION.rst index 386c3a9..2982b39 100644 --- a/Help/variable/CMAKE_VS_NsightTegra_VERSION.rst +++ b/Help/variable/CMAKE_VS_NsightTegra_VERSION.rst @@ -1,6 +1,8 @@ CMAKE_VS_NsightTegra_VERSION ---------------------------- +.. versionadded:: 3.1 + When using a Visual Studio generator with the :variable:`CMAKE_SYSTEM_NAME` variable set to ``Android``, this variable contains the version number of the diff --git a/Help/variable/CMAKE_VS_PLATFORM_NAME.rst b/Help/variable/CMAKE_VS_PLATFORM_NAME.rst index 7a4642a..7d08add 100644 --- a/Help/variable/CMAKE_VS_PLATFORM_NAME.rst +++ b/Help/variable/CMAKE_VS_PLATFORM_NAME.rst @@ -1,6 +1,8 @@ CMAKE_VS_PLATFORM_NAME ---------------------- +.. versionadded:: 3.1 + Visual Studio target platform name used by the current generator. VS 8 and above allow project files to specify a target platform. diff --git a/Help/variable/CMAKE_VS_PLATFORM_NAME_DEFAULT.rst b/Help/variable/CMAKE_VS_PLATFORM_NAME_DEFAULT.rst index c18e6fd..6440174 100644 --- a/Help/variable/CMAKE_VS_PLATFORM_NAME_DEFAULT.rst +++ b/Help/variable/CMAKE_VS_PLATFORM_NAME_DEFAULT.rst @@ -1,6 +1,8 @@ CMAKE_VS_PLATFORM_NAME_DEFAULT ------------------------------ +.. versionadded:: 3.14.3 + Default for the Visual Studio target platform name for the current generator without considering the value of the :variable:`CMAKE_GENERATOR_PLATFORM` variable. For :ref:`Visual Studio Generators` for VS 2017 and below this is diff --git a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_CUDA.rst b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_CUDA.rst index 67b7f74..e66378d 100644 --- a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_CUDA.rst +++ b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_CUDA.rst @@ -1,6 +1,8 @@ CMAKE_VS_PLATFORM_TOOLSET_CUDA ------------------------------ +.. versionadded:: 3.9 + NVIDIA CUDA Toolkit version whose Visual Studio toolset to use. The :ref:`Visual Studio Generators` for VS 2010 and above support using diff --git a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR.rst b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR.rst index 060648a..74db6b1 100644 --- a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR.rst +++ b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR.rst @@ -1,6 +1,8 @@ CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR ----------------------------------------- +.. versionadded:: 3.16 + Path to standalone NVIDIA CUDA Toolkit (eg. extracted from installer). The :ref:`Visual Studio Generators` for VS 2010 and above support using diff --git a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst index 99ac90d..84d7212 100644 --- a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst +++ b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst @@ -1,6 +1,8 @@ CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE ------------------------------------------- +.. versionadded:: 3.8 + Visual Studio preferred tool architecture. The :ref:`Visual Studio Generators` for VS 2013 and above support using diff --git a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_VERSION.rst b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_VERSION.rst index 4d9b978..64f2e39 100644 --- a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_VERSION.rst +++ b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_VERSION.rst @@ -1,6 +1,8 @@ CMAKE_VS_PLATFORM_TOOLSET_VERSION --------------------------------- +.. versionadded:: 3.12 + Visual Studio Platform Toolset version. The :ref:`Visual Studio Generators` for VS 2017 and above allow to diff --git a/Help/variable/CMAKE_VS_SDK_EXCLUDE_DIRECTORIES.rst b/Help/variable/CMAKE_VS_SDK_EXCLUDE_DIRECTORIES.rst index 36c4dcc..969f328 100644 --- a/Help/variable/CMAKE_VS_SDK_EXCLUDE_DIRECTORIES.rst +++ b/Help/variable/CMAKE_VS_SDK_EXCLUDE_DIRECTORIES.rst @@ -1,4 +1,6 @@ CMAKE_VS_SDK_EXCLUDE_DIRECTORIES -------------------------------- +.. versionadded:: 3.12 + This variable allows to override Visual Studio default Exclude Directories. diff --git a/Help/variable/CMAKE_VS_SDK_EXECUTABLE_DIRECTORIES.rst b/Help/variable/CMAKE_VS_SDK_EXECUTABLE_DIRECTORIES.rst index 3ec755b..7455e10 100644 --- a/Help/variable/CMAKE_VS_SDK_EXECUTABLE_DIRECTORIES.rst +++ b/Help/variable/CMAKE_VS_SDK_EXECUTABLE_DIRECTORIES.rst @@ -1,4 +1,6 @@ CMAKE_VS_SDK_EXECUTABLE_DIRECTORIES ----------------------------------- +.. versionadded:: 3.12 + This variable allows to override Visual Studio default Executable Directories. diff --git a/Help/variable/CMAKE_VS_SDK_INCLUDE_DIRECTORIES.rst b/Help/variable/CMAKE_VS_SDK_INCLUDE_DIRECTORIES.rst index da10bde..3f27aea 100644 --- a/Help/variable/CMAKE_VS_SDK_INCLUDE_DIRECTORIES.rst +++ b/Help/variable/CMAKE_VS_SDK_INCLUDE_DIRECTORIES.rst @@ -1,4 +1,6 @@ CMAKE_VS_SDK_INCLUDE_DIRECTORIES -------------------------------- +.. versionadded:: 3.12 + This variable allows to override Visual Studio default Include Directories. diff --git a/Help/variable/CMAKE_VS_SDK_LIBRARY_DIRECTORIES.rst b/Help/variable/CMAKE_VS_SDK_LIBRARY_DIRECTORIES.rst index b33754a..35e45a3 100644 --- a/Help/variable/CMAKE_VS_SDK_LIBRARY_DIRECTORIES.rst +++ b/Help/variable/CMAKE_VS_SDK_LIBRARY_DIRECTORIES.rst @@ -1,4 +1,6 @@ CMAKE_VS_SDK_LIBRARY_DIRECTORIES -------------------------------- +.. versionadded:: 3.12 + This variable allows to override Visual Studio default Library Directories. diff --git a/Help/variable/CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES.rst b/Help/variable/CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES.rst index b022215..24b90b6 100644 --- a/Help/variable/CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES.rst +++ b/Help/variable/CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES.rst @@ -1,5 +1,7 @@ CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES -------------------------------------- +.. versionadded:: 3.12 + This variable allows to override Visual Studio default Library WinRT Directories. diff --git a/Help/variable/CMAKE_VS_SDK_REFERENCE_DIRECTORIES.rst b/Help/variable/CMAKE_VS_SDK_REFERENCE_DIRECTORIES.rst index c03f0ae..00382fe 100644 --- a/Help/variable/CMAKE_VS_SDK_REFERENCE_DIRECTORIES.rst +++ b/Help/variable/CMAKE_VS_SDK_REFERENCE_DIRECTORIES.rst @@ -1,4 +1,6 @@ CMAKE_VS_SDK_REFERENCE_DIRECTORIES ---------------------------------- +.. versionadded:: 3.12 + This variable allows to override Visual Studio default Reference Directories. diff --git a/Help/variable/CMAKE_VS_SDK_SOURCE_DIRECTORIES.rst b/Help/variable/CMAKE_VS_SDK_SOURCE_DIRECTORIES.rst index 0c73f06..b98c999 100644 --- a/Help/variable/CMAKE_VS_SDK_SOURCE_DIRECTORIES.rst +++ b/Help/variable/CMAKE_VS_SDK_SOURCE_DIRECTORIES.rst @@ -1,4 +1,6 @@ CMAKE_VS_SDK_SOURCE_DIRECTORIES ------------------------------- +.. versionadded:: 3.12 + This variable allows to override Visual Studio default Source Directories. diff --git a/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst b/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst index 83b9bc1..cb55bc2 100644 --- a/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst +++ b/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst @@ -1,6 +1,8 @@ CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION ---------------------------------------- +.. versionadded:: 3.4 + Visual Studio Windows Target Platform Version. When targeting Windows 10 and above Visual Studio 2015 and above support diff --git a/Help/variable/CMAKE_VS_WINRT_BY_DEFAULT.rst b/Help/variable/CMAKE_VS_WINRT_BY_DEFAULT.rst index 2eea424..9ded85f 100644 --- a/Help/variable/CMAKE_VS_WINRT_BY_DEFAULT.rst +++ b/Help/variable/CMAKE_VS_WINRT_BY_DEFAULT.rst @@ -1,6 +1,8 @@ CMAKE_VS_WINRT_BY_DEFAULT ------------------------- +.. versionadded:: 3.13 + Inform :ref:`Visual Studio Generators` for VS 2010 and above that the target platform enables WinRT compilation by default and it needs to be explicitly disabled if ``/ZW`` or :prop_tgt:`VS_WINRT_COMPONENT` is diff --git a/Help/variable/CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS.rst b/Help/variable/CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS.rst index 1636842..7b01185 100644 --- a/Help/variable/CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS.rst +++ b/Help/variable/CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS.rst @@ -1,6 +1,8 @@ CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS -------------------------------- +.. versionadded:: 3.4 + Default value for :prop_tgt:`WINDOWS_EXPORT_ALL_SYMBOLS` target property. This variable is used to initialize the property on each target as it is created. diff --git a/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst b/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst index be683d6..90e4c0e 100644 --- a/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst +++ b/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst @@ -1,6 +1,8 @@ CMAKE_XCODE_ATTRIBUTE_<an-attribute> ------------------------------------ +.. versionadded:: 3.1 + Set Xcode target attributes directly. Tell the :generator:`Xcode` generator to set '<an-attribute>' to a given value diff --git a/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst b/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst index 5b1a003..40070e1 100644 --- a/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst +++ b/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst @@ -1,6 +1,8 @@ CMAKE_XCODE_GENERATE_SCHEME --------------------------- +.. versionadded:: 3.9 + If enabled, the :generator:`Xcode` generator will generate schema files. These are useful to invoke analyze, archive, build-for-testing and test actions from the command line. diff --git a/Help/variable/CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY.rst b/Help/variable/CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY.rst index ea3e240..38d043c 100644 --- a/Help/variable/CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY.rst +++ b/Help/variable/CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY.rst @@ -1,6 +1,8 @@ CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY ------------------------------------------- +.. versionadded:: 3.11 + If enabled, the :generator:`Xcode` generator will generate only a single Xcode project file for the topmost :command:`project()` command instead of generating one for every ``project()`` command. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER.rst b/Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER.rst index b972ba5..b3fa93b 100644 --- a/Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER.rst +++ b/Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER.rst @@ -1,6 +1,8 @@ CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER ------------------------------------ +.. versionadded:: 3.13 + Whether to enable ``Address Sanitizer`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst b/Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst index 59eb32d..1a0a17a 100644 --- a/Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst +++ b/Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst @@ -1,6 +1,8 @@ CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN ----------------------------------------------------- +.. versionadded:: 3.13 + Whether to enable ``Detect use of stack after return`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING.rst b/Help/variable/CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING.rst index a264d36..917fc7f 100644 --- a/Help/variable/CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING.rst +++ b/Help/variable/CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING.rst @@ -1,6 +1,8 @@ CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING -------------------------------------------- +.. versionadded:: 3.16 + Whether to enable ``Allow debugging when using document Versions Browser`` in the Options section of the generated Xcode scheme. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst b/Help/variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst index 71bcf42..b604598 100644 --- a/Help/variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst +++ b/Help/variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst @@ -1,6 +1,8 @@ CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER ---------------------------------------------- +.. versionadded:: 3.13 + Whether to disable the ``Main Thread Checker`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst b/Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst index 53f55e6..070ddfc 100644 --- a/Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst +++ b/Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst @@ -1,6 +1,8 @@ CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS ---------------------------------------- +.. versionadded:: 3.13 + Whether to enable ``Dynamic Library Loads`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst b/Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst index 784ceb6..4291816 100644 --- a/Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst +++ b/Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst @@ -1,6 +1,8 @@ CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE ------------------------------------------- +.. versionadded:: 3.13 + Whether to enable ``Dynamic Linker API usage`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_ENVIRONMENT.rst b/Help/variable/CMAKE_XCODE_SCHEME_ENVIRONMENT.rst index 4832659..62b698d 100644 --- a/Help/variable/CMAKE_XCODE_SCHEME_ENVIRONMENT.rst +++ b/Help/variable/CMAKE_XCODE_SCHEME_ENVIRONMENT.rst @@ -1,6 +1,8 @@ CMAKE_XCODE_SCHEME_ENVIRONMENT ------------------------------ +.. versionadded:: 3.17 + Specify environment variables that should be added to the Arguments section of the generated Xcode scheme. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_GUARD_MALLOC.rst b/Help/variable/CMAKE_XCODE_SCHEME_GUARD_MALLOC.rst index 9350244..48b481e 100644 --- a/Help/variable/CMAKE_XCODE_SCHEME_GUARD_MALLOC.rst +++ b/Help/variable/CMAKE_XCODE_SCHEME_GUARD_MALLOC.rst @@ -1,6 +1,8 @@ CMAKE_XCODE_SCHEME_GUARD_MALLOC ------------------------------- +.. versionadded:: 3.13 + Whether to enable ``Guard Malloc`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst b/Help/variable/CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst index 45a2dad..ef8ed9b 100644 --- a/Help/variable/CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst +++ b/Help/variable/CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst @@ -1,6 +1,8 @@ CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP ------------------------------------------- +.. versionadded:: 3.13 + Whether to enable the ``Main Thread Checker`` option ``Pause on issues`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES.rst b/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES.rst index 94d1c61..d4ae9eb 100644 --- a/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES.rst +++ b/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES.rst @@ -1,6 +1,8 @@ CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES ------------------------------------- +.. versionadded:: 3.13 + Whether to enable ``Malloc Guard Edges`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE.rst b/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE.rst index 9bf0eb4..e28f6a1 100644 --- a/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE.rst +++ b/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE.rst @@ -1,6 +1,8 @@ CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE ---------------------------------- +.. versionadded:: 3.13 + Whether to enable ``Malloc Scribble`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_STACK.rst b/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_STACK.rst index 4cc21ee..59fcfd3 100644 --- a/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_STACK.rst +++ b/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_STACK.rst @@ -1,6 +1,8 @@ CMAKE_XCODE_SCHEME_MALLOC_STACK ------------------------------- +.. versionadded:: 3.13 + Whether to enable ``Malloc Stack`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER.rst b/Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER.rst index 6d1b56e..511eb04 100644 --- a/Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER.rst +++ b/Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER.rst @@ -1,6 +1,8 @@ CMAKE_XCODE_SCHEME_THREAD_SANITIZER ----------------------------------- +.. versionadded:: 3.13 + Whether to enable ``Thread Sanitizer`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP.rst b/Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP.rst index de40478..6f3b8ce 100644 --- a/Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP.rst +++ b/Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP.rst @@ -1,6 +1,8 @@ CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP ---------------------------------------- +.. versionadded:: 3.13 + Whether to enable ``Thread Sanitizer - Pause on issues`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst b/Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst index ec5df66..46d3ccf 100644 --- a/Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst +++ b/Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst @@ -1,6 +1,8 @@ CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER ------------------------------------------------ +.. versionadded:: 3.13 + Whether to enable ``Undefined Behavior Sanitizer`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst b/Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst index dcec9b0..8fa5ece 100644 --- a/Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst +++ b/Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst @@ -1,6 +1,8 @@ CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP ----------------------------------------------------- +.. versionadded:: 3.13 + Whether to enable ``Undefined Behavior Sanitizer`` option ``Pause on issues`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_WORKING_DIRECTORY.rst b/Help/variable/CMAKE_XCODE_SCHEME_WORKING_DIRECTORY.rst index 5bb7907..4221e48 100644 --- a/Help/variable/CMAKE_XCODE_SCHEME_WORKING_DIRECTORY.rst +++ b/Help/variable/CMAKE_XCODE_SCHEME_WORKING_DIRECTORY.rst @@ -1,6 +1,8 @@ CMAKE_XCODE_SCHEME_WORKING_DIRECTORY ------------------------------------ +.. versionadded:: 3.17 + Specify the ``Working Directory`` of the *Run* and *Profile* actions in the generated Xcode scheme. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS.rst b/Help/variable/CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS.rst index 82e9d76..fd9488e 100644 --- a/Help/variable/CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS.rst +++ b/Help/variable/CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS.rst @@ -1,6 +1,8 @@ CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS --------------------------------- +.. versionadded:: 3.13 + Whether to enable ``Zombie Objects`` in the Diagnostics section of the generated Xcode scheme. diff --git a/Help/variable/CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS.rst b/Help/variable/CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS.rst index 83d5ce7..01fb189 100644 --- a/Help/variable/CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS.rst +++ b/Help/variable/CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS.rst @@ -1,6 +1,8 @@ CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS ------------------------------------------- +.. versionadded:: 3.11 + Default permissions for implicitly created directories during packaging. This variable serves the same purpose during packaging as the diff --git a/Help/variable/CTEST_BINARY_DIRECTORY.rst b/Help/variable/CTEST_BINARY_DIRECTORY.rst index fd8461f..8413e37 100644 --- a/Help/variable/CTEST_BINARY_DIRECTORY.rst +++ b/Help/variable/CTEST_BINARY_DIRECTORY.rst @@ -1,5 +1,7 @@ CTEST_BINARY_DIRECTORY ---------------------- +.. versionadded:: 3.1 + Specify the CTest ``BuildDirectory`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_BUILD_COMMAND.rst b/Help/variable/CTEST_BUILD_COMMAND.rst index 7b13ba0..31c44e2 100644 --- a/Help/variable/CTEST_BUILD_COMMAND.rst +++ b/Help/variable/CTEST_BUILD_COMMAND.rst @@ -1,5 +1,7 @@ CTEST_BUILD_COMMAND ------------------- +.. versionadded:: 3.1 + Specify the CTest ``MakeCommand`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_BUILD_NAME.rst b/Help/variable/CTEST_BUILD_NAME.rst index d25d84c..3d08397 100644 --- a/Help/variable/CTEST_BUILD_NAME.rst +++ b/Help/variable/CTEST_BUILD_NAME.rst @@ -1,5 +1,7 @@ CTEST_BUILD_NAME ---------------- +.. versionadded:: 3.1 + Specify the CTest ``BuildName`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_BZR_COMMAND.rst b/Help/variable/CTEST_BZR_COMMAND.rst index 474d621..0c05d1a 100644 --- a/Help/variable/CTEST_BZR_COMMAND.rst +++ b/Help/variable/CTEST_BZR_COMMAND.rst @@ -1,5 +1,7 @@ CTEST_BZR_COMMAND ----------------- +.. versionadded:: 3.1 + Specify the CTest ``BZRCommand`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_BZR_UPDATE_OPTIONS.rst b/Help/variable/CTEST_BZR_UPDATE_OPTIONS.rst index d0f9579..4dd5e5b 100644 --- a/Help/variable/CTEST_BZR_UPDATE_OPTIONS.rst +++ b/Help/variable/CTEST_BZR_UPDATE_OPTIONS.rst @@ -1,5 +1,7 @@ CTEST_BZR_UPDATE_OPTIONS ------------------------ +.. versionadded:: 3.1 + Specify the CTest ``BZRUpdateOptions`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_CHANGE_ID.rst b/Help/variable/CTEST_CHANGE_ID.rst index a423f49..a6d15f7 100644 --- a/Help/variable/CTEST_CHANGE_ID.rst +++ b/Help/variable/CTEST_CHANGE_ID.rst @@ -1,6 +1,8 @@ CTEST_CHANGE_ID --------------- +.. versionadded:: 3.4 + Specify the CTest ``ChangeId`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_CHECKOUT_COMMAND.rst b/Help/variable/CTEST_CHECKOUT_COMMAND.rst index da256f2..852c28e 100644 --- a/Help/variable/CTEST_CHECKOUT_COMMAND.rst +++ b/Help/variable/CTEST_CHECKOUT_COMMAND.rst @@ -1,5 +1,7 @@ CTEST_CHECKOUT_COMMAND ---------------------- +.. versionadded:: 3.1 + Tell the :command:`ctest_start` command how to checkout or initialize the source directory in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_CONFIGURATION_TYPE.rst b/Help/variable/CTEST_CONFIGURATION_TYPE.rst index 9e277fa..392845e 100644 --- a/Help/variable/CTEST_CONFIGURATION_TYPE.rst +++ b/Help/variable/CTEST_CONFIGURATION_TYPE.rst @@ -1,6 +1,8 @@ CTEST_CONFIGURATION_TYPE ------------------------ +.. versionadded:: 3.1 + Specify the CTest ``DefaultCTestConfigurationType`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_CONFIGURE_COMMAND.rst b/Help/variable/CTEST_CONFIGURE_COMMAND.rst index 5561b6d..992ef47 100644 --- a/Help/variable/CTEST_CONFIGURE_COMMAND.rst +++ b/Help/variable/CTEST_CONFIGURE_COMMAND.rst @@ -1,5 +1,7 @@ CTEST_CONFIGURE_COMMAND ----------------------- +.. versionadded:: 3.1 + Specify the CTest ``ConfigureCommand`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_COVERAGE_COMMAND.rst b/Help/variable/CTEST_COVERAGE_COMMAND.rst index a78792e..f5425cb 100644 --- a/Help/variable/CTEST_COVERAGE_COMMAND.rst +++ b/Help/variable/CTEST_COVERAGE_COMMAND.rst @@ -1,6 +1,8 @@ CTEST_COVERAGE_COMMAND ---------------------- +.. versionadded:: 3.1 + Specify the CTest ``CoverageCommand`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_COVERAGE_EXTRA_FLAGS.rst b/Help/variable/CTEST_COVERAGE_EXTRA_FLAGS.rst index 2981955..39d9b5d 100644 --- a/Help/variable/CTEST_COVERAGE_EXTRA_FLAGS.rst +++ b/Help/variable/CTEST_COVERAGE_EXTRA_FLAGS.rst @@ -1,5 +1,7 @@ CTEST_COVERAGE_EXTRA_FLAGS -------------------------- +.. versionadded:: 3.1 + Specify the CTest ``CoverageExtraFlags`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_CURL_OPTIONS.rst b/Help/variable/CTEST_CURL_OPTIONS.rst index fc5dfc4..14af4e4 100644 --- a/Help/variable/CTEST_CURL_OPTIONS.rst +++ b/Help/variable/CTEST_CURL_OPTIONS.rst @@ -1,5 +1,7 @@ CTEST_CURL_OPTIONS ------------------ +.. versionadded:: 3.1 + Specify the CTest ``CurlOptions`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_CUSTOM_COVERAGE_EXCLUDE.rst b/Help/variable/CTEST_CUSTOM_COVERAGE_EXCLUDE.rst index d5893c9..84ba12d 100644 --- a/Help/variable/CTEST_CUSTOM_COVERAGE_EXCLUDE.rst +++ b/Help/variable/CTEST_CUSTOM_COVERAGE_EXCLUDE.rst @@ -1,6 +1,8 @@ CTEST_CUSTOM_COVERAGE_EXCLUDE ----------------------------- +.. versionadded:: 3.4 + A list of regular expressions which will be used to exclude files by their path from coverage output by the :command:`ctest_coverage` command. diff --git a/Help/variable/CTEST_CUSTOM_ERROR_EXCEPTION.rst b/Help/variable/CTEST_CUSTOM_ERROR_EXCEPTION.rst index cd65ae3..7191ce4 100644 --- a/Help/variable/CTEST_CUSTOM_ERROR_EXCEPTION.rst +++ b/Help/variable/CTEST_CUSTOM_ERROR_EXCEPTION.rst @@ -1,6 +1,8 @@ CTEST_CUSTOM_ERROR_EXCEPTION ---------------------------- +.. versionadded:: 3.4 + A list of regular expressions which will be used to exclude when detecting error messages in build outputs by the :command:`ctest_test` command. diff --git a/Help/variable/CTEST_CUSTOM_ERROR_MATCH.rst b/Help/variable/CTEST_CUSTOM_ERROR_MATCH.rst index 558f5e5..5d213f2 100644 --- a/Help/variable/CTEST_CUSTOM_ERROR_MATCH.rst +++ b/Help/variable/CTEST_CUSTOM_ERROR_MATCH.rst @@ -1,6 +1,8 @@ CTEST_CUSTOM_ERROR_MATCH ------------------------ +.. versionadded:: 3.4 + A list of regular expressions which will be used to detect error messages in build outputs by the :command:`ctest_test` command. diff --git a/Help/variable/CTEST_CUSTOM_ERROR_POST_CONTEXT.rst b/Help/variable/CTEST_CUSTOM_ERROR_POST_CONTEXT.rst index 614859b..452d060 100644 --- a/Help/variable/CTEST_CUSTOM_ERROR_POST_CONTEXT.rst +++ b/Help/variable/CTEST_CUSTOM_ERROR_POST_CONTEXT.rst @@ -1,6 +1,8 @@ CTEST_CUSTOM_ERROR_POST_CONTEXT ------------------------------- +.. versionadded:: 3.4 + The number of lines to include as context which follow an error message by the :command:`ctest_test` command. The default is 10. diff --git a/Help/variable/CTEST_CUSTOM_ERROR_PRE_CONTEXT.rst b/Help/variable/CTEST_CUSTOM_ERROR_PRE_CONTEXT.rst index 74dc47a..b7717dd 100644 --- a/Help/variable/CTEST_CUSTOM_ERROR_PRE_CONTEXT.rst +++ b/Help/variable/CTEST_CUSTOM_ERROR_PRE_CONTEXT.rst @@ -1,6 +1,8 @@ CTEST_CUSTOM_ERROR_PRE_CONTEXT ------------------------------ +.. versionadded:: 3.4 + The number of lines to include as context which precede an error message by the :command:`ctest_test` command. The default is 10. diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst index 5aeae88..31ba099 100644 --- a/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst +++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst @@ -1,6 +1,8 @@ CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE -------------------------------------------- +.. versionadded:: 3.4 + When saving a failing test's output, this is the maximum size, in bytes, that will be collected by the :command:`ctest_test` command. Defaults to 307200 (300 KiB). diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS.rst index 920cb04..e5be1ad 100644 --- a/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS.rst +++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS.rst @@ -1,6 +1,8 @@ CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS ------------------------------------- +.. versionadded:: 3.4 + The maximum number of errors in a single build step which will be detected. After this, the :command:`ctest_test` command will truncate the output. Defaults to 50. diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS.rst index a1f1cc1..b513a5c 100644 --- a/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS.rst +++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS.rst @@ -1,6 +1,8 @@ CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS --------------------------------------- +.. versionadded:: 3.4 + The maximum number of warnings in a single build step which will be detected. After this, the :command:`ctest_test` command will truncate the output. Defaults to 50. diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst index 1fbb8c5..08762d8 100644 --- a/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst +++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst @@ -1,6 +1,8 @@ CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE -------------------------------------------- +.. versionadded:: 3.4 + When saving a passing test's output, this is the maximum size, in bytes, that will be collected by the :command:`ctest_test` command. Defaults to 1024 (1 KiB). diff --git a/Help/variable/CTEST_CUSTOM_MEMCHECK_IGNORE.rst b/Help/variable/CTEST_CUSTOM_MEMCHECK_IGNORE.rst index 578576c..405fc33 100644 --- a/Help/variable/CTEST_CUSTOM_MEMCHECK_IGNORE.rst +++ b/Help/variable/CTEST_CUSTOM_MEMCHECK_IGNORE.rst @@ -1,6 +1,8 @@ CTEST_CUSTOM_MEMCHECK_IGNORE ---------------------------- +.. versionadded:: 3.4 + A list of regular expressions to use to exclude tests during the :command:`ctest_memcheck` command. diff --git a/Help/variable/CTEST_CUSTOM_POST_MEMCHECK.rst b/Help/variable/CTEST_CUSTOM_POST_MEMCHECK.rst index 40291fe..5e488a7 100644 --- a/Help/variable/CTEST_CUSTOM_POST_MEMCHECK.rst +++ b/Help/variable/CTEST_CUSTOM_POST_MEMCHECK.rst @@ -1,6 +1,8 @@ CTEST_CUSTOM_POST_MEMCHECK -------------------------- +.. versionadded:: 3.4 + A list of commands to run at the end of the :command:`ctest_memcheck` command. .. include:: CTEST_CUSTOM_XXX.txt diff --git a/Help/variable/CTEST_CUSTOM_POST_TEST.rst b/Help/variable/CTEST_CUSTOM_POST_TEST.rst index 791292c..7ec42f7 100644 --- a/Help/variable/CTEST_CUSTOM_POST_TEST.rst +++ b/Help/variable/CTEST_CUSTOM_POST_TEST.rst @@ -1,6 +1,8 @@ CTEST_CUSTOM_POST_TEST ---------------------- +.. versionadded:: 3.4 + A list of commands to run at the end of the :command:`ctest_test` command. .. include:: CTEST_CUSTOM_XXX.txt diff --git a/Help/variable/CTEST_CUSTOM_PRE_MEMCHECK.rst b/Help/variable/CTEST_CUSTOM_PRE_MEMCHECK.rst index 00de8aa..99e47bd 100644 --- a/Help/variable/CTEST_CUSTOM_PRE_MEMCHECK.rst +++ b/Help/variable/CTEST_CUSTOM_PRE_MEMCHECK.rst @@ -1,6 +1,8 @@ CTEST_CUSTOM_PRE_MEMCHECK ------------------------- +.. versionadded:: 3.4 + A list of commands to run at the start of the :command:`ctest_memcheck` command. diff --git a/Help/variable/CTEST_CUSTOM_PRE_TEST.rst b/Help/variable/CTEST_CUSTOM_PRE_TEST.rst index 6af7152..95c6314 100644 --- a/Help/variable/CTEST_CUSTOM_PRE_TEST.rst +++ b/Help/variable/CTEST_CUSTOM_PRE_TEST.rst @@ -1,6 +1,8 @@ CTEST_CUSTOM_PRE_TEST ---------------------- +.. versionadded:: 3.4 + A list of commands to run at the start of the :command:`ctest_test` command. .. include:: CTEST_CUSTOM_XXX.txt diff --git a/Help/variable/CTEST_CUSTOM_TESTS_IGNORE.rst b/Help/variable/CTEST_CUSTOM_TESTS_IGNORE.rst index 57222ca..27a75d9 100644 --- a/Help/variable/CTEST_CUSTOM_TESTS_IGNORE.rst +++ b/Help/variable/CTEST_CUSTOM_TESTS_IGNORE.rst @@ -1,6 +1,8 @@ CTEST_CUSTOM_TESTS_IGNORE ------------------------- +.. versionadded:: 3.14 + A list of regular expressions to use to exclude tests during the :command:`ctest_test` command. diff --git a/Help/variable/CTEST_CUSTOM_WARNING_EXCEPTION.rst b/Help/variable/CTEST_CUSTOM_WARNING_EXCEPTION.rst index a03d473..539760b 100644 --- a/Help/variable/CTEST_CUSTOM_WARNING_EXCEPTION.rst +++ b/Help/variable/CTEST_CUSTOM_WARNING_EXCEPTION.rst @@ -1,6 +1,8 @@ CTEST_CUSTOM_WARNING_EXCEPTION ------------------------------ +.. versionadded:: 3.4 + A list of regular expressions which will be used to exclude when detecting warning messages in build outputs by the :command:`ctest_build` command. diff --git a/Help/variable/CTEST_CUSTOM_WARNING_MATCH.rst b/Help/variable/CTEST_CUSTOM_WARNING_MATCH.rst index 18aa6b3..53e7707 100644 --- a/Help/variable/CTEST_CUSTOM_WARNING_MATCH.rst +++ b/Help/variable/CTEST_CUSTOM_WARNING_MATCH.rst @@ -1,6 +1,8 @@ CTEST_CUSTOM_WARNING_MATCH -------------------------- +.. versionadded:: 3.4 + A list of regular expressions which will be used to detect warning messages in build outputs by the :command:`ctest_build` command. diff --git a/Help/variable/CTEST_CVS_CHECKOUT.rst b/Help/variable/CTEST_CVS_CHECKOUT.rst index 6431c02..32cf9eb 100644 --- a/Help/variable/CTEST_CVS_CHECKOUT.rst +++ b/Help/variable/CTEST_CVS_CHECKOUT.rst @@ -1,4 +1,6 @@ CTEST_CVS_CHECKOUT ------------------ +.. versionadded:: 3.1 + Deprecated. Use :variable:`CTEST_CHECKOUT_COMMAND` instead. diff --git a/Help/variable/CTEST_CVS_COMMAND.rst b/Help/variable/CTEST_CVS_COMMAND.rst index 049700b..7932070 100644 --- a/Help/variable/CTEST_CVS_COMMAND.rst +++ b/Help/variable/CTEST_CVS_COMMAND.rst @@ -1,5 +1,7 @@ CTEST_CVS_COMMAND ----------------- +.. versionadded:: 3.1 + Specify the CTest ``CVSCommand`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_CVS_UPDATE_OPTIONS.rst b/Help/variable/CTEST_CVS_UPDATE_OPTIONS.rst index d7f2f7c..359e708 100644 --- a/Help/variable/CTEST_CVS_UPDATE_OPTIONS.rst +++ b/Help/variable/CTEST_CVS_UPDATE_OPTIONS.rst @@ -1,5 +1,7 @@ CTEST_CVS_UPDATE_OPTIONS ------------------------ +.. versionadded:: 3.1 + Specify the CTest ``CVSUpdateOptions`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_DROP_LOCATION.rst b/Help/variable/CTEST_DROP_LOCATION.rst index c0f2215..f66793b 100644 --- a/Help/variable/CTEST_DROP_LOCATION.rst +++ b/Help/variable/CTEST_DROP_LOCATION.rst @@ -1,5 +1,7 @@ CTEST_DROP_LOCATION ------------------- +.. versionadded:: 3.1 + Specify the CTest ``DropLocation`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_DROP_METHOD.rst b/Help/variable/CTEST_DROP_METHOD.rst index 50fbd4d..3a84658 100644 --- a/Help/variable/CTEST_DROP_METHOD.rst +++ b/Help/variable/CTEST_DROP_METHOD.rst @@ -1,5 +1,7 @@ CTEST_DROP_METHOD ----------------- +.. versionadded:: 3.1 + Specify the CTest ``DropMethod`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_DROP_SITE.rst b/Help/variable/CTEST_DROP_SITE.rst index d15d99b..9c871e3 100644 --- a/Help/variable/CTEST_DROP_SITE.rst +++ b/Help/variable/CTEST_DROP_SITE.rst @@ -1,5 +1,7 @@ CTEST_DROP_SITE --------------- +.. versionadded:: 3.1 + Specify the CTest ``DropSite`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_DROP_SITE_CDASH.rst b/Help/variable/CTEST_DROP_SITE_CDASH.rst index 22b9776..dcdb286 100644 --- a/Help/variable/CTEST_DROP_SITE_CDASH.rst +++ b/Help/variable/CTEST_DROP_SITE_CDASH.rst @@ -1,5 +1,7 @@ CTEST_DROP_SITE_CDASH --------------------- +.. versionadded:: 3.1 + Specify the CTest ``IsCDash`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_DROP_SITE_PASSWORD.rst b/Help/variable/CTEST_DROP_SITE_PASSWORD.rst index 904d2c8..8259651 100644 --- a/Help/variable/CTEST_DROP_SITE_PASSWORD.rst +++ b/Help/variable/CTEST_DROP_SITE_PASSWORD.rst @@ -1,5 +1,7 @@ CTEST_DROP_SITE_PASSWORD ------------------------ +.. versionadded:: 3.1 + Specify the CTest ``DropSitePassword`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_DROP_SITE_USER.rst b/Help/variable/CTEST_DROP_SITE_USER.rst index a860a03..8d2e3a3 100644 --- a/Help/variable/CTEST_DROP_SITE_USER.rst +++ b/Help/variable/CTEST_DROP_SITE_USER.rst @@ -1,5 +1,7 @@ CTEST_DROP_SITE_USER -------------------- +.. versionadded:: 3.1 + Specify the CTest ``DropSiteUser`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_EXTRA_COVERAGE_GLOB.rst b/Help/variable/CTEST_EXTRA_COVERAGE_GLOB.rst index 286f7df..1d7e8d4 100644 --- a/Help/variable/CTEST_EXTRA_COVERAGE_GLOB.rst +++ b/Help/variable/CTEST_EXTRA_COVERAGE_GLOB.rst @@ -1,6 +1,8 @@ CTEST_EXTRA_COVERAGE_GLOB ------------------------- +.. versionadded:: 3.4 + A list of regular expressions which will be used to find files which should be covered by the :command:`ctest_coverage` command. diff --git a/Help/variable/CTEST_GIT_COMMAND.rst b/Help/variable/CTEST_GIT_COMMAND.rst index eb83792..eb9b440 100644 --- a/Help/variable/CTEST_GIT_COMMAND.rst +++ b/Help/variable/CTEST_GIT_COMMAND.rst @@ -1,5 +1,7 @@ CTEST_GIT_COMMAND ----------------- +.. versionadded:: 3.1 + Specify the CTest ``GITCommand`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_GIT_INIT_SUBMODULES.rst b/Help/variable/CTEST_GIT_INIT_SUBMODULES.rst index fd27003..529bfc7 100644 --- a/Help/variable/CTEST_GIT_INIT_SUBMODULES.rst +++ b/Help/variable/CTEST_GIT_INIT_SUBMODULES.rst @@ -1,5 +1,7 @@ CTEST_GIT_INIT_SUBMODULES ------------------------- +.. versionadded:: 3.6 + Specify the CTest ``GITInitSubmodules`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_GIT_UPDATE_CUSTOM.rst b/Help/variable/CTEST_GIT_UPDATE_CUSTOM.rst index 0c479e6..82a8a6a 100644 --- a/Help/variable/CTEST_GIT_UPDATE_CUSTOM.rst +++ b/Help/variable/CTEST_GIT_UPDATE_CUSTOM.rst @@ -1,5 +1,7 @@ CTEST_GIT_UPDATE_CUSTOM ----------------------- +.. versionadded:: 3.1 + Specify the CTest ``GITUpdateCustom`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_GIT_UPDATE_OPTIONS.rst b/Help/variable/CTEST_GIT_UPDATE_OPTIONS.rst index 4590a78..1568239 100644 --- a/Help/variable/CTEST_GIT_UPDATE_OPTIONS.rst +++ b/Help/variable/CTEST_GIT_UPDATE_OPTIONS.rst @@ -1,5 +1,7 @@ CTEST_GIT_UPDATE_OPTIONS ------------------------ +.. versionadded:: 3.1 + Specify the CTest ``GITUpdateOptions`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_HG_COMMAND.rst b/Help/variable/CTEST_HG_COMMAND.rst index 3854950..3372fe4 100644 --- a/Help/variable/CTEST_HG_COMMAND.rst +++ b/Help/variable/CTEST_HG_COMMAND.rst @@ -1,5 +1,7 @@ CTEST_HG_COMMAND ---------------- +.. versionadded:: 3.1 + Specify the CTest ``HGCommand`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_HG_UPDATE_OPTIONS.rst b/Help/variable/CTEST_HG_UPDATE_OPTIONS.rst index 9049c1f..85c6b03 100644 --- a/Help/variable/CTEST_HG_UPDATE_OPTIONS.rst +++ b/Help/variable/CTEST_HG_UPDATE_OPTIONS.rst @@ -1,5 +1,7 @@ CTEST_HG_UPDATE_OPTIONS ----------------------- +.. versionadded:: 3.1 + Specify the CTest ``HGUpdateOptions`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_LABELS_FOR_SUBPROJECTS.rst b/Help/variable/CTEST_LABELS_FOR_SUBPROJECTS.rst index 959596b..dd6d125 100644 --- a/Help/variable/CTEST_LABELS_FOR_SUBPROJECTS.rst +++ b/Help/variable/CTEST_LABELS_FOR_SUBPROJECTS.rst @@ -1,5 +1,7 @@ CTEST_LABELS_FOR_SUBPROJECTS ---------------------------- +.. versionadded:: 3.10 + Specify the CTest ``LabelsForSubprojects`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_MEMORYCHECK_COMMAND.rst b/Help/variable/CTEST_MEMORYCHECK_COMMAND.rst index 8c199ba..25f1bd9 100644 --- a/Help/variable/CTEST_MEMORYCHECK_COMMAND.rst +++ b/Help/variable/CTEST_MEMORYCHECK_COMMAND.rst @@ -1,5 +1,7 @@ CTEST_MEMORYCHECK_COMMAND ------------------------- +.. versionadded:: 3.1 + Specify the CTest ``MemoryCheckCommand`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_MEMORYCHECK_COMMAND_OPTIONS.rst b/Help/variable/CTEST_MEMORYCHECK_COMMAND_OPTIONS.rst index 3e26ab5..51830d5 100644 --- a/Help/variable/CTEST_MEMORYCHECK_COMMAND_OPTIONS.rst +++ b/Help/variable/CTEST_MEMORYCHECK_COMMAND_OPTIONS.rst @@ -1,5 +1,7 @@ CTEST_MEMORYCHECK_COMMAND_OPTIONS --------------------------------- +.. versionadded:: 3.1 + Specify the CTest ``MemoryCheckCommandOptions`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_MEMORYCHECK_SANITIZER_OPTIONS.rst b/Help/variable/CTEST_MEMORYCHECK_SANITIZER_OPTIONS.rst index 2de5fb6..6cd51fa 100644 --- a/Help/variable/CTEST_MEMORYCHECK_SANITIZER_OPTIONS.rst +++ b/Help/variable/CTEST_MEMORYCHECK_SANITIZER_OPTIONS.rst @@ -1,5 +1,7 @@ CTEST_MEMORYCHECK_SANITIZER_OPTIONS ----------------------------------- +.. versionadded:: 3.1 + Specify the CTest ``MemoryCheckSanitizerOptions`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_MEMORYCHECK_SUPPRESSIONS_FILE.rst b/Help/variable/CTEST_MEMORYCHECK_SUPPRESSIONS_FILE.rst index 1147ee8..a61a3ef 100644 --- a/Help/variable/CTEST_MEMORYCHECK_SUPPRESSIONS_FILE.rst +++ b/Help/variable/CTEST_MEMORYCHECK_SUPPRESSIONS_FILE.rst @@ -1,5 +1,7 @@ CTEST_MEMORYCHECK_SUPPRESSIONS_FILE ----------------------------------- +.. versionadded:: 3.1 + Specify the CTest ``MemoryCheckSuppressionFile`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_MEMORYCHECK_TYPE.rst b/Help/variable/CTEST_MEMORYCHECK_TYPE.rst index 4e7d5c0..2452228 100644 --- a/Help/variable/CTEST_MEMORYCHECK_TYPE.rst +++ b/Help/variable/CTEST_MEMORYCHECK_TYPE.rst @@ -1,6 +1,8 @@ CTEST_MEMORYCHECK_TYPE ---------------------- +.. versionadded:: 3.1 + Specify the CTest ``MemoryCheckType`` setting in a :manual:`ctest(1)` dashboard client script. Valid values are ``Valgrind``, ``Purify``, ``BoundsChecker``, ``DrMemory`` and diff --git a/Help/variable/CTEST_NIGHTLY_START_TIME.rst b/Help/variable/CTEST_NIGHTLY_START_TIME.rst index 90841f9..2d707d5 100644 --- a/Help/variable/CTEST_NIGHTLY_START_TIME.rst +++ b/Help/variable/CTEST_NIGHTLY_START_TIME.rst @@ -1,6 +1,8 @@ CTEST_NIGHTLY_START_TIME ------------------------ +.. versionadded:: 3.1 + Specify the CTest ``NightlyStartTime`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_P4_CLIENT.rst b/Help/variable/CTEST_P4_CLIENT.rst index 347ea54..0778c5b 100644 --- a/Help/variable/CTEST_P4_CLIENT.rst +++ b/Help/variable/CTEST_P4_CLIENT.rst @@ -1,5 +1,7 @@ CTEST_P4_CLIENT --------------- +.. versionadded:: 3.1 + Specify the CTest ``P4Client`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_P4_COMMAND.rst b/Help/variable/CTEST_P4_COMMAND.rst index defab12..5cc2a81 100644 --- a/Help/variable/CTEST_P4_COMMAND.rst +++ b/Help/variable/CTEST_P4_COMMAND.rst @@ -1,5 +1,7 @@ CTEST_P4_COMMAND ---------------- +.. versionadded:: 3.1 + Specify the CTest ``P4Command`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_P4_OPTIONS.rst b/Help/variable/CTEST_P4_OPTIONS.rst index fee4ce2..01b6534 100644 --- a/Help/variable/CTEST_P4_OPTIONS.rst +++ b/Help/variable/CTEST_P4_OPTIONS.rst @@ -1,5 +1,7 @@ CTEST_P4_OPTIONS ---------------- +.. versionadded:: 3.1 + Specify the CTest ``P4Options`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_P4_UPDATE_OPTIONS.rst b/Help/variable/CTEST_P4_UPDATE_OPTIONS.rst index 0e2790f..365aa3f 100644 --- a/Help/variable/CTEST_P4_UPDATE_OPTIONS.rst +++ b/Help/variable/CTEST_P4_UPDATE_OPTIONS.rst @@ -1,5 +1,7 @@ CTEST_P4_UPDATE_OPTIONS ----------------------- +.. versionadded:: 3.1 + Specify the CTest ``P4UpdateOptions`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_RESOURCE_SPEC_FILE.rst b/Help/variable/CTEST_RESOURCE_SPEC_FILE.rst index a6fdbc9..8e9bf01 100644 --- a/Help/variable/CTEST_RESOURCE_SPEC_FILE.rst +++ b/Help/variable/CTEST_RESOURCE_SPEC_FILE.rst @@ -1,6 +1,8 @@ CTEST_RESOURCE_SPEC_FILE ------------------------ +.. versionadded:: 3.18 + Specify the CTest ``ResourceSpecFile`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_RUN_CURRENT_SCRIPT.rst b/Help/variable/CTEST_RUN_CURRENT_SCRIPT.rst index abc123c..32c85ad 100644 --- a/Help/variable/CTEST_RUN_CURRENT_SCRIPT.rst +++ b/Help/variable/CTEST_RUN_CURRENT_SCRIPT.rst @@ -1,5 +1,7 @@ CTEST_RUN_CURRENT_SCRIPT ------------------------ +.. versionadded:: 3.11 + Setting this to 0 prevents :manual:`ctest(1)` from being run again when it reaches the end of a script run by calling ``ctest -S``. diff --git a/Help/variable/CTEST_SCP_COMMAND.rst b/Help/variable/CTEST_SCP_COMMAND.rst index 19ea8b3..155b058 100644 --- a/Help/variable/CTEST_SCP_COMMAND.rst +++ b/Help/variable/CTEST_SCP_COMMAND.rst @@ -1,4 +1,6 @@ CTEST_SCP_COMMAND ----------------- +.. versionadded:: 3.1 + Legacy option. Not used. diff --git a/Help/variable/CTEST_SITE.rst b/Help/variable/CTEST_SITE.rst index 8a5ec25..526e6ed 100644 --- a/Help/variable/CTEST_SITE.rst +++ b/Help/variable/CTEST_SITE.rst @@ -1,5 +1,7 @@ CTEST_SITE ---------- +.. versionadded:: 3.1 + Specify the CTest ``Site`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_SOURCE_DIRECTORY.rst b/Help/variable/CTEST_SOURCE_DIRECTORY.rst index b6837d1..4c6ac54 100644 --- a/Help/variable/CTEST_SOURCE_DIRECTORY.rst +++ b/Help/variable/CTEST_SOURCE_DIRECTORY.rst @@ -1,5 +1,7 @@ CTEST_SOURCE_DIRECTORY ---------------------- +.. versionadded:: 3.1 + Specify the CTest ``SourceDirectory`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_SUBMIT_URL.rst b/Help/variable/CTEST_SUBMIT_URL.rst index 7d84da4..b6e7f68 100644 --- a/Help/variable/CTEST_SUBMIT_URL.rst +++ b/Help/variable/CTEST_SUBMIT_URL.rst @@ -1,5 +1,7 @@ CTEST_SUBMIT_URL ---------------- +.. versionadded:: 3.14 + Specify the CTest ``SubmitURL`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_SVN_COMMAND.rst b/Help/variable/CTEST_SVN_COMMAND.rst index af90143..e97acd0 100644 --- a/Help/variable/CTEST_SVN_COMMAND.rst +++ b/Help/variable/CTEST_SVN_COMMAND.rst @@ -1,5 +1,7 @@ CTEST_SVN_COMMAND ----------------- +.. versionadded:: 3.1 + Specify the CTest ``SVNCommand`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_SVN_OPTIONS.rst b/Help/variable/CTEST_SVN_OPTIONS.rst index 76551dc..5326e20 100644 --- a/Help/variable/CTEST_SVN_OPTIONS.rst +++ b/Help/variable/CTEST_SVN_OPTIONS.rst @@ -1,5 +1,7 @@ CTEST_SVN_OPTIONS ----------------- +.. versionadded:: 3.1 + Specify the CTest ``SVNOptions`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_SVN_UPDATE_OPTIONS.rst b/Help/variable/CTEST_SVN_UPDATE_OPTIONS.rst index 5f01a19..24e0bbf 100644 --- a/Help/variable/CTEST_SVN_UPDATE_OPTIONS.rst +++ b/Help/variable/CTEST_SVN_UPDATE_OPTIONS.rst @@ -1,5 +1,7 @@ CTEST_SVN_UPDATE_OPTIONS ------------------------ +.. versionadded:: 3.1 + Specify the CTest ``SVNUpdateOptions`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_TEST_LOAD.rst b/Help/variable/CTEST_TEST_LOAD.rst index 80823fe..b6a9d62 100644 --- a/Help/variable/CTEST_TEST_LOAD.rst +++ b/Help/variable/CTEST_TEST_LOAD.rst @@ -1,6 +1,8 @@ CTEST_TEST_LOAD --------------- +.. versionadded:: 3.4 + Specify the ``TestLoad`` setting in the :ref:`CTest Test Step` of a :manual:`ctest(1)` dashboard client script. This sets the default value for the ``TEST_LOAD`` option of the :command:`ctest_test` diff --git a/Help/variable/CTEST_TEST_TIMEOUT.rst b/Help/variable/CTEST_TEST_TIMEOUT.rst index c031437..61d9191 100644 --- a/Help/variable/CTEST_TEST_TIMEOUT.rst +++ b/Help/variable/CTEST_TEST_TIMEOUT.rst @@ -1,5 +1,7 @@ CTEST_TEST_TIMEOUT ------------------ +.. versionadded:: 3.1 + Specify the CTest ``TimeOut`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_TRIGGER_SITE.rst b/Help/variable/CTEST_TRIGGER_SITE.rst index a50e405..6abb852 100644 --- a/Help/variable/CTEST_TRIGGER_SITE.rst +++ b/Help/variable/CTEST_TRIGGER_SITE.rst @@ -1,4 +1,6 @@ CTEST_TRIGGER_SITE ------------------ +.. versionadded:: 3.1 + Legacy option. Not used. diff --git a/Help/variable/CTEST_UPDATE_COMMAND.rst b/Help/variable/CTEST_UPDATE_COMMAND.rst index 90155d0..c4ed645 100644 --- a/Help/variable/CTEST_UPDATE_COMMAND.rst +++ b/Help/variable/CTEST_UPDATE_COMMAND.rst @@ -1,5 +1,7 @@ CTEST_UPDATE_COMMAND -------------------- +.. versionadded:: 3.1 + Specify the CTest ``UpdateCommand`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_UPDATE_OPTIONS.rst b/Help/variable/CTEST_UPDATE_OPTIONS.rst index e43d61d..96c4b6c 100644 --- a/Help/variable/CTEST_UPDATE_OPTIONS.rst +++ b/Help/variable/CTEST_UPDATE_OPTIONS.rst @@ -1,5 +1,7 @@ CTEST_UPDATE_OPTIONS -------------------- +.. versionadded:: 3.1 + Specify the CTest ``UpdateOptions`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_UPDATE_VERSION_ONLY.rst b/Help/variable/CTEST_UPDATE_VERSION_ONLY.rst index a862baa..f7c863c 100644 --- a/Help/variable/CTEST_UPDATE_VERSION_ONLY.rst +++ b/Help/variable/CTEST_UPDATE_VERSION_ONLY.rst @@ -1,5 +1,7 @@ CTEST_UPDATE_VERSION_ONLY ------------------------- +.. versionadded:: 3.1 + Specify the CTest :ref:`UpdateVersionOnly <UpdateVersionOnly>` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_UPDATE_VERSION_OVERRIDE.rst b/Help/variable/CTEST_UPDATE_VERSION_OVERRIDE.rst index 39fbaba..87918cb 100644 --- a/Help/variable/CTEST_UPDATE_VERSION_OVERRIDE.rst +++ b/Help/variable/CTEST_UPDATE_VERSION_OVERRIDE.rst @@ -1,5 +1,7 @@ CTEST_UPDATE_VERSION_OVERRIDE ----------------------------- +.. versionadded:: 3.15 + Specify the CTest :ref:`UpdateVersionOverride <UpdateVersionOverride>` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/CTEST_USE_LAUNCHERS.rst b/Help/variable/CTEST_USE_LAUNCHERS.rst index 9f48a2e..728cdc5 100644 --- a/Help/variable/CTEST_USE_LAUNCHERS.rst +++ b/Help/variable/CTEST_USE_LAUNCHERS.rst @@ -1,5 +1,7 @@ CTEST_USE_LAUNCHERS ------------------- +.. versionadded:: 3.1 + Specify the CTest ``UseLaunchers`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Help/variable/GHS-MULTI.rst b/Help/variable/GHS-MULTI.rst index fe3b17e..bb139af 100644 --- a/Help/variable/GHS-MULTI.rst +++ b/Help/variable/GHS-MULTI.rst @@ -1,4 +1,6 @@ GHS-MULTI --------- +.. versionadded:: 3.3 + ``True`` when using :generator:`Green Hills MULTI` generator. diff --git a/Help/variable/IOS.rst b/Help/variable/IOS.rst index e5cc3f6..b27be55 100644 --- a/Help/variable/IOS.rst +++ b/Help/variable/IOS.rst @@ -1,4 +1,6 @@ IOS --- +.. versionadded:: 3.14 + Set to ``1`` when the target system (:variable:`CMAKE_SYSTEM_NAME`) is ``iOS``. diff --git a/Help/variable/MINGW.rst b/Help/variable/MINGW.rst index 6d29be4..27c56ea 100644 --- a/Help/variable/MINGW.rst +++ b/Help/variable/MINGW.rst @@ -1,6 +1,8 @@ MINGW ----- +.. versionadded:: 3.2 + ``True`` when using MinGW Set to ``true`` when the compiler is some version of MinGW. diff --git a/Help/variable/MSVC14.rst b/Help/variable/MSVC14.rst index 79e0c10..1eb5183 100644 --- a/Help/variable/MSVC14.rst +++ b/Help/variable/MSVC14.rst @@ -1,6 +1,8 @@ MSVC14 ------ +.. versionadded:: 3.1 + Discouraged. Use the :variable:`MSVC_VERSION` variable instead. ``True`` when using the Microsoft Visual Studio ``v140`` or ``v141`` diff --git a/Help/variable/MSVC_TOOLSET_VERSION.rst b/Help/variable/MSVC_TOOLSET_VERSION.rst index f4a33e2..c642a9f 100644 --- a/Help/variable/MSVC_TOOLSET_VERSION.rst +++ b/Help/variable/MSVC_TOOLSET_VERSION.rst @@ -1,6 +1,8 @@ MSVC_TOOLSET_VERSION -------------------- +.. versionadded:: 3.12 + The toolset version of Microsoft Visual C/C++ being used if any. If MSVC-like is being used, this variable is set based on the version of the compiler as given by the :variable:`MSVC_VERSION` variable. diff --git a/Help/variable/MSYS.rst b/Help/variable/MSYS.rst index 25ddc7f..6be7681 100644 --- a/Help/variable/MSYS.rst +++ b/Help/variable/MSYS.rst @@ -1,4 +1,6 @@ MSYS ---- +.. versionadded:: 3.14 + ``True`` when using the :generator:`MSYS Makefiles` generator. diff --git a/Help/variable/PROJECT-NAME_DESCRIPTION.rst b/Help/variable/PROJECT-NAME_DESCRIPTION.rst index 2b88b1a..f372f5c 100644 --- a/Help/variable/PROJECT-NAME_DESCRIPTION.rst +++ b/Help/variable/PROJECT-NAME_DESCRIPTION.rst @@ -1,5 +1,7 @@ <PROJECT-NAME>_DESCRIPTION -------------------------- +.. versionadded:: 3.12 + Value given to the ``DESCRIPTION`` option of the most recent call to the :command:`project` command with project name ``<PROJECT-NAME>``, if any. diff --git a/Help/variable/PROJECT-NAME_HOMEPAGE_URL.rst b/Help/variable/PROJECT-NAME_HOMEPAGE_URL.rst index 22cc304..4800b13 100644 --- a/Help/variable/PROJECT-NAME_HOMEPAGE_URL.rst +++ b/Help/variable/PROJECT-NAME_HOMEPAGE_URL.rst @@ -1,5 +1,7 @@ <PROJECT-NAME>_HOMEPAGE_URL --------------------------- +.. versionadded:: 3.12 + Value given to the ``HOMEPAGE_URL`` option of the most recent call to the :command:`project` command with project name ``<PROJECT-NAME>``, if any. diff --git a/Help/variable/PROJECT_DESCRIPTION.rst b/Help/variable/PROJECT_DESCRIPTION.rst index 2833e11..1fefcdc 100644 --- a/Help/variable/PROJECT_DESCRIPTION.rst +++ b/Help/variable/PROJECT_DESCRIPTION.rst @@ -1,6 +1,8 @@ PROJECT_DESCRIPTION ------------------- +.. versionadded:: 3.9 + Short project description given to the project command. This is the description given to the most recently called :command:`project` diff --git a/Help/variable/PROJECT_HOMEPAGE_URL.rst b/Help/variable/PROJECT_HOMEPAGE_URL.rst index 754c9e8..0d2c937 100644 --- a/Help/variable/PROJECT_HOMEPAGE_URL.rst +++ b/Help/variable/PROJECT_HOMEPAGE_URL.rst @@ -1,6 +1,8 @@ PROJECT_HOMEPAGE_URL -------------------- +.. versionadded:: 3.12 + The homepage URL of the project. This is the homepage URL given to the most recently called :command:`project` diff --git a/Help/variable/PackageName_ROOT.rst b/Help/variable/PackageName_ROOT.rst index 1c2fd34..3f7ee4c 100644 --- a/Help/variable/PackageName_ROOT.rst +++ b/Help/variable/PackageName_ROOT.rst @@ -1,6 +1,8 @@ <PackageName>_ROOT ------------------ +.. versionadded:: 3.12.1 + Calls to :command:`find_package(<PackageName>)` will search in prefixes specified by the ``<PackageName>_ROOT`` CMake variable, where ``<PackageName>`` is the name given to the :command:`find_package` call diff --git a/Help/variable/WINCE.rst b/Help/variable/WINCE.rst index 54ff7de..4dca297 100644 --- a/Help/variable/WINCE.rst +++ b/Help/variable/WINCE.rst @@ -1,5 +1,7 @@ WINCE ----- +.. versionadded:: 3.1 + True when the :variable:`CMAKE_SYSTEM_NAME` variable is set to ``WindowsCE``. diff --git a/Help/variable/WINDOWS_PHONE.rst b/Help/variable/WINDOWS_PHONE.rst index 61d91b0..bf7099d 100644 --- a/Help/variable/WINDOWS_PHONE.rst +++ b/Help/variable/WINDOWS_PHONE.rst @@ -1,5 +1,7 @@ WINDOWS_PHONE ------------- +.. versionadded:: 3.1 + True when the :variable:`CMAKE_SYSTEM_NAME` variable is set to ``WindowsPhone``. diff --git a/Help/variable/WINDOWS_STORE.rst b/Help/variable/WINDOWS_STORE.rst index dae3b53..13831c2 100644 --- a/Help/variable/WINDOWS_STORE.rst +++ b/Help/variable/WINDOWS_STORE.rst @@ -1,5 +1,7 @@ WINDOWS_STORE ------------- +.. versionadded:: 3.1 + True when the :variable:`CMAKE_SYSTEM_NAME` variable is set to ``WindowsStore``. diff --git a/Help/variable/XCODE.rst b/Help/variable/XCODE.rst index 99f20fb..167ca86 100644 --- a/Help/variable/XCODE.rst +++ b/Help/variable/XCODE.rst @@ -1,4 +1,6 @@ XCODE ----- +.. versionadded:: 3.7 + ``True`` when using :generator:`Xcode` generator. diff --git a/Modules/AndroidTestUtilities.cmake b/Modules/AndroidTestUtilities.cmake index 95e2ef7..ddccf58 100644 --- a/Modules/AndroidTestUtilities.cmake +++ b/Modules/AndroidTestUtilities.cmake @@ -5,6 +5,8 @@ AndroidTestUtilities ------------------------ +.. versionadded:: 3.7 + Create a test that automatically loads specified data onto an Android device. Introduction diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index df48fa5..ebfd5a4 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -248,7 +248,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} set(id_PostBuildEvent_Command "") if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Ll][Ll][Vv][Mm](_v[0-9]+(_xp)?)?$") set(id_cl_var "ClangClExecutable") - elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Cc][Ll][Aa][Nn][Gg][Cc][Ll]$") + elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Cc][Ll][Aa][Nn][Gg]([Cc][Ll]$|_[0-9])") set(id_cl "$(CLToolExe)") elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "v[0-9]+_clang_.*") set(id_cl clang.exe) @@ -310,17 +310,36 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} set(id_PreferredToolArchitecture "") endif() if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone") + set(id_keyword "Win32Proj") set(id_system "<ApplicationType>Windows Phone</ApplicationType>") elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + set(id_keyword "Win32Proj") set(id_system "<ApplicationType>Windows Store</ApplicationType>") + elseif(CMAKE_SYSTEM_NAME STREQUAL "Android") + set(id_keyword "Android") + set(id_system "<ApplicationType>Android</ApplicationType>") else() + set(id_keyword "Win32Proj") set(id_system "") endif() - if(id_system AND CMAKE_SYSTEM_VERSION MATCHES "^([0-9]+\\.[0-9]+)") + if(id_keyword STREQUAL "Android") + if(CMAKE_GENERATOR MATCHES "Visual Studio 14") + set(id_system_version "<ApplicationTypeRevision>2.0</ApplicationTypeRevision>") + elseif(CMAKE_GENERATOR MATCHES "Visual Studio 1[56]") + set(id_system_version "<ApplicationTypeRevision>3.0</ApplicationTypeRevision>") + else() + set(id_system_version "") + endif() + elseif(id_system AND CMAKE_SYSTEM_VERSION MATCHES "^([0-9]+\\.[0-9]+)") set(id_system_version "<ApplicationTypeRevision>${CMAKE_MATCH_1}</ApplicationTypeRevision>") else() set(id_system_version "") endif() + if(id_keyword STREQUAL "Android") + set(id_config_type "DynamicLibrary") + else() + set(id_config_type "Application") + endif() if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION) set(id_WindowsTargetPlatformVersion "<WindowsTargetPlatformVersion>${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}</WindowsTargetPlatformVersion>") endif() @@ -333,9 +352,11 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} string(APPEND id_CustomGlobals "<${CMAKE_MATCH_1}>${CMAKE_MATCH_2}</${CMAKE_MATCH_1}>\n ") endif() endforeach() - if(id_platform STREQUAL ARM64) + if(id_keyword STREQUAL "Android") + set(id_WindowsSDKDesktopARMSupport "") + elseif(id_platform STREQUAL "ARM64") set(id_WindowsSDKDesktopARMSupport "<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>") - elseif(id_platform STREQUAL ARM) + elseif(id_platform STREQUAL "ARM") set(id_WindowsSDKDesktopARMSupport "<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>") else() set(id_WindowsSDKDesktopARMSupport "") diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index d0cfc2b..532e368 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -22,9 +22,13 @@ section below for details. The generated binary installers will contain all files that have been installed via CMake's :command:`install` command (and the deprecated commands :command:`install_files`, :command:`install_programs`, and -:command:`install_targets`). Certain kinds of binary installers can be -configured such that users can select individual application components to -install. See the :module:`CPackComponent` module for further details. +:command:`install_targets`). Note that the ``DESTINATION`` option of the +:command:`install` command must be a relative path; otherwise installed files +are ignored by CPack. + +Certain kinds of binary installers can be configured such that users can select +individual application components to install. See the :module:`CPackComponent` +module for further details. Source packages (configured through ``CPackSourceConfig.cmake`` and generated by the :cpack_gen:`CPack Archive Generator`) will contain all source files in @@ -386,6 +390,21 @@ The following variables are for advanced uses of CPack: select the CPack generator(s) to be used when building the ``package`` target or when running :manual:`cpack <cpack(1)>` without the ``-G`` option. +.. variable:: CPACK_PRE_BUILD_SCRIPTS + + List of CMake scripts to execute after CPack has installed the files to + be packed into a staging directory and before producing the result + packages. + +.. variable:: CPACK_POST_BUILD_SCRIPTS + + List of CMake scripts to execute after CPack has produced the result + packages and before copying them back to a build directory. + +.. variable:: CPACK_PACKAGE_FILES + + List of resulting package files passed to the ``CPACK_POST_BUILD_SCRIPTS``. + #]=======================================================================] # Define this var in order to avoid (or warn) concerning multiple inclusion diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake index 80a907f..58e6a37 100644 --- a/Modules/CPackIFW.cmake +++ b/Modules/CPackIFW.cmake @@ -5,6 +5,8 @@ CPackIFW -------- +.. versionadded:: 3.1 + This module looks for the location of the command-line utilities supplied with the `Qt Installer Framework <http://doc.qt.io/qtinstallerframework/index.html>`_ (QtIFW). diff --git a/Modules/CPackIFWConfigureFile.cmake b/Modules/CPackIFWConfigureFile.cmake index 0abe0da..296b13f 100644 --- a/Modules/CPackIFWConfigureFile.cmake +++ b/Modules/CPackIFWConfigureFile.cmake @@ -5,6 +5,8 @@ CPackIFWConfigureFile --------------------- +.. versionadded:: 3.8 + The module defines :command:`configure_file` similar command to configure file templates prepared in QtIFW/SDK/Creator style. diff --git a/Modules/CSharpUtilities.cmake b/Modules/CSharpUtilities.cmake index 6a4b5c7..dedb146 100644 --- a/Modules/CSharpUtilities.cmake +++ b/Modules/CSharpUtilities.cmake @@ -5,6 +5,8 @@ CSharpUtilities --------------- +.. versionadded:: 3.8 + Functions to make configuration of CSharp/.NET targets easier. A collection of CMake utility functions useful for dealing with CSharp diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index b1268be..a01a2fe 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -5,6 +5,8 @@ CTestCoverageCollectGCOV ------------------------ +.. versionadded:: 3.2 + This module provides the ``ctest_coverage_collect_gcov`` function. This function runs gcov on all .gcda files found in the binary tree diff --git a/Modules/CheckFortranCompilerFlag.cmake b/Modules/CheckFortranCompilerFlag.cmake index 299cd8c..b8fac97 100644 --- a/Modules/CheckFortranCompilerFlag.cmake +++ b/Modules/CheckFortranCompilerFlag.cmake @@ -5,6 +5,8 @@ CheckFortranCompilerFlag ------------------------ +.. versionadded:: 3.3 + Check whether the Fortran compiler supports a given flag. .. command:: check_fortran_compiler_flag diff --git a/Modules/CheckFortranSourceCompiles.cmake b/Modules/CheckFortranSourceCompiles.cmake index 3354bfb..d776b0c 100644 --- a/Modules/CheckFortranSourceCompiles.cmake +++ b/Modules/CheckFortranSourceCompiles.cmake @@ -5,6 +5,8 @@ CheckFortranSourceCompiles -------------------------- +.. versionadded:: 3.1 + Check if given Fortran source compiles and links into an executable. .. command:: check_fortran_source_compiles diff --git a/Modules/CheckFortranSourceRuns.cmake b/Modules/CheckFortranSourceRuns.cmake index f858b84..a710352 100644 --- a/Modules/CheckFortranSourceRuns.cmake +++ b/Modules/CheckFortranSourceRuns.cmake @@ -5,6 +5,8 @@ CheckFortranSourceRuns ---------------------- +.. versionadded:: 3.14 + Check if given Fortran source compiles and links into an executable and can subsequently be run. diff --git a/Modules/CheckIPOSupported.cmake b/Modules/CheckIPOSupported.cmake index 90a9f61..1dd951d 100644 --- a/Modules/CheckIPOSupported.cmake +++ b/Modules/CheckIPOSupported.cmake @@ -5,6 +5,8 @@ CheckIPOSupported ----------------- +.. versionadded:: 3.9 + Check whether the compiler supports an interprocedural optimization (IPO/LTO). Use this before enabling the :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION` target property. diff --git a/Modules/CheckLinkerFlag.cmake b/Modules/CheckLinkerFlag.cmake index beda5fe..cd7301f 100644 --- a/Modules/CheckLinkerFlag.cmake +++ b/Modules/CheckLinkerFlag.cmake @@ -5,6 +5,8 @@ CheckLinkerFlag --------------- +.. versionadded:: 3.18 + Check whether the compiler supports a given link flag. .. command:: check_linker_flag diff --git a/Modules/CheckOBJCCompilerFlag.cmake b/Modules/CheckOBJCCompilerFlag.cmake index 1d975da..a98f429 100644 --- a/Modules/CheckOBJCCompilerFlag.cmake +++ b/Modules/CheckOBJCCompilerFlag.cmake @@ -5,6 +5,8 @@ CheckOBJCCompilerFlag --------------------- +.. versionadded:: 3.16 + Check whether the Objective-C compiler supports a given flag. .. command:: check_objc_compiler_flag diff --git a/Modules/CheckOBJCSourceCompiles.cmake b/Modules/CheckOBJCSourceCompiles.cmake index 601f1fa..502ed74 100644 --- a/Modules/CheckOBJCSourceCompiles.cmake +++ b/Modules/CheckOBJCSourceCompiles.cmake @@ -5,6 +5,8 @@ CheckOBJCSourceCompiles ----------------------- +.. versionadded:: 3.16 + Check if given Objective-C source compiles and links into an executable. .. command:: check_objc_source_compiles diff --git a/Modules/CheckOBJCSourceRuns.cmake b/Modules/CheckOBJCSourceRuns.cmake index 6684693..9d4fb1b 100644 --- a/Modules/CheckOBJCSourceRuns.cmake +++ b/Modules/CheckOBJCSourceRuns.cmake @@ -5,6 +5,8 @@ CheckOBJCSourceRuns ------------------- +.. versionadded:: 3.16 + Check if given Objective-C source compiles and links into an executable and can subsequently be run. diff --git a/Modules/CheckOBJCXXCompilerFlag.cmake b/Modules/CheckOBJCXXCompilerFlag.cmake index c32741b..7944ab0 100644 --- a/Modules/CheckOBJCXXCompilerFlag.cmake +++ b/Modules/CheckOBJCXXCompilerFlag.cmake @@ -5,6 +5,8 @@ CheckOBJCXXCompilerFlag ----------------------- +.. versionadded:: 3.16 + Check whether the Objective-C++ compiler supports a given flag. .. command:: check_objcxx_compiler_flag diff --git a/Modules/CheckOBJCXXSourceCompiles.cmake b/Modules/CheckOBJCXXSourceCompiles.cmake index 2ee79f4..7b839e4 100644 --- a/Modules/CheckOBJCXXSourceCompiles.cmake +++ b/Modules/CheckOBJCXXSourceCompiles.cmake @@ -5,6 +5,8 @@ CheckOBJCXXSourceCompiles ------------------------- +.. versionadded:: 3.16 + Check if given Objective-C++ source compiles and links into an executable. .. command:: check_objcxx_source_compiles diff --git a/Modules/CheckOBJCXXSourceRuns.cmake b/Modules/CheckOBJCXXSourceRuns.cmake index 7f7e04f..c327598 100644 --- a/Modules/CheckOBJCXXSourceRuns.cmake +++ b/Modules/CheckOBJCXXSourceRuns.cmake @@ -5,6 +5,8 @@ CheckOBJCXXSourceRuns --------------------- +.. versionadded:: 3.16 + Check if given Objective-C++ source compiles and links into an executable and can subsequently be run. diff --git a/Modules/CheckPIESupported.cmake b/Modules/CheckPIESupported.cmake index 6d63f0b..a99d8c4 100644 --- a/Modules/CheckPIESupported.cmake +++ b/Modules/CheckPIESupported.cmake @@ -5,6 +5,8 @@ CheckPIESupported ----------------- +.. versionadded:: 3.14 + Check whether the linker supports Position Independent Code (PIE) or No Position Independent Code (NO_PIE) for executables. Use this to ensure that the :prop_tgt:`POSITION_INDEPENDENT_CODE` target diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake index 2794f52..26a4bbd 100644 --- a/Modules/Compiler/AppleClang-C.cmake +++ b/Modules/Compiler/AppleClang-C.cmake @@ -1,6 +1,8 @@ include(Compiler/Clang) __compiler_clang(C) +set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c) + if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90") diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake index 15edc21..611c674 100644 --- a/Modules/Compiler/AppleClang-CXX.cmake +++ b/Modules/Compiler/AppleClang-CXX.cmake @@ -1,6 +1,8 @@ include(Compiler/Clang) __compiler_clang(CXX) +set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++) + if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden") endif() diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake index 7c4a263..fb6ffa7 100644 --- a/Modules/Compiler/Clang-C.cmake +++ b/Modules/Compiler/Clang-C.cmake @@ -8,6 +8,8 @@ endif() if("x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC") set(CMAKE_C_CLANG_TIDY_DRIVER_MODE "cl") +elseif("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU") + set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c) endif() if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4) diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake index 789e991..311d2b0 100644 --- a/Modules/Compiler/Clang-CXX.cmake +++ b/Modules/Compiler/Clang-CXX.cmake @@ -2,7 +2,9 @@ include(Compiler/Clang) __compiler_clang(CXX) __compiler_clang_cxx_standards(CXX) + if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU") + set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++) set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden") endif() diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index ca286b3..8105a77 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -1,6 +1,8 @@ include(Compiler/GNU) __compiler_gnu(C) +set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c) + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90") diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index fcaaeab..59ec056 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -1,6 +1,8 @@ include(Compiler/GNU) __compiler_gnu(CXX) +set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++) + if (WIN32) if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fno-keep-inline-dllexport") diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake index ec3bfd8..322f63d 100644 --- a/Modules/Compiler/Intel-C.cmake +++ b/Modules/Compiler/Intel-C.cmake @@ -28,6 +28,8 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC") else() + set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c) + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0.0) set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11") set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11") diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake index b71b946..42adfd1 100644 --- a/Modules/Compiler/Intel-CXX.cmake +++ b/Modules/Compiler/Intel-CXX.cmake @@ -42,6 +42,8 @@ if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") else() + set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++) + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.0) set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++20") set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++20") diff --git a/Modules/Compiler/XL-C.cmake b/Modules/Compiler/XL-C.cmake index 2077bda..78c44d5 100644 --- a/Modules/Compiler/XL-C.cmake +++ b/Modules/Compiler/XL-C.cmake @@ -6,6 +6,8 @@ string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -DNDEBUG") # -qthreaded = Ensures that all optimizations will be thread-safe string(APPEND CMAKE_C_FLAGS_INIT " -qthreaded") +set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -qsourcetype=c) + if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-qlanglvl=stdc89") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-qlanglvl=extc89") diff --git a/Modules/Compiler/XL-CXX.cmake b/Modules/Compiler/XL-CXX.cmake index 41e3e11..3b911f3 100644 --- a/Modules/Compiler/XL-CXX.cmake +++ b/Modules/Compiler/XL-CXX.cmake @@ -6,6 +6,8 @@ string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG") # -qthreaded = Ensures that all optimizations will be thread-safe string(APPEND CMAKE_CXX_FLAGS_INIT " -qthreaded") +set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -+) + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1) if(CMAKE_SYSTEM MATCHES "Linux") set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "") @@ -32,6 +34,3 @@ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1) endif () __compiler_check_default_language_standard(CXX 10.1 98) - -set(CMAKE_CXX_COMPILE_OBJECT - "<CMAKE_CXX_COMPILER> -+ <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>") diff --git a/Modules/Compiler/XLClang-C.cmake b/Modules/Compiler/XLClang-C.cmake index 54c18a6..1668a4d 100644 --- a/Modules/Compiler/XLClang-C.cmake +++ b/Modules/Compiler/XLClang-C.cmake @@ -1,6 +1,8 @@ include(Compiler/XLClang) __compiler_xlclang(C) +set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c) + if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1.1) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c89") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu89") diff --git a/Modules/Compiler/XLClang-CXX.cmake b/Modules/Compiler/XLClang-CXX.cmake index 9ea3d7c..02638c7 100644 --- a/Modules/Compiler/XLClang-CXX.cmake +++ b/Modules/Compiler/XLClang-CXX.cmake @@ -1,6 +1,8 @@ include(Compiler/XLClang) __compiler_xlclang(CXX) +set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++) + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1.1) set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "") set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "") diff --git a/Modules/CompilerId/VS-10.vcxproj.in b/Modules/CompilerId/VS-10.vcxproj.in index b48a332..3598fc7 100644 --- a/Modules/CompilerId/VS-10.vcxproj.in +++ b/Modules/CompilerId/VS-10.vcxproj.in @@ -9,7 +9,7 @@ <PropertyGroup Label="Globals"> <ProjectGuid>{CAE07175-D007-4FC3-BFE8-47B392814159}</ProjectGuid> <RootNamespace>CompilerId@id_lang@</RootNamespace> - <Keyword>Win32Proj</Keyword> + <Keyword>@id_keyword@</Keyword> @id_system@ @id_system_version@ @id_WindowsTargetPlatformVersion@ @@ -24,7 +24,7 @@ @id_PreferredToolArchitecture@ </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@id_platform@'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> + <ConfigurationType>@id_config_type@</ConfigurationType> @id_toolset@ <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake index e05ca96..c85e2d8 100644 --- a/Modules/FetchContent.cmake +++ b/Modules/FetchContent.cmake @@ -5,6 +5,8 @@ FetchContent ------------------ +.. versionadded:: 3.11 + .. only:: html .. contents:: diff --git a/Modules/FindArmadillo.cmake b/Modules/FindArmadillo.cmake index 243b9e0..c8a31a0 100644 --- a/Modules/FindArmadillo.cmake +++ b/Modules/FindArmadillo.cmake @@ -84,6 +84,7 @@ if(_ARMA_USE_WRAPPER) # Link to the armadillo wrapper library. find_library(ARMADILLO_LIBRARY NAMES armadillo + NAMES_PER_DIR PATHS "$ENV{ProgramFiles}/Armadillo/lib" "$ENV{ProgramFiles}/Armadillo/lib64" diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake index 60f178b..1e3b563 100644 --- a/Modules/FindBLAS.cmake +++ b/Modules/FindBLAS.cmake @@ -36,7 +36,7 @@ The following variables may be set to influence this module's behavior: * ``SCSL`` * ``SGIMATH`` * ``IBMESSL`` - * ``Intel10_32`` (intel mkl v10 32 bit) + * ``Intel10_32`` (intel mkl v10 32 bit, threaded code) * ``Intel10_64lp`` (intel mkl v10+ 64 bit, threaded code, lp64 model) * ``Intel10_64lp_seq`` (intel mkl v10+ 64 bit, sequential code, lp64 model) * ``Intel10_64ilp`` (intel mkl v10+ 64 bit, threaded code, ilp64 model) @@ -208,6 +208,7 @@ macro(CHECK_BLAS_LIBRARIES LIBRARIES _prefix _name _flags _list _threadlibs _add if(_libraries_work) find_library(${_prefix}_${_library}_LIBRARY NAMES ${_library} + NAMES_PER_DIR PATHS ${_extaddlibdir} PATH_SUFFIXES ${_subdirs} ) @@ -397,6 +398,10 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") # Add threading/sequential libs set(BLAS_SEARCH_LIBS_WIN_THREAD "") + if(BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All") + list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD + "libiomp5md mkl_intel_thread${BLAS_mkl_DLL_SUFFIX}") + endif() if(BLA_VENDOR MATCHES "^Intel10_64i?lp$" OR BLA_VENDOR STREQUAL "All") # old version list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD @@ -483,7 +488,9 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") endif() set(BLAS_mkl_LIB_PATH_SUFFIXES "compiler/lib" "compiler/lib/${BLAS_mkl_ARCH_NAME}_${BLAS_mkl_OS_NAME}" + "compiler/lib/${BLAS_mkl_ARCH_NAME}" "mkl/lib" "mkl/lib/${BLAS_mkl_ARCH_NAME}_${BLAS_mkl_OS_NAME}" + "mkl/lib/${BLAS_mkl_ARCH_NAME}" "lib/${BLAS_mkl_ARCH_NAME}_${BLAS_mkl_OS_NAME}") foreach(IT ${BLAS_SEARCH_LIBS}) diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake index 98ab72c..5704d1d 100644 --- a/Modules/FindBZip2.cmake +++ b/Modules/FindBZip2.cmake @@ -45,8 +45,8 @@ set(_BZIP2_PATHS PATHS find_path(BZIP2_INCLUDE_DIR bzlib.h ${_BZIP2_PATHS} PATH_SUFFIXES include) if (NOT BZIP2_LIBRARIES) - find_library(BZIP2_LIBRARY_RELEASE NAMES bz2 bzip2 libbz2 libbzip2 ${_BZIP2_PATHS} PATH_SUFFIXES lib) - find_library(BZIP2_LIBRARY_DEBUG NAMES bz2d bzip2d libbz2d libbzip2d ${_BZIP2_PATHS} PATH_SUFFIXES lib) + find_library(BZIP2_LIBRARY_RELEASE NAMES bz2 bzip2 libbz2 libbzip2 NAMES_PER_DIR ${_BZIP2_PATHS} PATH_SUFFIXES lib) + find_library(BZIP2_LIBRARY_DEBUG NAMES bz2d bzip2d libbz2d libbzip2d NAMES_PER_DIR ${_BZIP2_PATHS} PATH_SUFFIXES lib) include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) SELECT_LIBRARY_CONFIGURATIONS(BZIP2) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 13981d3..82dbcb9 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -1270,10 +1270,8 @@ function(_Boost_COMPONENT_HEADERS component _hdrs) set(_Boost_UNIT_TEST_FRAMEWORK_HEADERS "boost/test/framework.hpp") set(_Boost_WAVE_HEADERS "boost/wave.hpp") set(_Boost_WSERIALIZATION_HEADERS "boost/archive/text_wiarchive.hpp") - if(WIN32) - set(_Boost_BZIP2_HEADERS "boost/iostreams/filter/bzip2.hpp") - set(_Boost_ZLIB_HEADERS "boost/iostreams/filter/zlib.hpp") - endif() + set(_Boost_BZIP2_HEADERS "boost/iostreams/filter/bzip2.hpp") + set(_Boost_ZLIB_HEADERS "boost/iostreams/filter/zlib.hpp") string(TOUPPER ${component} uppercomponent) set(${_hdrs} ${_Boost_${uppercomponent}_HEADERS} PARENT_SCOPE) diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake index 47bc546..4e52e03 100644 --- a/Modules/FindCUDAToolkit.cmake +++ b/Modules/FindCUDAToolkit.cmake @@ -5,6 +5,8 @@ FindCUDAToolkit --------------- +.. versionadded:: 3.17 + This script locates the NVIDIA CUDA toolkit and the associated libraries, but does not require the ``CUDA`` language be enabled for a given project. This module does not search for the NVIDIA CUDA Samples. diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake index 919babc..3acadc2 100644 --- a/Modules/FindCURL.cmake +++ b/Modules/FindCURL.cmake @@ -92,6 +92,7 @@ if(NOT CURL_LIBRARY) curllib_static # Windows older "Win32 - MSVC" prebuilts (libcurl.lib, e.g. libcurl-7.15.5-win32-msvc.zip): libcurl + NAMES_PER_DIR HINTS ${PC_CURL_LIBRARY_DIRS} ) mark_as_advanced(CURL_LIBRARY_RELEASE) @@ -100,6 +101,7 @@ if(NOT CURL_LIBRARY) # Windows MSVC CMake builds in debug configuration on vcpkg: libcurl-d_imp libcurl-d + NAMES_PER_DIR HINTS ${PC_CURL_LIBRARY_DIRS} ) mark_as_advanced(CURL_LIBRARY_DEBUG) diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake index ba56078..cde3a4d 100644 --- a/Modules/FindCurses.cmake +++ b/Modules/FindCurses.cmake @@ -156,7 +156,9 @@ if(CURSES_USE_NCURSES) CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}" cbreak "" CURSES_NCURSES_HAS_CBREAK) - if(NOT CURSES_NCURSES_HAS_CBREAK) + CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}" + nodelay "" CURSES_NCURSES_HAS_NODELAY) + if(NOT CURSES_NCURSES_HAS_CBREAK OR NOT CURSES_NCURSES_HAS_NODELAY) find_library(CURSES_EXTRA_LIBRARY "${CURSES_TINFO_LIBRARY_NAME}" HINTS "${_cursesLibDir}") find_library(CURSES_EXTRA_LIBRARY "${CURSES_TINFO_LIBRARY_NAME}" ) diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake index 15b419a..b0bb02a 100644 --- a/Modules/FindEXPAT.cmake +++ b/Modules/FindEXPAT.cmake @@ -38,7 +38,7 @@ pkg_check_modules(PC_EXPAT QUIET expat) find_path(EXPAT_INCLUDE_DIR NAMES expat.h HINTS ${PC_EXPAT_INCLUDE_DIRS}) # Look for the library. -find_library(EXPAT_LIBRARY NAMES expat libexpat HINTS ${PC_EXPAT_LIBRARY_DIRS}) +find_library(EXPAT_LIBRARY NAMES expat libexpat NAMES_PER_DIR HINTS ${PC_EXPAT_LIBRARY_DIRS}) if (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h") file(STRINGS "${EXPAT_INCLUDE_DIR}/expat.h" expat_version_str diff --git a/Modules/FindEnvModules.cmake b/Modules/FindEnvModules.cmake index 4dd5116..a4ac0b4 100644 --- a/Modules/FindEnvModules.cmake +++ b/Modules/FindEnvModules.cmake @@ -5,6 +5,8 @@ FindEnvModules -------------- +.. versionadded:: 3.15 + Locate an environment module implementation and make commands available to CMake scripts to use them. This is compatible with both Lua-based Lmod and TCL-based EnvironmentModules. diff --git a/Modules/FindFontconfig.cmake b/Modules/FindFontconfig.cmake index a6f0180..5228831 100644 --- a/Modules/FindFontconfig.cmake +++ b/Modules/FindFontconfig.cmake @@ -5,6 +5,8 @@ FindFontconfig -------------- +.. versionadded:: 3.14 + Find Fontconfig headers and library. Imported Targets diff --git a/Modules/FindGIF.cmake b/Modules/FindGIF.cmake index d5a143e..cea9cd8 100644 --- a/Modules/FindGIF.cmake +++ b/Modules/FindGIF.cmake @@ -60,6 +60,7 @@ set(POTENTIAL_GIF_LIBS gif libgif ungif libungif giflib giflib4) find_library(GIF_LIBRARY NAMES ${POTENTIAL_GIF_LIBS} + NAMES_PER_DIR HINTS ENV GIF_DIR PATH_SUFFIXES lib diff --git a/Modules/FindGLEW.cmake b/Modules/FindGLEW.cmake index 27ffa13..080371a 100644 --- a/Modules/FindGLEW.cmake +++ b/Modules/FindGLEW.cmake @@ -139,11 +139,13 @@ __glew_set_find_library_suffix(SHARED) find_library(GLEW_SHARED_LIBRARY_RELEASE NAMES GLEW glew glew32 + NAMES_PER_DIR PATH_SUFFIXES lib lib64 libx32 lib/Release/${_arch} PATHS ENV GLEW_ROOT) find_library(GLEW_SHARED_LIBRARY_DEBUG NAMES GLEWd glewd glew32d + NAMES_PER_DIR PATH_SUFFIXES lib lib64 PATHS ENV GLEW_ROOT) @@ -152,11 +154,13 @@ __glew_set_find_library_suffix(STATIC) find_library(GLEW_STATIC_LIBRARY_RELEASE NAMES GLEW glew glew32s + NAMES_PER_DIR PATH_SUFFIXES lib lib64 libx32 lib/Release/${_arch} PATHS ENV GLEW_ROOT) find_library(GLEW_STATIC_LIBRARY_DEBUG NAMES GLEWds glewds glew32ds + NAMES_PER_DIR PATH_SUFFIXES lib lib64 PATHS ENV GLEW_ROOT) diff --git a/Modules/FindGSL.cmake b/Modules/FindGSL.cmake index da1b3c4..3d4e7f9 100644 --- a/Modules/FindGSL.cmake +++ b/Modules/FindGSL.cmake @@ -5,6 +5,8 @@ FindGSL -------- +.. versionadded:: 3.2 + Find the native GNU Scientific Library (GSL) includes and libraries. The GNU Scientific Library (GSL) is a numerical library for C and C++ diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake index 53cab1a..10e31b2 100644 --- a/Modules/FindGTest.cmake +++ b/Modules/FindGTest.cmake @@ -96,6 +96,27 @@ function(__gtest_find_library _name) mark_as_advanced(${_name}) endfunction() +function(__gtest_find_library_configuration _name _lib _cfg_suffix) + set(_libs ${_lib}) + if(MSVC AND GTEST_MSVC_SEARCH STREQUAL "MD") + # The provided /MD project files for Google Test add -md suffixes to the + # library names. + list(INSERT _libs 0 ${_lib}-md) + endif() + list(TRANSFORM _libs APPEND "${_cfg_suffix}") + + __gtest_find_library(${_name} ${_libs}) +endfunction() + +include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) +function(__gtest_find_and_select_library_configurations _basename _lib) + __gtest_find_library_configuration(${_basename}_LIBRARY_RELEASE ${_lib} "") + __gtest_find_library_configuration(${_basename}_LIBRARY_DEBUG ${_lib} "d") + + select_library_configurations(${_basename}) + set(${_basename}_LIBRARY ${${_basename}_LIBRARY} PARENT_SCOPE) +endfunction() + macro(__gtest_determine_windows_library_type _var) if(EXISTS "${${_var}}") file(TO_NATIVE_PATH "${${_var}}" _lib_path) @@ -187,18 +208,13 @@ find_path(GTEST_INCLUDE_DIR gtest/gtest.h ) mark_as_advanced(GTEST_INCLUDE_DIR) -if(MSVC AND GTEST_MSVC_SEARCH STREQUAL "MD") - # The provided /MD project files for Google Test add -md suffixes to the - # library names. - __gtest_find_library(GTEST_LIBRARY gtest-md gtest) - __gtest_find_library(GTEST_LIBRARY_DEBUG gtest-mdd gtestd) - __gtest_find_library(GTEST_MAIN_LIBRARY gtest_main-md gtest_main) - __gtest_find_library(GTEST_MAIN_LIBRARY_DEBUG gtest_main-mdd gtest_maind) -else() - __gtest_find_library(GTEST_LIBRARY gtest) - __gtest_find_library(GTEST_LIBRARY_DEBUG gtestd) - __gtest_find_library(GTEST_MAIN_LIBRARY gtest_main) - __gtest_find_library(GTEST_MAIN_LIBRARY_DEBUG gtest_maind) +# Allow GTEST_LIBRARY and GTEST_MAIN_LIBRARY to be set manually, as the +# locations of the gtest and gtest_main libraries, respectively. +if(NOT GTEST_LIBRARY) + __gtest_find_and_select_library_configurations(GTEST gtest) +endif() +if(NOT GTEST_MAIN_LIBRARY) + __gtest_find_and_select_library_configurations(GTEST_MAIN gtest_main) endif() include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 60a313d..7a1c252 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -125,8 +125,6 @@ The following variables can be set to guide the search for HDF5 libraries and in Set ``true`` to skip trying to find ``hdf5-config.cmake``. #]=======================================================================] -# This module is maintained by Will Dicharry <wdicharry@stellarscience.com>. - include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) @@ -347,6 +345,7 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var # wrapper exists, but not the compiler. E.g. Miniconda / Anaconda Python execute_process( COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} ${test_file} + WORKING_DIRECTORY ${scratch_dir} RESULT_VARIABLE return_value ) if(return_value) @@ -355,6 +354,7 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var else() execute_process( COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} -show ${lib_type_args} ${test_file} + WORKING_DIRECTORY ${scratch_dir} OUTPUT_VARIABLE output ERROR_VARIABLE output RESULT_VARIABLE return_value diff --git a/Modules/FindICU.cmake b/Modules/FindICU.cmake index 38081f5..c8b3e1f 100644 --- a/Modules/FindICU.cmake +++ b/Modules/FindICU.cmake @@ -5,6 +5,8 @@ FindICU ------- +.. versionadded:: 3.7 + Find the International Components for Unicode (ICU) libraries and programs. diff --git a/Modules/FindIce.cmake b/Modules/FindIce.cmake index 5ce2b42..0f821e8 100644 --- a/Modules/FindIce.cmake +++ b/Modules/FindIce.cmake @@ -5,6 +5,8 @@ FindIce ------- +.. versionadded:: 3.1 + Find the ZeroC Internet Communication Engine (ICE) programs, libraries and datafiles. diff --git a/Modules/FindIconv.cmake b/Modules/FindIconv.cmake index bf20f6f..41b7550 100644 --- a/Modules/FindIconv.cmake +++ b/Modules/FindIconv.cmake @@ -5,6 +5,8 @@ FindIconv --------- +.. versionadded:: 3.11 + This module finds the ``iconv()`` POSIX.1 functions on the system. These functions might be provided in the regular C library or externally in the form of an additional library. @@ -110,6 +112,7 @@ endif() find_library(Iconv_LIBRARY NAMES ${Iconv_LIBRARY_NAMES} + NAMES_PER_DIR DOC "iconv library (potentially the C library)") mark_as_advanced(Iconv_INCLUDE_DIR) diff --git a/Modules/FindIntl.cmake b/Modules/FindIntl.cmake index 3818d45..1a09a60 100644 --- a/Modules/FindIntl.cmake +++ b/Modules/FindIntl.cmake @@ -5,6 +5,8 @@ FindIntl -------- +.. versionadded:: 3.2 + Find the Gettext libintl headers and libraries. This module reports information about the Gettext libintl @@ -40,7 +42,7 @@ find_path(Intl_INCLUDE_DIR mark_as_advanced(Intl_INCLUDE_DIR) # Find all Intl libraries -find_library(Intl_LIBRARY "intl" +find_library(Intl_LIBRARY "intl" NAMES_PER_DIR DOC "libintl libraries (if not in the C library)") mark_as_advanced(Intl_LIBRARY) diff --git a/Modules/FindJPEG.cmake b/Modules/FindJPEG.cmake index 0bb6989..632fc9a 100644 --- a/Modules/FindJPEG.cmake +++ b/Modules/FindJPEG.cmake @@ -58,8 +58,8 @@ foreach(name ${jpeg_names}) endforeach() if(NOT JPEG_LIBRARY) - find_library(JPEG_LIBRARY_RELEASE NAMES ${jpeg_names}) - find_library(JPEG_LIBRARY_DEBUG NAMES ${jpeg_names_debug}) + find_library(JPEG_LIBRARY_RELEASE NAMES ${jpeg_names} NAMES_PER_DIR) + find_library(JPEG_LIBRARY_DEBUG NAMES ${jpeg_names_debug} NAMES_PER_DIR) include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) select_library_configurations(JPEG) mark_as_advanced(JPEG_LIBRARY_RELEASE JPEG_LIBRARY_DEBUG) diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake index 31e7de6..f996d4c 100644 --- a/Modules/FindLAPACK.cmake +++ b/Modules/FindLAPACK.cmake @@ -28,7 +28,7 @@ The following variables may be set to influence this module's behavior: * ``OpenBLAS`` * ``FLAME`` - * ``Intel10_32`` (intel mkl v10 32 bit) + * ``Intel10_32`` (intel mkl v10 32 bit, threaded code) * ``Intel10_64lp`` (intel mkl v10+ 64 bit, threaded code, lp64 model) * ``Intel10_64lp_seq`` (intel mkl v10+ 64 bit, sequential code, lp64 model) * ``Intel10_64ilp`` (intel mkl v10+ 64 bit, threaded code, ilp64 model) @@ -162,6 +162,7 @@ macro(CHECK_LAPACK_LIBRARIES LIBRARIES _prefix _name _flags _list _threadlibs _a if(_libraries_work) find_library(${_prefix}_${_library}_LIBRARY NAMES ${_library} + NAMES_PER_DIR PATHS ${_extaddlibdir} PATH_SUFFIXES ${_subdirs} ) @@ -289,7 +290,9 @@ if(BLAS_FOUND) endif() set(LAPACK_mkl_LIB_PATH_SUFFIXES "compiler/lib" "compiler/lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}" + "compiler/lib/${LAPACK_mkl_ARCH_NAME}" "mkl/lib" "mkl/lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}" + "mkl/lib/${LAPACK_mkl_ARCH_NAME}" "lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}") # First try empty lapack libs diff --git a/Modules/FindLTTngUST.cmake b/Modules/FindLTTngUST.cmake index 9cd17eb..f478e4d 100644 --- a/Modules/FindLTTngUST.cmake +++ b/Modules/FindLTTngUST.cmake @@ -5,6 +5,8 @@ FindLTTngUST ------------ +.. versionadded:: 3.6 + Find `Linux Trace Toolkit Next Generation (LTTng-UST) <http://lttng.org/>`__ library. diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake index 200d6bf..4a79a10 100644 --- a/Modules/FindLibLZMA.cmake +++ b/Modules/FindLibLZMA.cmake @@ -43,8 +43,8 @@ This module will set the following variables in your project: find_path(LIBLZMA_INCLUDE_DIR lzma.h ) if(NOT LIBLZMA_LIBRARY) - find_library(LIBLZMA_LIBRARY_RELEASE NAMES lzma liblzma PATH_SUFFIXES lib) - find_library(LIBLZMA_LIBRARY_DEBUG NAMES lzmad liblzmad PATH_SUFFIXES lib) + find_library(LIBLZMA_LIBRARY_RELEASE NAMES lzma liblzma NAMES_PER_DIR PATH_SUFFIXES lib) + find_library(LIBLZMA_LIBRARY_DEBUG NAMES lzmad liblzmad NAMES_PER_DIR PATH_SUFFIXES lib) include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) select_library_configurations(LIBLZMA) else() diff --git a/Modules/FindLibinput.cmake b/Modules/FindLibinput.cmake index c1fe455..88d5b2f 100644 --- a/Modules/FindLibinput.cmake +++ b/Modules/FindLibinput.cmake @@ -5,6 +5,8 @@ FindLibinput ------------ +.. versionadded:: 3.14 + Find libinput headers and library. Imported Targets diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index e42c206..05ec3ae 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -992,7 +992,10 @@ function(matlab_add_mex) endif() endif() - if(NOT Matlab_VERSION_STRING VERSION_LESS "9.4") # For 9.4 (R2018a) and newer, add API macro + # For 9.4 (R2018a) and newer, add API macro. + # Add it for unknown versions too, just in case. + if(NOT Matlab_VERSION_STRING VERSION_LESS "9.4" + OR Matlab_VERSION_STRING STREQUAL "unknown") if(${${prefix}_R2018a}) set(MEX_API_MACRO "MATLAB_DEFAULT_RELEASE=R2018a") else() diff --git a/Modules/FindODBC.cmake b/Modules/FindODBC.cmake index 3f710db..884653c 100644 --- a/Modules/FindODBC.cmake +++ b/Modules/FindODBC.cmake @@ -5,6 +5,8 @@ FindODBC -------- +.. versionadded:: 3.12 + Find an Open Database Connectivity (ODBC) include directory and library. On Windows, when building with Visual Studio, this module assumes the ODBC diff --git a/Modules/FindOpenACC.cmake b/Modules/FindOpenACC.cmake index 398dcf5..ed52e35 100644 --- a/Modules/FindOpenACC.cmake +++ b/Modules/FindOpenACC.cmake @@ -5,6 +5,8 @@ FindOpenACC ----------- +.. versionadded:: 3.10 + Detect OpenACC support by the compiler. This module can be used to detect OpenACC support in a compiler. diff --git a/Modules/FindOpenCL.cmake b/Modules/FindOpenCL.cmake index 34a203e..b3e5a9f 100644 --- a/Modules/FindOpenCL.cmake +++ b/Modules/FindOpenCL.cmake @@ -5,6 +5,8 @@ FindOpenCL ---------- +.. versionadded:: 3.1 + Finds Open Computing Language (OpenCL) IMPORTED Targets diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake index f1fe89a..fd0e4e9 100644 --- a/Modules/FindPNG.cmake +++ b/Modules/FindPNG.cmake @@ -76,8 +76,8 @@ if(ZLIB_FOUND) # For compatibility with versions prior to this multi-config search, honor # any PNG_LIBRARY that is already specified and skip the search. if(NOT PNG_LIBRARY) - find_library(PNG_LIBRARY_RELEASE NAMES ${PNG_NAMES}) - find_library(PNG_LIBRARY_DEBUG NAMES ${PNG_NAMES_DEBUG}) + find_library(PNG_LIBRARY_RELEASE NAMES ${PNG_NAMES} NAMES_PER_DIR) + find_library(PNG_LIBRARY_DEBUG NAMES ${PNG_NAMES_DEBUG} NAMES_PER_DIR) include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) select_library_configurations(PNG) mark_as_advanced(PNG_LIBRARY_RELEASE PNG_LIBRARY_DEBUG) diff --git a/Modules/FindPatch.cmake b/Modules/FindPatch.cmake index 4998839..4108651 100644 --- a/Modules/FindPatch.cmake +++ b/Modules/FindPatch.cmake @@ -5,6 +5,8 @@ FindPatch --------- +.. versionadded:: 3.10 + The module defines the following variables: ``Patch_EXECUTABLE`` diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake index e09717d..f6d8fe3 100644 --- a/Modules/FindProtobuf.cmake +++ b/Modules/FindProtobuf.cmake @@ -376,11 +376,13 @@ function(_protobuf_find_libraries name filename) else() find_library(${name}_LIBRARY_RELEASE NAMES ${filename} + NAMES_PER_DIR PATHS ${Protobuf_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Release) mark_as_advanced(${name}_LIBRARY_RELEASE) find_library(${name}_LIBRARY_DEBUG NAMES ${filename}d ${filename} + NAMES_PER_DIR PATHS ${Protobuf_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Debug) mark_as_advanced(${name}_LIBRARY_DEBUG) diff --git a/Modules/FindPython.cmake b/Modules/FindPython.cmake index 01b82c4..f503cca 100644 --- a/Modules/FindPython.cmake +++ b/Modules/FindPython.cmake @@ -5,6 +5,8 @@ FindPython ---------- +.. versionadded:: 3.12 + Find Python interpreter, compiler and development environment (include directories and libraries). diff --git a/Modules/FindPython2.cmake b/Modules/FindPython2.cmake index 84c0c73..42d87c8 100644 --- a/Modules/FindPython2.cmake +++ b/Modules/FindPython2.cmake @@ -5,6 +5,8 @@ FindPython2 ----------- +.. versionadded:: 3.12 + Find Python 2 interpreter, compiler and development environment (include directories and libraries). diff --git a/Modules/FindPython3.cmake b/Modules/FindPython3.cmake index f142c07..b58ee30 100644 --- a/Modules/FindPython3.cmake +++ b/Modules/FindPython3.cmake @@ -5,6 +5,8 @@ FindPython3 ----------- +.. versionadded:: 3.12 + Find Python 3 interpreter, compiler and development environment (include directories and libraries). diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake index 8d793a9..59eddbb 100644 --- a/Modules/FindSDL.cmake +++ b/Modules/FindSDL.cmake @@ -5,24 +5,54 @@ FindSDL ------- -Locate SDL library +Locate the SDL library -This module defines -:: +Imported targets +^^^^^^^^^^^^^^^^ - SDL_LIBRARY, the name of the library to link against - SDL_FOUND, if false, do not try to link to SDL - SDL_INCLUDE_DIR, where to find SDL.h - SDL_VERSION_STRING, human-readable string containing the version of SDL +This module defines the following :prop_tgt:`IMPORTED` target: +``SDL::SDL`` + The SDL library, if found +Result variables +^^^^^^^^^^^^^^^^ -This module responds to the flag: +This module will set the following variables in your project: + +``SDL_INCLUDE_DIRS`` + where to find SDL.h +``SDL_LIBRARIES`` + the name of the library to link against +``SDL_FOUND`` + if false, do not try to link to SDL +``SDL_VERSION`` + the human-readable string containing the version of SDL if found +``SDL_VERSION_MAJOR`` + SDL major version +``SDL_VERSION_MINOR`` + SDL minor version +``SDL_VERSION_PATCH`` + SDL patch version + +Cache variables +^^^^^^^^^^^^^^^ + +These variables may optionally be set to help this module find the correct files: -:: +``SDL_INCLUDE_DIR`` + where to find SDL.h +``SDL_LIBRARY`` + the name of the library to link against + + +Variables for locating SDL +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This module responds to the flag: - SDL_BUILDING_LIBRARY +``SDL_BUILDING_LIBRARY`` If this is defined, then no SDL_main will be linked in because only applications need main(). Otherwise, it is assumed you are building an application and this @@ -30,6 +60,15 @@ This module responds to the flag: as part of the returned SDL_LIBRARY variable. +Obsolete variables +^^^^^^^^^^^^^^^^^^ + +These variables are obsolete and provided for backwards compatibility: + +``SDL_VERSION_STRING`` + the human-readable string containing the version of SDL if found. + Identical to SDL_VERSION + Don't forget to include SDLmain.h and SDLmain.m your project for the OS X framework based version. (Other versions link to -lSDLmain which @@ -52,15 +91,6 @@ does not get created. $SDLDIR is an environment variable that would correspond to the ./configure --prefix=$SDLDIR used in building SDL. l.e.galup 9-20-02 -Modified by Eric Wing. Added code to assist with automated building -by using environmental variables and providing a more -controlled/consistent search behavior. Added new modifications to -recognize OS X frameworks and additional Unix paths (FreeBSD, etc). -Also corrected the header search path to follow "proper" SDL -guidelines. Added a search for SDLmain which is needed by some -platforms. Added a search for threads which is needed by some -platforms. Added needed compile switches for MinGW. - On OSX, this will prefer the Framework version (if found) over others. People will have to manually change the cache values of SDL_LIBRARY to override this selection or set the CMake environment @@ -174,13 +204,11 @@ if(SDL_INCLUDE_DIR AND EXISTS "${SDL_INCLUDE_DIR}/SDL_version.h") string(REGEX REPLACE "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_VERSION_MAJOR "${SDL_VERSION_MAJOR_LINE}") string(REGEX REPLACE "^#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_VERSION_MINOR "${SDL_VERSION_MINOR_LINE}") string(REGEX REPLACE "^#define[ \t]+SDL_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_VERSION_PATCH "${SDL_VERSION_PATCH_LINE}") - set(SDL_VERSION_STRING ${SDL_VERSION_MAJOR}.${SDL_VERSION_MINOR}.${SDL_VERSION_PATCH}) unset(SDL_VERSION_MAJOR_LINE) unset(SDL_VERSION_MINOR_LINE) unset(SDL_VERSION_PATCH_LINE) - unset(SDL_VERSION_MAJOR) - unset(SDL_VERSION_MINOR) - unset(SDL_VERSION_PATCH) + set(SDL_VERSION ${SDL_VERSION_MAJOR}.${SDL_VERSION_MINOR}.${SDL_VERSION_PATCH}) + set(SDL_VERSION_STRING ${SDL_VERSION}) endif() include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) @@ -188,3 +216,14 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL REQUIRED_VARS SDL_LIBRARY SDL_INCLUDE_DIR VERSION_VAR SDL_VERSION_STRING) + +if(SDL_FOUND) + set(SDL_LIBRARIES ${SDL_LIBRARY}) + set(SDL_INCLUDE_DIRS ${SDL_INCLUDE_DIR}) + if(NOT TARGET SDL::SDL) + add_library(SDL::SDL INTERFACE IMPORTED) + set_target_properties(SDL::SDL PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${SDL_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${SDL_LIBRARY}") + endif() +endif() diff --git a/Modules/FindSQLite3.cmake b/Modules/FindSQLite3.cmake index 374d7af..88c7dd2 100644 --- a/Modules/FindSQLite3.cmake +++ b/Modules/FindSQLite3.cmake @@ -5,6 +5,8 @@ FindSQLite3 ----------- +.. versionadded:: 3.14 + Find the SQLite libraries, v3 IMPORTED targets diff --git a/Modules/FindTIFF.cmake b/Modules/FindTIFF.cmake index 00a3a41..3b74c94 100644 --- a/Modules/FindTIFF.cmake +++ b/Modules/FindTIFF.cmake @@ -5,7 +5,14 @@ FindTIFF -------- -Find the TIFF library (``libtiff``). +Find the TIFF library (``libtiff``, https://libtiff.gitlab.io/libtiff/). + +Optional COMPONENTS +^^^^^^^^^^^^^^^^^^^ + +This module supports the optional component `CXX`, for use with the COMPONENTS +argument of the :command:`find_package` command. This component has an associated +imported target, as described below. Imported targets ^^^^^^^^^^^^^^^^ @@ -15,6 +22,11 @@ This module defines the following :prop_tgt:`IMPORTED` targets: ``TIFF::TIFF`` The TIFF library, if found. +``TIFF::CXX`` + The C++ wrapper libtiffxx, if requested by the `COMPONENTS CXX` option, + if the compiler is not MSVC (which includes the C++ wrapper in libtiff), + and if found. + Result variables ^^^^^^^^^^^^^^^^ @@ -36,10 +48,19 @@ The following cache variables may also be set: ``TIFF_INCLUDE_DIR`` the directory containing the TIFF headers -``TIFF_LIBRARY`` - the path to the TIFF library +``TIFF_LIBRARY_RELEASE`` + the path to the TIFF library for release configurations +``TIFF_LIBRARY_DEBUG`` + the path to the TIFF library for debug configurations +``TIFFXX_LIBRARY_RELEASE`` + the path to the TIFFXX library for release configurations +``TIFFXX_LIBRARY_DEBUG`` + the path to the TIFFXX library for debug configurations #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0057 NEW) + find_path(TIFF_INCLUDE_DIR tiff.h) set(TIFF_NAMES ${TIFF_NAMES} tiff libtiff tiff3 libtiff3) @@ -54,8 +75,6 @@ if(NOT TIFF_LIBRARY) select_library_configurations(TIFF) mark_as_advanced(TIFF_LIBRARY_RELEASE TIFF_LIBRARY_DEBUG) endif() -unset(TIFF_NAMES) -unset(TIFF_NAMES_DEBUG) if(TIFF_INCLUDE_DIR AND EXISTS "${TIFF_INCLUDE_DIR}/tiffvers.h") file(STRINGS "${TIFF_INCLUDE_DIR}/tiffvers.h" tiff_version_str @@ -66,13 +85,46 @@ if(TIFF_INCLUDE_DIR AND EXISTS "${TIFF_INCLUDE_DIR}/tiffvers.h") unset(tiff_version_str) endif() +foreach(_comp IN LISTS TIFF_FIND_COMPONENTS) + if(_comp STREQUAL "CXX") + if(MSVC) + # C++ bindings are built into the main tiff library. + set(TIFF_CXX_FOUND 1) + else() + foreach(name ${TIFF_NAMES}) + list(APPEND TIFFXX_NAMES "${name}xx") + list(APPEND TIFFXX_NAMES_DEBUG "${name}xxd") + endforeach() + find_library(TIFFXX_LIBRARY_RELEASE NAMES ${TIFFXX_NAMES}) + find_library(TIFFXX_LIBRARY_DEBUG NAMES ${TIFFXX_NAMES_DEBUG}) + include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) + select_library_configurations(TIFFXX) + mark_as_advanced(TIFFXX_LIBRARY_RELEASE TIFFXX_LIBRARY_DEBUG) + unset(TIFFXX_NAMES) + unset(TIFFXX_NAMES_DEBUG) + if(TIFFXX_LIBRARY) + set(TIFF_CXX_FOUND 1) + endif() + endif() + endif() +endforeach() +unset(_comp) + +unset(TIFF_NAMES) +unset(TIFF_NAMES_DEBUG) + include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(TIFF + HANDLE_COMPONENTS REQUIRED_VARS TIFF_LIBRARY TIFF_INCLUDE_DIR VERSION_VAR TIFF_VERSION_STRING) if(TIFF_FOUND) set(TIFF_LIBRARIES ${TIFF_LIBRARY}) + if("CXX" IN_LIST TIFF_FIND_COMPONENTS AND NOT MSVC) + list(APPEND TIFF_LIBRARIES ${TIFFXX_LIBRARY}) + endif() + set(TIFF_INCLUDE_DIRS "${TIFF_INCLUDE_DIR}") if(NOT TARGET TIFF::TIFF) @@ -101,6 +153,41 @@ if(TIFF_FOUND) IMPORTED_LOCATION_DEBUG "${TIFF_LIBRARY_DEBUG}") endif() endif() + + if(NOT TARGET TIFF::CXX) + if(MSVC) + add_library(TIFF::CXX INTERFACE IMPORTED) + set_property(TARGET TIFF::CXX PROPERTY INTERFACE_LINK_LIBRARIES TIFF::TIFF) + else() + add_library(TIFF::CXX UNKNOWN IMPORTED) + set_property(TARGET TIFF::CXX PROPERTY INTERFACE_LINK_LIBRARIES TIFF::TIFF) + if(TIFF_INCLUDE_DIRS) + set_target_properties(TIFF::CXX PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${TIFF_INCLUDE_DIRS}") + endif() + if(EXISTS "${TIFFXX_LIBRARY}") + set_target_properties(TIFF::CXX PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${TIFFXX_LIBRARY}") + endif() + if(EXISTS "${TIFFXX_LIBRARY_RELEASE}") + set_property(TARGET TIFF::CXX APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(TIFF::CXX PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${TIFFXX_LIBRARY_RELEASE}") + endif() + if(EXISTS "${TIFFXX_LIBRARY_DEBUG}") + set_property(TARGET TIFF::CXX APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(TIFF::CXX PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" + IMPORTED_LOCATION_DEBUG "${TIFFXX_LIBRARY_DEBUG}") + endif() + endif() + endif() + endif() -mark_as_advanced(TIFF_INCLUDE_DIR TIFF_LIBRARY) +mark_as_advanced(TIFF_INCLUDE_DIR) +cmake_policy(POP) diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake index 4b999b6..0ec6013 100644 --- a/Modules/FindVulkan.cmake +++ b/Modules/FindVulkan.cmake @@ -5,6 +5,8 @@ FindVulkan ---------- +.. versionadded:: 3.7 + Find Vulkan, which is a low-overhead, cross-platform 3D graphics and computing API. @@ -14,6 +16,9 @@ IMPORTED Targets This module defines :prop_tgt:`IMPORTED` target ``Vulkan::Vulkan``, if Vulkan has been found. +This module defines :prop_tgt:`IMPORTED` target ``Vulkan::glslc``, if +Vulkan and the GLSLC SPIR-V compiler has been found. + Result Variables ^^^^^^^^^^^^^^^^ @@ -23,10 +28,11 @@ This module defines the following variables:: Vulkan_INCLUDE_DIRS - include directories for Vulkan Vulkan_LIBRARIES - link against this library to use Vulkan -The module will also define two cache variables:: +The module will also define three cache variables:: - Vulkan_INCLUDE_DIR - the Vulkan include directory - Vulkan_LIBRARY - the path to the Vulkan library + Vulkan_INCLUDE_DIR - the Vulkan include directory + Vulkan_LIBRARY - the path to the Vulkan library + Vulkan_GLSLC_EXECUTABLE - the path to the GLSL SPIR-V compiler Hints ^^^^^ @@ -53,6 +59,11 @@ if(WIN32) "$ENV{VULKAN_SDK}/Lib" "$ENV{VULKAN_SDK}/Bin" ) + find_program(Vulkan_GLSLC_EXECUTABLE + NAMES glslc + HINTS + "$ENV{VULKAN_SDK}/Bin" + ) elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) find_library(Vulkan_LIBRARY NAMES vulkan-1 @@ -60,6 +71,11 @@ if(WIN32) "$ENV{VULKAN_SDK}/Lib32" "$ENV{VULKAN_SDK}/Bin32" ) + find_program(Vulkan_GLSLC_EXECUTABLE + NAMES glslc + HINTS + "$ENV{VULKAN_SDK}/Bin32" + ) endif() else() find_path(Vulkan_INCLUDE_DIR @@ -68,6 +84,9 @@ else() find_library(Vulkan_LIBRARY NAMES vulkan HINTS "$ENV{VULKAN_SDK}/lib") + find_program(Vulkan_GLSLC_EXECUTABLE + NAMES glslc + HINTS "$ENV{VULKAN_SDK}/bin") endif() set(Vulkan_LIBRARIES ${Vulkan_LIBRARY}) @@ -78,7 +97,7 @@ find_package_handle_standard_args(Vulkan DEFAULT_MSG Vulkan_LIBRARY Vulkan_INCLUDE_DIR) -mark_as_advanced(Vulkan_INCLUDE_DIR Vulkan_LIBRARY) +mark_as_advanced(Vulkan_INCLUDE_DIR Vulkan_LIBRARY Vulkan_GLSLC_EXECUTABLE) if(Vulkan_FOUND AND NOT TARGET Vulkan::Vulkan) add_library(Vulkan::Vulkan UNKNOWN IMPORTED) @@ -86,3 +105,8 @@ if(Vulkan_FOUND AND NOT TARGET Vulkan::Vulkan) IMPORTED_LOCATION "${Vulkan_LIBRARIES}" INTERFACE_INCLUDE_DIRECTORIES "${Vulkan_INCLUDE_DIRS}") endif() + +if(Vulkan_FOUND AND Vulkan_GLSLC_EXECUTABLE AND NOT TARGET Vulkan::glslc) + add_executable(Vulkan::glslc IMPORTED) + set_property(TARGET Vulkan::glslc PROPERTY IMPORTED_LOCATION "${Vulkan_GLSLC_EXECUTABLE}") +endif() diff --git a/Modules/FindXCTest.cmake b/Modules/FindXCTest.cmake index 15721e1..1f6e825 100644 --- a/Modules/FindXCTest.cmake +++ b/Modules/FindXCTest.cmake @@ -5,6 +5,8 @@ FindXCTest ---------- +.. versionadded:: 3.3 + Functions to help creating and executing XCTest bundles. An XCTest bundle is a CFBundle with a special product-type diff --git a/Modules/FindXalanC.cmake b/Modules/FindXalanC.cmake index 3adaa44..ca9195c 100644 --- a/Modules/FindXalanC.cmake +++ b/Modules/FindXalanC.cmake @@ -5,6 +5,8 @@ FindXalanC ----------- +.. versionadded:: 3.5 + Find the Apache Xalan-C++ XSL transform processor headers and libraries. Imported targets diff --git a/Modules/FindXercesC.cmake b/Modules/FindXercesC.cmake index db78b61..abe18c0 100644 --- a/Modules/FindXercesC.cmake +++ b/Modules/FindXercesC.cmake @@ -5,6 +5,8 @@ FindXercesC ----------- +.. versionadded:: 3.1 + Find the Apache Xerces-C++ validating XML parser headers and libraries. Imported targets diff --git a/Modules/GoogleTest.cmake b/Modules/GoogleTest.cmake index b210a77..2ef7382 100644 --- a/Modules/GoogleTest.cmake +++ b/Modules/GoogleTest.cmake @@ -5,6 +5,8 @@ GoogleTest ---------- +.. versionadded:: 3.9 + This module defines functions to help use the Google Test infrastructure. Two mechanisms for adding tests are provided. :command:`gtest_add_tests` has been around for some time, originally via ``find_package(GTest)``. diff --git a/Modules/Platform/Android-Clang.cmake b/Modules/Platform/Android-Clang.cmake index 759448b..160eada 100644 --- a/Modules/Platform/Android-Clang.cmake +++ b/Modules/Platform/Android-Clang.cmake @@ -53,4 +53,7 @@ macro(__android_compiler_clang lang) endif() list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "--target=${CMAKE_${lang}_COMPILER_TARGET}") endif() + if(CMAKE_GENERATOR MATCHES "Visual Studio") + set(_ANDROID_STL_NOSTDLIBXX 1) + endif() endmacro() diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake index 2225897..11a0504 100644 --- a/Modules/Platform/Android-Determine.cmake +++ b/Modules/Platform/Android-Determine.cmake @@ -7,8 +7,8 @@ # Support for NVIDIA Nsight Tegra Visual Studio Edition was previously # implemented in the CMake VS IDE generators. Avoid interfering with -# that functionality for now. Later we may try to integrate this. -if(CMAKE_GENERATOR MATCHES "Visual Studio") +# that functionality for now. +if(CMAKE_GENERATOR_PLATFORM STREQUAL "Tegra-Android") return() endif() @@ -27,6 +27,63 @@ endif() cmake_policy(PUSH) cmake_policy(SET CMP0057 NEW) # if IN_LIST +# If using Android tools for Visual Studio, compile a sample project to get the +# sysroot. +if(CMAKE_GENERATOR MATCHES "Visual Studio") + if(NOT CMAKE_SYSROOT) + set(vcx_platform ${CMAKE_GENERATOR_PLATFORM}) + if(CMAKE_GENERATOR MATCHES "Visual Studio 1[45]") + set(vcx_sysroot_var "Sysroot") + else() + set(vcx_sysroot_var "SysrootLink") + endif() + if(CMAKE_GENERATOR MATCHES "Visual Studio 14") + set(vcx_revision "2.0") + elseif(CMAKE_GENERATOR MATCHES "Visual Studio 1[56]") + set(vcx_revision "3.0") + else() + set(vcx_revision "") + endif() + configure_file(${CMAKE_ROOT}/Modules/Platform/Android/VCXProjInspect.vcxproj.in + ${CMAKE_PLATFORM_INFO_DIR}/VCXProjInspect.vcxproj @ONLY) + execute_process( + COMMAND "${CMAKE_VS_MSBUILD_COMMAND}" "VCXProjInspect.vcxproj" + "/p:Configuration=Debug" "/p:Platform=${vcx_platform}" + WORKING_DIRECTORY ${CMAKE_PLATFORM_INFO_DIR} + OUTPUT_VARIABLE VCXPROJ_INSPECT_OUTPUT + ERROR_VARIABLE VCXPROJ_INSPECT_OUTPUT + RESULT_VARIABLE VCXPROJ_INSPECT_RESULT + ) + if(NOT CMAKE_SYSROOT AND VCXPROJ_INSPECT_OUTPUT MATCHES "CMAKE_SYSROOT=([^%\r\n]+)[\r\n]") + # Strip VS diagnostic output from the end of the line. + string(REGEX REPLACE " \\(TaskId:[0-9]*\\)$" "" _sysroot "${CMAKE_MATCH_1}") + if(EXISTS "${_sysroot}") + file(TO_CMAKE_PATH "${_sysroot}" CMAKE_SYSROOT) + endif() + endif() + if(VCXPROJ_INSPECT_RESULT) + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Determining the sysroot for the Android NDK failed. +The output was: +${VCXPROJ_INSPECT_RESULT} +${VCXPROJ_INSPECT_OUTPUT} + +") + else() + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Determining the sysroot for the Android NDK succeeded. +The output was: +${VCXPROJ_INSPECT_RESULT} +${VCXPROJ_INSPECT_OUTPUT} + +") + endif() + endif() + if(NOT CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION) + set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") + endif() +endif() + # If the user provided CMAKE_SYSROOT for us, extract information from it. set(_ANDROID_SYSROOT_NDK "") set(_ANDROID_SYSROOT_API "") diff --git a/Modules/Platform/Android-Initialize.cmake b/Modules/Platform/Android-Initialize.cmake index b90dd7a..5019c28 100644 --- a/Modules/Platform/Android-Initialize.cmake +++ b/Modules/Platform/Android-Initialize.cmake @@ -6,7 +6,7 @@ # Support for NVIDIA Nsight Tegra Visual Studio Edition was previously # implemented in the CMake VS IDE generators. Avoid interfering with -# that functionality for now. Later we may try to integrate this. +# that functionality for now. if(CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android") return() endif() diff --git a/Modules/Platform/Android/VCXProjInspect.vcxproj.in b/Modules/Platform/Android/VCXProjInspect.vcxproj.in new file mode 100644 index 0000000..6919d2c --- /dev/null +++ b/Modules/Platform/Android/VCXProjInspect.vcxproj.in @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|@vcx_platform@"> + <Configuration>Debug</Configuration> + <Platform>@vcx_platform@</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{14D44772-ECF7-47BD-9E29-BC62FAF940A5}</ProjectGuid> + <RootNamespace>VCXProjInspect</RootNamespace> + <Keyword>Android</Keyword> + <ApplicationType>Android</ApplicationType> + <ApplicationTypeRevision>@vcx_revision@</ApplicationTypeRevision> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@vcx_platform@'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <PropertyGroup> + <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|@vcx_platform@'">false</LinkIncremental> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@vcx_platform@'"> + <PostBuildEvent> + <Command>%40echo CMAKE_SYSROOT=$(@vcx_sysroot_var@)</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake index 80e9a40..aa0e554 100644 --- a/Modules/Platform/Darwin-Initialize.cmake +++ b/Modules/Platform/Darwin-Initialize.cmake @@ -62,10 +62,10 @@ elseif("${CMAKE_GENERATOR}" MATCHES Xcode # Find installed SDKs in either Xcode-4.3+ or pre-4.3 SDKs directory. set(_CMAKE_OSX_SDKS_DIR "") if(OSX_DEVELOPER_ROOT) - foreach(d Platforms/MacOSX.platform/Developer/SDKs SDKs) - file(GLOB _CMAKE_OSX_SDKS ${OSX_DEVELOPER_ROOT}/${d}/*) + foreach(_d Platforms/MacOSX.platform/Developer/SDKs SDKs) + file(GLOB _CMAKE_OSX_SDKS ${OSX_DEVELOPER_ROOT}/${_d}/*) if(_CMAKE_OSX_SDKS) - set(_CMAKE_OSX_SDKS_DIR ${OSX_DEVELOPER_ROOT}/${d}) + set(_CMAKE_OSX_SDKS_DIR ${OSX_DEVELOPER_ROOT}/${_d}) break() endif() endforeach() @@ -88,10 +88,10 @@ elseif("${CMAKE_GENERATOR}" MATCHES Xcode # pick an SDK that works set(_CMAKE_OSX_SYSROOT_DEFAULT) - foreach(ver ${CMAKE_OSX_DEPLOYMENT_TARGET} - ${_CURRENT_OSX_VERSION} - ${_CMAKE_OSX_LATEST_SDK_VERSION}) - set(_CMAKE_OSX_DEPLOYMENT_TARGET ${ver}) + foreach(_ver ${CMAKE_OSX_DEPLOYMENT_TARGET} + ${_CURRENT_OSX_VERSION} + ${_CMAKE_OSX_LATEST_SDK_VERSION}) + set(_CMAKE_OSX_DEPLOYMENT_TARGET ${_ver}) set(_CMAKE_OSX_SDKS_VER ${_CMAKE_OSX_DEPLOYMENT_TARGET}${_CMAKE_OSX_SDKS_VER_SUFFIX_${_CMAKE_OSX_DEPLOYMENT_TARGET}}) set(_CMAKE_OSX_SYSROOT_CHECK "${_CMAKE_OSX_SDKS_DIR}/MacOSX${_CMAKE_OSX_SDKS_VER}.sdk") if(IS_DIRECTORY "${_CMAKE_OSX_SYSROOT_CHECK}") @@ -113,8 +113,8 @@ endif() # Set cache variable - end user may change this during ccmake or cmake-gui configure. # Choose the type based on the current value. set(_CMAKE_OSX_SYSROOT_TYPE STRING) -foreach(v CMAKE_OSX_SYSROOT _CMAKE_OSX_SYSROOT_DEFAULT) - if("x${${v}}" MATCHES "/") +foreach(_v CMAKE_OSX_SYSROOT _CMAKE_OSX_SYSROOT_DEFAULT) + if("x${${_v}}" MATCHES "/") set(_CMAKE_OSX_SYSROOT_TYPE PATH) break() endif() diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index 23d81b5..5100035 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -5,6 +5,8 @@ WriteCompilerDetectionHeader ---------------------------- +.. versionadded:: 3.1 + This module provides the function ``write_compiler_detection_header()``. This function can be used to generate a file suitable for preprocessor diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 1b6bb00..ee8767f 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -412,6 +412,8 @@ set(SRCS cmSourceFileLocationKind.h cmSourceGroup.cxx cmSourceGroup.h + cmStandardLevelResolver.cxx + cmStandardLevelResolver.h cmState.cxx cmState.h cmStateDirectory.cxx diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 96a5b97..b7dcd98 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,8 +1,8 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 18) -set(CMake_VERSION_PATCH 0) -set(CMake_VERSION_RC 4) +set(CMake_VERSION_PATCH 20200714) +#set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) # Start with the full version number used in tags. It has no dev info. diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index fe7abf4..cefb906 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -8,7 +8,9 @@ #include <map> #include <CoreFoundation/CoreFoundation.h> +#include <cm3p/kwiml/abi.h> +#include "cmsys/Base64.h" #include "cmsys/FStream.hxx" #include "cmsys/RegularExpression.hxx" @@ -18,6 +20,7 @@ #include "cmGeneratedFileStream.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmXMLWriter.h" #ifdef HAVE_CoreServices // For the old LocaleStringToLangAndRegionCodes() function, to convert @@ -26,36 +29,28 @@ # include <CoreServices/CoreServices.h> #endif -static const char* SLAHeader = - "data 'LPic' (5000) {\n" - " $\"0002 0011 0003 0001 0000 0000 0002 0000\"\n" - " $\"0008 0003 0000 0001 0004 0000 0004 0005\"\n" - " $\"0000 000E 0006 0001 0005 0007 0000 0007\"\n" - " $\"0008 0000 0047 0009 0000 0034 000A 0001\"\n" - " $\"0035 000B 0001 0020 000C 0000 0011 000D\"\n" - " $\"0000 005B 0004 0000 0033 000F 0001 000C\"\n" - " $\"0010 0000 000B 000E 0000\"\n" - "};\n" - "\n"; - -static const char* SLASTREnglish = - "resource 'STR#' (5002, \"English\") {\n" - " {\n" - " \"English\",\n" - " \"Agree\",\n" - " \"Disagree\",\n" - " \"Print\",\n" - " \"Save...\",\n" - " \"You agree to the License Agreement terms when you click \"\n" - " \"the \\\"Agree\\\" button.\",\n" - " \"Software License Agreement\",\n" - " \"This text cannot be saved. This disk may be full or locked, " - "or the \"\n" - " \"file may be locked.\",\n" - " \"Unable to print. Make sure you have selected a printer.\"\n" - " }\n" - "};\n" - "\n"; +static const uint16_t DefaultLpic[] = { + /* clang-format off */ + 0x0002, 0x0011, 0x0003, 0x0001, 0x0000, 0x0000, 0x0002, 0x0000, + 0x0008, 0x0003, 0x0000, 0x0001, 0x0004, 0x0000, 0x0004, 0x0005, + 0x0000, 0x000E, 0x0006, 0x0001, 0x0005, 0x0007, 0x0000, 0x0007, + 0x0008, 0x0000, 0x0047, 0x0009, 0x0000, 0x0034, 0x000A, 0x0001, + 0x0035, 0x000B, 0x0001, 0x0020, 0x000C, 0x0000, 0x0011, 0x000D, + 0x0000, 0x005B, 0x0004, 0x0000, 0x0033, 0x000F, 0x0001, 0x000C, + 0x0010, 0x0000, 0x000B, 0x000E, 0x0000 + /* clang-format on */ +}; + +static const std::vector<std::string> DefaultMenu = { + { "English", "Agree", "Disagree", "Print", "Save...", + // NOLINTNEXTLINE(bugprone-suspicious-missing-comma) + "You agree to the License Agreement terms when " + "you click the \"Agree\" button.", + "Software License Agreement", + "This text cannot be saved. " + "This disk may be full or locked, or the file may be locked.", + "Unable to print. Make sure you have selected a printer." } +}; cmCPackDragNDropGenerator::cmCPackDragNDropGenerator() : singleLicense(false) @@ -523,22 +518,43 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, } } + // Create the final compressed read-only disk image ... + std::ostringstream final_image_command; + final_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); + final_image_command << " convert \"" << temp_image << "\""; + final_image_command << " -format "; + final_image_command << cpack_dmg_format; + final_image_command << " -imagekey"; + final_image_command << " zlib-level=9"; + final_image_command << " -o \"" << output_file << "\""; + + std::string convert_error; + + if (!this->RunCommand(final_image_command, &convert_error)) { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error compressing disk image." << std::endl + << convert_error + << std::endl); + + return 0; + } + if (!cpack_license_file.empty() || !slaDirectory.empty()) { // Use old hardcoded style if sla_dir is not set bool oldStyle = slaDirectory.empty(); - std::string sla_r = - cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"), "/sla.r"); + std::string sla_xml = + cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"), "/sla.xml"); std::vector<std::string> languages; if (!oldStyle) { cmExpandList(cpack_dmg_languages, languages); } - cmGeneratedFileStream ofs(sla_r); - ofs << "#include <CoreServices/CoreServices.r>\n\n"; + std::vector<uint16_t> header_data; if (oldStyle) { - ofs << SLAHeader; - ofs << "\n"; + header_data = std::vector<uint16_t>( + DefaultLpic, + DefaultLpic + (sizeof(DefaultLpic) / sizeof(*DefaultLpic))); } else { /* * LPic Layout @@ -558,8 +574,6 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, * } */ - // Create vector first for readability, then iterate to write to ofs - std::vector<uint16_t> header_data; header_data.push_back(0); header_data.push_back(languages.size()); for (size_t i = 0; i < languages.size(); ++i) { @@ -596,52 +610,50 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, header_data.push_back(0); #endif } - ofs << "data 'LPic' (5000) {\n"; - ofs << std::hex << std::uppercase << std::setfill('0'); - - for (size_t i = 0; i < header_data.size(); ++i) { - if (i % 8 == 0) { - ofs << " $\""; - } - - ofs << std::setw(4) << header_data[i]; + } - if (i % 8 == 7 || i == header_data.size() - 1) { - ofs << "\"\n"; - } else { - ofs << " "; - } + RezDoc rez; + + { + RezDict lpic = { {}, 5000, {} }; + lpic.Data.reserve(header_data.size() * sizeof(header_data[0])); + for (uint16_t x : header_data) { + // LPic header is big-endian. + char* d = reinterpret_cast<char*>(&x); +#if KWIML_ABI_ENDIAN_ID == KWIML_ABI_ENDIAN_ID_LITTLE + lpic.Data.push_back(d[1]); + lpic.Data.push_back(d[0]); +#else + lpic.Data.push_back(d[0]); + lpic.Data.push_back(d[1]); +#endif } - ofs << "};\n\n"; - // Reset ofs options - ofs << std::dec << std::nouppercase << std::setfill(' '); + rez.LPic.Entries.emplace_back(std::move(lpic)); } bool have_write_license_error = false; std::string error; if (oldStyle) { - if (!this->WriteLicense(ofs, 0, "", cpack_license_file, &error)) { + if (!this->WriteLicense(rez, 0, "", cpack_license_file, &error)) { have_write_license_error = true; } } else { for (size_t i = 0; i < languages.size() && !have_write_license_error; ++i) { if (singleLicense) { - if (!this->WriteLicense(ofs, i + 5000, languages[i], + if (!this->WriteLicense(rez, i + 5000, languages[i], cpack_license_file, &error)) { have_write_license_error = true; } } else { - if (!this->WriteLicense(ofs, i + 5000, languages[i], "", &error)) { + if (!this->WriteLicense(rez, i + 5000, languages[i], "", &error)) { have_write_license_error = true; } } } } - ofs.Close(); - if (have_write_license_error) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Error writing license file to SLA." << std::endl @@ -650,96 +662,27 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, return 0; } - if (temp_image_format != "UDZO") { - temp_image_format = "UDZO"; - // convert to UDZO to enable unflatten/flatten - std::string temp_udzo = cmStrCat( - this->GetOption("CPACK_TOPLEVEL_DIRECTORY"), "/temp-udzo.dmg"); + this->WriteRezXML(sla_xml, rez); - std::ostringstream udco_image_command; - udco_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); - udco_image_command << " convert \"" << temp_image << "\""; - udco_image_command << " -format UDZO"; - udco_image_command << " -ov -o \"" << temp_udzo << "\""; - - if (!this->RunCommand(udco_image_command, &error)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, - "Error converting to UDCO dmg for adding SLA." - << std::endl - << error << std::endl); - return 0; - } - temp_image = temp_udzo; - } - - // unflatten dmg - std::ostringstream unflatten_command; - unflatten_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); - unflatten_command << " unflatten "; - unflatten_command << "\"" << temp_image << "\""; - - if (!this->RunCommand(unflatten_command, &error)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, - "Error unflattening dmg for adding SLA." << std::endl - << error - << std::endl); - return 0; - } - - // Rez the SLA + // Create the final compressed read-only disk image ... std::ostringstream embed_sla_command; - embed_sla_command << this->GetOption("CPACK_COMMAND_REZ"); - const char* sysroot = this->GetOption("CPACK_OSX_SYSROOT"); - if (sysroot && sysroot[0] != '\0') { - embed_sla_command << " -isysroot \"" << sysroot << "\""; - } - embed_sla_command << " \"" << sla_r << "\""; - embed_sla_command << " -a -o "; - embed_sla_command << "\"" << temp_image << "\""; - - if (!this->RunCommand(embed_sla_command, &error)) { + embed_sla_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); + embed_sla_command << " udifrez"; + embed_sla_command << " -xml"; + embed_sla_command << " \"" << sla_xml << "\""; + embed_sla_command << " FIXME_WHY_IS_THIS_ARGUMENT_NEEDED"; + embed_sla_command << " \"" << output_file << "\""; + std::string embed_error; + if (!this->RunCommand(embed_sla_command, &embed_error)) { cmCPackLogger(cmCPackLog::LOG_ERROR, - "Error adding SLA." << std::endl - << error << std::endl); - return 0; - } - - // flatten dmg - std::ostringstream flatten_command; - flatten_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); - flatten_command << " flatten "; - flatten_command << "\"" << temp_image << "\""; + "Error compressing disk image." << std::endl + << embed_error + << std::endl); - if (!this->RunCommand(flatten_command, &error)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, - "Error flattening dmg for adding SLA." << std::endl - << error - << std::endl); return 0; } } - // Create the final compressed read-only disk image ... - std::ostringstream final_image_command; - final_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); - final_image_command << " convert \"" << temp_image << "\""; - final_image_command << " -format "; - final_image_command << cpack_dmg_format; - final_image_command << " -imagekey"; - final_image_command << " zlib-level=9"; - final_image_command << " -o \"" << output_file << "\""; - - std::string convert_error; - - if (!this->RunCommand(final_image_command, &convert_error)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, - "Error compressing disk image." << std::endl - << convert_error - << std::endl); - - return 0; - } - return 1; } @@ -788,10 +731,67 @@ std::string cmCPackDragNDropGenerator::GetComponentInstallDirNameSuffix( return GetComponentPackageFileName(package_file_name, componentName, false); } -bool cmCPackDragNDropGenerator::WriteLicense( - cmGeneratedFileStream& outputStream, int licenseNumber, - std::string licenseLanguage, const std::string& licenseFile, - std::string* error) +void cmCPackDragNDropGenerator::WriteRezXML(std::string const& file, + RezDoc const& rez) +{ + cmGeneratedFileStream fxml(file); + cmXMLWriter xml(fxml); + xml.StartDocument(); + xml.StartElement("plist"); + xml.Attribute("version", "1.0"); + xml.StartElement("dict"); + this->WriteRezArray(xml, rez.LPic); + this->WriteRezArray(xml, rez.Menu); + this->WriteRezArray(xml, rez.Text); + this->WriteRezArray(xml, rez.RTF); + xml.EndElement(); // dict + xml.EndElement(); // plist + xml.EndDocument(); + fxml.Close(); +} + +void cmCPackDragNDropGenerator::WriteRezArray(cmXMLWriter& xml, + RezArray const& array) +{ + if (array.Entries.empty()) { + return; + } + xml.StartElement("key"); + xml.Content(array.Key); + xml.EndElement(); // key + xml.StartElement("array"); + for (RezDict const& dict : array.Entries) { + this->WriteRezDict(xml, dict); + } + xml.EndElement(); // array +} + +void cmCPackDragNDropGenerator::WriteRezDict(cmXMLWriter& xml, + RezDict const& dict) +{ + std::vector<char> base64buf(dict.Data.size() * 3 / 2 + 5); + size_t base64len = + cmsysBase64_Encode(dict.Data.data(), dict.Data.size(), + reinterpret_cast<unsigned char*>(base64buf.data()), 0); + std::string base64data(base64buf.data(), base64len); + /* clang-format off */ + xml.StartElement("dict"); + xml.StartElement("key"); xml.Content("Attributes"); xml.EndElement(); + xml.StartElement("string"); xml.Content("0x0000"); xml.EndElement(); + xml.StartElement("key"); xml.Content("Data"); xml.EndElement(); + xml.StartElement("data"); xml.Content(base64data); xml.EndElement(); + xml.StartElement("key"); xml.Content("ID"); xml.EndElement(); + xml.StartElement("string"); xml.Content(dict.ID); xml.EndElement(); + xml.StartElement("key"); xml.Content("Name"); xml.EndElement(); + xml.StartElement("string"); xml.Content(dict.Name); xml.EndElement(); + xml.EndElement(); // dict + /* clang-format on */ +} + +bool cmCPackDragNDropGenerator::WriteLicense(RezDoc& rez, size_t licenseNumber, + std::string licenseLanguage, + const std::string& licenseFile, + std::string* error) { if (!licenseFile.empty() && !singleLicense) { licenseNumber = 5002; @@ -799,11 +799,11 @@ bool cmCPackDragNDropGenerator::WriteLicense( } // License file - std::string license_format = "TEXT"; + RezArray* licenseArray = &rez.Text; std::string actual_license; if (!licenseFile.empty()) { if (cmHasLiteralSuffix(licenseFile, ".rtf")) { - license_format = "RTF "; + licenseArray = &rez.RTF; } actual_license = licenseFile; } else { @@ -812,85 +812,86 @@ bool cmCPackDragNDropGenerator::WriteLicense( if (cmSystemTools::FileExists(license_wo_ext + ".txt")) { actual_license = license_wo_ext + ".txt"; } else { - license_format = "RTF "; + licenseArray = &rez.RTF; actual_license = license_wo_ext + ".rtf"; } } - // License header - outputStream << "data '" << license_format << "' (" << licenseNumber - << ", \"" << licenseLanguage << "\") {\n"; // License body - cmsys::ifstream license_ifs; - license_ifs.open(actual_license.c_str()); - if (license_ifs.is_open()) { - while (license_ifs.good()) { - std::string line; - std::getline(license_ifs, line); - if (!line.empty()) { - EscapeQuotesAndBackslashes(line); - std::vector<std::string> lines; - if (!this->BreakLongLine(line, lines, error)) { - return false; - } - for (auto const& l : lines) { - outputStream << " \"" << l << "\"\n"; - } - } - outputStream << " \"\\n\"\n"; + { + RezDict license = { licenseLanguage, licenseNumber, {} }; + std::vector<std::string> lines; + if (!this->ReadFile(actual_license, lines, error)) { + return false; } - license_ifs.close(); + this->EncodeLicense(license, lines); + licenseArray->Entries.emplace_back(std::move(license)); } - // End of License - outputStream << "};\n\n"; - if (!licenseFile.empty() && !singleLicense) { - outputStream << SLASTREnglish; - } else { - // Menu header - outputStream << "resource 'STR#' (" << licenseNumber << ", \"" - << licenseLanguage << "\") {\n"; - outputStream << " {\n"; - - // Menu body - cmsys::ifstream menu_ifs; - menu_ifs.open( - (slaDirectory + "/" + licenseLanguage + ".menu.txt").c_str()); - if (menu_ifs.is_open()) { - size_t lines_written = 0; - while (menu_ifs.good()) { - // Lines written from original file, not from broken up lines - std::string line; - std::getline(menu_ifs, line); - if (!line.empty()) { - EscapeQuotesAndBackslashes(line); - std::vector<std::string> lines; - if (!this->BreakLongLine(line, lines, error)) { - return false; - } - for (size_t i = 0; i < lines.size(); ++i) { - std::string comma; - // We need a comma after every complete string, - // but not on the very last line - if (lines_written != 8 && i == lines.size() - 1) { - comma = ","; - } else { - comma = ""; - } - outputStream << " \"" << lines[i] << "\"" << comma << "\n"; - } - ++lines_written; - } + // Menu body + { + RezDict menu = { licenseLanguage, licenseNumber, {} }; + if (!licenseFile.empty() && !singleLicense) { + this->EncodeMenu(menu, DefaultMenu); + } else { + std::vector<std::string> lines; + std::string actual_menu = + slaDirectory + "/" + licenseLanguage + ".menu.txt"; + if (!this->ReadFile(actual_menu, lines, error)) { + return false; } - menu_ifs.close(); + this->EncodeMenu(menu, lines); } + rez.Menu.Entries.emplace_back(std::move(menu)); + } + + return true; +} + +void cmCPackDragNDropGenerator::EncodeLicense( + RezDict& dict, std::vector<std::string> const& lines) +{ + // License text uses CR newlines. + for (std::string const& l : lines) { + dict.Data.insert(dict.Data.end(), l.begin(), l.end()); + dict.Data.push_back('\r'); + } + dict.Data.push_back('\r'); +} - // End of menu - outputStream << " }\n"; - outputStream << "};\n"; - outputStream << "\n"; +void cmCPackDragNDropGenerator::EncodeMenu( + RezDict& dict, std::vector<std::string> const& lines) +{ + // Menu resources start with a big-endian uint16_t for number of lines: + { + uint16_t numLines = static_cast<uint16_t>(lines.size()); + char* d = reinterpret_cast<char*>(&numLines); +#if KWIML_ABI_ENDIAN_ID == KWIML_ABI_ENDIAN_ID_LITTLE + dict.Data.push_back(d[1]); + dict.Data.push_back(d[0]); +#else + dict.Data.push_back(d[0]); + dict.Data.push_back(d[1]); +#endif } + // Each line starts with a uint8_t length, plus the bytes themselves: + for (std::string const& l : lines) { + dict.Data.push_back(static_cast<unsigned char>(l.length())); + dict.Data.insert(dict.Data.end(), l.begin(), l.end()); + } +} +bool cmCPackDragNDropGenerator::ReadFile(std::string const& file, + std::vector<std::string>& lines, + std::string* error) +{ + cmsys::ifstream ifs(file); + std::string line; + while (std::getline(ifs, line)) { + if (!this->BreakLongLine(line, lines, error)) { + return false; + } + } return true; } @@ -898,7 +899,7 @@ bool cmCPackDragNDropGenerator::BreakLongLine(const std::string& line, std::vector<std::string>& lines, std::string* error) { - const size_t max_line_length = 512; + const size_t max_line_length = 255; size_t line_length = max_line_length; for (size_t i = 0; i < line.size(); i += line_length) { line_length = max_line_length; @@ -913,25 +914,10 @@ bool cmCPackDragNDropGenerator::BreakLongLine(const std::string& line, if (line_length == 0) { *error = "Please make sure there are no words " "(or character sequences not broken up by spaces or newlines) " - "in your license file which are more than 512 characters long."; + "in your license file which are more than 255 characters long."; return false; } lines.push_back(line.substr(i, line_length)); } return true; } - -void cmCPackDragNDropGenerator::EscapeQuotesAndBackslashes(std::string& line) -{ - std::string::size_type backslash_pos = line.find('\\'); - while (backslash_pos != std::string::npos) { - line.replace(backslash_pos, 1, "\\\\"); - backslash_pos = line.find('\\', backslash_pos + 2); - } - - std::string::size_type quote_pos = line.find('\"'); - while (quote_pos != std::string::npos) { - line.replace(quote_pos, 1, "\\\""); - quote_pos = line.find('\"', quote_pos + 2); - } -} diff --git a/Source/CPack/cmCPackDragNDropGenerator.h b/Source/CPack/cmCPackDragNDropGenerator.h index f8c86c0..dbd190c 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.h +++ b/Source/CPack/cmCPackDragNDropGenerator.h @@ -14,6 +14,7 @@ #include "cmCPackGenerator.h" class cmGeneratedFileStream; +class cmXMLWriter; /** \class cmCPackDragNDropGenerator * \brief A generator for OSX drag-n-drop installs @@ -45,12 +46,40 @@ private: std::string slaDirectory; bool singleLicense; - bool WriteLicense(cmGeneratedFileStream& outputStream, int licenseNumber, + struct RezDict + { + std::string Name; + size_t ID; + std::vector<unsigned char> Data; + }; + + struct RezArray + { + std::string Key; + std::vector<RezDict> Entries; + }; + + struct RezDoc + { + RezArray LPic = { "LPic", {} }; + RezArray Menu = { "STR#", {} }; + RezArray Text = { "TEXT", {} }; + RezArray RTF = { "RTF ", {} }; + }; + + void WriteRezXML(std::string const& file, RezDoc const& rez); + void WriteRezArray(cmXMLWriter& xml, RezArray const& array); + void WriteRezDict(cmXMLWriter& xml, RezDict const& dict); + + bool WriteLicense(RezDoc& rez, size_t licenseNumber, std::string licenseLanguage, const std::string& licenseFile, std::string* error); + void EncodeLicense(RezDict& dict, std::vector<std::string> const& lines); + void EncodeMenu(RezDict& dict, std::vector<std::string> const& lines); + bool ReadFile(std::string const& file, std::vector<std::string>& lines, + std::string* error); bool BreakLongLine(const std::string& line, std::vector<std::string>& lines, std::string* error); - void EscapeQuotesAndBackslashes(std::string& line); }; #endif diff --git a/Source/CPack/cmCPackExternalGenerator.cxx b/Source/CPack/cmCPackExternalGenerator.cxx index 11e1aec..53be4fe 100644 --- a/Source/CPack/cmCPackExternalGenerator.cxx +++ b/Source/CPack/cmCPackExternalGenerator.cxx @@ -75,6 +75,12 @@ int cmCPackExternalGenerator::PackageFiles() if (cmSystemTools::GetErrorOccuredFlag() || !res) { return 0; } + + const char* builtPackagesStr = + this->GetOption("CPACK_EXTERNAL_BUILT_PACKAGES"); + if (builtPackagesStr) { + cmExpandList(builtPackagesStr, this->packageFileNames, false); + } } return 1; diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 288dc58..c641175 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -264,6 +264,23 @@ int cmCPackGenerator::InstallProject() return 0; } + // Run pre-build actions + const char* preBuildScripts = this->GetOption("CPACK_PRE_BUILD_SCRIPTS"); + if (preBuildScripts) { + const auto scripts = cmExpandedList(preBuildScripts, false); + for (const auto& script : scripts) { + cmCPackLogger(cmCPackLog::LOG_OUTPUT, + "Executing pre-build script: " << script << std::endl); + + if (!this->MakefileMap->ReadListFile(script)) { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "The pre-build script not found: " << script + << std::endl); + return 0; + } + } + } + if (setDestDir) { cmSystemTools::PutEnv("DESTDIR="); } @@ -333,7 +350,8 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( if (installDirectoriesVector.size() % 2 != 0) { cmCPackLogger( cmCPackLog::LOG_ERROR, - "CPACK_INSTALLED_DIRECTORIES should contain pairs of <directory> and " + "CPACK_INSTALLED_DIRECTORIES should contain pairs of <directory> " + "and " "<subdirectory>. The <subdirectory> can be '.' to be installed in " "the toplevel directory of installation." << std::endl); @@ -475,10 +493,10 @@ int cmCPackGenerator::InstallProjectViaInstallScript( "- Install script: " << installScript << std::endl); if (setDestDir) { - // For DESTDIR based packaging, use the *project* CMAKE_INSTALL_PREFIX - // underneath the tempInstallDirectory. The value of the project's - // CMAKE_INSTALL_PREFIX is sent in here as the value of the - // CPACK_INSTALL_PREFIX variable. + // For DESTDIR based packaging, use the *project* + // CMAKE_INSTALL_PREFIX underneath the tempInstallDirectory. The + // value of the project's CMAKE_INSTALL_PREFIX is sent in here as the + // value of the CPACK_INSTALL_PREFIX variable. std::string dir; if (this->GetOption("CPACK_INSTALL_PREFIX")) { @@ -811,7 +829,7 @@ int cmCPackGenerator::InstallCMakeProject( * - Because it was already used for component install * in order to put things in subdirs... */ - cmSystemTools::PutEnv(std::string("DESTDIR=") + tempInstallDirectory); + cmSystemTools::PutEnv("DESTDIR=" + tempInstallDirectory); cmCPackLogger(cmCPackLog::LOG_DEBUG, "- Creating directory: '" << dir << "'" << std::endl); @@ -1076,6 +1094,25 @@ int cmCPackGenerator::DoPackage() return 0; } } + // Run post-build actions + const char* postBuildScripts = this->GetOption("CPACK_POST_BUILD_SCRIPTS"); + if (postBuildScripts) { + this->MakefileMap->AddDefinition("CPACK_PACKAGE_FILES", + cmJoin(this->packageFileNames, ";")); + + const auto scripts = cmExpandedList(postBuildScripts, false); + for (const auto& script : scripts) { + cmCPackLogger(cmCPackLog::LOG_OUTPUT, + "Executing post-build script: " << script << std::endl); + + if (!this->MakefileMap->ReadListFile(script)) { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "The post-build script not found: " << script + << std::endl); + return 0; + } + } + } /* Prepare checksum algorithm*/ const char* algo = this->GetOption("CPACK_PACKAGE_CHECKSUM"); @@ -1289,7 +1326,7 @@ bool cmCPackGenerator::ConfigureFile(const std::string& inName, bool copyOnly /* = false */) { return this->MakefileMap->ConfigureFile(inName, outName, copyOnly, true, - false) == 1; + false, true) == 1; } int cmCPackGenerator::CleanTemporaryDirectory() @@ -1378,7 +1415,8 @@ int cmCPackGenerator::PrepareGroupingKind() << std::endl); } - // if user specified packaging method, override the default packaging method + // if user specified packaging method, override the default packaging + // method if (method != UNKNOWN_COMPONENT_PACKAGE_METHOD) { componentPackageMethod = method; } diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 85b8ab1..d2772a7 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -326,6 +326,9 @@ void cmCTestMemCheckHandler::GenerateDartOutput(cmXMLWriter& xml) case cmCTestMemCheckHandler::BOUNDS_CHECKER: xml.Attribute("Checker", "BoundsChecker"); break; + case cmCTestMemCheckHandler::CUDA_MEMCHECK: + xml.Attribute("Checker", "CudaMemcheck"); + break; case cmCTestMemCheckHandler::ADDRESS_SANITIZER: xml.Attribute("Checker", "AddressSanitizer"); break; @@ -465,6 +468,8 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() this->MemoryTesterStyle = cmCTestMemCheckHandler::PURIFY; } else if (testerName.find("BC") != std::string::npos) { this->MemoryTesterStyle = cmCTestMemCheckHandler::BOUNDS_CHECKER; + } else if (testerName.find("cuda-memcheck") != std::string::npos) { + this->MemoryTesterStyle = cmCTestMemCheckHandler::CUDA_MEMCHECK; } else { this->MemoryTesterStyle = cmCTestMemCheckHandler::UNKNOWN; } @@ -485,6 +490,11 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() this->MemoryTester = this->CTest->GetCTestConfiguration("BoundsCheckerCommand"); this->MemoryTesterStyle = cmCTestMemCheckHandler::BOUNDS_CHECKER; + } else if (cmSystemTools::FileExists( + this->CTest->GetCTestConfiguration("CudaMemcheckCommand"))) { + this->MemoryTester = + this->CTest->GetCTestConfiguration("CudaMemcheckCommand"); + this->MemoryTesterStyle = cmCTestMemCheckHandler::CUDA_MEMCHECK; } if (this->CTest->GetCTestConfiguration("MemoryCheckType") == "AddressSanitizer") { @@ -528,6 +538,8 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() this->MemoryTesterStyle = cmCTestMemCheckHandler::VALGRIND; } else if (checkType == "DrMemory") { this->MemoryTesterStyle = cmCTestMemCheckHandler::DRMEMORY; + } else if (checkType == "CudaMemcheck") { + this->MemoryTesterStyle = cmCTestMemCheckHandler::CUDA_MEMCHECK; } } if (this->MemoryTester.empty()) { @@ -553,6 +565,10 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() .empty()) { memoryTesterOptions = this->CTest->GetCTestConfiguration("DrMemoryCommandOptions"); + } else if (!this->CTest->GetCTestConfiguration("CudaMemcheckCommandOptions") + .empty()) { + memoryTesterOptions = + this->CTest->GetCTestConfiguration("CudaMemcheckCommandOptions"); } this->MemoryTesterOptions = cmSystemTools::ParseArguments(memoryTesterOptions); @@ -686,6 +702,18 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() this->MemoryTesterOptions.emplace_back("/M"); break; } + case cmCTestMemCheckHandler::CUDA_MEMCHECK: { + // cuda-memcheck separates flags from arguments by spaces + if (this->MemoryTesterOptions.empty()) { + this->MemoryTesterOptions.emplace_back("--tool"); + this->MemoryTesterOptions.emplace_back("memcheck"); + this->MemoryTesterOptions.emplace_back("--leak-check"); + this->MemoryTesterOptions.emplace_back("full"); + } + this->MemoryTesterDynamicOptions.emplace_back("--log-file"); + this->MemoryTesterDynamicOptions.push_back(this->MemoryTesterOutputFile); + break; + } // these are almost the same but the env var used is different case cmCTestMemCheckHandler::ADDRESS_SANITIZER: case cmCTestMemCheckHandler::LEAK_SANITIZER: @@ -771,6 +799,8 @@ bool cmCTestMemCheckHandler::ProcessMemCheckOutput(const std::string& str, return this->ProcessMemCheckSanitizerOutput(str, log, results); case cmCTestMemCheckHandler::BOUNDS_CHECKER: return this->ProcessMemCheckBoundsCheckerOutput(str, log, results); + case cmCTestMemCheckHandler::CUDA_MEMCHECK: + return this->ProcessMemCheckCudaOutput(str, log, results); default: log.append("\nMemory checking style used was: "); log.append("None that I know"); @@ -1103,6 +1133,118 @@ bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput( return defects == 0; } +bool cmCTestMemCheckHandler::ProcessMemCheckCudaOutput( + const std::string& str, std::string& log, std::vector<int>& results) +{ + std::vector<std::string> lines; + cmsys::SystemTools::Split(str, lines); + bool unlimitedOutput = false; + if (str.find("CTEST_FULL_OUTPUT") != std::string::npos || + this->CustomMaximumFailedTestOutputSize == 0) { + unlimitedOutput = true; + } + + std::string::size_type cc; + + std::ostringstream ostr; + log.clear(); + + int defects = 0; + + cmsys::RegularExpression memcheckLine("^========"); + + cmsys::RegularExpression leakExpr("== Leaked [0-9,]+ bytes at"); + + // list of matchers for output messages that contain variable content + // (addresses, sizes, ...) or can be shortened in general. the first match is + // used as a error name. + std::vector<cmsys::RegularExpression> matchers{ + // API errors + "== Malloc/Free error encountered: (.*)", + "== Program hit error ([^ ]*).* on CUDA API call to", + "== Program hit ([^ ]*).* on CUDA API call to", + // memcheck + "== (Invalid .*) of size [0-9,]+", + // racecheck + "== .* (Potential .* hazard detected)", "== .* (Race reported)", + // synccheck + "== (Barrier error)", + // initcheck + "== (Uninitialized .* memory read)", "== (Unused memory)", + // generic error: ignore ERROR SUMMARY, CUDA-MEMCHECK and others + "== ([A-Z][a-z].*)" + }; + + std::vector<std::string::size_type> nonMemcheckOutput; + auto sttime = std::chrono::steady_clock::now(); + cmCTestOptionalLog(this->CTest, DEBUG, + "Start test: " << lines.size() << std::endl, this->Quiet); + std::string::size_type totalOutputSize = 0; + for (cc = 0; cc < lines.size(); cc++) { + cmCTestOptionalLog(this->CTest, DEBUG, + "test line " << lines[cc] << std::endl, this->Quiet); + + if (memcheckLine.find(lines[cc])) { + cmCTestOptionalLog(this->CTest, DEBUG, + "cuda-memcheck line " << lines[cc] << std::endl, + this->Quiet); + int failure = -1; + auto& line = lines[cc]; + if (leakExpr.find(line)) { + failure = static_cast<int>(this->FindOrAddWarning("Memory leak")); + } else { + for (auto& matcher : matchers) { + if (matcher.find(line)) { + failure = + static_cast<int>(this->FindOrAddWarning(matcher.match(1))); + break; + } + } + } + + if (failure >= 0) { + ostr << "<b>" << this->ResultStrings[failure] << "</b> "; + if (results.empty() || unsigned(failure) > results.size() - 1) { + results.push_back(1); + } else { + results[failure]++; + } + defects++; + } + totalOutputSize += lines[cc].size(); + ostr << lines[cc] << std::endl; + } else { + nonMemcheckOutput.push_back(cc); + } + } + // Now put all all the non cuda-memcheck output into the test output + // This should be last in case it gets truncated by the output + // limiting code + for (std::string::size_type i : nonMemcheckOutput) { + totalOutputSize += lines[i].size(); + ostr << lines[i] << std::endl; + if (!unlimitedOutput && + totalOutputSize > + static_cast<size_t>(this->CustomMaximumFailedTestOutputSize)) { + ostr << "....\n"; + ostr << "Test Output for this test has been truncated see testing" + " machine logs for full output,\n"; + ostr << "or put CTEST_FULL_OUTPUT in the output of " + "this test program.\n"; + break; // stop the copy of output if we are full + } + } + cmCTestOptionalLog(this->CTest, DEBUG, + "End test (elapsed: " + << cmDurationTo<unsigned int>( + std::chrono::steady_clock::now() - sttime) + << "s)" << std::endl, + this->Quiet); + log = ostr.str(); + this->DefectCount += defects; + return defects == 0; +} + // PostProcessTest memcheck results void cmCTestMemCheckHandler::PostProcessTest(cmCTestTestResult& res, int test) { diff --git a/Source/CTest/cmCTestMemCheckHandler.h b/Source/CTest/cmCTestMemCheckHandler.h index 52667f8..63ab573 100644 --- a/Source/CTest/cmCTestMemCheckHandler.h +++ b/Source/CTest/cmCTestMemCheckHandler.h @@ -46,6 +46,7 @@ private: DRMEMORY, BOUNDS_CHECKER, // checkers after here do not use the standard error list + CUDA_MEMCHECK, ADDRESS_SANITIZER, LEAK_SANITIZER, THREAD_SANITIZER, @@ -137,6 +138,8 @@ private: std::vector<int>& results); bool ProcessMemCheckPurifyOutput(const std::string& str, std::string& log, std::vector<int>& results); + bool ProcessMemCheckCudaOutput(const std::string& str, std::string& log, + std::vector<int>& results); bool ProcessMemCheckSanitizerOutput(const std::string& str, std::string& log, std::vector<int>& results); bool ProcessMemCheckBoundsCheckerOutput(const std::string& str, diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake index 50ccc7c..e726fc7 100644 --- a/Source/Checks/cm_cxx_features.cmake +++ b/Source/Checks/cm_cxx_features.cmake @@ -63,3 +63,8 @@ if(CMake_HAVE_CXX_MAKE_UNIQUE) set(CMake_HAVE_CXX_UNIQUE_PTR 1) endif() cm_check_cxx_feature(unique_ptr) +if (NOT CMAKE_CXX_STANDARD LESS "17") + cm_check_cxx_feature(filesystem) +else() + set(CMake_HAVE_CXX_FILESYSTEM FALSE) +endif() diff --git a/Source/Checks/cm_cxx_filesystem.cxx b/Source/Checks/cm_cxx_filesystem.cxx new file mode 100644 index 0000000..e508d1c --- /dev/null +++ b/Source/Checks/cm_cxx_filesystem.cxx @@ -0,0 +1,10 @@ + +#include <filesystem> + +int main() +{ + std::filesystem::path p1("/a/b/c"); + std::filesystem::path p2("/a/b/c"); + + return p1 == p2 ? 0 : 1; +} diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx index 9a26db5..85e256b 100644 --- a/Source/CursesDialog/ccmake.cxx +++ b/Source/CursesDialog/ccmake.cxx @@ -2,11 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include <csignal> +#include <cstdio> +#include <cstdlib> #include <cstring> #include <iostream> #include <string> #include <vector> +#include <unistd.h> + #include "cmsys/Encoding.hxx" #include "cmCursesColor.h" @@ -54,7 +58,12 @@ void onsig(int /*unused*/) { if (cmCursesForm::CurrentForm) { endwin(); - initscr(); /* Initialization */ + if (initscr() == nullptr) { + static const char errmsg[] = "Error: ncurses initialization failed\n"; + auto r = write(STDERR_FILENO, errmsg, sizeof(errmsg) - 1); + static_cast<void>(r); + exit(1); + } noecho(); /* Echo off */ cbreak(); /* nl- or cr not needed */ keypad(stdscr, true); /* Use key symbols as KEY_DOWN */ @@ -124,7 +133,10 @@ int main(int argc, char const* const* argv) cmCursesForm::DebugStart(); } - initscr(); /* Initialization */ + if (initscr() == nullptr) { + fprintf(stderr, "Error: ncurses initialization failed\n"); + exit(1); + } noecho(); /* Echo off */ cbreak(); /* nl- or cr not needed */ keypad(stdscr, true); /* Use key symbols as KEY_DOWN */ diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 98dd0e2..e6d6b17 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -3,111 +3,79 @@ project(QtDialog) CMake_OPTIONAL_COMPONENT(cmake-gui) -find_package(Qt5Widgets QUIET) -if (Qt5Widgets_FOUND) - include_directories(${Qt5Widgets_INCLUDE_DIRS}) - add_definitions(${Qt5Widgets_DEFINITONS}) - macro(qt4_wrap_ui) - qt5_wrap_ui(${ARGN}) - endmacro() - macro(qt4_wrap_cpp) - qt5_wrap_cpp(${ARGN}) - endmacro() - macro(qt4_add_resources) - qt5_add_resources(${ARGN}) - endmacro() +find_package(Qt5Widgets REQUIRED) - set(CMake_QT_LIBRARIES ${Qt5Widgets_LIBRARIES}) - set(QT_QTMAIN_LIBRARY ${Qt5Core_QTMAIN_LIBRARIES}) +set(CMake_QT_EXTRA_LIBRARIES) - # Try to find the package WinExtras for the task bar progress - if(WIN32) - find_package(Qt5WinExtras QUIET) - if (Qt5WinExtras_FOUND) - include_directories(${Qt5WinExtras_INCLUDE_DIRS}) - add_definitions(-DQT_WINEXTRAS) - list(APPEND CMake_QT_LIBRARIES ${Qt5WinExtras_LIBRARIES}) - endif() +# Try to find the package WinExtras for the task bar progress +if(WIN32) + find_package(Qt5WinExtras QUIET) + if (Qt5WinExtras_FOUND) + add_definitions(-DQT_WINEXTRAS) + list(APPEND CMake_QT_EXTRA_LIBRARIES Qt5::WinExtras) endif() +endif() - # Remove this when the minimum version of Qt is 4.6. - add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0) - - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") - if(CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES) - list(APPEND CMake_QT_LIBRARIES ${CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES}) - set_property(SOURCE CMakeSetup.cxx - PROPERTY COMPILE_DEFINITIONS USE_QXcbIntegrationPlugin) - endif() +if(CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES) + list(APPEND CMake_QT_EXTRA_LIBRARIES ${CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES}) + set_property(SOURCE CMakeSetup.cxx + PROPERTY COMPILE_DEFINITIONS USE_QXcbIntegrationPlugin) +endif() - if(CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES) - list(APPEND CMake_QT_LIBRARIES ${CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES}) - set_property(SOURCE CMakeSetup.cxx - PROPERTY COMPILE_DEFINITIONS USE_QWindowsIntegrationPlugin) - endif() +if(CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES) + list(APPEND CMake_QT_EXTRA_LIBRARIES ${CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES}) + set_property(SOURCE CMakeSetup.cxx + PROPERTY COMPILE_DEFINITIONS USE_QWindowsIntegrationPlugin) +endif() - # We need to install platform plugin and add qt.conf for Qt5 on Mac and Windows. - # FIXME: This should be part of Qt5 CMake scripts, but unfortunately - # Qt5 support is missing there. - if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32)) - macro(install_qt5_plugin _qt_plugin_name _qt_plugins_var) - get_target_property(_qt_plugin_path "${_qt_plugin_name}" LOCATION) - if(EXISTS "${_qt_plugin_path}") - get_filename_component(_qt_plugin_file "${_qt_plugin_path}" NAME) - get_filename_component(_qt_plugin_type "${_qt_plugin_path}" PATH) - get_filename_component(_qt_plugin_type "${_qt_plugin_type}" NAME) - if(APPLE) - set(_qt_plugin_dir "PlugIns") - elseif(WIN32) - set(_qt_plugin_dir "plugins") - endif() - set(_qt_plugin_dest "${_qt_plugin_dir}/${_qt_plugin_type}") - install(FILES "${_qt_plugin_path}" - DESTINATION "${_qt_plugin_dest}" - ${COMPONENT}) - set(${_qt_plugins_var} - "${${_qt_plugins_var}};\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${_qt_plugin_dest}/${_qt_plugin_file}") - else() - message(FATAL_ERROR "QT plugin ${_qt_plugin_name} not found") +# We need to install platform plugin and add qt.conf for Qt5 on Mac and Windows. +# FIXME: This should be part of Qt5 CMake scripts, but unfortunately +# Qt5 support is missing there. +if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32)) + macro(install_qt5_plugin _qt_plugin_name _qt_plugins_var) + get_target_property(_qt_plugin_path "${_qt_plugin_name}" LOCATION) + if(EXISTS "${_qt_plugin_path}") + get_filename_component(_qt_plugin_file "${_qt_plugin_path}" NAME) + get_filename_component(_qt_plugin_type "${_qt_plugin_path}" PATH) + get_filename_component(_qt_plugin_type "${_qt_plugin_type}" NAME) + if(APPLE) + set(_qt_plugin_dir "PlugIns") + elseif(WIN32) + set(_qt_plugin_dir "plugins") endif() - endmacro() - if(APPLE) - install_qt5_plugin("Qt5::QCocoaIntegrationPlugin" QT_PLUGINS) - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" - "[Paths]\nPlugins = ${_qt_plugin_dir}\n") - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" - DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources" + set(_qt_plugin_dest "${_qt_plugin_dir}/${_qt_plugin_type}") + install(FILES "${_qt_plugin_path}" + DESTINATION "${_qt_plugin_dest}" ${COMPONENT}) - elseif(WIN32 AND NOT CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES) - install_qt5_plugin("Qt5::QWindowsIntegrationPlugin" QT_PLUGINS) - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" - "[Paths]\nPlugins = ../${_qt_plugin_dir}\n") - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" - DESTINATION bin - ${COMPONENT}) - endif() - endif() - - if(TARGET Qt5::Core) - get_property(_Qt5_Core_LOCATION TARGET Qt5::Core PROPERTY LOCATION) - get_filename_component(Qt_BIN_DIR "${_Qt5_Core_LOCATION}" PATH) - if(APPLE) - get_filename_component(Qt_BIN_DIR "${Qt_BIN_DIR}" PATH) + set(${_qt_plugins_var} + "${${_qt_plugins_var}};\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${_qt_plugin_dest}/${_qt_plugin_file}") + else() + message(FATAL_ERROR "QT plugin ${_qt_plugin_name} not found") endif() + endmacro() + if(APPLE) + install_qt5_plugin("Qt5::QCocoaIntegrationPlugin" QT_PLUGINS) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" + "[Paths]\nPlugins = ${_qt_plugin_dir}\n") + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" + DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources" + ${COMPONENT}) + elseif(WIN32 AND NOT CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES) + install_qt5_plugin("Qt5::QWindowsIntegrationPlugin" QT_PLUGINS) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" + "[Paths]\nPlugins = ../${_qt_plugin_dir}\n") + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" + DESTINATION bin + ${COMPONENT}) endif() -else() - set(QT_MIN_VERSION "4.4.0") - find_package(Qt4 REQUIRED) - if(NOT QT4_FOUND) - message(SEND_ERROR "Failed to find Qt 4.4 or greater.") - return() - endif() - - include(${QT_USE_FILE}) - - set(CMake_QT_LIBRARIES ${QT_LIBRARIES}) +endif() +get_property(_Qt5_Core_LOCATION TARGET Qt5::Core PROPERTY LOCATION) +get_filename_component(Qt_BIN_DIR "${_Qt5_Core_LOCATION}" PATH) +if(APPLE) + get_filename_component(Qt_BIN_DIR "${Qt_BIN_DIR}" PATH) endif() set(SRCS @@ -116,6 +84,7 @@ set(SRCS CMakeSetup.cxx CMakeSetupDialog.cxx CMakeSetupDialog.h + Compilers.h FirstConfigure.cxx FirstConfigure.h QCMake.cxx @@ -129,7 +98,7 @@ set(SRCS WarningMessagesDialog.cxx WarningMessagesDialog.h ) -QT4_WRAP_UI(UI_SRCS +qt5_wrap_ui(UI_SRCS CMakeSetupDialog.ui Compilers.ui CrossCompiler.ui @@ -137,7 +106,7 @@ QT4_WRAP_UI(UI_SRCS RegexExplorer.ui WarningMessagesDialog.ui ) -QT4_WRAP_CPP(MOC_SRCS +qt5_wrap_cpp(MOC_SRCS AddCacheEntry.h Compilers.h CMakeSetupDialog.h @@ -148,14 +117,24 @@ QT4_WRAP_CPP(MOC_SRCS RegexExplorer.h WarningMessagesDialog.h ) -QT4_ADD_RESOURCES(RC_SRCS CMakeSetup.qrc) +qt5_add_resources(RC_SRCS CMakeSetup.qrc) + +if (FALSE) # CMake's bootstrap binary does not support automoc + set(CMAKE_AUTOMOC 1) + set(CMAKE_AUTORCC 1) + set(CMAKE_AUTOUIC 1) +else () + list(APPEND SRCS + ${UI_SRCS} + ${MOC_SRCS} + ${RC_SRCS}) +endif () -set(SRCS ${SRCS} ${UI_SRCS} ${MOC_SRCS} ${RC_SRCS}) if(WIN32) - set(SRCS ${SRCS} CMakeSetup.rc) + list(APPEND SRCS CMakeSetup.rc) endif() if(APPLE) - set(SRCS ${SRCS} CMakeSetup.icns) + list(APPEND SRCS CMakeSetup.icns) set(MACOSX_BUNDLE_ICON_FILE CMakeSetup.icns) set_source_files_properties(CMakeSetup.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources) @@ -172,7 +151,7 @@ endif() set(CMAKE_INCLUDE_CURRENT_DIR ON) add_executable(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS} ${MANIFEST_FILE}) -target_link_libraries(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${CMake_QT_LIBRARIES}) +target_link_libraries(cmake-gui CMakeLib Qt5::Core Qt5::Widgets ${CMake_QT_EXTRA_LIBRARIES}) if(WIN32) target_sources(cmake-gui PRIVATE $<TARGET_OBJECTS:CMakeVersion>) diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index 9d928b2..7ef5a72 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -115,14 +115,6 @@ int main(int argc, char** argv) QTextCodec* utf8_codec = QTextCodec::codecForName("UTF-8"); QTextCodec::setCodecForLocale(utf8_codec); -#if QT_VERSION < 0x050000 - // clean out standard Qt paths for plugins, which we don't use anyway - // when creating Mac bundles, it potentially causes problems - foreach (QString p, QApplication::libraryPaths()) { - QApplication::removeLibraryPath(p); - } -#endif - // tell the cmake library where cmake is QDir cmExecDir(QApplication::applicationDirPath()); #if defined(Q_OS_MAC) diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 6dbfe11..fcc8408 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -152,9 +152,6 @@ CMakeSetupDialog::CMakeSetupDialog() this->WarnUninitializedAction = OptionsMenu->addAction(tr("&Warn Uninitialized (--warn-uninitialized)")); this->WarnUninitializedAction->setCheckable(true); - this->WarnUnusedAction = - OptionsMenu->addAction(tr("&Warn Unused (--warn-unused-vars)")); - this->WarnUnusedAction->setCheckable(true); QAction* debugAction = OptionsMenu->addAction(tr("&Debug Output")); debugAction->setCheckable(true); @@ -290,9 +287,6 @@ void CMakeSetupDialog::initialize() QObject::connect(this->WarnUninitializedAction, SIGNAL(triggered(bool)), this->CMakeThread->cmakeInstance(), SLOT(setWarnUninitializedMode(bool))); - QObject::connect(this->WarnUnusedAction, SIGNAL(triggered(bool)), - this->CMakeThread->cmakeInstance(), - SLOT(setWarnUnusedMode(bool))); if (!this->SourceDirectory->text().isEmpty() || !this->BinaryDirectory->lineEdit()->text().isEmpty()) { diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h index d1e2035..914be12 100644 --- a/Source/QtDialog/CMakeSetupDialog.h +++ b/Source/QtDialog/CMakeSetupDialog.h @@ -111,7 +111,6 @@ protected: QAction* ConfigureAction; QAction* GenerateAction; QAction* WarnUninitializedAction; - QAction* WarnUnusedAction; QAction* InstallForCommandLineAction; State CurrentState; diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 776af81..6090256 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -21,7 +21,6 @@ QCMake::QCMake(QObject* p) : QObject(p) { this->WarnUninitializedMode = false; - this->WarnUnusedMode = false; qRegisterMetaType<QCMakeProperty>(); qRegisterMetaType<QCMakePropertyList>(); @@ -170,7 +169,6 @@ void QCMake::configure() this->CMakeInstance->SetGeneratorToolset(this->Toolset.toLocal8Bit().data()); this->CMakeInstance->LoadCache(); this->CMakeInstance->SetWarnUninitialized(this->WarnUninitializedMode); - this->CMakeInstance->SetWarnUnused(this->WarnUnusedMode); this->CMakeInstance->PreLoadCMakeFiles(); InterruptFlag = 0; @@ -340,10 +338,10 @@ void QCMake::interrupt() bool QCMake::interruptCallback() { -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - return this->InterruptFlag; -#else +#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) return this->InterruptFlag.load(); +#else + return this->InterruptFlag.loadRelaxed(); #endif } @@ -478,11 +476,6 @@ void QCMake::setWarnUninitializedMode(bool value) this->WarnUninitializedMode = value; } -void QCMake::setWarnUnusedMode(bool value) -{ - this->WarnUnusedMode = value; -} - void QCMake::checkOpenPossible() { std::string data = this->BinaryDirectory.toLocal8Bit().data(); diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h index 110a971..39555d6 100644 --- a/Source/QtDialog/QCMake.h +++ b/Source/QtDialog/QCMake.h @@ -114,8 +114,6 @@ public slots: void setDeprecatedWarningsAsErrors(bool value); /// set whether to run cmake with warnings about uninitialized variables void setWarnUninitializedMode(bool value); - /// set whether to run cmake with warnings about unused variables - void setWarnUnusedMode(bool value); /// check if project IDE open is possible and emit openPossible signal void checkOpenPossible(); @@ -175,8 +173,6 @@ protected: void stderrCallback(std::string const& msg); bool WarnUninitializedMode; - bool WarnUnusedMode; - bool WarnUnusedAllMode; QString SourceDirectory; QString BinaryDirectory; QString Generator; diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx index b1f4a82..659a512 100644 --- a/Source/QtDialog/QCMakeCacheView.cxx +++ b/Source/QtDialog/QCMakeCacheView.cxx @@ -155,11 +155,7 @@ QModelIndex QCMakeCacheView::moveCursor(CursorAction act, void QCMakeCacheView::setShowAdvanced(bool s) { -#if QT_VERSION >= 040300 - // new 4.3 API that needs to be called. what about an older Qt? this->SearchFilter->invalidate(); -#endif - this->AdvancedFilter->setShowAdvanced(s); } @@ -209,9 +205,7 @@ void QCMakeCacheModel::clear() void QCMakeCacheModel::setProperties(const QCMakePropertyList& props) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) this->beginResetModel(); -#endif QSet<QCMakeProperty> newProps; QSet<QCMakeProperty> newProps2; @@ -334,11 +328,7 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props) } this->blockSignals(b); -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) this->endResetModel(); -#else - this->reset(); -#endif } QCMakeCacheModel::ViewType QCMakeCacheModel::viewType() const @@ -348,9 +338,7 @@ QCMakeCacheModel::ViewType QCMakeCacheModel::viewType() const void QCMakeCacheModel::setViewType(QCMakeCacheModel::ViewType t) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) this->beginResetModel(); -#endif this->View = t; @@ -367,11 +355,7 @@ void QCMakeCacheModel::setViewType(QCMakeCacheModel::ViewType t) this->setProperties(oldProps); this->setProperties(props); this->blockSignals(b); -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) this->endResetModel(); -#else - this->reset(); -#endif } void QCMakeCacheModel::setPropertyData(const QModelIndex& idx1, @@ -497,8 +481,7 @@ QCMakePropertyList QCMakeCacheModel::properties() const // go to the next in the tree while (!idxs.isEmpty() && ( -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) && \ - QT_VERSION < QT_VERSION_CHECK(5, 1, 0) +#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0) (idxs.last().row() + 1) >= rowCount(idxs.last().parent()) || #endif !idxs.last().sibling(idxs.last().row() + 1, 0).isValid())) { @@ -658,20 +641,6 @@ bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, return success; } -// Issue 205903 fixed in Qt 4.5.0. -// Can remove this function and FileDialogFlag when minimum Qt version is 4.5 -bool QCMakeCacheModelDelegate::eventFilter(QObject* object, QEvent* evt) -{ - // workaround for what looks like a bug in Qt on macOS - // where it doesn't create a QWidget wrapper for the native file dialog - // so the Qt library ends up assuming the focus was lost to something else - - if (evt->type() == QEvent::FocusOut && this->FileDialogFlag) { - return false; - } - return QItemDelegate::eventFilter(object, evt); -} - void QCMakeCacheModelDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const diff --git a/Source/QtDialog/QCMakeCacheView.h b/Source/QtDialog/QCMakeCacheView.h index bea1965..a252708 100644 --- a/Source/QtDialog/QCMakeCacheView.h +++ b/Source/QtDialog/QCMakeCacheView.h @@ -144,7 +144,6 @@ public: bool editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index); - bool eventFilter(QObject* object, QEvent* event); void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; QSize sizeHint(const QStyleOptionViewItem& option, diff --git a/Source/QtDialog/QCMakeWidgets.cxx b/Source/QtDialog/QCMakeWidgets.cxx index 332a770..d16ea58 100644 --- a/Source/QtDialog/QCMakeWidgets.cxx +++ b/Source/QtDialog/QCMakeWidgets.cxx @@ -4,9 +4,9 @@ #include <utility> -#include <QDirModel> #include <QFileDialog> #include <QFileInfo> +#include <QFileSystemModel> #include <QResizeEvent> #include <QToolButton> @@ -88,20 +88,20 @@ void QCMakePathEditor::chooseFile() } } -// use same QDirModel for all completers -static QDirModel* fileDirModel() +// use same QFileSystemModel for all completers +static QFileSystemModel* fileDirModel() { - static QDirModel* m = nullptr; + static QFileSystemModel* m = nullptr; if (!m) { - m = new QDirModel(); + m = new QFileSystemModel(); } return m; } -static QDirModel* pathDirModel() +static QFileSystemModel* pathDirModel() { - static QDirModel* m = nullptr; + static QFileSystemModel* m = nullptr; if (!m) { - m = new QDirModel(); + m = new QFileSystemModel(); m->setFilter(QDir::AllDirs | QDir::Drives | QDir::NoDotAndDotDot); } return m; @@ -110,7 +110,7 @@ static QDirModel* pathDirModel() QCMakeFileCompleter::QCMakeFileCompleter(QObject* o, bool dirs) : QCompleter(o) { - QDirModel* m = dirs ? pathDirModel() : fileDirModel(); + QFileSystemModel* m = dirs ? pathDirModel() : fileDirModel(); this->setModel(m); } diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx index d6f7500e..53d4cb4 100644 --- a/Source/cmAuxSourceDirectoryCommand.cxx +++ b/Source/cmAuxSourceDirectoryCommand.cxx @@ -55,7 +55,7 @@ bool cmAuxSourceDirectoryCommand(std::vector<std::string> const& args, auto ext = cm::string_view(file).substr(dotpos + 1); // Process only source files auto cm = mf.GetCMakeInstance(); - if (dotpos > 0 && cm->IsSourceExtension(ext)) { + if (dotpos > 0 && cm->IsACLikeSourceExtension(ext)) { std::string fullname = cmStrCat(templateDirectory, '/', file); // add the file as a class file so // depends can be done diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index bca7540..4254e2e 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -841,6 +841,7 @@ bool cmCTest::OpenOutputFile(const std::string& path, const std::string& name, } } std::string filename = testingDir + "/" + name; + stream.SetTempExt("tmp"); stream.Open(filename); if (!stream) { cmCTestLog(this, ERROR_MESSAGE, diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 4c5f57d..5efa365 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -849,31 +849,31 @@ void cmComputeLinkInformation::ComputeItemParserInfo() { // Get possible library name prefixes. cmMakefile* mf = this->Makefile; - this->AddLinkPrefix(mf->GetDefinition("CMAKE_STATIC_LIBRARY_PREFIX")); - this->AddLinkPrefix(mf->GetDefinition("CMAKE_SHARED_LIBRARY_PREFIX")); + this->AddLinkPrefix(mf->GetSafeDefinition("CMAKE_STATIC_LIBRARY_PREFIX")); + this->AddLinkPrefix(mf->GetSafeDefinition("CMAKE_SHARED_LIBRARY_PREFIX")); // Import library names should be matched and treated as shared // libraries for the purposes of linking. - this->AddLinkExtension(mf->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"), + this->AddLinkExtension(mf->GetSafeDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"), LinkShared); - this->AddLinkExtension(mf->GetDefinition("CMAKE_STATIC_LIBRARY_SUFFIX"), + this->AddLinkExtension(mf->GetSafeDefinition("CMAKE_STATIC_LIBRARY_SUFFIX"), LinkStatic); - this->AddLinkExtension(mf->GetDefinition("CMAKE_SHARED_LIBRARY_SUFFIX"), + this->AddLinkExtension(mf->GetSafeDefinition("CMAKE_SHARED_LIBRARY_SUFFIX"), LinkShared); - this->AddLinkExtension(mf->GetDefinition("CMAKE_LINK_LIBRARY_SUFFIX"), + this->AddLinkExtension(mf->GetSafeDefinition("CMAKE_LINK_LIBRARY_SUFFIX"), LinkUnknown); if (const char* linkSuffixes = mf->GetDefinition("CMAKE_EXTRA_LINK_EXTENSIONS")) { std::vector<std::string> linkSuffixVec = cmExpandedList(linkSuffixes); for (std::string const& i : linkSuffixVec) { - this->AddLinkExtension(i.c_str(), LinkUnknown); + this->AddLinkExtension(i, LinkUnknown); } } if (const char* sharedSuffixes = mf->GetDefinition("CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES")) { std::vector<std::string> sharedSuffixVec = cmExpandedList(sharedSuffixes); for (std::string const& i : sharedSuffixVec) { - this->AddLinkExtension(i.c_str(), LinkShared); + this->AddLinkExtension(i, LinkShared); } } @@ -903,7 +903,7 @@ void cmComputeLinkInformation::ComputeItemParserInfo() #ifdef CM_COMPUTE_LINK_INFO_DEBUG fprintf(stderr, "any regex [%s]\n", reg_any.c_str()); #endif - this->ExtractAnyLibraryName.compile(reg_any.c_str()); + this->ExtractAnyLibraryName.compile(reg_any); // Create a regex to match static library names. if (!this->StaticLinkExtensions.empty()) { @@ -912,7 +912,7 @@ void cmComputeLinkInformation::ComputeItemParserInfo() #ifdef CM_COMPUTE_LINK_INFO_DEBUG fprintf(stderr, "static regex [%s]\n", reg_static.c_str()); #endif - this->ExtractStaticLibraryName.compile(reg_static.c_str()); + this->ExtractStaticLibraryName.compile(reg_static); } // Create a regex to match shared library names. @@ -924,20 +924,21 @@ void cmComputeLinkInformation::ComputeItemParserInfo() #ifdef CM_COMPUTE_LINK_INFO_DEBUG fprintf(stderr, "shared regex [%s]\n", reg_shared.c_str()); #endif - this->ExtractSharedLibraryName.compile(reg_shared.c_str()); + this->ExtractSharedLibraryName.compile(reg_shared); } } -void cmComputeLinkInformation::AddLinkPrefix(const char* p) +void cmComputeLinkInformation::AddLinkPrefix(std::string const& p) { - if (p && *p) { + if (!p.empty()) { this->LinkPrefixes.insert(p); } } -void cmComputeLinkInformation::AddLinkExtension(const char* e, LinkType type) +void cmComputeLinkInformation::AddLinkExtension(std::string const& e, + LinkType type) { - if (e && *e) { + if (!e.empty()) { if (type == LinkStatic) { this->StaticLinkExtensions.emplace_back(e); } @@ -962,7 +963,7 @@ std::string cmComputeLinkInformation::CreateExtensionRegex( // Store this extension choice with the "." escaped. libext += "\\"; #if defined(_WIN32) && !defined(__CYGWIN__) - libext += this->NoCaseExpression(i.c_str()); + libext += this->NoCaseExpression(i); #else libext += i; #endif @@ -980,21 +981,19 @@ std::string cmComputeLinkInformation::CreateExtensionRegex( return libext; } -std::string cmComputeLinkInformation::NoCaseExpression(const char* str) +std::string cmComputeLinkInformation::NoCaseExpression(std::string const& str) { std::string ret; - ret.reserve(strlen(str) * 4); - const char* s = str; - while (*s) { - if (*s == '.') { - ret += *s; + ret.reserve(str.size() * 4); + for (char c : str) { + if (c == '.') { + ret += c; } else { ret += '['; - ret += static_cast<char>(tolower(*s)); - ret += static_cast<char>(toupper(*s)); + ret += static_cast<char>(tolower(c)); + ret += static_cast<char>(toupper(c)); ret += ']'; } - s++; } return ret; } @@ -1688,7 +1687,7 @@ void cmComputeLinkInformation::AddLibraryRuntimeInfo( } } -static void cmCLI_ExpandListUnique(const char* str, +static void cmCLI_ExpandListUnique(std::string const& str, std::vector<std::string>& out, std::set<std::string>& emitted) { @@ -1735,7 +1734,7 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs, if (use_install_rpath) { std::string install_rpath; this->Target->GetInstallRPATH(this->Config, install_rpath); - cmCLI_ExpandListUnique(install_rpath.c_str(), runtimeDirs, emitted); + cmCLI_ExpandListUnique(install_rpath, runtimeDirs, emitted); } if (use_build_rpath) { // Add directories explicitly specified by user @@ -1743,7 +1742,7 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs, if (this->Target->GetBuildRPATH(this->Config, build_rpath)) { // This will not resolve entries to use $ORIGIN, the user is expected to // do that if necessary. - cmCLI_ExpandListUnique(build_rpath.c_str(), runtimeDirs, emitted); + cmCLI_ExpandListUnique(build_rpath, runtimeDirs, emitted); } } if (use_build_rpath || use_link_rpath) { @@ -1823,8 +1822,8 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs, "CMAKE_" + li + "_USE_IMPLICIT_LINK_DIRECTORIES_IN_RUNTIME_PATH"; if (this->Makefile->IsOn(useVar)) { std::string dirVar = "CMAKE_" + li + "_IMPLICIT_LINK_DIRECTORIES"; - if (const char* dirs = this->Makefile->GetDefinition(dirVar)) { - cmCLI_ExpandListUnique(dirs, runtimeDirs, emitted); + if (cmProp dirs = this->Makefile->GetDef(dirVar)) { + cmCLI_ExpandListUnique(*dirs, runtimeDirs, emitted); } } } @@ -1832,7 +1831,7 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs, // Add runtime paths required by the platform to always be // present. This is done even when skipping rpath support. - cmCLI_ExpandListUnique(this->RuntimeAlways.c_str(), runtimeDirs, emitted); + cmCLI_ExpandListUnique(this->RuntimeAlways, runtimeDirs, emitted); } std::string cmComputeLinkInformation::GetRPathString(bool for_install) const diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h index e50d369..544ff23 100644 --- a/Source/cmComputeLinkInformation.h +++ b/Source/cmComputeLinkInformation.h @@ -144,11 +144,11 @@ private: cmsys::RegularExpression ExtractSharedLibraryName; cmsys::RegularExpression ExtractAnyLibraryName; std::string SharedRegexString; - void AddLinkPrefix(const char* p); - void AddLinkExtension(const char* e, LinkType type); + void AddLinkPrefix(std::string const& p); + void AddLinkExtension(std::string const& e, LinkType type); std::string CreateExtensionRegex(std::vector<std::string> const& exts, LinkType type); - std::string NoCaseExpression(const char* str); + std::string NoCaseExpression(std::string const& str); // Handling of link items. void AddTargetItem(BT<std::string> const& item, diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index 41f5346..6b4d110 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -196,7 +196,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index) std::set<cmLinkItem> emitted; std::vector<std::string> const& configs = - depender->Makefile->GetGeneratorConfigs(); + depender->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); for (std::string const& it : configs) { cmLinkImplementation const* impl = depender->GetLinkImplementation(it); diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in index 4de1c5d..97e7856 100644 --- a/Source/cmConfigure.cmake.h.in +++ b/Source/cmConfigure.cmake.h.in @@ -19,7 +19,6 @@ #cmakedefine HAVE_UNSETENV #cmakedefine CMAKE_USE_ELF_PARSER #cmakedefine CMAKE_USE_MACH_PARSER -#cmakedefine CMake_HAVE_CXX_MAKE_UNIQUE #define CMake_DEFAULT_RECURSION_LIMIT @CMake_DEFAULT_RECURSION_LIMIT@ #define CMAKE_BIN_DIR "/@CMAKE_BIN_DIR@" #define CMAKE_DATA_DIR "/@CMAKE_DATA_DIR@" diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx index 5b3045d..68322cc 100644 --- a/Source/cmConfigureFileCommand.cxx +++ b/Source/cmConfigureFileCommand.cxx @@ -60,6 +60,7 @@ bool cmConfigureFileCommand(std::vector<std::string> const& args, } bool copyOnly = false; bool escapeQuotes = false; + bool use_source_permissions = true; static std::set<cm::string_view> noopOptions = { /* Legacy. */ @@ -87,6 +88,8 @@ bool cmConfigureFileCommand(std::vector<std::string> const& args, escapeQuotes = true; } else if (args[i] == "@ONLY") { atOnly = true; + } else if (args[i] == "NO_SOURCE_PERMISSIONS") { + use_source_permissions = false; } else if (noopOptions.find(args[i]) != noopOptions.end()) { /* Ignore no-op options. */ } else { @@ -102,7 +105,8 @@ bool cmConfigureFileCommand(std::vector<std::string> const& args, } if (!status.GetMakefile().ConfigureFile( - inputFile, outputFile, copyOnly, atOnly, escapeQuotes, newLineStyle)) { + inputFile, outputFile, copyOnly, atOnly, escapeQuotes, + use_source_permissions, newLineStyle)) { status.SetError("Problem configuring file"); return false; } diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 8550d04..7fbe90e 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -25,77 +25,205 @@ #include "cmVersion.h" #include "cmake.h" -static std::string const kCMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN = - "CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN"; -static std::string const kCMAKE_C_COMPILER_TARGET = "CMAKE_C_COMPILER_TARGET"; -static std::string const kCMAKE_C_LINK_NO_PIE_SUPPORTED = - "CMAKE_C_LINK_NO_PIE_SUPPORTED"; -static std::string const kCMAKE_C_LINK_PIE_SUPPORTED = - "CMAKE_C_LINK_PIE_SUPPORTED"; -static std::string const kCMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN = - "CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN"; -static std::string const kCMAKE_CXX_COMPILER_TARGET = - "CMAKE_CXX_COMPILER_TARGET"; -static std::string const kCMAKE_CXX_LINK_NO_PIE_SUPPORTED = - "CMAKE_CXX_LINK_NO_PIE_SUPPORTED"; -static std::string const kCMAKE_CXX_LINK_PIE_SUPPORTED = - "CMAKE_CXX_LINK_PIE_SUPPORTED"; -static std::string const kCMAKE_CUDA_ARCHITECTURES = - "CMAKE_CUDA_ARCHITECTURES"; -static std::string const kCMAKE_CUDA_COMPILER_TARGET = - "CMAKE_CUDA_COMPILER_TARGET"; -static std::string const kCMAKE_CUDA_RUNTIME_LIBRARY = - "CMAKE_CUDA_RUNTIME_LIBRARY"; -static std::string const kCMAKE_ENABLE_EXPORTS = "CMAKE_ENABLE_EXPORTS"; -static std::string const kCMAKE_LINK_SEARCH_END_STATIC = +namespace { +class LanguageStandardState +{ +public: + LanguageStandardState(std::string&& lang) + : IsEnabled(false) + , DidStandard(false) + , DidStandardRequired(false) + , DidExtensions(false) + , StandardFlag(lang + "_STANDARD") + , RequiredFlag(lang + "_STANDARD_REQUIRED") + , ExtensionFlag(lang + "_EXTENSIONS") + { + } + + void Enabled(bool isEnabled) { this->IsEnabled = isEnabled; } + + bool UpdateIfMatches(std::vector<std::string> const& argv, size_t& index) + { + bool updated = false; + if (argv[index] == this->StandardFlag) { + this->DidStandard = true; + this->StandardValue = argv[++index]; + updated = true; + } else if (argv[index] == this->RequiredFlag) { + this->DidStandardRequired = true; + this->RequiredValue = argv[++index]; + updated = true; + } else if (argv[index] == this->ExtensionFlag) { + this->DidExtensions = true; + this->ExtensionValue = argv[++index]; + updated = true; + } + return updated; + } + + bool Validate(cmMakefile* const makefile) const + { + if (this->DidStandard) { + makefile->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat(this->StandardFlag, + " allowed only in source file signature.")); + return false; + } + if (this->DidStandardRequired) { + makefile->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat(this->RequiredFlag, + " allowed only in source file signature.")); + return false; + } + if (this->DidExtensions) { + makefile->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat(this->ExtensionFlag, + " allowed only in source file signature.")); + return false; + } + + return true; + } + + bool DidNone() const + { + return !this->DidStandard && !this->DidStandardRequired && + !this->DidExtensions; + } + + void LoadUnsetPropertyValues(cmMakefile* const makefile, bool honorStandard, + bool warnCMP0067, + std::vector<std::string>& warnCMP0067Variables) + { + if (!this->IsEnabled) { + return; + } + + auto lookupStdVar = [&](std::string const& var) -> std::string { + std::string value = makefile->GetSafeDefinition(var); + if (warnCMP0067 && !value.empty()) { + value.clear(); + warnCMP0067Variables.push_back(var); + } + return value; + }; + + if (honorStandard || warnCMP0067) { + if (!this->DidStandard) { + this->StandardValue = + lookupStdVar(cmStrCat("CMAKE_", this->StandardFlag)); + } + if (!this->DidStandardRequired) { + this->RequiredValue = + lookupStdVar(cmStrCat("CMAKE_", this->RequiredFlag)); + } + if (!this->DidExtensions) { + this->ExtensionValue = + lookupStdVar(cmStrCat("CMAKE_", this->ExtensionFlag)); + } + } + } + + void WriteProperties(FILE* fout, std::string const& targetName) const + { + if (!this->IsEnabled) { + return; + } + + auto writeProp = [&](std::string const& prop, std::string const& value) { + fprintf(fout, "set_property(TARGET %s PROPERTY %s %s)\n", + targetName.c_str(), + cmOutputConverter::EscapeForCMake(prop).c_str(), + cmOutputConverter::EscapeForCMake(value).c_str()); + }; + + if (!this->StandardValue.empty()) { + writeProp(this->StandardFlag, this->StandardValue); + } + if (!this->RequiredValue.empty()) { + writeProp(this->RequiredFlag, this->RequiredValue); + } + if (!this->ExtensionValue.empty()) { + writeProp(this->ExtensionFlag, this->ExtensionValue); + } + } + +private: + bool IsEnabled; + bool DidStandard; + bool DidStandardRequired; + bool DidExtensions; + + std::string StandardFlag; + std::string RequiredFlag; + std::string ExtensionFlag; + + std::string StandardValue; + std::string RequiredValue; + std::string ExtensionValue; +}; + +constexpr size_t lang_property_start = 0; +constexpr size_t lang_property_size = 4; +constexpr size_t pie_property_start = 4; +constexpr size_t pie_property_size = 2; +#define SETUP_LANGUAGE(name, lang) \ + static const std::string name[lang_property_size + pie_property_size + 1] = \ + { "CMAKE_" #lang "_COMPILER_EXTERNAL_TOOLCHAIN", \ + "CMAKE_" #lang "_COMPILER_TARGET", \ + "CMAKE_" #lang "_LINK_NO_PIE_SUPPORTED", \ + "CMAKE_" #lang "_PIE_SUPPORTED", "" } + +// NOLINTNEXTLINE(bugprone-suspicious-missing-comma) +SETUP_LANGUAGE(c_properties, C); +// NOLINTNEXTLINE(bugprone-suspicious-missing-comma) +SETUP_LANGUAGE(cxx_properties, CXX); + +// NOLINTNEXTLINE(bugprone-suspicious-missing-comma) +SETUP_LANGUAGE(cuda_properties, CUDA); +// NOLINTNEXTLINE(bugprone-suspicious-missing-comma) +SETUP_LANGUAGE(fortran_properties, Fortran); +// NOLINTNEXTLINE(bugprone-suspicious-missing-comma) +SETUP_LANGUAGE(objc_properties, OBJC); +// NOLINTNEXTLINE(bugprone-suspicious-missing-comma) +SETUP_LANGUAGE(objcxx_properties, OBJCXX); +// NOLINTNEXTLINE(bugprone-suspicious-missing-comma) +SETUP_LANGUAGE(swift_properties, Swift); +#undef SETUP_LANGUAGE + +std::string const kCMAKE_CUDA_ARCHITECTURES = "CMAKE_CUDA_ARCHITECTURES"; +std::string const kCMAKE_CUDA_RUNTIME_LIBRARY = "CMAKE_CUDA_RUNTIME_LIBRARY"; +std::string const kCMAKE_ENABLE_EXPORTS = "CMAKE_ENABLE_EXPORTS"; +std::string const kCMAKE_LINK_SEARCH_END_STATIC = "CMAKE_LINK_SEARCH_END_STATIC"; -static std::string const kCMAKE_LINK_SEARCH_START_STATIC = +std::string const kCMAKE_LINK_SEARCH_START_STATIC = "CMAKE_LINK_SEARCH_START_STATIC"; -static std::string const kCMAKE_MSVC_RUNTIME_LIBRARY_DEFAULT = +std::string const kCMAKE_MSVC_RUNTIME_LIBRARY_DEFAULT = "CMAKE_MSVC_RUNTIME_LIBRARY_DEFAULT"; -static std::string const kCMAKE_OSX_ARCHITECTURES = "CMAKE_OSX_ARCHITECTURES"; -static std::string const kCMAKE_OSX_DEPLOYMENT_TARGET = - "CMAKE_OSX_DEPLOYMENT_TARGET"; -static std::string const kCMAKE_OSX_SYSROOT = "CMAKE_OSX_SYSROOT"; -static std::string const kCMAKE_APPLE_ARCH_SYSROOTS = - "CMAKE_APPLE_ARCH_SYSROOTS"; -static std::string const kCMAKE_POSITION_INDEPENDENT_CODE = +std::string const kCMAKE_OSX_ARCHITECTURES = "CMAKE_OSX_ARCHITECTURES"; +std::string const kCMAKE_OSX_DEPLOYMENT_TARGET = "CMAKE_OSX_DEPLOYMENT_TARGET"; +std::string const kCMAKE_OSX_SYSROOT = "CMAKE_OSX_SYSROOT"; +std::string const kCMAKE_APPLE_ARCH_SYSROOTS = "CMAKE_APPLE_ARCH_SYSROOTS"; +std::string const kCMAKE_POSITION_INDEPENDENT_CODE = "CMAKE_POSITION_INDEPENDENT_CODE"; -static std::string const kCMAKE_SYSROOT = "CMAKE_SYSROOT"; -static std::string const kCMAKE_SYSROOT_COMPILE = "CMAKE_SYSROOT_COMPILE"; -static std::string const kCMAKE_SYSROOT_LINK = "CMAKE_SYSROOT_LINK"; -static std::string const kCMAKE_Swift_COMPILER_TARGET = - "CMAKE_Swift_COMPILER_TARGET"; -static std::string const kCMAKE_TRY_COMPILE_OSX_ARCHITECTURES = +std::string const kCMAKE_SYSROOT = "CMAKE_SYSROOT"; +std::string const kCMAKE_SYSROOT_COMPILE = "CMAKE_SYSROOT_COMPILE"; +std::string const kCMAKE_SYSROOT_LINK = "CMAKE_SYSROOT_LINK"; +std::string const kCMAKE_TRY_COMPILE_OSX_ARCHITECTURES = "CMAKE_TRY_COMPILE_OSX_ARCHITECTURES"; -static std::string const kCMAKE_TRY_COMPILE_PLATFORM_VARIABLES = +std::string const kCMAKE_TRY_COMPILE_PLATFORM_VARIABLES = "CMAKE_TRY_COMPILE_PLATFORM_VARIABLES"; -static std::string const kCMAKE_WARN_DEPRECATED = "CMAKE_WARN_DEPRECATED"; +std::string const kCMAKE_WARN_DEPRECATED = "CMAKE_WARN_DEPRECATED"; /* GHS Multi platform variables */ -static std::set<std::string> ghs_platform_vars{ +std::set<std::string> const ghs_platform_vars{ "GHS_TARGET_PLATFORM", "GHS_PRIMARY_TARGET", "GHS_TOOLSET_ROOT", "GHS_OS_ROOT", "GHS_OS_DIR", "GHS_BSP_NAME", "GHS_OS_DIR_OPTION" }; - -static void writeProperty(FILE* fout, std::string const& targetName, - std::string const& prop, std::string const& value) -{ - fprintf(fout, "set_property(TARGET %s PROPERTY %s %s)\n", targetName.c_str(), - cmOutputConverter::EscapeForCMake(prop).c_str(), - cmOutputConverter::EscapeForCMake(value).c_str()); -} - -std::string cmCoreTryCompile::LookupStdVar(std::string const& var, - bool warnCMP0067) -{ - std::string value = this->Makefile->GetSafeDefinition(var); - if (warnCMP0067 && !value.empty()) { - value.clear(); - this->WarnCMP0067.push_back(var); - } - return value; } int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, @@ -137,21 +265,11 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, std::string outputVariable; std::string copyFile; std::string copyFileError; - std::string cStandard; - std::string objcStandard; - std::string cxxStandard; - std::string objcxxStandard; - std::string cudaStandard; - std::string cStandardRequired; - std::string cxxStandardRequired; - std::string objcStandardRequired; - std::string objcxxStandardRequired; - std::string cudaStandardRequired; - std::string cExtensions; - std::string cxxExtensions; - std::string objcExtensions; - std::string objcxxExtensions; - std::string cudaExtensions; + LanguageStandardState cState("C"); + LanguageStandardState cudaState("CUDA"); + LanguageStandardState cxxState("CXX"); + LanguageStandardState objcState("OBJC"); + LanguageStandardState objcxxState("OBJCXX"); std::vector<std::string> targets; std::vector<std::string> linkOptions; std::string libsToLink = " "; @@ -160,21 +278,6 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, bool didOutputVariable = false; bool didCopyFile = false; bool didCopyFileError = false; - bool didCStandard = false; - bool didCxxStandard = false; - bool didObjCStandard = false; - bool didObjCxxStandard = false; - bool didCudaStandard = false; - bool didCStandardRequired = false; - bool didCxxStandardRequired = false; - bool didObjCStandardRequired = false; - bool didObjCxxStandardRequired = false; - bool didCudaStandardRequired = false; - bool didCExtensions = false; - bool didCxxExtensions = false; - bool didObjCExtensions = false; - bool didObjCxxExtensions = false; - bool didCudaExtensions = false; bool useSources = argv[2] == "SOURCES"; std::vector<std::string> sources; @@ -188,21 +291,6 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, DoingOutputVariable, DoingCopyFile, DoingCopyFileError, - DoingCStandard, - DoingCxxStandard, - DoingObjCStandard, - DoingObjCxxStandard, - DoingCudaStandard, - DoingCStandardRequired, - DoingCxxStandardRequired, - DoingObjCStandardRequired, - DoingObjCxxStandardRequired, - DoingCudaStandardRequired, - DoingCExtensions, - DoingCxxExtensions, - DoingObjCExtensions, - DoingObjCxxExtensions, - DoingCudaExtensions, DoingSources, DoingCMakeInternal }; @@ -226,51 +314,12 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, } else if (argv[i] == "COPY_FILE_ERROR") { doing = DoingCopyFileError; didCopyFileError = true; - } else if (argv[i] == "C_STANDARD") { - doing = DoingCStandard; - didCStandard = true; - } else if (argv[i] == "CXX_STANDARD") { - doing = DoingCxxStandard; - didCxxStandard = true; - } else if (argv[i] == "OBJC_STANDARD") { - doing = DoingObjCStandard; - didObjCStandard = true; - } else if (argv[i] == "OBJCXX_STANDARD") { - doing = DoingObjCxxStandard; - didObjCxxStandard = true; - } else if (argv[i] == "CUDA_STANDARD") { - doing = DoingCudaStandard; - didCudaStandard = true; - } else if (argv[i] == "C_STANDARD_REQUIRED") { - doing = DoingCStandardRequired; - didCStandardRequired = true; - } else if (argv[i] == "CXX_STANDARD_REQUIRED") { - doing = DoingCxxStandardRequired; - didCxxStandardRequired = true; - } else if (argv[i] == "OBJC_STANDARD_REQUIRED") { - doing = DoingObjCStandardRequired; - didObjCStandardRequired = true; - } else if (argv[i] == "OBJCXX_STANDARD_REQUIRED") { - doing = DoingObjCxxStandardRequired; - didObjCxxStandardRequired = true; - } else if (argv[i] == "CUDA_STANDARD_REQUIRED") { - doing = DoingCudaStandardRequired; - didCudaStandardRequired = true; - } else if (argv[i] == "C_EXTENSIONS") { - doing = DoingCExtensions; - didCExtensions = true; - } else if (argv[i] == "CXX_EXTENSIONS") { - doing = DoingCxxExtensions; - didCxxExtensions = true; - } else if (argv[i] == "OBJC_EXTENSIONS") { - doing = DoingObjCExtensions; - didObjCExtensions = true; - } else if (argv[i] == "OBJCXX_EXTENSIONS") { - doing = DoingObjCxxExtensions; - didObjCxxExtensions = true; - } else if (argv[i] == "CUDA_EXTENSIONS") { - doing = DoingCudaExtensions; - didCudaExtensions = true; + } else if (cState.UpdateIfMatches(argv, i) || + cxxState.UpdateIfMatches(argv, i) || + cudaState.UpdateIfMatches(argv, i) || + objcState.UpdateIfMatches(argv, i) || + objcxxState.UpdateIfMatches(argv, i)) { + continue; } else if (argv[i] == "__CMAKE_INTERNAL") { doing = DoingCMakeInternal; } else if (doing == DoingCMakeFlags) { @@ -315,51 +364,6 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, } else if (doing == DoingCopyFileError) { copyFileError = argv[i]; doing = DoingNone; - } else if (doing == DoingCStandard) { - cStandard = argv[i]; - doing = DoingNone; - } else if (doing == DoingCxxStandard) { - cxxStandard = argv[i]; - doing = DoingNone; - } else if (doing == DoingObjCStandard) { - objcStandard = argv[i]; - doing = DoingNone; - } else if (doing == DoingObjCxxStandard) { - objcxxStandard = argv[i]; - doing = DoingNone; - } else if (doing == DoingCudaStandard) { - cudaStandard = argv[i]; - doing = DoingNone; - } else if (doing == DoingCStandardRequired) { - cStandardRequired = argv[i]; - doing = DoingNone; - } else if (doing == DoingCxxStandardRequired) { - cxxStandardRequired = argv[i]; - doing = DoingNone; - } else if (doing == DoingObjCStandardRequired) { - objcStandardRequired = argv[i]; - doing = DoingNone; - } else if (doing == DoingObjCxxStandardRequired) { - objcxxStandardRequired = argv[i]; - doing = DoingNone; - } else if (doing == DoingCudaStandardRequired) { - cudaStandardRequired = argv[i]; - doing = DoingNone; - } else if (doing == DoingCExtensions) { - cExtensions = argv[i]; - doing = DoingNone; - } else if (doing == DoingCxxExtensions) { - cxxExtensions = argv[i]; - doing = DoingNone; - } else if (doing == DoingObjCExtensions) { - objcExtensions = argv[i]; - doing = DoingNone; - } else if (doing == DoingObjCxxExtensions) { - objcxxExtensions = argv[i]; - doing = DoingNone; - } else if (doing == DoingCudaExtensions) { - cudaExtensions = argv[i]; - doing = DoingNone; } else if (doing == DoingSources) { sources.push_back(argv[i]); } else if (doing == DoingCMakeInternal) { @@ -411,59 +415,22 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, return -1; } - if (didCStandard && !this->SrcFileSignature) { - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - "C_STANDARD allowed only in source file signature."); - return -1; - } - if (didCxxStandard && !this->SrcFileSignature) { - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - "CXX_STANDARD allowed only in source file signature."); - return -1; - } - if (didCudaStandard && !this->SrcFileSignature) { - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - "CUDA_STANDARD allowed only in source file signature."); - return -1; - } - if (didCStandardRequired && !this->SrcFileSignature) { - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - "C_STANDARD_REQUIRED allowed only in source file signature."); - return -1; - } - if (didCxxStandardRequired && !this->SrcFileSignature) { - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - "CXX_STANDARD_REQUIRED allowed only in source file signature."); - return -1; - } - if (didCudaStandardRequired && !this->SrcFileSignature) { - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - "CUDA_STANDARD_REQUIRED allowed only in source file signature."); - return -1; - } - if (didCExtensions && !this->SrcFileSignature) { - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - "C_EXTENSIONS allowed only in source file signature."); - return -1; - } - if (didCxxExtensions && !this->SrcFileSignature) { - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - "CXX_EXTENSIONS allowed only in source file signature."); - return -1; - } - if (didCudaExtensions && !this->SrcFileSignature) { - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - "CUDA_EXTENSIONS allowed only in source file signature."); - return -1; + if (!this->SrcFileSignature) { + if (!cState.Validate(this->Makefile)) { + return -1; + } + if (!cudaState.Validate(this->Makefile)) { + return -1; + } + if (!cxxState.Validate(this->Makefile)) { + return -1; + } + if (!objcState.Validate(this->Makefile)) { + return -1; + } + if (!objcxxState.Validate(this->Makefile)) { + return -1; + } } // compute the binary dir when TRY_COMPILE is called with a src file @@ -721,12 +688,23 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, // Forward a set of variables to the inner project cache. { std::set<std::string> vars; - vars.insert(kCMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN); - vars.insert(kCMAKE_C_COMPILER_TARGET); - vars.insert(kCMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN); - vars.insert(kCMAKE_CXX_COMPILER_TARGET); + vars.insert(&c_properties[lang_property_start], + &c_properties[lang_property_start + lang_property_size]); + vars.insert(&cxx_properties[lang_property_start], + &cxx_properties[lang_property_start + lang_property_size]); + vars.insert(&cuda_properties[lang_property_start], + &cuda_properties[lang_property_start + lang_property_size]); + vars.insert( + &fortran_properties[lang_property_start], + &fortran_properties[lang_property_start + lang_property_size]); + vars.insert(&objc_properties[lang_property_start], + &objc_properties[lang_property_start + lang_property_size]); + vars.insert( + &objcxx_properties[lang_property_start], + &objcxx_properties[lang_property_start + lang_property_size]); + vars.insert(&swift_properties[lang_property_start], + &swift_properties[lang_property_start + lang_property_size]); vars.insert(kCMAKE_CUDA_ARCHITECTURES); - vars.insert(kCMAKE_CUDA_COMPILER_TARGET); vars.insert(kCMAKE_CUDA_RUNTIME_LIBRARY); vars.insert(kCMAKE_ENABLE_EXPORTS); vars.insert(kCMAKE_LINK_SEARCH_END_STATIC); @@ -739,7 +717,6 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, vars.insert(kCMAKE_SYSROOT); vars.insert(kCMAKE_SYSROOT_COMPILE); vars.insert(kCMAKE_SYSROOT_LINK); - vars.insert(kCMAKE_Swift_COMPILER_TARGET); vars.insert(kCMAKE_WARN_DEPRECATED); vars.emplace("CMAKE_MSVC_RUNTIME_LIBRARY"_s); @@ -753,10 +730,22 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, cmPolicies::NEW) { // To ensure full support of PIE, propagate cache variables // driving the link options - vars.insert(kCMAKE_C_LINK_PIE_SUPPORTED); - vars.insert(kCMAKE_C_LINK_NO_PIE_SUPPORTED); - vars.insert(kCMAKE_CXX_LINK_PIE_SUPPORTED); - vars.insert(kCMAKE_CXX_LINK_NO_PIE_SUPPORTED); + vars.insert(&c_properties[pie_property_start], + &c_properties[pie_property_start + pie_property_size]); + vars.insert(&cxx_properties[pie_property_start], + &cxx_properties[pie_property_start + pie_property_size]); + vars.insert(&cuda_properties[pie_property_start], + &cuda_properties[pie_property_start + pie_property_size]); + vars.insert( + &fortran_properties[pie_property_start], + &fortran_properties[pie_property_start + pie_property_size]); + vars.insert(&objc_properties[pie_property_start], + &objc_properties[pie_property_start + pie_property_size]); + vars.insert( + &objcxx_properties[pie_property_start], + &objcxx_properties[pie_property_start + pie_property_size]); + vars.insert(&swift_properties[pie_property_start], + &swift_properties[pie_property_start + pie_property_size]); } /* for the TRY_COMPILEs we want to be able to specify the architecture. @@ -819,21 +808,17 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, } fprintf(fout, ")\n"); - bool const testC = testLangs.find("C") != testLangs.end(); - bool const testObjC = testLangs.find("OBJC") != testLangs.end(); - bool const testCxx = testLangs.find("CXX") != testLangs.end(); - bool const testObjCxx = testLangs.find("OBJCXX") != testLangs.end(); - bool const testCuda = testLangs.find("CUDA") != testLangs.end(); + cState.Enabled(testLangs.find("C") != testLangs.end()); + cxxState.Enabled(testLangs.find("CXX") != testLangs.end()); + cudaState.Enabled(testLangs.find("CUDA") != testLangs.end()); + objcState.Enabled(testLangs.find("OBJC") != testLangs.end()); + objcxxState.Enabled(testLangs.find("OBJCXX") != testLangs.end()); bool warnCMP0067 = false; bool honorStandard = true; - if (!didCStandard && !didCxxStandard && !didObjCStandard && - !didObjCxxStandard && !didCudaStandard && !didCStandardRequired && - !didCxxStandardRequired && !didObjCStandardRequired && - !didObjCxxStandardRequired && !didCudaStandardRequired && - !didCExtensions && !didCxxExtensions && !didObjCExtensions && - !didObjCxxExtensions && !didCudaExtensions) { + if (cState.DidNone() && cxxState.DidNone() && objcState.DidNone() && + objcxxState.DidNone() && cudaState.DidNone()) { switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0067)) { case cmPolicies::WARN: warnCMP0067 = this->Makefile->PolicyOptionalWarningEnabled( @@ -855,46 +840,20 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, } } - if (honorStandard || warnCMP0067) { + std::vector<std::string> warnCMP0067Variables; - auto testLanguage = - [&](bool testLang, bool didLangStandard, bool didLangStandardRequired, - bool didLangExtensions, std::string& langStandard, - std::string& langStandardRequired, std::string& langExtensions, - const std::string& lang) { - if (testLang) { - if (!didLangStandard) { - langStandard = this->LookupStdVar( - cmStrCat("CMAKE_", lang, "_STANDARD"), warnCMP0067); - } - if (!didLangStandardRequired) { - langStandardRequired = this->LookupStdVar( - cmStrCat("CMAKE_", lang, "_STANDARD_REQUIRED"), warnCMP0067); - } - if (!didLangExtensions) { - langExtensions = this->LookupStdVar( - cmStrCat("CMAKE_", lang, "_EXTENSIONS"), warnCMP0067); - } - } - }; - - testLanguage(testC, didCStandard, didCStandardRequired, didCExtensions, - cStandard, cStandardRequired, cExtensions, "C"); - testLanguage(testObjC, didObjCStandard, didObjCStandardRequired, - didObjCExtensions, objcStandard, objcStandardRequired, - objcExtensions, "OBJC"); - testLanguage(testCxx, didCxxStandard, didCxxStandardRequired, - didCxxExtensions, cxxStandard, cxxStandardRequired, - cxxExtensions, "CXX"); - testLanguage(testObjCxx, didObjCxxStandard, didObjCxxStandardRequired, - didObjCxxExtensions, objcxxStandard, objcxxStandardRequired, - objcxxExtensions, "OBJCXX"); - testLanguage(testCuda, didCudaStandard, didCudaStandardRequired, - didCudaExtensions, cudaStandard, cudaStandardRequired, - cudaExtensions, "CUDA"); - } + cState.LoadUnsetPropertyValues(this->Makefile, honorStandard, warnCMP0067, + warnCMP0067Variables); + cxxState.LoadUnsetPropertyValues(this->Makefile, honorStandard, + warnCMP0067, warnCMP0067Variables); + cudaState.LoadUnsetPropertyValues(this->Makefile, honorStandard, + warnCMP0067, warnCMP0067Variables); + objcState.LoadUnsetPropertyValues(this->Makefile, honorStandard, + warnCMP0067, warnCMP0067Variables); + objcxxState.LoadUnsetPropertyValues(this->Makefile, honorStandard, + warnCMP0067, warnCMP0067Variables); - if (!this->WarnCMP0067.empty()) { + if (!warnCMP0067Variables.empty()) { std::ostringstream w; /* clang-format off */ w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0067) << "\n" @@ -902,43 +861,17 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, "is not honoring language standard variables in the test project:\n" ; /* clang-format on */ - for (std::string const& vi : this->WarnCMP0067) { + for (std::string const& vi : warnCMP0067Variables) { w << " " << vi << "\n"; } this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, w.str()); } - auto writeLanguageProperties = [&](bool testLang, - const std::string& langStandard, - const std::string& langStandardRequired, - const std::string& langExtensions, - const std::string& lang) { - if (testLang) { - if (!langStandard.empty()) { - writeProperty(fout, targetName, cmStrCat(lang, "_STANDARD"), - langStandard); - } - if (!langStandardRequired.empty()) { - writeProperty(fout, targetName, cmStrCat(lang, "_STANDARD_REQUIRED"), - langStandardRequired); - } - if (!langExtensions.empty()) { - writeProperty(fout, targetName, cmStrCat(lang, "_EXTENSIONS"), - langExtensions); - } - } - }; - - writeLanguageProperties(testC, cStandard, cStandardRequired, cExtensions, - "C"); - writeLanguageProperties(testObjC, objcStandard, objcStandardRequired, - objcExtensions, "OBJC"); - writeLanguageProperties(testCxx, cxxStandard, cxxStandardRequired, - cxxExtensions, "CXX"); - writeLanguageProperties(testObjCxx, objcxxStandard, objcxxStandardRequired, - objcxxExtensions, "OBJCXX"); - writeLanguageProperties(testCuda, cudaStandard, cudaStandardRequired, - cudaExtensions, "CUDA"); + cState.WriteProperties(fout, targetName); + cxxState.WriteProperties(fout, targetName); + cudaState.WriteProperties(fout, targetName); + objcState.WriteProperties(fout, targetName); + objcxxState.WriteProperties(fout, targetName); if (!linkOptions.empty()) { std::vector<std::string> options; diff --git a/Source/cmCoreTryCompile.h b/Source/cmCoreTryCompile.h index ae714a6..916572a 100644 --- a/Source/cmCoreTryCompile.h +++ b/Source/cmCoreTryCompile.h @@ -47,10 +47,6 @@ protected: std::string OutputFile; std::string FindErrorMessage; bool SrcFileSignature = false; - -private: - std::vector<std::string> WarnCMP0067; - std::string LookupStdVar(std::string const& var, bool warnCMP0067); }; #endif diff --git a/Source/cmCreateTestSourceList.cxx b/Source/cmCreateTestSourceList.cxx index 9d492ba..9c4deea 100644 --- a/Source/cmCreateTestSourceList.cxx +++ b/Source/cmCreateTestSourceList.cxx @@ -127,7 +127,7 @@ bool cmCreateTestSourceList(std::vector<std::string> const& args, mf.AddDefinition("CMAKE_FORWARD_DECLARE_TESTS", forwardDeclareCode); mf.AddDefinition("CMAKE_FUNCTION_TABLE_ENTIRES", functionMapCode); bool res = true; - if (!mf.ConfigureFile(configFile, driver, false, true, false)) { + if (!mf.ConfigureFile(configFile, driver, false, true, false, true)) { res = false; } diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx index 69a6427..4a4f87d 100644 --- a/Source/cmDefinitions.cxx +++ b/Source/cmDefinitions.cxx @@ -19,7 +19,6 @@ cmDefinitions::Def const& cmDefinitions::GetInternal(const std::string& key, { auto it = begin->Map.find(cm::String::borrow(key)); if (it != begin->Map.end()) { - it->second.Used = true; return it->second; } } @@ -108,16 +107,3 @@ void cmDefinitions::Unset(const std::string& key) { this->Map[key] = Def(); } - -std::vector<std::string> cmDefinitions::UnusedKeys() const -{ - std::vector<std::string> keys; - keys.reserve(this->Map.size()); - // Consider local definitions. - for (auto const& mi : this->Map) { - if (!mi.second.Used) { - keys.push_back(*mi.first.str_if_stable()); - } - } - return keys; -} diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h index 0e38fb1..d57750a 100644 --- a/Source/cmDefinitions.h +++ b/Source/cmDefinitions.h @@ -48,9 +48,6 @@ public: /** Unset a definition. */ void Unset(const std::string& key); - /** List of unused keys. */ - std::vector<std::string> UnusedKeys() const; - private: /** String with existence boolean. */ struct Def @@ -62,7 +59,6 @@ private: { } cm::String Value; - bool Used = false; }; static Def NoDef; diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx index 9f8a821..352eaf2 100644 --- a/Source/cmExportCommand.cxx +++ b/Source/cmExportCommand.cxx @@ -223,11 +223,9 @@ bool cmExportCommand(std::vector<std::string> const& args, ebfg->SetExportOld(arguments.ExportOld); // Compute the set of configurations exported. - std::vector<std::string> configurationTypes; - mf.GetConfigurations(configurationTypes); - if (configurationTypes.empty()) { - configurationTypes.emplace_back(); - } + std::vector<std::string> configurationTypes = + mf.GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); + for (std::string const& ct : configurationTypes) { ebfg->AddConfiguration(ct); } diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 4d0e099..58aa391 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -567,8 +567,9 @@ void cmExportFileGenerator::PopulateCompatibleInterfaceProperties( if (gtarget->GetType() != cmStateEnums::INTERFACE_LIBRARY) { getCompatibleInterfaceProperties(gtarget, ifaceProperties, ""); - std::vector<std::string> configNames; - gtarget->Target->GetMakefile()->GetConfigurations(configNames); + std::vector<std::string> configNames = + gtarget->Target->GetMakefile()->GetGeneratorConfigs( + cmMakefile::ExcludeEmptyConfig); for (std::string const& cn : configNames) { getCompatibleInterfaceProperties(gtarget, ifaceProperties, cn); diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 32b0ca9..652c041 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -370,7 +370,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( std::string lang = s->GetOrDetermineLanguage(); if (lang == "C" || lang == "CXX" || lang == "CUDA") { std::string const& srcext = s->GetExtension(); - isCFile = cm->IsSourceExtension(srcext); + isCFile = cm->IsACLikeSourceExtension(srcext); } std::string const& fullPath = s->ResolveFullPath(); diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx index bf7555d..95cfb0a 100644 --- a/Source/cmExtraCodeLiteGenerator.cxx +++ b/Source/cmExtraCodeLiteGenerator.cxx @@ -227,8 +227,7 @@ std::string cmExtraCodeLiteGenerator::CollectSourceFiles( cmSystemTools::LowerCase(s->GetExtension()); // check whether it is a source or a include file // then put it accordingly into one of the two containers - if (cm->IsSourceExtension(extLower) || cm->IsCudaExtension(extLower) || - cm->IsFortranExtension(extLower)) { + if (cm->IsAKnownSourceExtension(extLower)) { cFiles[fullPath] = s; } else { otherFiles.insert(fullPath); diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index 613a943..3e265a0 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -349,6 +349,13 @@ std::string cmExtraSublimeTextGenerator::ComputeFlagsForObject( if (language.empty()) { language = "C"; } + + // explicitly add the explicit language flag before any other flag + // this way backwards compatibility with user flags is maintained + if (source->GetProperty("LANGUAGE")) { + lg->AppendFeatureOptions(flags, language, "EXPLICIT_LANGUAGE"); + } + std::string const& config = lg->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE"); diff --git a/Source/cmFileAPI.cxx b/Source/cmFileAPI.cxx index 594969b..c2ab2f1 100644 --- a/Source/cmFileAPI.cxx +++ b/Source/cmFileAPI.cxx @@ -665,7 +665,7 @@ std::string cmFileAPI::NoSupportedVersion( // The "codemodel" object kind. -static unsigned int const CodeModelV2Minor = 1; +static unsigned int const CodeModelV2Minor = 2; void cmFileAPI::BuildClientRequestCodeModel( ClientRequest& r, std::vector<RequestVersion> const& versions) diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx index fe331ec..e9af208 100644 --- a/Source/cmFileAPICodemodel.cxx +++ b/Source/cmFileAPICodemodel.cxx @@ -175,6 +175,38 @@ public: } }; +template <typename T> +class JBTs +{ +public: + JBTs(T v = T(), std::vector<JBTIndex> ids = std::vector<JBTIndex>()) + : Value(std::move(v)) + , Backtraces(std::move(ids)) + { + } + T Value; + std::vector<JBTIndex> Backtraces; + friend bool operator==(JBTs<T> const& l, JBTs<T> const& r) + { + if ((l.Value == r.Value) && (l.Backtraces.size() == r.Backtraces.size())) { + for (size_t i = 0; i < l.Backtraces.size(); i++) { + if (l.Backtraces[i].Index != r.Backtraces[i].Index) { + return false; + } + } + } + return true; + } + static bool ValueEq(JBTs<T> const& l, JBTs<T> const& r) + { + return l.Value == r.Value; + } + static bool ValueLess(JBTs<T> const& l, JBTs<T> const& r) + { + return l.Value < r.Value; + } +}; + class BacktraceData { std::string TopSource; @@ -277,6 +309,7 @@ struct CompileData std::string Language; std::string Sysroot; + JBTs<std::string> LanguageStandard; std::vector<JBT<std::string>> Flags; std::vector<JBT<std::string>> Defines; std::vector<JBT<std::string>> PrecompileHeaders; @@ -287,6 +320,7 @@ struct CompileData return (l.Language == r.Language && l.Sysroot == r.Sysroot && l.Flags == r.Flags && l.Defines == r.Defines && l.PrecompileHeaders == r.PrecompileHeaders && + l.LanguageStandard == r.LanguageStandard && l.Includes == r.Includes); } }; @@ -320,6 +354,12 @@ struct hash<CompileData> result = result ^ hash<std::string>()(i.Value) ^ hash<Json::ArrayIndex>()(i.Backtrace.Index); } + if (!in.LanguageStandard.Value.empty()) { + result = result ^ hash<std::string>()(in.LanguageStandard.Value); + for (JBTIndex backtrace : in.LanguageStandard.Backtraces) { + result = result ^ hash<Json::ArrayIndex>()(backtrace.Index); + } + } return result; } }; @@ -363,6 +403,16 @@ class Target return JBT<T>(bt.Value, this->Backtraces.Add(bt.Backtrace)); } + template <typename T> + JBTs<T> ToJBTs(BTs<T> const& bts) + { + std::vector<JBTIndex> ids; + for (cmListFileBacktrace const& backtrace : bts.Backtraces) { + ids.emplace_back(this->Backtraces.Add(backtrace)); + } + return JBTs<T>(bts.Value, ids); + } + void ProcessLanguages(); void ProcessLanguage(std::string const& lang); @@ -377,6 +427,7 @@ class Target Json::Value DumpCompileData(CompileData const& cd); Json::Value DumpInclude(CompileData::IncludeEntry const& inc); Json::Value DumpPrecompileHeader(JBT<std::string> const& header); + Json::Value DumpLanguageStandard(JBTs<std::string> const& standard); Json::Value DumpDefine(JBT<std::string> const& def); Json::Value DumpSources(); Json::Value DumpSource(cmGeneratorTarget::SourceAndKind const& sk, @@ -438,7 +489,7 @@ Json::Value Codemodel::DumpConfigurations() const auto& makefiles = gg->GetMakefiles(); if (!makefiles.empty()) { std::vector<std::string> const& configs = - makefiles[0]->GetGeneratorConfigs(); + makefiles[0]->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); for (std::string const& config : configs) { configurations.append(this->DumpConfiguration(config)); } @@ -838,6 +889,11 @@ void Target::ProcessLanguage(std::string const& lang) for (BT<std::string> const& pch : precompileHeaders) { cd.PrecompileHeaders.emplace_back(this->ToJBT(pch)); } + BTs<std::string> const* languageStandard = + this->GT->GetLanguageStandardProperty(lang, this->Config); + if (languageStandard) { + cd.LanguageStandard = this->ToJBTs(*languageStandard); + } } Json::ArrayIndex Target::AddSourceGroup(cmSourceGroup* sg, Json::ArrayIndex si) @@ -996,6 +1052,9 @@ CompileData Target::MergeCompileData(CompileData const& fd) // All compile groups share the precompile headers of the target. cd.PrecompileHeaders = td.PrecompileHeaders; + // All compile groups share the language standard of the target. + cd.LanguageStandard = td.LanguageStandard; + // Use target-wide flags followed by source-specific flags. cd.Flags.reserve(td.Flags.size() + fd.Flags.size()); cd.Flags.insert(cd.Flags.end(), td.Flags.begin(), td.Flags.end()); @@ -1153,6 +1212,10 @@ Json::Value Target::DumpCompileData(CompileData const& cd) } result["precompileHeaders"] = std::move(precompileHeaders); } + if (!cd.LanguageStandard.Value.empty()) { + result["languageStandard"] = + this->DumpLanguageStandard(cd.LanguageStandard); + } return result; } @@ -1176,6 +1239,20 @@ Json::Value Target::DumpPrecompileHeader(JBT<std::string> const& header) return precompileHeader; } +Json::Value Target::DumpLanguageStandard(JBTs<std::string> const& standard) +{ + Json::Value languageStandard = Json::objectValue; + languageStandard["standard"] = standard.Value; + if (!standard.Backtraces.empty()) { + Json::Value backtraces = Json::arrayValue; + for (JBTIndex backtrace : standard.Backtraces) { + backtraces.append(backtrace.Index); + } + languageStandard["backtraces"] = backtraces; + } + return languageStandard; +} + Json::Value Target::DumpDefine(JBT<std::string> const& def) { Json::Value define = Json::objectValue; diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index 4b88bea..77728ec 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/Source/cmFindProgramCommand.cxx @@ -4,6 +4,7 @@ #include "cmMakefile.h" #include "cmMessageType.h" +#include "cmPolicies.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" @@ -19,6 +20,7 @@ struct cmFindProgramHelper cmFindProgramHelper(cmMakefile* makefile, cmFindBase const* base) : DebugSearches("find_program", base) , Makefile(makefile) + , PolicyCMP0109(makefile->GetPolicyStatus(cmPolicies::CMP0109)) { #if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) // Consider platform-specific extensions. @@ -48,6 +50,8 @@ struct cmFindProgramHelper cmFindBaseDebugState DebugSearches; cmMakefile* Makefile; + cmPolicies::PolicyStatus PolicyCMP0109; + void AddName(std::string const& name) { this->Names.push_back(name); } void SetName(std::string const& name) { @@ -85,7 +89,7 @@ struct cmFindProgramHelper this->TestNameExt = cmStrCat(name, ext); this->TestPath = cmSystemTools::CollapseFullPath(this->TestNameExt, path); - bool exists = cmSystemTools::FileExists(this->TestPath, true); + bool exists = this->FileIsExecutable(this->TestPath); exists ? this->DebugSearches.FoundAt(this->TestPath) : this->DebugSearches.FailedAt(this->TestPath); if (exists) { @@ -95,6 +99,48 @@ struct cmFindProgramHelper } return false; } + bool FileIsExecutable(std::string const& file) const + { + switch (this->PolicyCMP0109) { + case cmPolicies::OLD: + return cmSystemTools::FileExists(file, true); + case cmPolicies::NEW: + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::REQUIRED_IF_USED: + return cmSystemTools::FileIsExecutable(file); + default: + break; + } + bool const isExeOld = cmSystemTools::FileExists(file, true); + bool const isExeNew = cmSystemTools::FileIsExecutable(file); + if (isExeNew == isExeOld) { + return isExeNew; + } + if (isExeNew) { + this->Makefile->IssueMessage( + MessageType::AUTHOR_WARNING, + cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0109), + "\n" + "The file\n" + " ", + file, + "\n" + "is executable but not readable. " + "CMake is ignoring it for compatibility.")); + } else { + this->Makefile->IssueMessage( + MessageType::AUTHOR_WARNING, + cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0109), + "\n" + "The file\n" + " ", + file, + "\n" + "is readable but not executable. " + "CMake is using it for compatibility.")); + } + return isExeOld; + } }; cmFindProgramCommand::cmFindProgramCommand(cmExecutionStatus& status) @@ -266,14 +312,13 @@ std::string cmFindProgramCommand::GetBundleExecutable( if (executableURL != nullptr) { const int MAX_OSX_PATH_SIZE = 1024; - char buffer[MAX_OSX_PATH_SIZE]; + UInt8 buffer[MAX_OSX_PATH_SIZE]; - // Convert the CFString to a C string - CFStringGetCString(CFURLGetString(executableURL), buffer, - MAX_OSX_PATH_SIZE, kCFStringEncodingUTF8); - - // And finally to a c++ string - executable = bundlePath + "/Contents/MacOS/" + std::string(buffer); + if (CFURLGetFileSystemRepresentation(executableURL, false, buffer, + MAX_OSX_PATH_SIZE)) { + executable = bundlePath + "/Contents/MacOS/" + + std::string(reinterpret_cast<char*>(buffer)); + } // Only release CFURLRef if it's not null CFRelease(executableURL); } diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx index 9cee0e6..345f0ba 100644 --- a/Source/cmGeneratedFileStream.cxx +++ b/Source/cmGeneratedFileStream.cxx @@ -122,10 +122,17 @@ void cmGeneratedFileStreamBase::Open(std::string const& name) // Create the name of the temporary file. this->TempName = name; #if defined(__VMS) - this->TempName += "_tmp"; + this->TempName += "_"; #else - this->TempName += ".tmp"; + this->TempName += "."; #endif + if (!this->TempExt.empty()) { + this->TempName += this->TempExt; + } else { + char buf[64]; + sprintf(buf, "tmp%05x", cmSystemTools::RandomSeed() & 0xFFFFF); + this->TempName += buf; + } // Make sure the temporary file that will be used is not present. cmSystemTools::RemoveFile(this->TempName); @@ -216,3 +223,8 @@ void cmGeneratedFileStream::SetName(const std::string& fname) { this->Name = fname; } + +void cmGeneratedFileStream::SetTempExt(std::string const& ext) +{ + this->TempExt = ext; +} diff --git a/Source/cmGeneratedFileStream.h b/Source/cmGeneratedFileStream.h index a9088ac..3dee142 100644 --- a/Source/cmGeneratedFileStream.h +++ b/Source/cmGeneratedFileStream.h @@ -43,6 +43,9 @@ protected: // The name of the final destination file for the output. std::string Name; + // The extension of the temporary file. + std::string TempExt; + // The name of the temporary file. std::string TempName; @@ -138,6 +141,12 @@ public: * the output file to be changed during the use of cmGeneratedFileStream. */ void SetName(const std::string& fname); + + /** + * Set set a custom temporary file extension used with 'Open'. + * This does not work if the file was opened by the constructor. + */ + void SetTempExt(std::string const& ext); }; #endif diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx index 9e8707d..1107adb 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.cxx +++ b/Source/cmGeneratorExpressionEvaluationFile.cxx @@ -157,12 +157,8 @@ void cmGeneratorExpressionEvaluationFile::Generate(cmLocalGenerator* lg) std::map<std::string, std::string> outputFiles; - std::vector<std::string> allConfigs; - lg->GetMakefile()->GetConfigurations(allConfigs); - - if (allConfigs.empty()) { - allConfigs.emplace_back(); - } + std::vector<std::string> allConfigs = + lg->GetMakefile()->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); std::vector<std::string> enabledLanguages; cmGlobalGenerator* gg = lg->GetGlobalGenerator(); diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index e4fb67e..4adc6a2 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -37,6 +37,7 @@ #include "cmPolicies.h" #include "cmProperty.h" #include "cmRange.h" +#include "cmStandardLevelResolver.h" #include "cmState.h" #include "cmStateSnapshot.h" #include "cmStateTypes.h" @@ -881,7 +882,7 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode { ConfigurationTestNode() {} // NOLINT(modernize-use-equals-default) - int NumExpectedParameters() const override { return OneOrZeroParameters; } + int NumExpectedParameters() const override { return ZeroOrMoreParameters; } std::string Evaluate( const std::vector<std::string>& parameters, @@ -899,13 +900,15 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode return std::string(); } context->HadContextSensitiveCondition = true; - if (context->Config.empty()) { - return parameters.front().empty() ? "1" : "0"; - } - - if (cmsysString_strcasecmp(parameters.front().c_str(), - context->Config.c_str()) == 0) { - return "1"; + for (auto& param : parameters) { + if (context->Config.empty()) { + if (param.empty()) { + return "1"; + } + } else if (cmsysString_strcasecmp(param.c_str(), + context->Config.c_str()) == 0) { + return "1"; + } } if (context->CurrentTarget && context->CurrentTarget->IsImported()) { @@ -922,10 +925,12 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode "MAP_IMPORTED_CONFIG_", cmSystemTools::UpperCase(context->Config)); if (cmProp mapValue = context->CurrentTarget->GetProperty(mapProp)) { cmExpandList(cmSystemTools::UpperCase(*mapValue), mappedConfigs); - return cm::contains(mappedConfigs, - cmSystemTools::UpperCase(parameters.front())) - ? "1" - : "0"; + + for (auto& param : parameters) { + if (cm::contains(mappedConfigs, cmSystemTools::UpperCase(param))) { + return "1"; + } + } } } } @@ -1703,12 +1708,12 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode static LangMap availableFeatures; LangMap testedFeatures; - + cmStandardLevelResolver standardResolver(context->LG->GetMakefile()); for (std::string const& p : parameters) { std::string error; std::string lang; - if (!context->LG->GetMakefile()->CompileFeatureKnown( - context->HeadTarget->Target, p, lang, &error)) { + if (!standardResolver.CompileFeatureKnown( + context->HeadTarget->Target->GetName(), p, lang, &error)) { reportError(context, content->GetOriginalExpression(), error); return std::string(); } @@ -1716,7 +1721,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode if (availableFeatures.find(lang) == availableFeatures.end()) { const char* featuresKnown = - context->LG->GetMakefile()->CompileFeaturesAvailable(lang, &error); + standardResolver.CompileFeaturesAvailable(lang, &error); if (!featuresKnown) { reportError(context, content->GetOriginalExpression(), error); return std::string(); @@ -1741,10 +1746,10 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode // All features known for the language are always available. continue; } - if (!context->LG->GetMakefile()->HaveStandardAvailable( - target->Target, lit.first, it)) { + if (!standardResolver.HaveStandardAvailable(target, lit.first, + context->Config, it)) { if (evalLL) { - cmProp l = target->GetProperty(lit.first + "_STANDARD"); + cmProp l = target->GetLanguageStandard(lit.first, context->Config); if (!l) { l = standardDefault; } diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index f2011ee..ccd8e7e 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -43,6 +43,7 @@ #include "cmSourceFile.h" #include "cmSourceFileLocation.h" #include "cmSourceFileLocationKind.h" +#include "cmStandardLevelResolver.h" #include "cmState.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" @@ -801,7 +802,8 @@ void cmGeneratorTarget::GetObjectSources( void cmGeneratorTarget::ComputeObjectMapping() { - auto const& configs = this->Makefile->GetGeneratorConfigs(); + auto const& configs = + this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); std::set<std::string> configSet(configs.begin(), configs.end()); if (configSet == this->VisitedConfigsForObjects) { return; @@ -947,6 +949,61 @@ bool cmGeneratorTarget::HasExplicitObjectName(cmSourceFile const* file) const return it != this->ExplicitObjectName.end(); } +BTs<std::string> const* cmGeneratorTarget::GetLanguageStandardProperty( + std::string const& lang, std::string const& config) const +{ + std::string key = cmStrCat(cmSystemTools::UpperCase(config), '-', lang); + auto langStandardIter = this->LanguageStandardMap.find(key); + if (langStandardIter != this->LanguageStandardMap.end()) { + return &langStandardIter->second; + } + + return this->Target->GetLanguageStandardProperty( + cmStrCat(lang, "_STANDARD")); +} + +cmProp cmGeneratorTarget::GetLanguageStandard(std::string const& lang, + std::string const& config) const +{ + BTs<std::string> const* languageStandard = + this->GetLanguageStandardProperty(lang, config); + + if (languageStandard) { + return &(languageStandard->Value); + } + + return nullptr; +} + +cmProp cmGeneratorTarget::GetPropertyWithPairedLanguageSupport( + std::string const& lang, const char* suffix) const +{ + cmProp propertyValue = this->Target->GetProperty(cmStrCat(lang, suffix)); + if (propertyValue == nullptr) { + // Check if we should use the value set by another language. + if (lang == "OBJC") { + propertyValue = this->GetPropertyWithPairedLanguageSupport("C", suffix); + } else if (lang == "OBJCXX" || lang == "CUDA") { + propertyValue = + this->GetPropertyWithPairedLanguageSupport("CXX", suffix); + } + } + return propertyValue; +} + +cmProp cmGeneratorTarget::GetLanguageExtensions(std::string const& lang) const +{ + return this->GetPropertyWithPairedLanguageSupport(lang, "_EXTENSIONS"); +} + +bool cmGeneratorTarget::GetLanguageStandardRequired( + std::string const& lang) const +{ + cmProp p = + this->GetPropertyWithPairedLanguageSupport(lang, "_STANDARD_REQUIRED"); + return p && cmIsOn(*p); +} + void cmGeneratorTarget::GetModuleDefinitionSources( std::vector<cmSourceFile const*>& data, const std::string& config) const { @@ -1723,8 +1780,8 @@ cmGeneratorTarget::GetAllConfigSources() const void cmGeneratorTarget::ComputeAllConfigSources() const { - std::vector<std::string> configs; - this->Makefile->GetConfigurations(configs); + std::vector<std::string> configs = + this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); std::map<cmSourceFile const*, size_t> index; @@ -2757,7 +2814,7 @@ cmTargetTraceDependencies::cmTargetTraceDependencies(cmGeneratorTarget* target) if (target->GetType() != cmStateEnums::INTERFACE_LIBRARY) { std::set<cmSourceFile*> emitted; std::vector<std::string> const& configs = - this->Makefile->GetGeneratorConfigs(); + this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); for (std::string const& c : configs) { std::vector<cmSourceFile*> sources; this->GeneratorTarget->GetSourceFiles(sources, c); @@ -2968,7 +3025,7 @@ void cmTargetTraceDependencies::CheckCustomCommand(cmCustomCommand const& cc) // Queue the custom command dependencies. std::set<std::string> emitted; std::vector<std::string> const& configs = - this->Makefile->GetGeneratorConfigs(); + this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); for (std::string const& conf : configs) { this->FollowCommandDepends(cc, conf, emitted); } @@ -4408,12 +4465,75 @@ void cmGeneratorTarget::ComputeTargetManifest(const std::string& config) const bool cmGeneratorTarget::ComputeCompileFeatures(std::string const& config) const { + // Compute the language standard based on the compile features. + cmStandardLevelResolver standardResolver(this->Makefile); std::vector<BT<std::string>> features = this->GetCompileFeatures(config); for (BT<std::string> const& f : features) { - if (!this->Makefile->AddRequiredTargetFeature(this->Target, f.Value)) { + std::string lang; + if (!standardResolver.CompileFeatureKnown(this->Target->GetName(), f.Value, + lang, nullptr)) { + return false; + } + + std::string key = cmStrCat(cmSystemTools::UpperCase(config), '-', lang); + cmProp currentLanguageStandard = this->GetLanguageStandard(lang, config); + + std::string newRequiredStandard; + if (!standardResolver.GetNewRequiredStandard( + this->Target->GetName(), f.Value, currentLanguageStandard, + newRequiredStandard)) { return false; } + + if (!newRequiredStandard.empty()) { + BTs<std::string>& languageStandardProperty = + this->LanguageStandardMap[key]; + if (languageStandardProperty.Value != newRequiredStandard) { + languageStandardProperty.Value = newRequiredStandard; + languageStandardProperty.Backtraces.clear(); + } + languageStandardProperty.Backtraces.emplace_back(f.Backtrace); + } + } + + return true; +} + +bool cmGeneratorTarget::ComputeCompileFeatures( + std::string const& config, std::set<LanguagePair> const& languagePairs) const +{ + for (const auto& language : languagePairs) { + BTs<std::string> const* generatorTargetLanguageStandard = + this->GetLanguageStandardProperty(language.first, config); + if (!generatorTargetLanguageStandard) { + // If the standard isn't explicitly set we copy it over from the + // specified paired language. + std::string key = + cmStrCat(cmSystemTools::UpperCase(config), '-', language.first); + BTs<std::string> const* standardToCopy = + this->GetLanguageStandardProperty(language.second, config); + if (standardToCopy != nullptr) { + this->LanguageStandardMap[key] = *standardToCopy; + generatorTargetLanguageStandard = &this->LanguageStandardMap[key]; + } else { + cmProp defaultStandard = this->Makefile->GetDef( + cmStrCat("CMAKE_", language.second, "_STANDARD_DEFAULT")); + if (defaultStandard != nullptr) { + this->LanguageStandardMap[key] = BTs<std::string>(*defaultStandard); + generatorTargetLanguageStandard = &this->LanguageStandardMap[key]; + } + } + + // Custom updates for the CUDA standard. + if (generatorTargetLanguageStandard != nullptr && + language.first == "CUDA") { + if (generatorTargetLanguageStandard->Value == "98") { + this->LanguageStandardMap[key].Value = "03"; + } + } + } } + return true; } @@ -6731,7 +6851,7 @@ bool cmGeneratorTarget::GetConfigCommonSourceFiles( std::vector<cmSourceFile*>& files) const { std::vector<std::string> const& configs = - this->Makefile->GetGeneratorConfigs(); + this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); auto it = configs.begin(); const std::string& firstConfig = *it; diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 3aedbf5..07f071b 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -148,6 +148,16 @@ public: bool HasExplicitObjectName(cmSourceFile const* file) const; void AddExplicitObjectName(cmSourceFile const* sf); + BTs<std::string> const* GetLanguageStandardProperty( + std::string const& lang, std::string const& config) const; + + cmProp GetLanguageStandard(std::string const& lang, + std::string const& config) const; + + cmProp GetLanguageExtensions(std::string const& lang) const; + + bool GetLanguageStandardRequired(std::string const& lang) const; + void GetModuleDefinitionSources(std::vector<cmSourceFile const*>&, const std::string& config) const; void GetExternalObjects(std::vector<cmSourceFile const*>&, @@ -515,6 +525,11 @@ public: bool ComputeCompileFeatures(std::string const& config) const; + using LanguagePair = std::pair<std::string, std::string>; + bool ComputeCompileFeatures( + std::string const& config, + std::set<LanguagePair> const& languagePairs) const; + /** * Trace through the source files in this target and add al source files * that they depend on, used by all generators @@ -1038,6 +1053,11 @@ private: bool GetRPATH(const std::string& config, const std::string& prop, std::string& rpath) const; + mutable std::map<std::string, BTs<std::string>> LanguageStandardMap; + + cmProp GetPropertyWithPairedLanguageSupport(std::string const& lang, + const char* suffix) const; + public: const std::vector<const cmGeneratorTarget*>& GetLinkImplementationClosure( const std::string& config) const; diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx index 811421a..38bffbf 100644 --- a/Source/cmGetFilenameComponentCommand.cxx +++ b/Source/cmGetFilenameComponentCommand.cxx @@ -14,6 +14,7 @@ bool cmGetFilenameComponentCommand(std::vector<std::string> const& args, { if (args.size() < 3) { status.SetError("called with incorrect number of arguments"); + cmSystemTools::SetFatalErrorOccured(); return false; } @@ -114,6 +115,7 @@ bool cmGetFilenameComponentCommand(std::vector<std::string> const& args, } else { std::string err = "unknown component " + args[2]; status.SetError(err); + cmSystemTools::SetFatalErrorOccured(); return false; } diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 4dc4092..a0cee0e 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -313,19 +313,16 @@ bool cmGlobalGenerator::CheckTargetsForMissingSources() const } } - std::vector<std::string> configs; - target->Makefile->GetConfigurations(configs); + std::vector<std::string> configs = + target->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); std::vector<cmSourceFile*> srcs; - if (configs.empty()) { - target->GetSourceFiles(srcs, ""); - } else { - for (std::string const& config : configs) { - target->GetSourceFiles(srcs, config); - if (!srcs.empty()) { - break; - } + for (std::string const& config : configs) { + target->GetSourceFiles(srcs, config); + if (!srcs.empty()) { + break; } } + if (srcs.empty()) { std::ostringstream e; e << "No SOURCES given to target: " << target->GetName(); @@ -349,7 +346,8 @@ bool cmGlobalGenerator::CheckTargetsForType() const if (target->GetType() == cmStateEnums::EXECUTABLE && target->GetPropertyAsBool("WIN32_EXECUTABLE")) { std::vector<std::string> const& configs = - target->Makefile->GetGeneratorConfigs(); + target->Makefile->GetGeneratorConfigs( + cmMakefile::IncludeEmptyConfig); for (std::string const& config : configs) { if (target->GetLinkerLanguage(config) == "Swift") { this->GetCMakeInstance()->IssueMessage( @@ -596,6 +594,16 @@ void cmGlobalGenerator::EnableLanguage( mf->ReadListFile(fpath); } } + + if (readCMakeSystem) { + // Find the native build tool for this generator. + // This has to be done early so that MSBuild can be used to examine the + // cross-compilation environment. + if (!this->FindMakeProgram(mf)) { + return; + } + } + // Load the CMakeDetermineSystem.cmake file and find out // what platform we are running on if (!mf->GetDefinition("CMAKE_SYSTEM")) { @@ -667,11 +675,6 @@ void cmGlobalGenerator::EnableLanguage( cmSystemTools::SetFatalErrorOccured(); return; } - - // Find the native build tool for this generator. - if (!this->FindMakeProgram(mf)) { - return; - } } // Check that the languages are supported by the generator and its @@ -1442,12 +1445,10 @@ bool cmGlobalGenerator::Compute() localGen->AddHelperCommands(); } - // Finalize the set of compile features for each target. - // FIXME: This turns into calls to cmMakefile::AddRequiredTargetFeature - // which actually modifies the <lang>_STANDARD target property - // on the original cmTarget instance. It accumulates features - // across all configurations. Some refactoring is needed to - // compute a per-config resulta purely during generation. + // Perform up-front computation in order to handle errors (such as unknown + // features) at this point. While processing the compile features we also + // calculate and cache the language standard required by the compile + // features. for (const auto& localGen : this->LocalGenerators) { if (!localGen->ComputeTargetCompileFeatures()) { return false; @@ -1698,8 +1699,8 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo() cmPolicies::PolicyStatus polSt = mf->GetPolicyStatus(cmPolicies::CMP0043); if (polSt == cmPolicies::WARN || polSt == cmPolicies::OLD) { - std::vector<std::string> configs; - mf->GetConfigurations(configs); + std::vector<std::string> configs = + mf->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig); for (std::string const& c : configs) { std::string defPropName = @@ -1988,8 +1989,9 @@ int cmGlobalGenerator::Build( std::string makeCommandStr; output += "\nRun Build Command(s):"; - for (auto command = makeCommand.begin(); command != makeCommand.end(); - ++command) { + retVal = 0; + for (auto command = makeCommand.begin(); + command != makeCommand.end() && retVal == 0; ++command) { makeCommandStr = command->Printable(); if (command != makeCommand.end()) { makeCommandStr += " && "; @@ -3123,7 +3125,8 @@ void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target) fout << "# Source files and their labels\n"; std::vector<cmSourceFile*> sources; std::vector<std::string> const& configs = - target->Target->GetMakefile()->GetGeneratorConfigs(); + target->Target->GetMakefile()->GetGeneratorConfigs( + cmMakefile::IncludeEmptyConfig); for (std::string const& c : configs) { target->GetSourceFiles(sources, c); } @@ -3222,8 +3225,9 @@ bool cmGlobalGenerator::GenerateCPackPropertiesFile() const auto& lg = this->LocalGenerators[0]; cmMakefile* mf = lg->GetMakefile(); - std::vector<std::string> configs; - std::string config = mf->GetConfigurations(configs, false); + std::vector<std::string> configs = + mf->GetGeneratorConfigs(cmMakefile::OnlyMultiConfig); + std::string config = mf->GetDefaultConfiguration(); std::string path = cmStrCat(this->CMakeInstance->GetHomeOutputDirectory(), "/CPackProperties.cmake"); diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 843b0f4..48eb405 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -5,9 +5,9 @@ #include <algorithm> #include <cctype> #include <cstdio> -#include <iterator> #include <sstream> +#include <cm/iterator> #include <cm/memory> #include <cmext/algorithm> #include <cmext/memory> @@ -518,7 +518,8 @@ void cmGlobalNinjaGenerator::Generate() if (cmSystemTools::GetErrorOccuredFlag()) { this->RulesFileStream->setstate(std::ios::failbit); - for (auto const& config : this->Makefiles[0]->GetGeneratorConfigs()) { + for (auto const& config : this->Makefiles[0]->GetGeneratorConfigs( + cmMakefile::IncludeEmptyConfig)) { this->GetImplFileStream(config)->setstate(std::ios::failbit); this->GetConfigFileStream(config)->setstate(std::ios::failbit); } @@ -1207,7 +1208,8 @@ void cmGlobalNinjaGenerator::AddTargetAlias(const std::string& alias, this->TargetAliases[output].GeneratorTarget = nullptr; this->DefaultTargetAliases[output].GeneratorTarget = nullptr; for (const std::string& config2 : - this->Makefiles.front()->GetGeneratorConfigs()) { + this->Makefiles.front()->GetGeneratorConfigs( + cmMakefile::IncludeEmptyConfig)) { this->Configs[config2].TargetAliases[output].GeneratorTarget = nullptr; } } @@ -1280,7 +1282,8 @@ void cmGlobalNinjaGenerator::WriteTargetAliases(std::ostream& os) } if (this->IsMultiConfig()) { - for (auto const& config : this->Makefiles.front()->GetGeneratorConfigs()) { + for (auto const& config : this->Makefiles.front()->GetGeneratorConfigs( + cmMakefile::IncludeEmptyConfig)) { for (auto const& ta : this->Configs[config].TargetAliases) { // Don't write ambiguous aliases. if (!ta.second.GeneratorTarget) { @@ -1339,11 +1342,9 @@ void cmGlobalNinjaGenerator::WriteFolderTargets(std::ostream& os) cmGlobalNinjaGenerator::WriteDivider(os); std::string const& currentBinaryDir = it.first; DirectoryTarget const& dt = it.second; - std::vector<std::string> configs; - dt.LG->GetMakefile()->GetConfigurations(configs, true); - if (configs.empty()) { - configs.emplace_back(); - } + std::vector<std::string> configs = + dt.LG->GetMakefile()->GetGeneratorConfigs( + cmMakefile::IncludeEmptyConfig); // Setup target cmNinjaDeps configDeps; @@ -1538,7 +1539,8 @@ void cmGlobalNinjaGenerator::WriteBuiltinTargets(std::ostream& os) this->WriteTargetClean(os); this->WriteTargetHelp(os); - for (auto const& config : this->Makefiles[0]->GetGeneratorConfigs()) { + for (auto const& config : this->Makefiles[0]->GetGeneratorConfigs( + cmMakefile::IncludeEmptyConfig)) { this->WriteTargetDefault(*this->GetConfigFileStream(config)); } @@ -1712,11 +1714,8 @@ bool cmGlobalNinjaGenerator::WriteTargetCleanAdditional(std::ostream& os) std::string cleanScriptRel = "CMakeFiles/clean_additional.cmake"; std::string cleanScriptAbs = cmStrCat(lgr->GetBinaryDirectory(), '/', cleanScriptRel); - std::vector<std::string> configs; - this->Makefiles[0]->GetConfigurations(configs, true); - if (configs.empty()) { - configs.emplace_back(); - } + std::vector<std::string> configs = + this->Makefiles[0]->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); // Check if there are additional files to clean bool empty = true; @@ -1810,7 +1809,8 @@ void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os) WriteRule(*this->RulesFileStream, rule); } - auto const configs = this->Makefiles.front()->GetGeneratorConfigs(); + auto const configs = this->Makefiles.front()->GetGeneratorConfigs( + cmMakefile::IncludeEmptyConfig); // Write build { @@ -2489,7 +2489,8 @@ bool cmGlobalNinjaMultiGenerator::OpenBuildFileStreams() << "# This file contains build statements common to all " "configurations.\n\n"; - for (auto const& config : this->Makefiles[0]->GetGeneratorConfigs()) { + for (auto const& config : this->Makefiles[0]->GetGeneratorConfigs( + cmMakefile::IncludeEmptyConfig)) { // Open impl file. if (!this->OpenFileStream(this->ImplFileStreams[config], GetNinjaImplFilename(config))) { @@ -2529,7 +2530,8 @@ void cmGlobalNinjaMultiGenerator::CloseBuildFileStreams() this->DefaultFileStream.reset(); } // No error if it wasn't open - for (auto const& config : this->Makefiles[0]->GetGeneratorConfigs()) { + for (auto const& config : this->Makefiles[0]->GetGeneratorConfigs( + cmMakefile::IncludeEmptyConfig)) { if (this->ImplFileStreams[config]) { this->ImplFileStreams[config].reset(); } else { @@ -2571,7 +2573,8 @@ std::string cmGlobalNinjaMultiGenerator::GetNinjaConfigFilename( void cmGlobalNinjaMultiGenerator::AddRebuildManifestOutputs( cmNinjaDeps& outputs) const { - for (auto const& config : this->Makefiles.front()->GetGeneratorConfigs()) { + for (auto const& config : this->Makefiles.front()->GetGeneratorConfigs( + cmMakefile::IncludeEmptyConfig)) { outputs.push_back(this->NinjaOutputPath(GetNinjaImplFilename(config))); outputs.push_back(this->NinjaOutputPath(GetNinjaConfigFilename(config))); } @@ -2583,11 +2586,9 @@ void cmGlobalNinjaMultiGenerator::AddRebuildManifestOutputs( void cmGlobalNinjaMultiGenerator::GetQtAutoGenConfigs( std::vector<std::string>& configs) const { - auto const oldSize = configs.size(); - this->Makefiles.front()->GetConfigurations(configs); - if (configs.size() == oldSize) { - configs.emplace_back(); - } + auto allConfigs = + this->Makefiles[0]->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); + configs.insert(configs.end(), cm::cbegin(allConfigs), cm::cend(allConfigs)); } bool cmGlobalNinjaMultiGenerator::InspectConfigTypeVariables() diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 5dac072..3805546 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -138,9 +138,6 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator( "ProductDir", vc10Express, cmSystemTools::KeyWOW64_32); this->CudaEnabled = false; - this->SystemIsWindowsCE = false; - this->SystemIsWindowsPhone = false; - this->SystemIsWindowsStore = false; this->MSBuildCommandInitialized = false; { std::string envPlatformToolset; @@ -511,18 +508,16 @@ bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf) mf->IssueMessage(MessageType::FATAL_ERROR, e.str()); return false; } - std::string v = this->GetInstalledNsightTegraVersion(); - if (v.empty()) { - mf->IssueMessage(MessageType::FATAL_ERROR, - "CMAKE_SYSTEM_NAME is 'Android' but " - "'NVIDIA Nsight Tegra Visual Studio Edition' " - "is not installed."); - return false; + if (mf->GetSafeDefinition("CMAKE_GENERATOR_PLATFORM") == "Tegra-Android") { + if (!this->InitializeTegraAndroid(mf)) { + return false; + } + } else { + this->SystemIsAndroid = true; + if (!this->InitializeAndroid(mf)) { + return false; + } } - this->DefaultPlatformName = "Tegra-Android"; - this->DefaultPlatformToolset = "Default"; - this->NsightTegraVersion = v; - mf->AddDefinition("CMAKE_VS_NsightTegra_VERSION", v); } return true; @@ -564,6 +559,31 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsStore(cmMakefile* mf) return false; } +bool cmGlobalVisualStudio10Generator::InitializeTegraAndroid(cmMakefile* mf) +{ + std::string v = this->GetInstalledNsightTegraVersion(); + if (v.empty()) { + mf->IssueMessage(MessageType::FATAL_ERROR, + "CMAKE_SYSTEM_NAME is 'Android' but " + "'NVIDIA Nsight Tegra Visual Studio Edition' " + "is not installed."); + return false; + } + this->DefaultPlatformName = "Tegra-Android"; + this->DefaultPlatformToolset = "Default"; + this->NsightTegraVersion = v; + mf->AddDefinition("CMAKE_VS_NsightTegra_VERSION", v); + return true; +} + +bool cmGlobalVisualStudio10Generator::InitializeAndroid(cmMakefile* mf) +{ + std::ostringstream e; + e << this->GetName() << " does not support Android."; + mf->IssueMessage(MessageType::FATAL_ERROR, e.str()); + return false; +} + bool cmGlobalVisualStudio10Generator::SelectWindowsPhoneToolset( std::string& toolset) const { @@ -598,6 +618,28 @@ void cmGlobalVisualStudio10Generator::Generate() { this->LongestSource = LongestSourcePath(); this->cmGlobalVisualStudio8Generator::Generate(); + if (!this->AndroidExecutableWarnings.empty() && + !this->CMakeInstance->GetIsInTryCompile()) { + std::ostringstream e; + /* clang-format off */ + e << + "You are using Visual Studio tools for Android, which does not support " + "standalone executables. However, the following executable targets do " + "not have the ANDROID_GUI property set, and thus will not be built as " + "expected. They will be built as shared libraries with executable " + "filenames:\n" + " "; + /* clang-format on */ + bool first = true; + for (auto const& name : this->AndroidExecutableWarnings) { + if (!first) { + e << ", "; + } + first = false; + e << name; + } + this->CMakeInstance->IssueMessage(MessageType::WARNING, e.str()); + } if (this->LongestSource.Length > 0) { cmLocalGenerator* lg = this->LongestSource.Target->GetLocalGenerator(); std::ostringstream e; @@ -664,8 +706,14 @@ std::string const& cmGlobalVisualStudio10Generator::GetPlatformToolsetString() if (!this->GeneratorToolset.empty()) { return this->GeneratorToolset; } - if (!this->DefaultPlatformToolset.empty()) { - return this->DefaultPlatformToolset; + if (this->SystemIsAndroid) { + if (!this->DefaultAndroidToolset.empty()) { + return this->DefaultAndroidToolset; + } + } else { + if (!this->DefaultPlatformToolset.empty()) { + return this->DefaultPlatformToolset; + } } static std::string const empty; return empty; @@ -879,7 +927,10 @@ bool cmGlobalVisualStudio10Generator::FindVCTargetsPath(cmMakefile* mf) epg.Attribute("Label", "Globals"); cmXMLElement(epg, "ProjectGuid") .Content("{F3FC6D86-508D-3FB1-96D2-995F08B142EC}"); - cmXMLElement(epg, "Keyword").Content("Win32Proj"); + cmXMLElement(epg, "Keyword") + .Content(mf->GetSafeDefinition("CMAKE_SYSTEM_NAME") == "Android" + ? "Android" + : "Win32Proj"); cmXMLElement(epg, "Platform").Content(this->GetPlatformName()); if (this->GetSystemName() == "WindowsPhone") { cmXMLElement(epg, "ApplicationType").Content("Windows Phone"); @@ -889,15 +940,21 @@ bool cmGlobalVisualStudio10Generator::FindVCTargetsPath(cmMakefile* mf) cmXMLElement(epg, "ApplicationType").Content("Windows Store"); cmXMLElement(epg, "ApplicationTypeRevision") .Content(this->GetApplicationTypeRevision()); + } else if (this->GetSystemName() == "Android") { + cmXMLElement(epg, "ApplicationType").Content("Android"); + cmXMLElement(epg, "ApplicationTypeRevision") + .Content(this->GetApplicationTypeRevision()); } if (!this->WindowsTargetPlatformVersion.empty()) { cmXMLElement(epg, "WindowsTargetPlatformVersion") .Content(this->WindowsTargetPlatformVersion); } - if (this->GetPlatformName() == "ARM64") { - cmXMLElement(epg, "WindowsSDKDesktopARM64Support").Content("true"); - } else if (this->GetPlatformName() == "ARM") { - cmXMLElement(epg, "WindowsSDKDesktopARMSupport").Content("true"); + if (this->GetSystemName() != "Android") { + if (this->GetPlatformName() == "ARM64") { + cmXMLElement(epg, "WindowsSDKDesktopARM64Support").Content("true"); + } else if (this->GetPlatformName() == "ARM") { + cmXMLElement(epg, "WindowsSDKDesktopARMSupport").Content("true"); + } } } cmXMLElement(eprj, "Import") @@ -1209,6 +1266,10 @@ std::string cmGlobalVisualStudio10Generator::GetInstalledNsightTegraVersion() std::string cmGlobalVisualStudio10Generator::GetApplicationTypeRevision() const { + if (this->GetSystemName() == "Android") { + return this->GetAndroidApplicationTypeRevision(); + } + // Return the first two '.'-separated components of the Windows version. std::string::size_type end1 = this->SystemVersion.find('.'); std::string::size_type end2 = diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index b8c18b4..0c53537 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -4,6 +4,7 @@ #define cmGlobalVisualStudio10Generator_h #include <memory> +#include <set> #include "cmGlobalVisualStudio8Generator.h" #include "cmVisualStudio10ToolsetOptions.h" @@ -43,6 +44,11 @@ public: void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*, bool optional) override; + void AddAndroidExecutableWarning(const std::string& name) + { + this->AndroidExecutableWarnings.insert(name); + } + bool IsCudaEnabled() const { return this->CudaEnabled; } /** Generating for Nsight Tegra VS plugin? */ @@ -100,6 +106,9 @@ public: /** Return true if building for WindowsStore */ bool TargetsWindowsStore() const { return this->SystemIsWindowsStore; } + /** Return true if building for Android */ + bool TargetsAndroid() const { return this->SystemIsAndroid; } + const char* GetCMakeCFGIntDir() const override { return "$(Configuration)"; } bool Find64BitTools(cmMakefile* mf); @@ -128,6 +137,8 @@ public: /** Return the first two components of CMAKE_SYSTEM_VERSION. */ std::string GetApplicationTypeRevision() const; + virtual const char* GetAndroidApplicationTypeRevision() const { return ""; } + cmIDEFlagTable const* GetClFlagTable() const; cmIDEFlagTable const* GetCSharpFlagTable() const; cmIDEFlagTable const* GetRcFlagTable() const; @@ -148,6 +159,8 @@ protected: virtual bool InitializeWindowsCE(cmMakefile* mf); virtual bool InitializeWindowsPhone(cmMakefile* mf); virtual bool InitializeWindowsStore(cmMakefile* mf); + virtual bool InitializeTegraAndroid(cmMakefile* mf); + virtual bool InitializeAndroid(cmMakefile* mf); virtual bool ProcessGeneratorToolsetField(std::string const& key, std::string const& value); @@ -171,6 +184,7 @@ protected: std::string GeneratorToolsetCudaCustomDir; std::string DefaultPlatformToolset; std::string DefaultPlatformToolsetHostArchitecture; + std::string DefaultAndroidToolset; std::string WindowsTargetPlatformVersion; std::string SystemName; std::string SystemVersion; @@ -185,9 +199,10 @@ protected: std::string DefaultNasmFlagTableName; std::string DefaultRCFlagTableName; bool SupportsUnityBuilds = false; - bool SystemIsWindowsCE; - bool SystemIsWindowsPhone; - bool SystemIsWindowsStore; + bool SystemIsWindowsCE = false; + bool SystemIsWindowsPhone = false; + bool SystemIsWindowsStore = false; + bool SystemIsAndroid = false; private: class Factory; @@ -211,6 +226,7 @@ private: std::string MSBuildCommand; bool MSBuildCommandInitialized; cmVisualStudio10ToolsetOptions ToolsetOptions; + std::set<std::string> AndroidExecutableWarnings; virtual std::string FindMSBuildCommand(); std::string FindDevEnvCommand() override; std::string GetVSMakeProgram() override { return this->GetMSBuildCommand(); } diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx index f549b6a..451d448 100644 --- a/Source/cmGlobalVisualStudio14Generator.cxx +++ b/Source/cmGlobalVisualStudio14Generator.cxx @@ -109,6 +109,7 @@ cmGlobalVisualStudio14Generator::cmGlobalVisualStudio14Generator( "ProductDir", vc14Express, cmSystemTools::KeyWOW64_32); this->DefaultPlatformToolset = "v140"; + this->DefaultAndroidToolset = "Clang_3_8"; this->DefaultCLFlagTableName = "v140"; this->DefaultCSharpFlagTableName = "v140"; this->DefaultLibFlagTableName = "v14"; @@ -159,6 +160,11 @@ bool cmGlobalVisualStudio14Generator::InitializeWindowsStore(cmMakefile* mf) return true; } +bool cmGlobalVisualStudio14Generator::InitializeAndroid(cmMakefile*) +{ + return true; +} + bool cmGlobalVisualStudio14Generator::SelectWindows10SDK(cmMakefile* mf, bool required) { diff --git a/Source/cmGlobalVisualStudio14Generator.h b/Source/cmGlobalVisualStudio14Generator.h index ccc2917..39353f2 100644 --- a/Source/cmGlobalVisualStudio14Generator.h +++ b/Source/cmGlobalVisualStudio14Generator.h @@ -23,12 +23,18 @@ public: bool MatchesGeneratorName(const std::string& name) const override; + const char* GetAndroidApplicationTypeRevision() const override + { + return "2.0"; + } + protected: cmGlobalVisualStudio14Generator(cmake* cm, const std::string& name, std::string const& platformInGeneratorName); bool InitializeWindows(cmMakefile* mf) override; bool InitializeWindowsStore(cmMakefile* mf) override; + bool InitializeAndroid(cmMakefile* mf) override; bool SelectWindowsStoreToolset(std::string& toolset) const override; // These aren't virtual because we need to check if the selected version diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 7ada325..0083c40 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -19,8 +19,8 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile( std::ostream& fout, cmLocalGenerator* root, std::vector<cmLocalGenerator*>& generators) { - std::vector<std::string> configs; - root->GetMakefile()->GetConfigurations(configs); + std::vector<std::string> configs = + root->GetMakefile()->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig); // Write out the header for a SLN file this->WriteSLNHeader(fout); diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 428c748..9f798e6 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -568,8 +568,9 @@ void cmGlobalVisualStudio7Generator::WriteSLNFooter(std::ostream& fout) std::string cmGlobalVisualStudio7Generator::WriteUtilityDepend( cmGeneratorTarget const* target) { - std::vector<std::string> configs; - target->Target->GetMakefile()->GetConfigurations(configs); + std::vector<std::string> configs = + target->Target->GetMakefile()->GetGeneratorConfigs( + cmMakefile::ExcludeEmptyConfig); std::string pname = cmStrCat(target->GetName(), "_UTILITY"); std::string fname = cmStrCat(target->GetLocalGenerator()->GetCurrentBinaryDirectory(), '/', diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx index 605dc8b..e2e045c 100644 --- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx +++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx @@ -100,6 +100,24 @@ static const char* VSVersionToToolset( return ""; } +static const char* VSVersionToAndroidToolset( + cmGlobalVisualStudioGenerator::VSVersion v) +{ + switch (v) { + case cmGlobalVisualStudioGenerator::VS9: + case cmGlobalVisualStudioGenerator::VS10: + case cmGlobalVisualStudioGenerator::VS11: + case cmGlobalVisualStudioGenerator::VS12: + return ""; + case cmGlobalVisualStudioGenerator::VS14: + return "Clang_3_8"; + case cmGlobalVisualStudioGenerator::VS15: + case cmGlobalVisualStudioGenerator::VS16: + return "Clang_5_0"; + } + return ""; +} + static const char vs15generatorName[] = "Visual Studio 15 2017"; // Map generator name without year to name with year. @@ -284,6 +302,7 @@ cmGlobalVisualStudioVersionedGenerator::cmGlobalVisualStudioVersionedGenerator( this->Version = version; this->ExpressEdition = false; this->DefaultPlatformToolset = VSVersionToToolset(this->Version); + this->DefaultAndroidToolset = VSVersionToAndroidToolset(this->Version); this->DefaultCLFlagTableName = VSVersionToToolset(this->Version); this->DefaultCSharpFlagTableName = VSVersionToToolset(this->Version); this->DefaultLinkFlagTableName = VSVersionToToolset(this->Version); @@ -408,6 +427,25 @@ bool cmGlobalVisualStudioVersionedGenerator::IsStdOutEncodingSupported() const vsInstanceVersion > vsInstanceVersion16_7_P2); } +const char* +cmGlobalVisualStudioVersionedGenerator::GetAndroidApplicationTypeRevision() + const +{ + switch (this->Version) { + case cmGlobalVisualStudioGenerator::VS9: + case cmGlobalVisualStudioGenerator::VS10: + case cmGlobalVisualStudioGenerator::VS11: + case cmGlobalVisualStudioGenerator::VS12: + return ""; + case cmGlobalVisualStudioGenerator::VS14: + return "2.0"; + case cmGlobalVisualStudioGenerator::VS15: + case cmGlobalVisualStudioGenerator::VS16: + return "3.0"; + } + return ""; +} + std::string cmGlobalVisualStudioVersionedGenerator::GetAuxiliaryToolset() const { const char* version = this->GetPlatformToolsetVersion(); diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.h b/Source/cmGlobalVisualStudioVersionedGenerator.h index cbd3ba7..d5b8337 100644 --- a/Source/cmGlobalVisualStudioVersionedGenerator.h +++ b/Source/cmGlobalVisualStudioVersionedGenerator.h @@ -36,6 +36,8 @@ public: bool IsStdOutEncodingSupported() const override; + const char* GetAndroidApplicationTypeRevision() const override; + protected: cmGlobalVisualStudioVersionedGenerator( VSVersion version, cmake* cm, const std::string& name, diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index a5ce5d1..656a346 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -468,6 +468,9 @@ void cmGlobalXCodeGenerator::Generate() } } + // cache the enabled languages for source file type queries + this->GetEnabledLanguages(this->EnabledLangs); + this->SetGenerationRoot(root); // now create the project this->OutputXCodeProject(root, keyVal.second); @@ -819,6 +822,14 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile( default: break; } + + // explicitly add the explicit language flag before any other flag + // this way backwards compatibility with user flags is maintained + if (sf->GetProperty("LANGUAGE")) { + this->CurrentLocalGenerator->AppendFeatureOptions(flags, lang, + "EXPLICIT_LANGUAGE"); + } + const std::string COMPILE_FLAGS("COMPILE_FLAGS"); if (cmProp cflags = sf->GetProperty(COMPILE_FLAGS)) { lg->AppendFlags(flags, genexInterpreter.Evaluate(*cflags, COMPILE_FLAGS)); @@ -914,9 +925,9 @@ void cmGlobalXCodeGenerator::AddXCodeProjBuildRule( } } -std::string GetSourcecodeValueFromFileExtension(const std::string& _ext, - const std::string& lang, - bool& keepLastKnownFileType) +std::string GetSourcecodeValueFromFileExtension( + const std::string& _ext, const std::string& lang, + bool& keepLastKnownFileType, const std::vector<std::string>& enabled_langs) { std::string ext = cmSystemTools::LowerCase(_ext); std::string sourcecode = "sourcecode"; @@ -931,9 +942,9 @@ std::string GetSourcecodeValueFromFileExtension(const std::string& _ext, } else if (ext == "storyboard") { keepLastKnownFileType = true; sourcecode = "file.storyboard"; - } else if (ext == "mm") { + } else if (ext == "mm" && !cm::contains(enabled_langs, "OBJCXX")) { sourcecode += ".cpp.objcpp"; - } else if (ext == "m") { + } else if (ext == "m" && !cm::contains(enabled_langs, "OBJC")) { sourcecode += ".c.objc"; } else if (ext == "swift") { sourcecode += ".swift"; @@ -1020,8 +1031,8 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath( fileType = (ext == "xcassets" ? "folder.assetcatalog" : "folder"); useLastKnownFileType = true; } else { - fileType = - GetSourcecodeValueFromFileExtension(ext, lang, useLastKnownFileType); + fileType = GetSourcecodeValueFromFileExtension( + ext, lang, useLastKnownFileType, this->EnabledLangs); } } @@ -1069,11 +1080,8 @@ void cmGlobalXCodeGenerator::SetCurrentLocalGenerator(cmLocalGenerator* gen) this->CurrentMakefile = gen->GetMakefile(); // Select the current set of configuration types. - this->CurrentConfigurationTypes.clear(); - this->CurrentMakefile->GetConfigurations(this->CurrentConfigurationTypes); - if (this->CurrentConfigurationTypes.empty()) { - this->CurrentConfigurationTypes.emplace_back(); - } + this->CurrentConfigurationTypes = + this->CurrentMakefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); } struct cmSourceFilePathCompare @@ -1144,23 +1152,24 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget( } // organize the sources - std::vector<cmSourceFile*> classes; - if (!gtgt->GetConfigCommonSourceFiles(classes)) { + std::vector<cmSourceFile*> commonSourceFiles; + if (!gtgt->GetConfigCommonSourceFiles(commonSourceFiles)) { return false; } // Add CMakeLists.txt file for user convenience. - this->AddXCodeProjBuildRule(gtgt, classes); + this->AddXCodeProjBuildRule(gtgt, commonSourceFiles); // Add the Info.plist we are about to generate for an App Bundle. if (gtgt->GetPropertyAsBool("MACOSX_BUNDLE")) { std::string plist = this->ComputeInfoPListLocation(gtgt); cmSourceFile* sf = gtgt->Makefile->GetOrCreateSource( plist, true, cmSourceFileLocationKind::Known); - classes.push_back(sf); + commonSourceFiles.push_back(sf); } - std::sort(classes.begin(), classes.end(), cmSourceFilePathCompare()); + std::sort(commonSourceFiles.begin(), commonSourceFiles.end(), + cmSourceFilePathCompare()); gtgt->ComputeObjectMapping(); @@ -1168,7 +1177,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget( std::vector<cmXCodeObject*> headerFiles; std::vector<cmXCodeObject*> resourceFiles; std::vector<cmXCodeObject*> sourceFiles; - for (auto sourceFile : classes) { + for (auto sourceFile : commonSourceFiles) { cmXCodeObject* xsf = this->CreateXCodeSourceFile( this->CurrentLocalGenerator, sourceFile, gtgt); cmXCodeObject* fr = xsf->GetObject("fileRef"); @@ -1267,7 +1276,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget( using mapOfVectorOfSourceFiles = std::map<std::string, std::vector<cmSourceFile*>>; mapOfVectorOfSourceFiles bundleFiles; - for (auto sourceFile : classes) { + for (auto sourceFile : commonSourceFiles) { cmGeneratorTarget::SourceFileFlags tsFlags = gtgt->GetTargetSourceFileFlags(sourceFile); if (tsFlags.Type == cmGeneratorTarget::SourceFileTypeMacContent) { @@ -1315,7 +1324,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget( using mapOfVectorOfSourceFiles = std::map<std::string, std::vector<cmSourceFile*>>; mapOfVectorOfSourceFiles bundleFiles; - for (auto sourceFile : classes) { + for (auto sourceFile : commonSourceFiles) { cmGeneratorTarget::SourceFileFlags tsFlags = gtgt->GetTargetSourceFileFlags(sourceFile); if (tsFlags.Type == cmGeneratorTarget::SourceFileTypeDeepResource) { @@ -1345,22 +1354,20 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget( } } - // create framework build phase + // always create framework build phase cmXCodeObject* frameworkBuildPhase = nullptr; - if (!externalObjFiles.empty()) { - frameworkBuildPhase = - this->CreateObject(cmXCodeObject::PBXFrameworksBuildPhase); - frameworkBuildPhase->SetComment("Frameworks"); - frameworkBuildPhase->AddAttribute("buildActionMask", - this->CreateString("2147483647")); - buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST); - frameworkBuildPhase->AddAttribute("files", buildFiles); - for (auto& externalObjFile : externalObjFiles) { - buildFiles->AddObject(externalObjFile); - } - frameworkBuildPhase->AddAttribute("runOnlyForDeploymentPostprocessing", - this->CreateString("0")); - } + frameworkBuildPhase = + this->CreateObject(cmXCodeObject::PBXFrameworksBuildPhase); + frameworkBuildPhase->SetComment("Frameworks"); + frameworkBuildPhase->AddAttribute("buildActionMask", + this->CreateString("2147483647")); + buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST); + frameworkBuildPhase->AddAttribute("files", buildFiles); + for (auto& externalObjFile : externalObjFiles) { + buildFiles->AddObject(externalObjFile); + } + frameworkBuildPhase->AddAttribute("runOnlyForDeploymentPostprocessing", + this->CreateString("0")); // create list of build phases and create the Xcode target cmXCodeObject* buildPhases = this->CreateObject(cmXCodeObject::OBJECT_LIST); @@ -2760,6 +2767,156 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) } } + // Separate libraries into ones that can be linked using "Link Binary With + // Libraries" build phase and the ones that can't. Only targets that build + // Apple bundles (.app, .framework, .bundle) can use this feature and only + // targets that represent actual libraries (static or dynamic, local or + // imported) not objects and not executables will be used. These are + // limitations imposed by CMake use-cases - otherwise a lot of things break. + // The rest will be linked using linker flags (OTHER_LDFLAGS setting in Xcode + // project). + std::map<std::string, std::vector<cmComputeLinkInformation::Item const*>> + configItemMap; + auto addToLinkerArguments = + [&configItemMap](const std::string& configName, + cmComputeLinkInformation::Item const* libItemPtr) { + auto& linkVector = configItemMap[configName]; + if (std::find_if(linkVector.begin(), linkVector.end(), + [libItemPtr](cmComputeLinkInformation::Item const* p) { + return p == libItemPtr; + }) == linkVector.end()) { + linkVector.push_back(libItemPtr); + } + }; + std::vector<cmComputeLinkInformation::Item const*> linkPhaseTargetVector; + std::map<std::string, std::vector<std::string>> targetConfigMap; + using ConfigItemPair = + std::pair<std::string, cmComputeLinkInformation::Item const*>; + std::map<std::string, std::vector<ConfigItemPair>> targetItemMap; + std::map<std::string, std::vector<std::string>> targetProductNameMap; + for (auto const& configName : this->CurrentConfigurationTypes) { + cmComputeLinkInformation* cli = gt->GetLinkInformation(configName); + if (!cli) { + continue; + } + for (auto const& libItem : cli->GetItems()) { + // TODO: Drop this check once we have option to add outside libraries to + // Xcode project + auto* libTarget = FindXCodeTarget(libItem.Target); + if (gt->IsBundleOnApple() && + (gt->GetType() == cmStateEnums::EXECUTABLE || + gt->GetType() == cmStateEnums::SHARED_LIBRARY || + gt->GetType() == cmStateEnums::MODULE_LIBRARY || + gt->GetType() == cmStateEnums::UNKNOWN_LIBRARY) && + (libTarget && libItem.Target && + (libItem.Target->GetType() == cmStateEnums::STATIC_LIBRARY || + libItem.Target->GetType() == cmStateEnums::SHARED_LIBRARY || + libItem.Target->GetType() == cmStateEnums::MODULE_LIBRARY))) { + // Add unique configuration name to target-config map for later + // checks + std::string libName = libItem.Target->GetName(); + auto& configVector = targetConfigMap[libName]; + if (std::find(configVector.begin(), configVector.end(), configName) == + configVector.end()) { + configVector.push_back(configName); + } + // Add a pair of config and item to target-item map + auto& itemVector = targetItemMap[libName]; + itemVector.emplace_back(ConfigItemPair(configName, &libItem)); + // Add product file-name to a lib-product map + auto productName = cmSystemTools::GetFilenameName(libItem.Value.Value); + auto& productVector = targetProductNameMap[libName]; + if (std::find(productVector.begin(), productVector.end(), + productName) == productVector.end()) { + productVector.push_back(productName); + } + } else { + // Add this library item to a regular linker flag list + addToLinkerArguments(configName, &libItem); + } + } + } + + // Go through target library map and separate libraries that are linked + // in all configurations and produce only single product, from the rest. + // Only these will be linked through "Link Binary With Libraries" build + // phase. + for (auto const& targetLibConfigs : targetConfigMap) { + // Add this library to "Link Binary With Libraries" build phase if it's + // linked in all configurations and it has only one product name + auto& itemVector = targetItemMap[targetLibConfigs.first]; + auto& productVector = targetProductNameMap[targetLibConfigs.first]; + if (targetLibConfigs.second == this->CurrentConfigurationTypes && + productVector.size() == 1) { + // Add this library to "Link Binary With Libraries" list + linkPhaseTargetVector.push_back(itemVector[0].second); + } else { + for (auto const& libItem : targetItemMap[targetLibConfigs.first]) { + // Add this library item to a regular linker flag list + addToLinkerArguments(libItem.first, libItem.second); + } + } + } + + // Add libraries to "Link Binary With Libraries" build phase and collect + // their search paths. Xcode does not support per-configuration linking + // in this build phase so we don't have to do this for each configuration + // separately. + std::vector<std::string> linkSearchPaths; + for (auto const& libItem : linkPhaseTargetVector) { + // Add target output directory as a library search path + std::string linkDir = cmSystemTools::GetParentDirectory( + libItem->Target->GetLocationForBuild()); + if (std::find(linkSearchPaths.begin(), linkSearchPaths.end(), linkDir) == + linkSearchPaths.end()) { + linkSearchPaths.push_back(linkDir); + } + // Add target dependency + auto const& libName = *libItem; + if (!libName.Target->IsImported()) { + for (auto const& configName : this->CurrentConfigurationTypes) { + target->AddDependTarget(configName, libName.Target->GetName()); + } + } + // Get the library target + auto* libTarget = FindXCodeTarget(libItem->Target); + if (!libTarget) { + continue; + } + // Add the target output file as a build reference for other targets + // to link against + auto* fileRefObject = libTarget->GetObject("productReference"); + if (!fileRefObject) { + continue; + } + cmXCodeObject* buildFile; + auto it = FileRefToBuildFileMap.find(fileRefObject); + if (it == FileRefToBuildFileMap.end()) { + buildFile = this->CreateObject(cmXCodeObject::PBXBuildFile); + buildFile->AddAttribute("fileRef", fileRefObject); + FileRefToBuildFileMap[fileRefObject] = buildFile; + } else { + buildFile = it->second; + } + // Add this reference to current target + auto* buildPhases = target->GetObject("buildPhases"); + if (!buildPhases) { + continue; + } + auto* frameworkBuildPhase = + buildPhases->GetObject(cmXCodeObject::PBXFrameworksBuildPhase); + if (!frameworkBuildPhase) { + continue; + } + auto* buildFiles = frameworkBuildPhase->GetObject("files"); + if (!buildFiles) { + continue; + } + if (!buildFiles->HasObject(buildFile)) { + buildFiles->AddObject(buildFile); + } + } + // Loop over configuration types and set per-configuration info. for (auto const& configName : this->CurrentConfigurationTypes) { { @@ -2787,21 +2944,20 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) } // Compute the link library and directory information. - cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName); - if (!pcli) { + cmComputeLinkInformation* cli = gt->GetLinkInformation(configName); + if (!cli) { continue; } - cmComputeLinkInformation& cli = *pcli; // Add dependencies directly on library files. - for (auto const& libDep : cli.GetDepends()) { + for (auto const& libDep : cli->GetDepends()) { target->AddDependLibrary(configName, libDep); } // add the library search paths { std::string linkDirs; - for (auto const& libDir : cli.GetDirectories()) { + for (auto const& libDir : cli->GetDirectories()) { if (!libDir.empty() && libDir != "/usr/lib") { // Now add the same one but append // $(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) to it: @@ -2812,15 +2968,22 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) linkDirs += this->XCodeEscapePath(libDir); } } + // Add previously collected paths where to look for libraries + // that were added to "Link Binary With Libraries" + for (auto& linkDir : linkSearchPaths) { + linkDirs += " "; + linkDirs += this->XCodeEscapePath(linkDir); + } this->AppendBuildSettingAttribute(target, "LIBRARY_SEARCH_PATHS", linkDirs.c_str(), configName); } - // now add the link libraries + // now add the left-over link libraries { std::string linkLibs; const char* sep = ""; - for (auto const& libName : cli.GetItems()) { + for (auto const& libItem : configItemMap[configName]) { + auto const& libName = *libItem; linkLibs += sep; sep = " "; if (libName.IsPath) { diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index e380f1c..11b9312 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -28,7 +28,7 @@ struct cmDocumentationEntry; /** \class cmGlobalXCodeGenerator * \brief Write a Unix makefiles. * - * cmGlobalXCodeGenerator manages UNIX build process for a tree + * cmGlobalXCodeGenerator manages Xcode build process for a tree */ class cmGlobalXCodeGenerator : public cmGlobalGenerator { @@ -295,11 +295,13 @@ private: std::map<std::string, cmXCodeObject*> TargetGroup; std::map<std::string, cmXCodeObject*> FileRefs; std::map<cmGeneratorTarget const*, cmXCodeObject*> XCodeObjectMap; + std::map<cmXCodeObject*, cmXCodeObject*> FileRefToBuildFileMap; std::vector<std::string> Architectures; std::string ObjectDirArchDefault; std::string ObjectDirArch; std::string GeneratorToolset; std::map<cmGeneratorTarget const*, size_t> TargetOrderIndex; + std::vector<std::string> EnabledLangs; }; #endif diff --git a/Source/cmJsonObjects.cxx b/Source/cmJsonObjects.cxx index 9f17f15..3a2e3be 100644 --- a/Source/cmJsonObjects.cxx +++ b/Source/cmJsonObjects.cxx @@ -51,11 +51,7 @@ std::vector<std::string> getConfigurations(const cmake* cm) return configurations; } - makefiles[0]->GetConfigurations(configurations); - if (configurations.empty()) { - configurations.emplace_back(); - } - return configurations; + return makefiles[0]->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); } bool hasString(const Json::Value& v, const std::string& s) diff --git a/Source/cmLinkItemGraphVisitor.cxx b/Source/cmLinkItemGraphVisitor.cxx index acc23c8..dfdd3ff 100644 --- a/Source/cmLinkItemGraphVisitor.cxx +++ b/Source/cmLinkItemGraphVisitor.cxx @@ -24,15 +24,12 @@ void cmLinkItemGraphVisitor::VisitItem(cmLinkItem const& item) void cmLinkItemGraphVisitor::VisitLinks(cmLinkItem const& item, cmLinkItem const& rootItem) { - if (this->LinkVisited(item, rootItem)) { - return; - } - if (item.Target == nullptr) { return; } - for (auto const& config : item.Target->Makefile->GetGeneratorConfigs()) { + for (auto const& config : item.Target->Makefile->GetGeneratorConfigs( + cmMakefile::IncludeEmptyConfig)) { this->VisitLinks(item, rootItem, config); } } diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h index 89902ff..0b4414d 100644 --- a/Source/cmListFileCache.h +++ b/Source/cmListFileCache.h @@ -175,6 +175,32 @@ public: std::ostream& operator<<(std::ostream& os, BT<std::string> const& s); +// Wrap type T as a value with potentially multiple backtraces. For purposes +// of ordering and equality comparison, only the original value is used. The +// backtrace is considered incidental. +template <typename T> +class BTs +{ +public: + BTs(T v = T(), cmListFileBacktrace bt = cmListFileBacktrace()) + : Value(std::move(v)) + { + Backtraces.emplace_back(std::move(bt)); + } + T Value; + std::vector<cmListFileBacktrace> Backtraces; + friend bool operator==(BTs<T> const& l, BTs<T> const& r) + { + return l.Value == r.Value; + } + friend bool operator<(BTs<T> const& l, BTs<T> const& r) + { + return l.Value < r.Value; + } + friend bool operator==(BTs<T> const& l, T const& r) { return l.Value == r; } + friend bool operator==(T const& l, BTs<T> const& r) { return l == r.Value; } +}; + std::vector<BT<std::string>> ExpandListWithBacktrace( std::string const& list, cmListFileBacktrace const& bt = cmListFileBacktrace()); diff --git a/Source/cmLocalCommonGenerator.cxx b/Source/cmLocalCommonGenerator.cxx index 278ec8b..44db842 100644 --- a/Source/cmLocalCommonGenerator.cxx +++ b/Source/cmLocalCommonGenerator.cxx @@ -17,10 +17,8 @@ cmLocalCommonGenerator::cmLocalCommonGenerator(cmGlobalGenerator* gg, : cmLocalGenerator(gg, mf) , WorkingDirectory(std::move(wd)) { - this->Makefile->GetConfigurations(this->ConfigNames); - if (this->ConfigNames.empty()) { - this->ConfigNames.emplace_back(); - } + this->ConfigNames = + this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); } cmLocalCommonGenerator::~cmLocalCommonGenerator() = default; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 3b3f110..489065b 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -39,6 +39,7 @@ #include "cmSourceFile.h" #include "cmSourceFileLocation.h" #include "cmSourceFileLocationKind.h" +#include "cmStandardLevelResolver.h" #include "cmState.h" #include "cmStateDirectory.h" #include "cmStateTypes.h" @@ -297,9 +298,9 @@ void cmLocalGenerator::GenerateTestFiles() } // Compute the set of configurations. - std::vector<std::string> configurationTypes; - const std::string& config = - this->Makefile->GetConfigurations(configurationTypes, false); + std::vector<std::string> configurationTypes = + this->Makefile->GetGeneratorConfigs(cmMakefile::OnlyMultiConfig); + std::string config = this->Makefile->GetDefaultConfiguration(); std::string file = cmStrCat(this->StateSnapshot.GetDirectory().GetCurrentBinary(), @@ -379,7 +380,7 @@ void cmLocalGenerator::GenerateTestFiles() void cmLocalGenerator::CreateEvaluationFileOutputs() { std::vector<std::string> const& configs = - this->Makefile->GetGeneratorConfigs(); + this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); for (std::string const& c : configs) { this->CreateEvaluationFileOutputs(c); } @@ -462,9 +463,9 @@ void cmLocalGenerator::GenerateInstallRules() } // Compute the set of configurations. - std::vector<std::string> configurationTypes; - const std::string& config = - this->Makefile->GetConfigurations(configurationTypes, false); + std::vector<std::string> configurationTypes = + this->Makefile->GetGeneratorConfigs(cmMakefile::OnlyMultiConfig); + std::string config = this->Makefile->GetDefaultConfiguration(); // Choose a default install configuration. std::string default_config = config; @@ -753,11 +754,8 @@ cmGeneratorTarget* cmLocalGenerator::FindLocalNonAliasGeneratorTarget( void cmLocalGenerator::ComputeTargetManifest() { // Collect the set of configuration types. - std::vector<std::string> configNames; - this->Makefile->GetConfigurations(configNames); - if (configNames.empty()) { - configNames.emplace_back(); - } + std::vector<std::string> configNames = + this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); // Add our targets to the manifest for each configuration. const auto& targets = this->GetGeneratorTargets(); @@ -774,11 +772,8 @@ void cmLocalGenerator::ComputeTargetManifest() bool cmLocalGenerator::ComputeTargetCompileFeatures() { // Collect the set of configuration types. - std::vector<std::string> configNames; - this->Makefile->GetConfigurations(configNames); - if (configNames.empty()) { - configNames.emplace_back(); - } + std::vector<std::string> configNames = + this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); using LanguagePair = std::pair<std::string, std::string>; std::vector<LanguagePair> pairedLanguages{ { "OBJC", "C" }, @@ -803,39 +798,8 @@ bool cmLocalGenerator::ComputeTargetCompileFeatures() // Now that C/C++ _STANDARD values have been computed // set the values to ObjC/ObjCXX _STANDARD variables if (target->GetType() != cmStateEnums::INTERFACE_LIBRARY) { - auto copyStandardToObjLang = [&](LanguagePair const& lang) -> bool { - if (!target->GetProperty(cmStrCat(lang.first, "_STANDARD"))) { - cmProp standard = - target->GetProperty(cmStrCat(lang.second, "_STANDARD")); - if (!standard) { - standard = this->Makefile->GetDef( - cmStrCat("CMAKE_", lang.second, "_STANDARD_DEFAULT")); - } - target->Target->SetProperty(cmStrCat(lang.first, "_STANDARD"), - standard ? standard->c_str() : nullptr); - return true; - } - return false; - }; - auto copyPropertyToObjLang = [&](LanguagePair const& lang, - const char* property) { - if (!target->GetProperty(cmStrCat(lang.first, property)) && - target->GetProperty(cmStrCat(lang.second, property))) { - cmProp p = target->GetProperty(cmStrCat(lang.second, property)); - target->Target->SetProperty(cmStrCat(lang.first, property), - p ? p->c_str() : nullptr); - } - }; - for (auto const& lang : pairedLanguages) { - if (copyStandardToObjLang(lang)) { - copyPropertyToObjLang(lang, "_STANDARD_REQUIRED"); - copyPropertyToObjLang(lang, "_EXTENSIONS"); - } - } - if (cmProp standard = target->GetProperty("CUDA_STANDARD")) { - if (*standard == "98") { - target->Target->SetProperty("CUDA_STANDARD", "03"); - } + for (std::string const& c : configNames) { + target->ComputeCompileFeatures(c, inferredEnabledLanguages); } } } @@ -1025,12 +989,13 @@ void cmLocalGenerator::AddCompileOptions(std::vector<BT<std::string>>& flags, this->AppendCompileOptions(flags, targetCompileOpts); } + cmStandardLevelResolver standardResolver(this->Makefile); for (auto const& it : target->GetMaxLanguageStandards()) { - cmProp standard = target->GetProperty(it.first + "_STANDARD"); + cmProp standard = target->GetLanguageStandard(it.first, config); if (!standard) { continue; } - if (this->Makefile->IsLaterStandard(it.first, *standard, it.second)) { + if (standardResolver.IsLaterStandard(it.first, *standard, it.second)) { std::ostringstream e; e << "The COMPILE_FEATURES property of target \"" << target->GetName() << "\" was evaluated when computing the link " @@ -1050,7 +1015,7 @@ void cmLocalGenerator::AddCompileOptions(std::vector<BT<std::string>>& flags, } std::string compReqFlag; - this->AddCompilerRequirementFlag(compReqFlag, target, lang); + this->AddCompilerRequirementFlag(compReqFlag, target, lang, config); if (!compReqFlag.empty()) { flags.emplace_back(std::move(compReqFlag)); } @@ -2046,7 +2011,7 @@ void cmLocalGenerator::AddLanguageFlagsForLinking( // when linking in order to use the matching standard library. // FIXME: If CMake gains an abstraction for standard library // selection, this will have to be reconciled with it. - this->AddCompilerRequirementFlag(flags, target, lang); + this->AddCompilerRequirementFlag(flags, target, lang, config); } this->AddLanguageFlags(flags, target, lang, config); @@ -2189,7 +2154,8 @@ void cmLocalGenerator::AddSharedFlags(std::string& flags, } void cmLocalGenerator::AddCompilerRequirementFlag( - std::string& flags, cmGeneratorTarget const* target, const std::string& lang) + std::string& flags, cmGeneratorTarget const* target, const std::string& lang, + const std::string& config) { if (lang.empty()) { return; @@ -2200,15 +2166,13 @@ void cmLocalGenerator::AddCompilerRequirementFlag( // This compiler has no notion of language standard levels. return; } - std::string extProp = lang + "_EXTENSIONS"; bool ext = true; - if (cmProp extPropValue = target->GetProperty(extProp)) { + if (cmProp extPropValue = target->GetLanguageExtensions(lang)) { if (cmIsOff(*extPropValue)) { ext = false; } } - std::string stdProp = lang + "_STANDARD"; - cmProp standardProp = target->GetProperty(stdProp); + cmProp standardProp = target->GetLanguageStandard(lang, config); if (!standardProp) { if (ext) { // No language standard is specified and extensions are not disabled. @@ -2228,7 +2192,7 @@ void cmLocalGenerator::AddCompilerRequirementFlag( std::string const type = ext ? "EXTENSION" : "STANDARD"; - if (target->GetPropertyAsBool(lang + "_STANDARD_REQUIRED")) { + if (target->GetLanguageStandardRequired(lang)) { std::string option_flag = "CMAKE_" + lang + *standardProp + "_" + type + "_COMPILE_OPTION"; @@ -2583,11 +2547,8 @@ void cmLocalGenerator::AppendFlagEscape(std::string& flags, void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target) { - std::vector<std::string> configsList; - std::string configDefault = this->Makefile->GetConfigurations(configsList); - if (configsList.empty()) { - configsList.push_back(configDefault); - } + std::vector<std::string> configsList = + this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); for (std::string const& config : configsList) { // FIXME: Refactor collection of sources to not evaluate object @@ -3877,7 +3838,7 @@ void cmLocalGenerator::GenerateAppleInfoPList(cmGeneratorTarget* target, cmLGInfoProp(mf, target, "MACOSX_BUNDLE_SHORT_VERSION_STRING"); cmLGInfoProp(mf, target, "MACOSX_BUNDLE_BUNDLE_VERSION"); cmLGInfoProp(mf, target, "MACOSX_BUNDLE_COPYRIGHT"); - mf->ConfigureFile(inFile, fname, false, false, false); + mf->ConfigureFile(inFile, fname, false, false, false, true); } void cmLocalGenerator::GenerateFrameworkInfoPList( @@ -3913,7 +3874,7 @@ void cmLocalGenerator::GenerateFrameworkInfoPList( cmLGInfoProp(mf, target, "MACOSX_FRAMEWORK_IDENTIFIER"); cmLGInfoProp(mf, target, "MACOSX_FRAMEWORK_SHORT_VERSION_STRING"); cmLGInfoProp(mf, target, "MACOSX_FRAMEWORK_BUNDLE_VERSION"); - mf->ConfigureFile(inFile, fname, false, false, false); + mf->ConfigureFile(inFile, fname, false, false, false, true); } namespace { diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index f2d9145..f4781d6 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -123,7 +123,8 @@ public: const std::string& config); void AddCompilerRequirementFlag(std::string& flags, cmGeneratorTarget const* target, - const std::string& lang); + const std::string& lang, + const std::string& config); //! Append flags to a string. virtual void AppendFlags(std::string& flags, const std::string& newFlags) const; diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 5d50e2d..ad61ad3 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1331,8 +1331,8 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout, const std::string& libName, cmGeneratorTarget* target) { - std::vector<std::string> configs; - this->Makefile->GetConfigurations(configs); + std::vector<std::string> configs = + this->Makefile->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig); // We may be modifying the source groups temporarily, so make a copy. std::vector<cmSourceGroup> sourceGroups = this->Makefile->GetSourceGroups(); @@ -1580,8 +1580,9 @@ cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo( std::string cmLocalVisualStudio7Generator::ComputeLongestObjectDirectory( cmGeneratorTarget const* target) const { - std::vector<std::string> configs; - target->Target->GetMakefile()->GetConfigurations(configs); + std::vector<std::string> configs = + target->Target->GetMakefile()->GetGeneratorConfigs( + cmMakefile::ExcludeEmptyConfig); // Compute the maximum length configuration name. std::string config_max; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index c78b751..75c8934 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -34,6 +34,7 @@ #include "cmExecutionStatus.h" #include "cmExpandedCommandArgument.h" // IWYU pragma: keep #include "cmExportBuildFileGenerator.h" +#include "cmFSPermissions.h" #include "cmFileLockPool.h" #include "cmFunctionBlocker.h" #include "cmGeneratedFileStream.h" @@ -68,6 +69,8 @@ class cmMessenger; +using namespace cmFSPermissions; + cmDirectoryId::cmDirectoryId(std::string s) : String(std::move(s)) { @@ -82,7 +85,6 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator, { this->IsSourceFileTryCompile = false; - this->WarnUnused = this->GetCMakeInstance()->GetWarnUnused(); this->CheckSystemVars = this->GetCMakeInstance()->GetCheckSystemVars(); this->SuppressSideEffects = false; @@ -750,7 +752,6 @@ void cmMakefile::ReadListFile(cmListFile const& listFile, break; } } - this->CheckForUnusedVariables(); this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile); this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile); @@ -1434,8 +1435,8 @@ void cmMakefile::InitializeFromParent(cmMakefile* parent) if (polSt == cmPolicies::WARN || polSt == cmPolicies::OLD) { cmProp p = parent->GetProperty("COMPILE_DEFINITIONS"); this->SetProperty("COMPILE_DEFINITIONS", p ? p->c_str() : nullptr); - std::vector<std::string> configs; - this->GetConfigurations(configs); + std::vector<std::string> configs = + this->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig); for (std::string const& config : configs) { std::string defPropName = cmStrCat("COMPILE_DEFINITIONS_", cmSystemTools::UpperCase(config)); @@ -1461,6 +1462,9 @@ void cmMakefile::InitializeFromParent(cmMakefile* parent) // Imported targets. this->ImportedTargets = parent->ImportedTargets; + // Non-global Alias targets. + this->AliasTargets = parent->AliasTargets; + // Recursion depth. this->RecursionDepth = parent->RecursionDepth; } @@ -1510,8 +1514,6 @@ void cmMakefile::PopFunctionScope(bool reportError) #endif this->PopLoopBlockBarrier(); - - this->CheckForUnusedVariables(); } void cmMakefile::PushMacroScope(std::string const& fileName, @@ -1658,7 +1660,8 @@ void cmMakefile::Configure() this->SetCheckCMP0000(true); // Implicitly set the version for the user. - this->SetPolicyVersion("2.4", std::string()); + cmPolicies::ApplyPolicyVersion(this, 2, 4, 0, + cmPolicies::WarnCompat::Off); } } bool hasProject = false; @@ -1857,9 +1860,6 @@ void cmMakefile::AddSystemIncludeDirectories(const std::set<std::string>& incs) void cmMakefile::AddDefinition(const std::string& name, cm::string_view value) { - if (this->VariableInitialized(name)) { - this->LogUnused("changing definition", name); - } this->StateSnapshot.SetDefinition(name, value); #ifndef CMAKE_BOOTSTRAP @@ -1920,16 +1920,6 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, this->StateSnapshot.RemoveDefinition(name); } -void cmMakefile::CheckForUnusedVariables() const -{ - if (!this->WarnUnused) { - return; - } - for (const std::string& key : this->StateSnapshot.UnusedKeys()) { - this->LogUnused("out of scope", key); - } -} - void cmMakefile::MarkVariableAsUsed(const std::string& var) { this->StateSnapshot.GetDefinition(var); @@ -1957,29 +1947,8 @@ void cmMakefile::MaybeWarnUninitialized(std::string const& variable, } } -void cmMakefile::LogUnused(const char* reason, const std::string& name) const -{ - if (this->WarnUnused) { - std::string path; - if (!this->ExecutionStatusStack.empty()) { - path = this->GetExecutionContext().FilePath; - } else { - path = cmStrCat(this->GetCurrentSourceDirectory(), "/CMakeLists.txt"); - } - - if (this->CheckSystemVars || this->IsProjectFile(path.c_str())) { - std::ostringstream msg; - msg << "unused variable (" << reason << ") \'" << name << "\'"; - this->IssueMessage(MessageType::AUTHOR_WARNING, msg.str()); - } - } -} - void cmMakefile::RemoveDefinition(const std::string& name) { - if (this->VariableInitialized(name)) { - this->LogUnused("unsetting", name); - } this->StateSnapshot.RemoveDefinition(name); #ifndef CMAKE_BOOTSTRAP cmVariableWatch* vv = this->GetVariableWatch(); @@ -3284,25 +3253,28 @@ void cmMakefile::RemoveVariablesInString(std::string& source, } } -std::string cmMakefile::GetConfigurations(std::vector<std::string>& configs, - bool singleConfig) const +std::string cmMakefile::GetDefaultConfiguration() const { if (this->GetGlobalGenerator()->IsMultiConfig()) { - this->GetDefExpandList("CMAKE_CONFIGURATION_TYPES", configs); - return ""; - } - const std::string& buildType = this->GetSafeDefinition("CMAKE_BUILD_TYPE"); - if (singleConfig && !buildType.empty()) { - configs.push_back(buildType); + return std::string{}; } - return buildType; + return this->GetSafeDefinition("CMAKE_BUILD_TYPE"); } -std::vector<std::string> cmMakefile::GetGeneratorConfigs() const +std::vector<std::string> cmMakefile::GetGeneratorConfigs( + GeneratorConfigQuery mode) const { std::vector<std::string> configs; - GetConfigurations(configs); - if (configs.empty()) { + if (this->GetGlobalGenerator()->IsMultiConfig() || + mode == cmMakefile::OnlyMultiConfig) { + this->GetDefExpandList("CMAKE_CONFIGURATION_TYPES", configs); + } else { + const std::string& buildType = this->GetSafeDefinition("CMAKE_BUILD_TYPE"); + if (!buildType.empty()) { + configs.emplace_back(buildType); + } + } + if (mode == cmMakefile::IncludeEmptyConfig && configs.empty()) { configs.emplace_back(); } return configs; @@ -3722,7 +3694,7 @@ int cmMakefile::TryCompile(const std::string& srcdir, if (cmakeArgs) { // FIXME: Workaround to ignore unused CLI variables in try-compile. // - // Ideally we should use SetArgs to honor options like --warn-unused-vars. + // Ideally we should use SetArgs for options like --no-warn-unused-cli. // However, there is a subtle problem when certain arguments are passed to // a macro wrapping around try_compile or try_run that does not escape // semicolons in its parameters but just passes ${ARGV} or ${ARGN}. In @@ -3741,7 +3713,7 @@ int cmMakefile::TryCompile(const std::string& srcdir, // the value VAR=a is sufficient for the try_compile or try_run to get the // correct result. Calling SetArgs here would break such projects that // previously built. Instead we work around the issue by never reporting - // unused arguments and ignoring options such as --warn-unused-vars. + // unused arguments and ignoring options such as --no-warn-unused-cli. cm.SetWarnUnusedCli(false); // cm.SetArgs(*cmakeArgs, true); @@ -3995,6 +3967,7 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output, int cmMakefile::ConfigureFile(const std::string& infile, const std::string& outfile, bool copyonly, bool atOnly, bool escapeQuotes, + bool use_source_permissions, cmNewLineStyle newLine) { int res = 1; @@ -4018,7 +3991,13 @@ int cmMakefile::ConfigureFile(const std::string& infile, this->AddCMakeOutputFile(soutfile); mode_t perm = 0; - cmSystemTools::GetPermissions(sinfile, perm); + if (!use_source_permissions) { + perm = perm | mode_owner_read | mode_owner_write | mode_group_read | + mode_world_read; + } else { + cmSystemTools::GetPermissions(sinfile, perm); + } + std::string::size_type pos = soutfile.rfind('/'); if (pos != std::string::npos) { std::string path = soutfile.substr(0, pos); @@ -4027,6 +4006,13 @@ int cmMakefile::ConfigureFile(const std::string& infile, if (copyonly) { if (!cmSystemTools::CopyFileIfDifferent(sinfile, soutfile)) { + this->IssueMessage(MessageType::FATAL_ERROR, + cmSystemTools::GetLastSystemError()); + return 0; + } + if (!cmSystemTools::SetPermissions(soutfile, perm)) { + this->IssueMessage(MessageType::FATAL_ERROR, + cmSystemTools::GetLastSystemError()); return 0; } } else { @@ -4077,9 +4063,15 @@ int cmMakefile::ConfigureFile(const std::string& infile, fin.close(); fout.close(); if (!cmSystemTools::CopyFileIfDifferent(tempOutputFile, soutfile)) { + this->IssueMessage(MessageType::FATAL_ERROR, + cmSystemTools::GetLastSystemError()); res = 0; } else { - cmSystemTools::SetPermissions(soutfile, perm); + if (!cmSystemTools::SetPermissions(soutfile, perm)) { + this->IssueMessage(MessageType::FATAL_ERROR, + cmSystemTools::GetLastSystemError()); + res = 0; + } } cmSystemTools::RemoveFile(tempOutputFile); } @@ -4237,8 +4229,6 @@ void cmMakefile::PopScope() this->PopLoopBlockBarrier(); - this->CheckForUnusedVariables(); - this->PopSnapshot(); } @@ -4554,7 +4544,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::CMP0071 && + if (status == cmPolicies::OLD && id <= cmPolicies::CMP0072 && !(this->GetCMakeInstance()->GetIsInTryCompile() && ( // Policies set by cmCoreTryCompile::TryCompileCode. @@ -4596,7 +4586,7 @@ void cmMakefile::PopSnapshot(bool reportError) // cmStateSnapshot manages nested policy scopes within it. // Since the scope corresponding to the snapshot is closing, // reject any still-open nested policy scopes with an error. - while (!this->StateSnapshot.CanPopPolicyScope()) { + while (this->StateSnapshot.CanPopPolicyScope()) { if (reportError) { this->IssueMessage(MessageType::FATAL_ERROR, "cmake_policy PUSH without matching POP"); @@ -4612,7 +4602,8 @@ void cmMakefile::PopSnapshot(bool reportError) bool cmMakefile::SetPolicyVersion(std::string const& version_min, std::string const& version_max) { - return cmPolicies::ApplyPolicyVersion(this, version_min, version_max); + return cmPolicies::ApplyPolicyVersion(this, version_min, version_max, + cmPolicies::WarnCompat::On); } bool cmMakefile::HasCMP0054AlreadyBeenReported( @@ -4648,674 +4639,6 @@ bool cmMakefile::IgnoreErrorsCMP0061() const return ignoreErrors; } -#define FEATURE_STRING(F) , #F -static const char* const C_FEATURES[] = { nullptr FOR_EACH_C_FEATURE( - FEATURE_STRING) }; - -static const char* const CXX_FEATURES[] = { nullptr FOR_EACH_CXX_FEATURE( - FEATURE_STRING) }; - -static const char* const CUDA_FEATURES[] = { nullptr FOR_EACH_CUDA_FEATURE( - FEATURE_STRING) }; -#undef FEATURE_STRING - -static const char* const C_STANDARDS[] = { "90", "99", "11" }; -static const char* const CXX_STANDARDS[] = { "98", "11", "14", "17", "20" }; -static const char* const CUDA_STANDARDS[] = { "03", "11", "14", "17", "20" }; - -bool cmMakefile::AddRequiredTargetFeature(cmTarget* target, - const std::string& feature, - std::string* error) const -{ - if (cmGeneratorExpression::Find(feature) != std::string::npos) { - target->AppendProperty("COMPILE_FEATURES", feature); - return true; - } - - std::string lang; - if (!this->CompileFeatureKnown(target, feature, lang, error)) { - return false; - } - - const char* features = this->CompileFeaturesAvailable(lang, error); - if (!features) { - return false; - } - - std::vector<std::string> availableFeatures = cmExpandedList(features); - if (!cm::contains(availableFeatures, feature)) { - std::ostringstream e; - e << "The compiler feature \"" << feature << "\" is not known to " << lang - << " compiler\n\"" - << this->GetDefinition("CMAKE_" + lang + "_COMPILER_ID") - << "\"\nversion " - << this->GetDefinition("CMAKE_" + lang + "_COMPILER_VERSION") << "."; - if (error) { - *error = e.str(); - } else { - this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e.str(), - this->Backtrace); - } - return false; - } - - target->AppendProperty("COMPILE_FEATURES", feature); - - if (lang == "C" || lang == "OBJC") { - return this->AddRequiredTargetCFeature(target, feature, lang, error); - } - if (lang == "CUDA") { - return this->AddRequiredTargetCudaFeature(target, feature, lang, error); - } - return this->AddRequiredTargetCxxFeature(target, feature, lang, error); -} - -bool cmMakefile::CompileFeatureKnown(cmTarget const* target, - const std::string& feature, - std::string& lang, - std::string* error) const -{ - assert(cmGeneratorExpression::Find(feature) == std::string::npos); - - bool isCFeature = - std::find_if(cm::cbegin(C_FEATURES) + 1, cm::cend(C_FEATURES), - cmStrCmp(feature)) != cm::cend(C_FEATURES); - if (isCFeature) { - lang = "C"; - return true; - } - bool isCxxFeature = - std::find_if(cm::cbegin(CXX_FEATURES) + 1, cm::cend(CXX_FEATURES), - cmStrCmp(feature)) != cm::cend(CXX_FEATURES); - if (isCxxFeature) { - lang = "CXX"; - return true; - } - bool isCudaFeature = - std::find_if(cm::cbegin(CUDA_FEATURES) + 1, cm::cend(CUDA_FEATURES), - cmStrCmp(feature)) != cm::cend(CUDA_FEATURES); - if (isCudaFeature) { - lang = "CUDA"; - return true; - } - std::ostringstream e; - if (error) { - e << "specified"; - } else { - e << "Specified"; - } - e << " unknown feature \"" << feature - << "\" for " - "target \"" - << target->GetName() << "\"."; - if (error) { - *error = e.str(); - } else { - this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e.str(), - this->Backtrace); - } - return false; -} - -const char* cmMakefile::CompileFeaturesAvailable(const std::string& lang, - std::string* error) const -{ - if (!this->GlobalGenerator->GetLanguageEnabled(lang)) { - std::ostringstream e; - if (error) { - e << "cannot"; - } else { - e << "Cannot"; - } - e << " use features from non-enabled language " << lang; - if (error) { - *error = e.str(); - } else { - this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e.str(), - this->Backtrace); - } - return nullptr; - } - - const char* featuresKnown = - this->GetDefinition("CMAKE_" + lang + "_COMPILE_FEATURES"); - - if (!featuresKnown || !*featuresKnown) { - std::ostringstream e; - if (error) { - e << "no"; - } else { - e << "No"; - } - e << " known features for " << lang << " compiler\n\"" - << this->GetSafeDefinition("CMAKE_" + lang + "_COMPILER_ID") - << "\"\nversion " - << this->GetSafeDefinition("CMAKE_" + lang + "_COMPILER_VERSION") << "."; - if (error) { - *error = e.str(); - } else { - this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e.str(), - this->Backtrace); - } - return nullptr; - } - return featuresKnown; -} - -bool cmMakefile::HaveStandardAvailable(cmTarget const* target, - std::string const& lang, - const std::string& feature) const -{ - if (lang == "C" || lang == "OBJC") { - return this->HaveCStandardAvailable(target, feature, lang); - } - if (lang == "CUDA") { - return this->HaveCudaStandardAvailable(target, feature, lang); - } - return this->HaveCxxStandardAvailable(target, feature, lang); -} - -bool cmMakefile::HaveCStandardAvailable(cmTarget const* target, - const std::string& feature, - std::string const& lang) const -{ - cmProp defaultCStandard = - this->GetDef(cmStrCat("CMAKE_", lang, "_STANDARD_DEFAULT")); - if (!defaultCStandard) { - this->IssueMessage( - MessageType::INTERNAL_ERROR, - cmStrCat("CMAKE_", lang, - "_STANDARD_DEFAULT is not set. COMPILE_FEATURES support " - "not fully configured for this compiler.")); - // Return true so the caller does not try to lookup the default standard. - return true; - } - if (std::find_if(cm::cbegin(C_STANDARDS), cm::cend(C_STANDARDS), - cmStrCmp(*defaultCStandard)) == cm::cend(C_STANDARDS)) { - const std::string e = cmStrCat("The CMAKE_", lang, - "_STANDARD_DEFAULT variable contains an " - "invalid value: \"", - *defaultCStandard, "\"."); - this->IssueMessage(MessageType::INTERNAL_ERROR, e); - return false; - } - - bool needC90 = false; - bool needC99 = false; - bool needC11 = false; - - this->CheckNeededCLanguage(feature, lang, needC90, needC99, needC11); - - cmProp existingCStandard = target->GetProperty(cmStrCat(lang, "_STANDARD")); - if (!existingCStandard) { - existingCStandard = defaultCStandard; - } - - if (std::find_if(cm::cbegin(C_STANDARDS), cm::cend(C_STANDARDS), - cmStrCmp(*existingCStandard)) == cm::cend(C_STANDARDS)) { - const std::string e = cmStrCat( - "The ", lang, "_STANDARD property on target \"", target->GetName(), - "\" contained an invalid value: \"", *existingCStandard, "\"."); - this->IssueMessage(MessageType::FATAL_ERROR, e); - return false; - } - - const char* const* existingCIt = existingCStandard - ? std::find_if(cm::cbegin(C_STANDARDS), cm::cend(C_STANDARDS), - cmStrCmp(*existingCStandard)) - : cm::cend(C_STANDARDS); - - if (needC11 && existingCStandard && - existingCIt < std::find_if(cm::cbegin(C_STANDARDS), - cm::cend(C_STANDARDS), cmStrCmp("11"))) { - return false; - } - if (needC99 && existingCStandard && - existingCIt < std::find_if(cm::cbegin(C_STANDARDS), - cm::cend(C_STANDARDS), cmStrCmp("99"))) { - return false; - } - if (needC90 && existingCStandard && - existingCIt < std::find_if(cm::cbegin(C_STANDARDS), - cm::cend(C_STANDARDS), cmStrCmp("90"))) { - return false; - } - return true; -} - -bool cmMakefile::IsLaterStandard(std::string const& lang, - std::string const& lhs, - std::string const& rhs) -{ - if (lang == "C" || lang == "OBJC") { - const char* const* rhsIt = std::find_if( - cm::cbegin(C_STANDARDS), cm::cend(C_STANDARDS), cmStrCmp(rhs)); - - return std::find_if(rhsIt, cm::cend(C_STANDARDS), cmStrCmp(lhs)) != - cm::cend(C_STANDARDS); - } - if (lang == "CUDA") { - const char* const* rhsIt = std::find_if( - cm::cbegin(CUDA_STANDARDS), cm::cend(CUDA_STANDARDS), cmStrCmp(rhs)); - - return std::find_if(rhsIt, cm::cend(CUDA_STANDARDS), cmStrCmp(lhs)) != - cm::cend(CUDA_STANDARDS); - } - - const char* const* rhsIt = std::find_if( - cm::cbegin(CXX_STANDARDS), cm::cend(CXX_STANDARDS), cmStrCmp(rhs)); - - return std::find_if(rhsIt, cm::cend(CXX_STANDARDS), cmStrCmp(lhs)) != - cm::cend(CXX_STANDARDS); -} - -bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target, - const std::string& feature, - std::string const& lang) const -{ - cmProp defaultCxxStandard = - this->GetDef(cmStrCat("CMAKE_", lang, "_STANDARD_DEFAULT")); - if (!defaultCxxStandard) { - this->IssueMessage( - MessageType::INTERNAL_ERROR, - cmStrCat("CMAKE_", lang, - "_STANDARD_DEFAULT is not set. COMPILE_FEATURES support " - "not fully configured for this compiler.")); - // Return true so the caller does not try to lookup the default standard. - return true; - } - if (std::find_if(cm::cbegin(CXX_STANDARDS), cm::cend(CXX_STANDARDS), - cmStrCmp(*defaultCxxStandard)) == cm::cend(CXX_STANDARDS)) { - const std::string e = - cmStrCat("The CMAKE_", lang, "_STANDARD_DEFAULT variable contains an ", - "invalid value: \"", *defaultCxxStandard, "\"."); - this->IssueMessage(MessageType::INTERNAL_ERROR, e); - return false; - } - - bool needCxx98 = false; - bool needCxx11 = false; - bool needCxx14 = false; - bool needCxx17 = false; - bool needCxx20 = false; - this->CheckNeededCxxLanguage(feature, lang, needCxx98, needCxx11, needCxx14, - needCxx17, needCxx20); - - cmProp existingCxxStandard = - target->GetProperty(cmStrCat(lang, "_STANDARD")); - if (!existingCxxStandard) { - existingCxxStandard = defaultCxxStandard; - } - - const char* const* existingCxxLevel = - std::find_if(cm::cbegin(CXX_STANDARDS), cm::cend(CXX_STANDARDS), - cmStrCmp(*existingCxxStandard)); - if (existingCxxLevel == cm::cend(CXX_STANDARDS)) { - const std::string e = cmStrCat( - "The ", lang, "_STANDARD property on target \"", target->GetName(), - "\" contained an invalid value: \"", *existingCxxStandard, "\"."); - this->IssueMessage(MessageType::FATAL_ERROR, e); - return false; - } - - /* clang-format off */ - const char* const* needCxxLevel = - needCxx20 ? &CXX_STANDARDS[4] - : needCxx17 ? &CXX_STANDARDS[3] - : needCxx14 ? &CXX_STANDARDS[2] - : needCxx11 ? &CXX_STANDARDS[1] - : needCxx98 ? &CXX_STANDARDS[0] - : nullptr; - /* clang-format on */ - - return !needCxxLevel || needCxxLevel <= existingCxxLevel; -} - -void cmMakefile::CheckNeededCxxLanguage(const std::string& feature, - std::string const& lang, - bool& needCxx98, bool& needCxx11, - bool& needCxx14, bool& needCxx17, - bool& needCxx20) const -{ - if (const char* propCxx98 = - this->GetDefinition(cmStrCat("CMAKE_", lang, "98_COMPILE_FEATURES"))) { - std::vector<std::string> props = cmExpandedList(propCxx98); - needCxx98 = cm::contains(props, feature); - } - if (const char* propCxx11 = - this->GetDefinition(cmStrCat("CMAKE_", lang, "11_COMPILE_FEATURES"))) { - std::vector<std::string> props = cmExpandedList(propCxx11); - needCxx11 = cm::contains(props, feature); - } - if (const char* propCxx14 = - this->GetDefinition(cmStrCat("CMAKE_", lang, "14_COMPILE_FEATURES"))) { - std::vector<std::string> props = cmExpandedList(propCxx14); - needCxx14 = cm::contains(props, feature); - } - if (const char* propCxx17 = - this->GetDefinition(cmStrCat("CMAKE_", lang, "17_COMPILE_FEATURES"))) { - std::vector<std::string> props = cmExpandedList(propCxx17); - needCxx17 = cm::contains(props, feature); - } - if (const char* propCxx20 = - this->GetDefinition(cmStrCat("CMAKE_", lang, "20_COMPILE_FEATURES"))) { - std::vector<std::string> props = cmExpandedList(propCxx20); - needCxx20 = cm::contains(props, feature); - } -} - -bool cmMakefile::AddRequiredTargetCxxFeature(cmTarget* target, - const std::string& feature, - std::string const& lang, - std::string* error) const -{ - bool needCxx98 = false; - bool needCxx11 = false; - bool needCxx14 = false; - bool needCxx17 = false; - bool needCxx20 = false; - - this->CheckNeededCxxLanguage(feature, lang, needCxx98, needCxx11, needCxx14, - needCxx17, needCxx20); - - cmProp existingCxxStandard = - target->GetProperty(cmStrCat(lang, "_STANDARD")); - if (existingCxxStandard == nullptr) { - cmProp defaultCxxStandard = - this->GetDef(cmStrCat("CMAKE_", lang, "_STANDARD_DEFAULT")); - if (defaultCxxStandard && !defaultCxxStandard->empty()) { - existingCxxStandard = defaultCxxStandard; - } - } - const char* const* existingCxxLevel = nullptr; - if (existingCxxStandard) { - existingCxxLevel = - std::find_if(cm::cbegin(CXX_STANDARDS), cm::cend(CXX_STANDARDS), - cmStrCmp(*existingCxxStandard)); - if (existingCxxLevel == cm::cend(CXX_STANDARDS)) { - const std::string e = cmStrCat( - "The ", lang, "_STANDARD property on target \"", target->GetName(), - "\" contained an invalid value: \"", *existingCxxStandard, "\"."); - if (error) { - *error = e; - } else { - this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e, - this->Backtrace); - } - return false; - } - } - - /* clang-format off */ - const char* const* needCxxLevel = - needCxx20 ? &CXX_STANDARDS[4] - : needCxx17 ? &CXX_STANDARDS[3] - : needCxx14 ? &CXX_STANDARDS[2] - : needCxx11 ? &CXX_STANDARDS[1] - : needCxx98 ? &CXX_STANDARDS[0] - : nullptr; - /* clang-format on */ - - if (needCxxLevel) { - // Ensure the C++ language level is high enough to support - // the needed C++ features. - if (!existingCxxLevel || existingCxxLevel < needCxxLevel) { - target->SetProperty(cmStrCat(lang, "_STANDARD"), *needCxxLevel); - } - } - - return true; -} - -bool cmMakefile::HaveCudaStandardAvailable(cmTarget const* target, - const std::string& feature, - std::string const& lang) const -{ - cmProp defaultCudaStandard = - this->GetDef(cmStrCat("CMAKE_", lang, "_STANDARD_DEFAULT")); - if (!defaultCudaStandard) { - this->IssueMessage( - MessageType::INTERNAL_ERROR, - cmStrCat("CMAKE_", lang, - "_STANDARD_DEFAULT is not set. COMPILE_FEATURES support " - "not fully configured for this compiler.")); - // Return true so the caller does not try to lookup the default standard. - return true; - } - if (std::find_if(cm::cbegin(CUDA_STANDARDS), cm::cend(CUDA_STANDARDS), - cmStrCmp(*defaultCudaStandard)) == - cm::cend(CUDA_STANDARDS)) { - const std::string e = - cmStrCat("The CMAKE_", lang, "_STANDARD_DEFAULT variable contains an ", - "invalid value: \"", *defaultCudaStandard, "\"."); - this->IssueMessage(MessageType::INTERNAL_ERROR, e); - return false; - } - - bool needCuda03 = false; - bool needCuda11 = false; - bool needCuda14 = false; - bool needCuda17 = false; - bool needCuda20 = false; - this->CheckNeededCudaLanguage(feature, lang, needCuda03, needCuda11, - needCuda14, needCuda17, needCuda20); - - cmProp existingCudaStandard = - target->GetProperty(cmStrCat(lang, "_STANDARD")); - if (!existingCudaStandard) { - existingCudaStandard = defaultCudaStandard; - } - - const char* const* existingCudaLevel = - std::find_if(cm::cbegin(CUDA_STANDARDS), cm::cend(CUDA_STANDARDS), - cmStrCmp(*existingCudaStandard)); - if (existingCudaLevel == cm::cend(CUDA_STANDARDS)) { - const std::string e = cmStrCat( - "The ", lang, "_STANDARD property on target \"", target->GetName(), - "\" contained an invalid value: \"", *existingCudaStandard, "\"."); - this->IssueMessage(MessageType::FATAL_ERROR, e); - return false; - } - - /* clang-format off */ - const char* const* needCudaLevel = - needCuda20 ? &CUDA_STANDARDS[4] - : needCuda17 ? &CUDA_STANDARDS[3] - : needCuda14 ? &CUDA_STANDARDS[2] - : needCuda11 ? &CUDA_STANDARDS[1] - : needCuda03 ? &CUDA_STANDARDS[0] - : nullptr; - /* clang-format on */ - - return !needCudaLevel || needCudaLevel <= existingCudaLevel; -} - -void cmMakefile::CheckNeededCudaLanguage(const std::string& feature, - std::string const& lang, - bool& needCuda03, bool& needCuda11, - bool& needCuda14, bool& needCuda17, - bool& needCuda20) const -{ - if (const char* propCuda03 = - this->GetDefinition(cmStrCat("CMAKE_", lang, "03_COMPILE_FEATURES"))) { - std::vector<std::string> props = cmExpandedList(propCuda03); - needCuda03 = cm::contains(props, feature); - } - if (const char* propCuda11 = - this->GetDefinition(cmStrCat("CMAKE_", lang, "11_COMPILE_FEATURES"))) { - std::vector<std::string> props = cmExpandedList(propCuda11); - needCuda11 = cm::contains(props, feature); - } - if (const char* propCuda14 = - this->GetDefinition(cmStrCat("CMAKE_", lang, "14_COMPILE_FEATURES"))) { - std::vector<std::string> props = cmExpandedList(propCuda14); - needCuda14 = cm::contains(props, feature); - } - if (const char* propCuda17 = - this->GetDefinition(cmStrCat("CMAKE_", lang, "17_COMPILE_FEATURES"))) { - std::vector<std::string> props = cmExpandedList(propCuda17); - needCuda17 = cm::contains(props, feature); - } - if (const char* propCuda20 = - this->GetDefinition(cmStrCat("CMAKE_", lang, "20_COMPILE_FEATURES"))) { - std::vector<std::string> props = cmExpandedList(propCuda20); - needCuda20 = cm::contains(props, feature); - } -} - -bool cmMakefile::AddRequiredTargetCudaFeature(cmTarget* target, - const std::string& feature, - std::string const& lang, - std::string* error) const -{ - bool needCuda03 = false; - bool needCuda11 = false; - bool needCuda14 = false; - bool needCuda17 = false; - bool needCuda20 = false; - - this->CheckNeededCudaLanguage(feature, lang, needCuda03, needCuda11, - needCuda14, needCuda17, needCuda20); - - cmProp existingCudaStandard = - target->GetProperty(cmStrCat(lang, "_STANDARD")); - if (existingCudaStandard == nullptr) { - cmProp defaultCudaStandard = - this->GetDef(cmStrCat("CMAKE_", lang, "_STANDARD_DEFAULT")); - if (defaultCudaStandard && !defaultCudaStandard->empty()) { - existingCudaStandard = defaultCudaStandard; - } - } - const char* const* existingCudaLevel = nullptr; - if (existingCudaStandard) { - existingCudaLevel = - std::find_if(cm::cbegin(CUDA_STANDARDS), cm::cend(CUDA_STANDARDS), - cmStrCmp(*existingCudaStandard)); - if (existingCudaLevel == cm::cend(CUDA_STANDARDS)) { - const std::string e = cmStrCat( - "The ", lang, "_STANDARD property on target \"", target->GetName(), - "\" contained an invalid value: \"", *existingCudaStandard, "\"."); - if (error) { - *error = e; - } else { - this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e, - this->Backtrace); - } - return false; - } - } - - /* clang-format off */ - const char* const* needCudaLevel = - needCuda20 ? &CUDA_STANDARDS[4] - : needCuda17 ? &CUDA_STANDARDS[3] - : needCuda14 ? &CUDA_STANDARDS[2] - : needCuda11 ? &CUDA_STANDARDS[1] - : needCuda03 ? &CUDA_STANDARDS[0] - : nullptr; - /* clang-format on */ - - if (needCudaLevel) { - // Ensure the CUDA language level is high enough to support - // the needed CUDA features. - if (!existingCudaLevel || existingCudaLevel < needCudaLevel) { - target->SetProperty("CUDA_STANDARD", *needCudaLevel); - } - } - - return true; -} - -void cmMakefile::CheckNeededCLanguage(const std::string& feature, - std::string const& lang, bool& needC90, - bool& needC99, bool& needC11) const -{ - if (const char* propC90 = - this->GetDefinition(cmStrCat("CMAKE_", lang, "90_COMPILE_FEATURES"))) { - std::vector<std::string> props = cmExpandedList(propC90); - needC90 = cm::contains(props, feature); - } - if (const char* propC99 = - this->GetDefinition(cmStrCat("CMAKE_", lang, "99_COMPILE_FEATURES"))) { - std::vector<std::string> props = cmExpandedList(propC99); - needC99 = cm::contains(props, feature); - } - if (const char* propC11 = - this->GetDefinition(cmStrCat("CMAKE_", lang, "11_COMPILE_FEATURES"))) { - std::vector<std::string> props = cmExpandedList(propC11); - needC11 = cm::contains(props, feature); - } -} - -bool cmMakefile::AddRequiredTargetCFeature(cmTarget* target, - const std::string& feature, - std::string const& lang, - std::string* error) const -{ - bool needC90 = false; - bool needC99 = false; - bool needC11 = false; - - this->CheckNeededCLanguage(feature, lang, needC90, needC99, needC11); - - cmProp existingCStandard = target->GetProperty(cmStrCat(lang, "_STANDARD")); - if (existingCStandard == nullptr) { - cmProp defaultCStandard = - this->GetDef(cmStrCat("CMAKE_", lang, "_STANDARD_DEFAULT")); - if (defaultCStandard && !defaultCStandard->empty()) { - existingCStandard = defaultCStandard; - } - } - if (existingCStandard) { - if (std::find_if(cm::cbegin(C_STANDARDS), cm::cend(C_STANDARDS), - cmStrCmp(*existingCStandard)) == cm::cend(C_STANDARDS)) { - const std::string e = cmStrCat( - "The ", lang, "_STANDARD property on target \"", target->GetName(), - "\" contained an invalid value: \"", *existingCStandard, "\"."); - if (error) { - *error = e; - } else { - this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e, - this->Backtrace); - } - return false; - } - } - const char* const* existingCIt = existingCStandard - ? std::find_if(cm::cbegin(C_STANDARDS), cm::cend(C_STANDARDS), - cmStrCmp(*existingCStandard)) - : cm::cend(C_STANDARDS); - - bool setC90 = needC90 && !existingCStandard; - bool setC99 = needC99 && !existingCStandard; - bool setC11 = needC11 && !existingCStandard; - - if (needC11 && existingCStandard && - existingCIt < std::find_if(cm::cbegin(C_STANDARDS), - cm::cend(C_STANDARDS), cmStrCmp("11"))) { - setC11 = true; - } else if (needC99 && existingCStandard && - existingCIt < std::find_if(cm::cbegin(C_STANDARDS), - cm::cend(C_STANDARDS), - cmStrCmp("99"))) { - setC99 = true; - } else if (needC90 && existingCStandard && - existingCIt < std::find_if(cm::cbegin(C_STANDARDS), - cm::cend(C_STANDARDS), - cmStrCmp("90"))) { - setC90 = true; - } - - if (setC11) { - target->SetProperty(cmStrCat(lang, "_STANDARD"), "11"); - } else if (setC99) { - target->SetProperty(cmStrCat(lang, "_STANDARD"), "99"); - } else if (setC90) { - target->SetProperty(cmStrCat(lang, "_STANDARD"), "90"); - } - return true; -} - cmMakefile::FunctionPushPop::FunctionPushPop(cmMakefile* mf, const std::string& fileName, cmPolicies::PolicyMap const& pm) diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 45d7109..80d80d3 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -342,12 +342,19 @@ public: */ void SetProjectName(std::string const& name); - /** Get the configurations to be generated. */ - std::string GetConfigurations(std::vector<std::string>& configs, - bool single = true) const; + /* Get the default configuration */ + std::string GetDefaultConfiguration() const; + + enum GeneratorConfigQuery + { + IncludeEmptyConfig, // Include "" aka noconfig + ExcludeEmptyConfig, // Exclude "" aka noconfig + OnlyMultiConfig, + }; /** Get the configurations for dependency checking. */ - std::vector<std::string> GetGeneratorConfigs() const; + std::vector<std::string> GetGeneratorConfigs( + GeneratorConfigQuery mode) const; /** * Set the name of the library. @@ -686,6 +693,7 @@ public: */ int ConfigureFile(const std::string& infile, const std::string& outfile, bool copyonly, bool atOnly, bool escapeQuotes, + bool use_source_permissions, cmNewLineStyle = cmNewLineStyle()); /** @@ -925,21 +933,6 @@ public: bool PolicyOptionalWarningEnabled(std::string const& var); - bool AddRequiredTargetFeature(cmTarget* target, const std::string& feature, - std::string* error = nullptr) const; - - bool CompileFeatureKnown(cmTarget const* target, const std::string& feature, - std::string& lang, std::string* error) const; - - const char* CompileFeaturesAvailable(const std::string& lang, - std::string* error) const; - - bool HaveStandardAvailable(cmTarget const* target, std::string const& lang, - const std::string& feature) const; - - bool IsLaterStandard(std::string const& lang, std::string const& lhs, - std::string const& rhs); - void PushLoopBlock(); void PopLoopBlock(); bool IsLoopBlock() const; @@ -985,9 +978,6 @@ protected: // add link libraries and directories to the target void AddGlobalLinkInformation(cmTarget& target); - // Check for a an unused variable - void LogUnused(const char* reason, const std::string& name) const; - mutable std::set<cmListFileContext> CMP0054ReportedIds; // libraries, classes, and executables @@ -1162,44 +1152,6 @@ private: */ bool MightHaveCustomCommand(const std::string& name) const; - bool AddRequiredTargetCFeature(cmTarget* target, const std::string& feature, - std::string const& lang, - std::string* error = nullptr) const; - bool AddRequiredTargetCxxFeature(cmTarget* target, - const std::string& feature, - std::string const& lang, - std::string* error = nullptr) const; - bool AddRequiredTargetCudaFeature(cmTarget* target, - const std::string& feature, - std::string const& lang, - std::string* error = nullptr) const; - - void CheckNeededCLanguage(const std::string& feature, - std::string const& lang, bool& needC90, - bool& needC99, bool& needC11) const; - void CheckNeededCxxLanguage(const std::string& feature, - std::string const& lang, bool& needCxx98, - bool& needCxx11, bool& needCxx14, - bool& needCxx17, bool& needCxx20) const; - void CheckNeededCudaLanguage(const std::string& feature, - std::string const& lang, bool& needCuda03, - bool& needCuda11, bool& needCuda14, - bool& needCuda17, bool& needCuda20) const; - - bool HaveCStandardAvailable(cmTarget const* target, - const std::string& feature, - std::string const& lang) const; - bool HaveCxxStandardAvailable(cmTarget const* target, - const std::string& feature, - std::string const& lang) const; - bool HaveCudaStandardAvailable(cmTarget const* target, - const std::string& feature, - std::string const& lang) const; - - void CheckForUnusedVariables() const; - - // Unused variable flags - bool WarnUnused; bool CheckSystemVars; bool CheckCMP0000; std::set<std::string> WarnedCMP0074; diff --git a/Source/cmMakefileProfilingData.cxx b/Source/cmMakefileProfilingData.cxx index e0150dc..29fd440 100644 --- a/Source/cmMakefileProfilingData.cxx +++ b/Source/cmMakefileProfilingData.cxx @@ -58,7 +58,7 @@ void cmMakefileProfilingData::StartEntry(const cmListFileFunction& lff, cmsys::SystemInformation info; Json::Value v; v["ph"] = "B"; - v["name"] = lff.Name.Original; + v["name"] = lff.Name.Lower; v["cat"] = "cmake"; v["ts"] = Json::Value::UInt64( std::chrono::duration_cast<std::chrono::microseconds>( diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 8396fa3..6887569 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -532,6 +532,13 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( // Build the set of compiler flags. std::string flags; + // explicitly add the explicit language flag before any other flag + // this way backwards compatibility with user flags is maintained + if (source.GetProperty("LANGUAGE")) { + this->LocalGenerator->AppendFeatureOptions(flags, lang, + "EXPLICIT_LANGUAGE"); + } + // Add language-specific flags. std::string langFlags = cmStrCat("$(", lang, "_FLAGS", filterArch, ")"); this->LocalGenerator->AppendFlags(flags, langFlags); diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index d406c99..53a0cb7 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -65,7 +65,8 @@ cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmGeneratorTarget* target) , LocalGenerator( static_cast<cmLocalNinjaGenerator*>(target->GetLocalGenerator())) { - for (auto const& fileConfig : target->Makefile->GetGeneratorConfigs()) { + for (auto const& fileConfig : + target->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig)) { this->Configs[fileConfig].MacOSXContentGenerator = cm::make_unique<MacOSXContentGeneratorType>(this, fileConfig); } @@ -188,7 +189,16 @@ std::string cmNinjaTargetGenerator::ComputeFlagsForObject( } } - std::string flags = this->GetFlags(language, config, filterArch); + std::string flags; + // explicitly add the explicit language flag before any other flag + // this way backwards compatibility with user flags is maintained + if (source->GetProperty("LANGUAGE")) { + this->LocalGenerator->AppendFeatureOptions(flags, language, + "EXPLICIT_LANGUAGE"); + flags += " "; + } + + flags += this->GetFlags(language, config, filterArch); // Add Fortran format flags. if (language == "Fortran") { diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index dea3f8a..01e8c04 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -7,9 +7,11 @@ #include <sstream> #include <vector> +#include "cmListFileCache.h" #include "cmMakefile.h" #include "cmMessageType.h" #include "cmState.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" @@ -157,7 +159,8 @@ static bool GetPolicyDefault(cmMakefile* mf, std::string const& policy, bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf, std::string const& version_min, - std::string const& version_max) + std::string const& version_max, + WarnCompat warnCompat) { // Parse components of the minimum version. unsigned int minMajor = 2; @@ -244,13 +247,34 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf, polPatch = maxPatch; } - return cmPolicies::ApplyPolicyVersion(mf, polMajor, polMinor, polPatch); + return cmPolicies::ApplyPolicyVersion(mf, polMajor, polMinor, polPatch, + warnCompat); } bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf, unsigned int majorVer, unsigned int minorVer, - unsigned int patchVer) + unsigned int patchVer, + WarnCompat warnCompat) { + // Warn about policy versions for which support will be removed. + if (warnCompat == WarnCompat::On && + (majorVer < 2 || (majorVer == 2 && minorVer < 8) || + (majorVer == 2 && minorVer == 8 && patchVer < 12)) && + // Avoid warning on calls generated by install(EXPORT) + // in CMake versions prior to 3.18. + !(majorVer == 2 && minorVer == 6 && patchVer == 0 && + mf->GetStateSnapshot().CanPopPolicyScope() && + cmSystemTools::Strucmp(mf->GetBacktrace().Top().Name.c_str(), + "cmake_policy") == 0)) { + mf->IssueMessage( + MessageType::DEPRECATION_WARNING, + "Compatibility with CMake < 2.8.12 will be removed from " + "a future version of CMake.\n" + "Update the VERSION argument <min> value or use a ...<max> suffix " + "to tell CMake that the project does not need compatibility with " + "older versions."); + } + // now loop over all the policies and set them as appropriate std::vector<cmPolicies::PolicyID> ancientPolicies; for (PolicyID pid = cmPolicies::CMP0000; pid != cmPolicies::CMPCOUNT; diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index a82f421..bba8b03 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -320,7 +320,10 @@ class cmMakefile; SELECT(POLICY, CMP0107, "An ALIAS target cannot overwrite another target.", \ 3, 18, 0, cmPolicies::WARN) \ SELECT(POLICY, CMP0108, "A target cannot link to itself through an alias.", \ - 3, 18, 0, cmPolicies::WARN) + 3, 18, 0, cmPolicies::WARN) \ + SELECT(POLICY, CMP0109, \ + "find_program() requires permission to execute but not to read.", 3, \ + 19, 0, cmPolicies::WARN) #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1) #define CM_FOR_EACH_POLICY_ID(POLICY) \ @@ -396,12 +399,20 @@ public: //! Get the default status for a policy static cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id); + enum class WarnCompat + { + Off, + On + }; + //! Set a policy level for this listfile static bool ApplyPolicyVersion(cmMakefile* mf, std::string const& version_min, - std::string const& version_max); + std::string const& version_max, + WarnCompat warnCompat); static bool ApplyPolicyVersion(cmMakefile* mf, unsigned int majorVer, - unsigned int minorVer, unsigned int patchVer); + unsigned int minorVer, unsigned int patchVer, + WarnCompat warnCompat); //! return a warning string for a given policy static std::string GetPolicyWarning(cmPolicies::PolicyID id); diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 511a018..7e0bf96 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -315,10 +315,9 @@ bool cmQtAutoGenInitializer::InitCustomTargets() { // Configurations this->MultiConfig = this->GlobalGen->IsMultiConfig(); - this->ConfigDefault = this->Makefile->GetConfigurations(this->ConfigsList); - if (this->ConfigsList.empty()) { - this->ConfigsList.push_back(this->ConfigDefault); - } + this->ConfigDefault = this->Makefile->GetDefaultConfiguration(); + this->ConfigsList = + this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); // Verbosity { @@ -789,9 +788,9 @@ bool cmQtAutoGenInitializer::InitScanFiles() // Register files that will be scanned by moc or uic if (this->MocOrUicEnabled()) { - if (cm->IsHeaderExtension(extLower)) { + if (cm->IsAHeaderExtension(extLower)) { addMUHeader(makeMUFile(sf, fullPath, true), extLower); - } else if (cm->IsSourceExtension(extLower)) { + } else if (cm->IsACLikeSourceExtension(extLower)) { addMUSource(makeMUFile(sf, fullPath, true)); } } @@ -895,14 +894,14 @@ bool cmQtAutoGenInitializer::InitScanFiles() std::string const& extLower = cmSystemTools::LowerCase(sf->GetExtension()); - if (cm->IsHeaderExtension(extLower)) { + if (cm->IsAHeaderExtension(extLower)) { if (!cm::contains(this->AutogenTarget.Headers, sf.get())) { auto muf = makeMUFile(sf.get(), fullPath, false); if (muf->SkipMoc || muf->SkipUic) { addMUHeader(std::move(muf), extLower); } } - } else if (cm->IsSourceExtension(extLower)) { + } else if (cm->IsACLikeSourceExtension(extLower)) { if (!cm::contains(this->AutogenTarget.Sources, sf.get())) { auto muf = makeMUFile(sf.get(), fullPath, false); if (muf->SkipMoc || muf->SkipUic) { diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index 4f7131f..e586fd9 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -136,6 +136,7 @@ bool cmServerProtocol::Activate(cmServer* server, this->m_Server = server; this->m_CMakeInstance = cm::make_unique<cmake>(cmake::RoleProject, cmState::Project); + this->m_WarnUnused = false; const bool result = this->DoActivate(request, errorMessage); if (!result) { this->m_CMakeInstance = nullptr; @@ -636,7 +637,7 @@ cmServerResponse cmServerProtocol1::ProcessGlobalSettings( obj[kTRACE_KEY] = cm->GetTrace(); obj[kTRACE_EXPAND_KEY] = cm->GetTraceExpand(); obj[kWARN_UNINITIALIZED_KEY] = cm->GetWarnUninitialized(); - obj[kWARN_UNUSED_KEY] = cm->GetWarnUnused(); + obj[kWARN_UNUSED_KEY] = m_WarnUnused; obj[kWARN_UNUSED_CLI_KEY] = cm->GetWarnUnusedCli(); obj[kCHECK_SYSTEM_VARS_KEY] = cm->GetCheckSystemVars(); @@ -682,7 +683,7 @@ cmServerResponse cmServerProtocol1::ProcessSetGlobalSettings( setBool(request, kTRACE_EXPAND_KEY, [cm](bool e) { cm->SetTraceExpand(e); }); setBool(request, kWARN_UNINITIALIZED_KEY, [cm](bool e) { cm->SetWarnUninitialized(e); }); - setBool(request, kWARN_UNUSED_KEY, [cm](bool e) { cm->SetWarnUnused(e); }); + setBool(request, kWARN_UNUSED_KEY, [this](bool e) { m_WarnUnused = e; }); setBool(request, kWARN_UNUSED_CLI_KEY, [cm](bool e) { cm->SetWarnUnusedCli(e); }); setBool(request, kCHECK_SYSTEM_VARS_KEY, diff --git a/Source/cmServerProtocol.h b/Source/cmServerProtocol.h index c71b7bf..6009e23 100644 --- a/Source/cmServerProtocol.h +++ b/Source/cmServerProtocol.h @@ -94,6 +94,7 @@ protected: // Implement protocol specific activation tasks here. Called from Activate(). virtual bool DoActivate(const cmServerRequest& request, std::string* errorMessage); + bool m_WarnUnused = false; // storage for legacy option private: std::unique_ptr<cmake> m_CMakeInstance; diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index f525439..781ddbc 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSourceFile.h" -#include <array> #include <utility> #include "cmGlobalGenerator.h" @@ -130,13 +129,11 @@ bool cmSourceFile::FindFullPath(std::string* error) // Location path std::string const& lPath = this->Location.GetFullPath(); // List of extension lists - std::array<std::vector<std::string> const*, 2> const extsLists = { - { &makefile->GetCMakeInstance()->GetSourceExtensions(), - &makefile->GetCMakeInstance()->GetHeaderExtensions() } - }; + std::vector<std::string> exts = + makefile->GetCMakeInstance()->GetAllExtensions(); // Tries to find the file in a given directory - auto findInDir = [this, &extsLists, &lPath](std::string const& dir) -> bool { + auto findInDir = [this, &exts, &lPath](std::string const& dir) -> bool { // Compute full path std::string const fullPath = cmSystemTools::CollapseFullPath(lPath, dir); // Try full path @@ -145,14 +142,12 @@ bool cmSourceFile::FindFullPath(std::string* error) return true; } // Try full path with extension - for (auto& exts : extsLists) { - for (std::string const& ext : *exts) { - if (!ext.empty()) { - std::string extPath = cmStrCat(fullPath, '.', ext); - if (cmSystemTools::FileExists(extPath)) { - this->FullPath = extPath; - return true; - } + for (std::string const& ext : exts) { + if (!ext.empty()) { + std::string extPath = cmStrCat(fullPath, '.', ext); + if (cmSystemTools::FileExists(extPath)) { + this->FullPath = extPath; + return true; } } } @@ -175,11 +170,9 @@ bool cmSourceFile::FindFullPath(std::string* error) // Compose error std::string err = cmStrCat("Cannot find source file:\n ", lPath, "\nTried extensions"); - for (auto exts : extsLists) { - for (std::string const& ext : *exts) { - err += " ."; - err += ext; - } + for (std::string const& ext : exts) { + err += " ."; + err += ext; } if (error != nullptr) { *error = std::move(err); diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx index e852c05..222bafa 100644 --- a/Source/cmSourceFileLocation.cxx +++ b/Source/cmSourceFileLocation.cxx @@ -101,7 +101,7 @@ void cmSourceFileLocation::UpdateExtension(const std::string& name) cmMakefile const* mf = this->Makefile; auto cm = mf->GetCMakeInstance(); if (!gg->GetLanguageFromExtension(ext.c_str()).empty() || - cm->IsSourceExtension(ext) || cm->IsHeaderExtension(ext)) { + cm->IsAKnownExtension(ext)) { // This is a known extension. Use the given filename with extension. this->Name = cmSystemTools::GetFilenameName(name); this->AmbiguousExtension = false; @@ -157,7 +157,7 @@ bool cmSourceFileLocation::MatchesAmbiguousExtension( auto ext = cm::string_view(this->Name).substr(loc.Name.size() + 1); cmMakefile const* mf = this->Makefile; auto cm = mf->GetCMakeInstance(); - return cm->IsSourceExtension(ext) || cm->IsHeaderExtension(ext); + return cm->IsAKnownExtension(ext); } bool cmSourceFileLocation::Matches(cmSourceFileLocation const& loc) diff --git a/Source/cmStandardLevelResolver.cxx b/Source/cmStandardLevelResolver.cxx new file mode 100644 index 0000000..5e30680 --- /dev/null +++ b/Source/cmStandardLevelResolver.cxx @@ -0,0 +1,399 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#include "cmStandardLevelResolver.h" + +#include <algorithm> +#include <cassert> +#include <cstddef> +#include <sstream> +#include <unordered_map> +#include <utility> +#include <vector> + +#include <cm/iterator> +#include <cmext/algorithm> + +#include "cmGeneratorExpression.h" +#include "cmGeneratorTarget.h" +#include "cmGlobalGenerator.h" +#include "cmMakefile.h" +#include "cmMessageType.h" +#include "cmProperty.h" +#include "cmStringAlgorithms.h" +#include "cmTarget.h" +#include "cmake.h" + +namespace { + +#define FEATURE_STRING(F) , #F +const char* const C_FEATURES[] = { nullptr FOR_EACH_C_FEATURE( + FEATURE_STRING) }; + +const char* const CXX_FEATURES[] = { nullptr FOR_EACH_CXX_FEATURE( + FEATURE_STRING) }; + +const char* const CUDA_FEATURES[] = { nullptr FOR_EACH_CUDA_FEATURE( + FEATURE_STRING) }; +#undef FEATURE_STRING + +struct StandardNeeded +{ + int index; + int value; +}; + +struct StanardLevelComputer +{ + explicit StanardLevelComputer(std::string lang, std::vector<int> levels) + : Language(std::move(lang)) + , Levels(std::move(levels)) + { + } + + bool GetNewRequiredStandard(cmMakefile* makefile, + std::string const& targetName, + const std::string& feature, + cmProp currentLangStandardValue, + std::string& newRequiredStandard, + std::string* error) const + { + if (currentLangStandardValue) { + newRequiredStandard = *currentLangStandardValue; + } else { + newRequiredStandard.clear(); + } + + auto needed = this->HighestStandardNeeded(makefile, feature); + + cmProp existingStandard = currentLangStandardValue; + if (existingStandard == nullptr) { + cmProp defaultStandard = makefile->GetDef( + cmStrCat("CMAKE_", this->Language, "_STANDARD_DEFAULT")); + if (defaultStandard && !defaultStandard->empty()) { + existingStandard = defaultStandard; + } + } + + auto existingLevelIter = cm::cend(this->Levels); + if (existingStandard) { + existingLevelIter = + std::find(cm::cbegin(this->Levels), cm::cend(this->Levels), + std::stoi(*existingStandard)); + if (existingLevelIter == cm::cend(this->Levels)) { + const std::string e = + cmStrCat("The ", this->Language, "_STANDARD property on target \"", + targetName, "\" contained an invalid value: \"", + *existingStandard, "\"."); + if (error) { + *error = e; + } else { + makefile->IssueMessage(MessageType::FATAL_ERROR, e); + } + return false; + } + } + + if (needed.index != -1) { + // Ensure the C++ language level is high enough to support + // the needed C++ features. + if (existingLevelIter == cm::cend(this->Levels) || + existingLevelIter < this->Levels.begin() + needed.index) { + newRequiredStandard = std::to_string(this->Levels[needed.index]); + } + } + + return true; + } + + bool HaveStandardAvailable(cmMakefile* makefile, + cmGeneratorTarget const* target, + std::string const& config, + std::string const& feature) const + { + cmProp defaultStandard = makefile->GetDef( + cmStrCat("CMAKE_", this->Language, "_STANDARD_DEFAULT")); + if (!defaultStandard) { + makefile->IssueMessage( + MessageType::INTERNAL_ERROR, + cmStrCat("CMAKE_", this->Language, + "_STANDARD_DEFAULT is not set. COMPILE_FEATURES support " + "not fully configured for this compiler.")); + // Return true so the caller does not try to lookup the default standard. + return true; + } + // convert defaultStandard to an integer + if (std::find(cm::cbegin(this->Levels), cm::cend(this->Levels), + std::stoi(*defaultStandard)) == cm::cend(this->Levels)) { + const std::string e = cmStrCat("The CMAKE_", this->Language, + "_STANDARD_DEFAULT variable contains an " + "invalid value: \"", + *defaultStandard, "\"."); + makefile->IssueMessage(MessageType::INTERNAL_ERROR, e); + return false; + } + + cmProp existingStandard = + target->GetLanguageStandard(this->Language, config); + if (!existingStandard) { + existingStandard = defaultStandard; + } + + auto existingLevelIter = + std::find(cm::cbegin(this->Levels), cm::cend(this->Levels), + std::stoi(*existingStandard)); + if (existingLevelIter == cm::cend(this->Levels)) { + const std::string e = + cmStrCat("The ", this->Language, "_STANDARD property on target \"", + target->GetName(), "\" contained an invalid value: \"", + *existingStandard, "\"."); + makefile->IssueMessage(MessageType::FATAL_ERROR, e); + return false; + } + + auto needed = this->HighestStandardNeeded(makefile, feature); + + return (needed.index == -1) || + (this->Levels.begin() + needed.index) <= existingLevelIter; + } + + StandardNeeded HighestStandardNeeded(cmMakefile* makefile, + std::string const& feature) const + { + std::string prefix = cmStrCat("CMAKE_", this->Language); + StandardNeeded maxLevel = { -1, -1 }; + for (size_t i = 0; i < this->Levels.size(); ++i) { + if (const char* prop = makefile->GetDefinition(cmStrCat( + prefix, std::to_string(this->Levels[i]), "_COMPILE_FEATURES"))) { + std::vector<std::string> props = cmExpandedList(prop); + if (cm::contains(props, feature)) { + maxLevel = { static_cast<int>(i), this->Levels[i] }; + } + } + } + return maxLevel; + } + + bool IsLaterStandard(int lhs, int rhs) const + { + auto rhsIt = + std::find(cm::cbegin(this->Levels), cm::cend(this->Levels), rhs); + + return std::find(rhsIt, cm::cend(this->Levels), lhs) != + cm::cend(this->Levels); + } + + std::string Language; + std::vector<int> Levels; +}; + +std::unordered_map<std::string, StanardLevelComputer> StandardComputerMapping = + { + { "C", StanardLevelComputer{ "C", std::vector<int>{ 90, 99, 11 } } }, + { "CXX", + StanardLevelComputer{ "CXX", std::vector<int>{ 98, 11, 14, 17, 20 } } }, + { "CUDA", + StanardLevelComputer{ "CUDA", std::vector<int>{ 03, 11, 14, 17, 20 } } }, + { "OBJC", StanardLevelComputer{ "OBJC", std::vector<int>{ 90, 99, 11 } } }, + { "OBJCXX", + StanardLevelComputer{ "OBJCXX", + std::vector<int>{ 98, 11, 14, 17, 20 } } }, + }; +} + +bool cmStandardLevelResolver::AddRequiredTargetFeature( + cmTarget* target, const std::string& feature, std::string* error) const +{ + if (cmGeneratorExpression::Find(feature) != std::string::npos) { + target->AppendProperty("COMPILE_FEATURES", feature); + return true; + } + + std::string lang; + if (!this->CheckCompileFeaturesAvailable(target->GetName(), feature, lang, + error)) { + return false; + } + + target->AppendProperty("COMPILE_FEATURES", feature); + + // FIXME: Add a policy to avoid updating the <LANG>_STANDARD target + // property due to COMPILE_FEATURES. The language standard selection + // should be done purely at generate time based on whatever the project + // code put in these properties explicitly. That is mostly true now, + // but for compatibility we need to continue updating the property here. + std::string newRequiredStandard; + bool newRequired = this->GetNewRequiredStandard( + target->GetName(), feature, + target->GetProperty(cmStrCat(lang, "_STANDARD")), newRequiredStandard, + error); + if (!newRequiredStandard.empty()) { + target->SetProperty(cmStrCat(lang, "_STANDARD"), newRequiredStandard); + } + return newRequired; +} + +bool cmStandardLevelResolver::CheckCompileFeaturesAvailable( + const std::string& targetName, const std::string& feature, std::string& lang, + std::string* error) const +{ + if (!this->CompileFeatureKnown(targetName, feature, lang, error)) { + return false; + } + + const char* features = this->CompileFeaturesAvailable(lang, error); + if (!features) { + return false; + } + + std::vector<std::string> availableFeatures = cmExpandedList(features); + if (!cm::contains(availableFeatures, feature)) { + std::ostringstream e; + e << "The compiler feature \"" << feature << "\" is not known to " << lang + << " compiler\n\"" + << this->Makefile->GetDefinition("CMAKE_" + lang + "_COMPILER_ID") + << "\"\nversion " + << this->Makefile->GetDefinition("CMAKE_" + lang + "_COMPILER_VERSION") + << "."; + if (error) { + *error = e.str(); + } else { + this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str()); + } + return false; + } + + return true; +} + +bool cmStandardLevelResolver::CompileFeatureKnown( + const std::string& targetName, const std::string& feature, std::string& lang, + std::string* error) const +{ + assert(cmGeneratorExpression::Find(feature) == std::string::npos); + + bool isCFeature = + std::find_if(cm::cbegin(C_FEATURES) + 1, cm::cend(C_FEATURES), + cmStrCmp(feature)) != cm::cend(C_FEATURES); + if (isCFeature) { + lang = "C"; + return true; + } + bool isCxxFeature = + std::find_if(cm::cbegin(CXX_FEATURES) + 1, cm::cend(CXX_FEATURES), + cmStrCmp(feature)) != cm::cend(CXX_FEATURES); + if (isCxxFeature) { + lang = "CXX"; + return true; + } + bool isCudaFeature = + std::find_if(cm::cbegin(CUDA_FEATURES) + 1, cm::cend(CUDA_FEATURES), + cmStrCmp(feature)) != cm::cend(CUDA_FEATURES); + if (isCudaFeature) { + lang = "CUDA"; + return true; + } + std::ostringstream e; + if (error) { + e << "specified"; + } else { + e << "Specified"; + } + e << " unknown feature \"" << feature + << "\" for " + "target \"" + << targetName << "\"."; + if (error) { + *error = e.str(); + } else { + this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str()); + } + return false; +} + +const char* cmStandardLevelResolver::CompileFeaturesAvailable( + const std::string& lang, std::string* error) const +{ + if (!this->Makefile->GetGlobalGenerator()->GetLanguageEnabled(lang)) { + std::ostringstream e; + if (error) { + e << "cannot"; + } else { + e << "Cannot"; + } + e << " use features from non-enabled language " << lang; + if (error) { + *error = e.str(); + } else { + this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str()); + } + return nullptr; + } + + const char* featuresKnown = + this->Makefile->GetDefinition("CMAKE_" + lang + "_COMPILE_FEATURES"); + + if (!featuresKnown || !*featuresKnown) { + std::ostringstream e; + if (error) { + e << "no"; + } else { + e << "No"; + } + e << " known features for " << lang << " compiler\n\"" + << this->Makefile->GetSafeDefinition("CMAKE_" + lang + "_COMPILER_ID") + << "\"\nversion " + << this->Makefile->GetSafeDefinition("CMAKE_" + lang + + "_COMPILER_VERSION") + << "."; + if (error) { + *error = e.str(); + } else { + this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str()); + } + return nullptr; + } + return featuresKnown; +} + +bool cmStandardLevelResolver::GetNewRequiredStandard( + const std::string& targetName, const std::string& feature, + cmProp currentLangStandardValue, std::string& newRequiredStandard, + std::string* error) const +{ + std::string lang; + if (!this->CheckCompileFeaturesAvailable(targetName, feature, lang, error)) { + return false; + } + + auto mapping = StandardComputerMapping.find(lang); + if (mapping != cm::cend(StandardComputerMapping)) { + return mapping->second.GetNewRequiredStandard( + this->Makefile, targetName, feature, currentLangStandardValue, + newRequiredStandard, error); + } + return false; +} + +bool cmStandardLevelResolver::HaveStandardAvailable( + cmGeneratorTarget const* target, std::string const& lang, + std::string const& config, const std::string& feature) const +{ + auto mapping = StandardComputerMapping.find(lang); + if (mapping != cm::cend(StandardComputerMapping)) { + return mapping->second.HaveStandardAvailable(this->Makefile, target, + config, feature); + } + return false; +} + +bool cmStandardLevelResolver::IsLaterStandard(std::string const& lang, + std::string const& lhs, + std::string const& rhs) const +{ + auto mapping = StandardComputerMapping.find(lang); + if (mapping != cm::cend(StandardComputerMapping)) { + return mapping->second.IsLaterStandard(std::stoi(lhs), std::stoi(rhs)); + } + return false; +} diff --git a/Source/cmStandardLevelResolver.h b/Source/cmStandardLevelResolver.h new file mode 100644 index 0000000..193c053 --- /dev/null +++ b/Source/cmStandardLevelResolver.h @@ -0,0 +1,55 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#ifndef cmStandardLevelResolver_h +#define cmStandardLevelResolver_h + +#include <string> + +#include "cmProperty.h" + +class cmMakefile; +class cmGeneratorTarget; +class cmTarget; + +class cmStandardLevelResolver +{ + +public: + explicit cmStandardLevelResolver(cmMakefile* makefile) + : Makefile(makefile) + { + } + + bool AddRequiredTargetFeature(cmTarget* target, const std::string& feature, + std::string* error = nullptr) const; + + bool CompileFeatureKnown(const std::string& targetName, + const std::string& feature, std::string& lang, + std::string* error) const; + + const char* CompileFeaturesAvailable(const std::string& lang, + std::string* error) const; + + bool GetNewRequiredStandard(const std::string& targetName, + const std::string& feature, + cmProp currentLangStandardValue, + std::string& newRequiredStandard, + std::string* error = nullptr) const; + + bool HaveStandardAvailable(cmGeneratorTarget const* target, + std::string const& lang, + std::string const& config, + const std::string& feature) const; + + bool IsLaterStandard(std::string const& lang, std::string const& lhs, + std::string const& rhs) const; + +private: + bool CheckCompileFeaturesAvailable(const std::string& targetName, + const std::string& feature, + std::string& lang, + std::string* error) const; + + cmMakefile* Makefile; +}; +#endif diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx index c223431..cfabc3f 100644 --- a/Source/cmStateSnapshot.cxx +++ b/Source/cmStateSnapshot.cxx @@ -148,7 +148,7 @@ bool cmStateSnapshot::PopPolicy() bool cmStateSnapshot::CanPopPolicyScope() { - return this->Position->Policies == this->Position->PolicyScope; + return this->Position->Policies != this->Position->PolicyScope; } void cmStateSnapshot::SetPolicy(cmPolicies::PolicyID id, @@ -232,11 +232,6 @@ void cmStateSnapshot::RemoveDefinition(std::string const& name) this->Position->Vars->Unset(name); } -std::vector<std::string> cmStateSnapshot::UnusedKeys() const -{ - return this->Position->Vars->UnusedKeys(); -} - std::vector<std::string> cmStateSnapshot::ClosureKeys() const { return cmDefinitions::ClosureKeys(this->Position->Vars, diff --git a/Source/cmStateSnapshot.h b/Source/cmStateSnapshot.h index 021fd53..c19f174 100644 --- a/Source/cmStateSnapshot.h +++ b/Source/cmStateSnapshot.h @@ -28,7 +28,6 @@ public: bool IsInitialized(std::string const& name) const; void SetDefinition(std::string const& name, cm::string_view value); void RemoveDefinition(std::string const& name); - std::vector<std::string> UnusedKeys() const; std::vector<std::string> ClosureKeys() const; bool RaiseScope(std::string const& var, const char* varDef); diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 1e78d36..798c29a 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1213,7 +1213,7 @@ bool cmSystemTools::UnsetEnv(const char* value) { # if !defined(HAVE_UNSETENV) std::string var = cmStrCat(value, '='); - return cmSystemTools::PutEnv(var.c_str()); + return cmSystemTools::PutEnv(var); # else unsetenv(value); return true; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 36e1ad5..a4f9083 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -7,6 +7,7 @@ #include <cstring> #include <initializer_list> #include <iterator> +#include <map> #include <set> #include <sstream> #include <unordered_set> @@ -185,6 +186,7 @@ public: std::vector<cmInstallTargetGenerator*> InstallGenerators; std::set<std::string> SystemIncludeDirectories; cmTarget::LinkLibraryVectorType OriginalLinkLibraries; + std::map<std::string, BTs<std::string>> LanguageStandardProperties; std::vector<std::string> IncludeDirectoriesEntries; std::vector<cmListFileBacktrace> IncludeDirectoriesBacktraces; std::vector<std::string> CompileOptionsEntries; @@ -417,8 +419,8 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, "INTERPROCEDURAL_OPTIMIZATION_" }; // Collect the set of configuration types. - std::vector<std::string> configNames; - mf->GetConfigurations(configNames); + std::vector<std::string> configNames = + mf->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig); for (std::string const& configName : configNames) { std::string configUpper = cmSystemTools::UpperCase(configName); for (auto const& prop : configProps) { @@ -598,6 +600,40 @@ cmGlobalGenerator* cmTarget::GetGlobalGenerator() const return impl->Makefile->GetGlobalGenerator(); } +BTs<std::string> const* cmTarget::GetLanguageStandardProperty( + const std::string& propertyName) const +{ + auto entry = impl->LanguageStandardProperties.find(propertyName); + if (entry != impl->LanguageStandardProperties.end()) { + return &entry->second; + } + + return nullptr; +} + +void cmTarget::SetLanguageStandardProperty(std::string const& lang, + std::string const& value, + const std::string& feature) +{ + cmListFileBacktrace featureBacktrace; + for (size_t i = 0; i < impl->CompileFeaturesEntries.size(); i++) { + if (impl->CompileFeaturesEntries[i] == feature) { + if (i < impl->CompileFeaturesBacktraces.size()) { + featureBacktrace = impl->CompileFeaturesBacktraces[i]; + } + break; + } + } + + BTs<std::string>& languageStandardProperty = + impl->LanguageStandardProperties[cmStrCat(lang, "_STANDARD")]; + if (languageStandardProperty.Value != value) { + languageStandardProperty.Value = value; + languageStandardProperty.Backtraces.clear(); + } + languageStandardProperty.Backtraces.emplace_back(featureBacktrace); +} + void cmTarget::AddUtility(std::string const& name, bool cross, cmMakefile* mf) { impl->Utilities.insert(BT<std::pair<std::string, bool>>( @@ -636,6 +672,12 @@ bool cmTarget::IsAppBundleOnApple() const this->GetPropertyAsBool("MACOSX_BUNDLE")); } +bool cmTarget::IsAndroidGuiExecutable() const +{ + return (this->GetType() == cmStateEnums::EXECUTABLE && impl->IsAndroid && + this->GetPropertyAsBool("ANDROID_GUI")); +} + std::vector<cmCustomCommand> const& cmTarget::GetPreBuildCommands() const { return impl->PreBuildCommands; @@ -1127,6 +1169,11 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) return; } #define MAKE_STATIC_PROP(PROP) static const std::string prop##PROP = #PROP + MAKE_STATIC_PROP(C_STANDARD); + MAKE_STATIC_PROP(CXX_STANDARD); + MAKE_STATIC_PROP(CUDA_STANDARD); + MAKE_STATIC_PROP(OBJC_STANDARD); + MAKE_STATIC_PROP(OBJCXX_STANDARD); MAKE_STATIC_PROP(COMPILE_DEFINITIONS); MAKE_STATIC_PROP(COMPILE_FEATURES); MAKE_STATIC_PROP(COMPILE_OPTIONS); @@ -1310,6 +1357,15 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) cmProp tmp = reusedTarget->GetProperty("COMPILE_PDB_NAME"); this->SetProperty("COMPILE_PDB_NAME", tmp ? tmp->c_str() : nullptr); this->AddUtility(reusedFrom, false, impl->Makefile); + } else if (prop == propC_STANDARD || prop == propCXX_STANDARD || + prop == propCUDA_STANDARD || prop == propOBJC_STANDARD || + prop == propOBJCXX_STANDARD) { + if (value) { + impl->LanguageStandardProperties[prop] = + BTs<std::string>(value, impl->Makefile->GetBacktrace()); + } else { + impl->LanguageStandardProperties.erase(prop); + } } else { impl->Properties.SetProperty(prop, value); } @@ -1413,6 +1469,11 @@ void cmTarget::AppendProperty(const std::string& prop, } else if (cmHasLiteralPrefix(prop, "IMPORTED_LIBNAME")) { impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, prop + " property may not be APPENDed."); + } else if (prop == "C_STANDARD" || prop == "CXX_STANDARD" || + prop == "CUDA_STANDARD" || prop == "OBJC_STANDARD" || + prop == "OBJCXX_STANDARD") { + impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, + prop + " property may not be appended."); } else { impl->Properties.AppendProperty(prop, value, asString); } @@ -1626,6 +1687,11 @@ cmProp cmTarget::GetComputedProperty(const std::string& prop, cmProp cmTarget::GetProperty(const std::string& prop) const { #define MAKE_STATIC_PROP(PROP) static const std::string prop##PROP = #PROP + MAKE_STATIC_PROP(C_STANDARD); + MAKE_STATIC_PROP(CXX_STANDARD); + MAKE_STATIC_PROP(CUDA_STANDARD); + MAKE_STATIC_PROP(OBJC_STANDARD); + MAKE_STATIC_PROP(OBJCXX_STANDARD); MAKE_STATIC_PROP(LINK_LIBRARIES); MAKE_STATIC_PROP(TYPE); MAKE_STATIC_PROP(INCLUDE_DIRECTORIES); @@ -1646,6 +1712,11 @@ cmProp cmTarget::GetProperty(const std::string& prop) const MAKE_STATIC_PROP(TRUE); #undef MAKE_STATIC_PROP static std::unordered_set<std::string> const specialProps{ + propC_STANDARD, + propCXX_STANDARD, + propCUDA_STANDARD, + propOBJC_STANDARD, + propOBJCXX_STANDARD, propLINK_LIBRARIES, propTYPE, propINCLUDE_DIRECTORIES, @@ -1664,6 +1735,15 @@ cmProp cmTarget::GetProperty(const std::string& prop) const propSOURCES }; if (specialProps.count(prop)) { + if (prop == propC_STANDARD || prop == propCXX_STANDARD || + prop == propCUDA_STANDARD || prop == propOBJC_STANDARD || + prop == propOBJCXX_STANDARD) { + auto propertyIter = impl->LanguageStandardProperties.find(prop); + if (propertyIter == impl->LanguageStandardProperties.end()) { + return nullptr; + } + return &(propertyIter->second.Value); + } if (prop == propLINK_LIBRARIES) { if (impl->LinkImplementationPropertyEntries.empty()) { return nullptr; @@ -1865,7 +1945,7 @@ const char* cmTarget::GetSuffixVariableInternal( case cmStateEnums::RuntimeBinaryArtifact: // Android GUI application packages store the native // binary as a shared library. - return (impl->IsAndroid && this->GetPropertyAsBool("ANDROID_GUI") + return (this->IsAndroidGuiExecutable() ? "CMAKE_SHARED_LIBRARY_SUFFIX" : "CMAKE_EXECUTABLE_SUFFIX"); case cmStateEnums::ImportLibraryArtifact: @@ -1906,7 +1986,7 @@ const char* cmTarget::GetPrefixVariableInternal( case cmStateEnums::RuntimeBinaryArtifact: // Android GUI application packages store the native // binary as a shared library. - return (impl->IsAndroid && this->GetPropertyAsBool("ANDROID_GUI") + return (this->IsAndroidGuiExecutable() ? "CMAKE_SHARED_LIBRARY_PREFIX" : ""); case cmStateEnums::ImportLibraryArtifact: diff --git a/Source/cmTarget.h b/Source/cmTarget.h index f0ddb68..7a16de8 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -209,6 +209,9 @@ public: //! Return whether this target is an executable Bundle on Apple. bool IsAppBundleOnApple() const; + //! Return whether this target is a GUI executable on Android. + bool IsAndroidGuiExecutable() const; + //! Get a backtrace from the creation of the target. cmListFileBacktrace const& GetBacktrace() const; @@ -233,6 +236,13 @@ public: void AddSystemIncludeDirectories(std::set<std::string> const& incs); std::set<std::string> const& GetSystemIncludeDirectories() const; + BTs<std::string> const* GetLanguageStandardProperty( + const std::string& propertyName) const; + + void SetLanguageStandardProperty(std::string const& lang, + std::string const& value, + const std::string& feature); + cmStringRange GetIncludeDirectoriesEntries() const; cmBacktraceRange GetIncludeDirectoriesBacktraces() const; diff --git a/Source/cmTargetCompileFeaturesCommand.cxx b/Source/cmTargetCompileFeaturesCommand.cxx index 06be4f0..aa1abdd 100644 --- a/Source/cmTargetCompileFeaturesCommand.cxx +++ b/Source/cmTargetCompileFeaturesCommand.cxx @@ -4,6 +4,7 @@ #include "cmMakefile.h" #include "cmMessageType.h" +#include "cmStandardLevelResolver.h" #include "cmStringAlgorithms.h" #include "cmTargetPropCommandBase.h" @@ -29,9 +30,10 @@ private: const std::vector<std::string>& content, bool /*prepend*/, bool /*system*/) override { + cmStandardLevelResolver standardResolver(this->Makefile); for (std::string const& it : content) { std::string error; - if (!this->Makefile->AddRequiredTargetFeature(tgt, it, &error)) { + if (!standardResolver.AddRequiredTargetFeature(tgt, it, &error)) { this->SetError(error); return false; // Not (successfully) handled. } diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index a3ccd2b..5f6b41d 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -232,15 +232,17 @@ cmVisualStudio10TargetGenerator::cmVisualStudio10TargetGenerator( , LocalGenerator( (cmLocalVisualStudio10Generator*)target->GetLocalGenerator()) { - this->Makefile->GetConfigurations(this->Configurations); + this->Configurations = + this->Makefile->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig); this->NsightTegra = gg->IsNsightTegra(); + this->Android = gg->TargetsAndroid(); for (int i = 0; i < 4; ++i) { this->NsightTegraVersion[i] = 0; } sscanf(gg->GetNsightTegraVersion().c_str(), "%u.%u.%u.%u", &this->NsightTegraVersion[0], &this->NsightTegraVersion[1], &this->NsightTegraVersion[2], &this->NsightTegraVersion[3]); - this->MSTools = !this->NsightTegra; + this->MSTools = !this->NsightTegra && !this->Android; this->Managed = false; this->TargetCompileAsWinRT = false; this->IsMissingFiles = false; @@ -333,6 +335,13 @@ void cmVisualStudio10TargetGenerator::Generate() this->ProjectType = csproj; this->Managed = true; } + + if (this->Android && + this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE && + !this->GeneratorTarget->Target->IsAndroidGuiExecutable()) { + this->GlobalGenerator->AddAndroidExecutableWarning(this->Name); + } + // Tell the global generator the name of the project file this->GeneratorTarget->Target->SetProperty("GENERATOR_FILE_NAME", this->Name); @@ -427,7 +436,7 @@ void cmVisualStudio10TargetGenerator::Generate() e1.Attribute("Label", "Globals"); e1.Element("ProjectGuid", "{" + this->GUID + "}"); - if (this->MSTools && + if ((this->MSTools || this->Android) && this->GeneratorTarget->GetType() <= cmStateEnums::GLOBAL_TARGET) { this->WriteApplicationTypeSettings(e1); this->VerifyNecessaryFiles(); @@ -469,7 +478,11 @@ void cmVisualStudio10TargetGenerator::Generate() cmProp vsGlobalKeyword = this->GeneratorTarget->GetProperty("VS_GLOBAL_KEYWORD"); if (!vsGlobalKeyword) { - e1.Element("Keyword", "Win32Proj"); + if (this->GlobalGenerator->TargetsAndroid()) { + e1.Element("Keyword", "Android"); + } else { + e1.Element("Keyword", "Win32Proj"); + } } else { e1.Element("Keyword", *vsGlobalKeyword); } @@ -658,7 +671,7 @@ void cmVisualStudio10TargetGenerator::Generate() cmStrCat(this->DefaultArtifactDir, "\\nasm.props"); ConvertToWindowsSlash(propsLocal); this->Makefile->ConfigureFile(propsTemplate, propsLocal, false, true, - true); + true, true); Elem(e1, "Import").Attribute("Project", propsLocal); } } @@ -1134,9 +1147,11 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0) break; case cmStateEnums::EXECUTABLE: if (this->NsightTegra && - !this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI")) { + !this->GeneratorTarget->Target->IsAndroidGuiExecutable()) { // Android executables are .so too. configType = "DynamicLibrary"; + } else if (this->Android) { + configType = "DynamicLibrary"; } else { configType = "Application"; } @@ -1166,6 +1181,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0) } } else if (this->NsightTegra) { this->WriteNsightTegraConfigurationValues(e1, c); + } else if (this->Android) { + this->WriteAndroidConfigurationValues(e1, c); } } } @@ -1324,6 +1341,24 @@ void cmVisualStudio10TargetGenerator::WriteNsightTegraConfigurationValues( } } +void cmVisualStudio10TargetGenerator::WriteAndroidConfigurationValues( + Elem& e1, std::string const&) +{ + cmGlobalVisualStudio10Generator* gg = this->GlobalGenerator; + if (cmProp projectToolsetOverride = + this->GeneratorTarget->GetProperty("VS_PLATFORM_TOOLSET")) { + e1.Element("PlatformToolset", *projectToolsetOverride); + } else if (const char* toolset = gg->GetPlatformToolset()) { + e1.Element("PlatformToolset", toolset); + } + if (cmProp stlType = + this->GeneratorTarget->GetProperty("ANDROID_STL_TYPE")) { + if (*stlType != "none") { + e1.Element("UseOfStl", *stlType); + } + } +} + void cmVisualStudio10TargetGenerator::WriteCustomCommands(Elem& e0) { this->CSharpCustomCommandNames.clear(); @@ -2909,7 +2944,9 @@ void cmVisualStudio10TargetGenerator::WriteClOptions( } } - if (this->MSTools) { + if (this->Android) { + e2.Element("ObjectFileName", "$(IntDir)%(filename).o"); + } else if (this->MSTools) { cmsys::RegularExpression clangToolset("v[0-9]+_clang_.*"); const char* toolset = this->GlobalGenerator->GetPlatformToolset(); if (toolset && clangToolset.find(toolset)) { @@ -4015,8 +4052,7 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups(Elem& e0) // output manifest flags <Manifest></Manifest> this->WriteManifestOptions(e1, c); if (this->NsightTegra && - this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE && - this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI")) { + this->GeneratorTarget->Target->IsAndroidGuiExecutable()) { this->WriteAntBuildOptions(e1, c); } } @@ -4131,8 +4167,9 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0) } // Don't reference targets that don't produce any output. - if (dt->GetManagedType(this->Configurations[0]) == - cmGeneratorTarget::ManagedType::Undefined) { + if (this->Configurations.empty() || + dt->GetManagedType(this->Configurations[0]) == + cmGeneratorTarget::ManagedType::Undefined) { e2.Element("ReferenceOutputAssembly", "false"); e2.Element("CopyToOutputDirectory", "Never"); } @@ -4348,6 +4385,7 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings(Elem& e1) bool isAppContainer = false; bool const isWindowsPhone = this->GlobalGenerator->TargetsWindowsPhone(); bool const isWindowsStore = this->GlobalGenerator->TargetsWindowsStore(); + bool const isAndroid = this->GlobalGenerator->TargetsAndroid(); std::string const& rev = this->GlobalGenerator->GetApplicationTypeRevision(); if (isWindowsPhone || isWindowsStore) { e1.Element("ApplicationType", @@ -4385,13 +4423,19 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings(Elem& e1) this->Name + "_$(Configuration)_$(Platform).xap"); } } + } else if (isAndroid) { + e1.Element("ApplicationType", "Android"); + e1.Element("ApplicationTypeRevision", + gg->GetAndroidApplicationTypeRevision()); } if (isAppContainer) { e1.Element("AppContainerApplication", "true"); - } else if (this->Platform == "ARM64") { - e1.Element("WindowsSDKDesktopARM64Support", "true"); - } else if (this->Platform == "ARM") { - e1.Element("WindowsSDKDesktopARMSupport", "true"); + } else if (!isAndroid) { + if (this->Platform == "ARM64") { + e1.Element("WindowsSDKDesktopARM64Support", "true"); + } else if (this->Platform == "ARM") { + e1.Element("WindowsSDKDesktopARMSupport", "true"); + } } std::string const& targetPlatformVersion = gg->GetWindowsTargetPlatformVersion(); diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index 7c71de3..c54057a 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -70,6 +70,7 @@ private: void WriteExtraSource(Elem& e1, cmSourceFile const* sf); void WriteNsightTegraConfigurationValues(Elem& e1, std::string const& config); + void WriteAndroidConfigurationValues(Elem& e1, std::string const& config); void WriteSource(Elem& e2, cmSourceFile const* sf); void WriteExcludeFromBuild(Elem& e2, std::vector<size_t> const& exclude_configs); @@ -215,6 +216,7 @@ private: bool MSTools; bool Managed; bool NsightTegra; + bool Android; unsigned int NsightTegraVersion[4]; bool TargetCompileAsWinRT; std::set<std::string> IPOEnabledConfigurations; diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx index f4c2f2d..0e3cf08 100644 --- a/Source/cmXCodeScheme.cxx +++ b/Source/cmXCodeScheme.cxx @@ -33,7 +33,7 @@ void cmXCodeScheme::WriteXCodeSharedScheme(const std::string& xcProjDir, // Create shared scheme sub-directory tree // std::string xcodeSchemeDir = cmStrCat(xcProjDir, "/xcshareddata/xcschemes"); - cmSystemTools::MakeDirectory(xcodeSchemeDir.c_str()); + cmSystemTools::MakeDirectory(xcodeSchemeDir); std::string xcodeSchemeFile = cmStrCat(xcodeSchemeDir, '/', this->TargetName, ".xcscheme"); diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 162e807..2656849 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -64,10 +64,6 @@ # include "cmVariableWatch.h" #endif -#if !defined(CMAKE_BOOTSTRAP) -# define CMAKE_USE_ECLIPSE -#endif - #if defined(__MINGW32__) && defined(CMAKE_BOOTSTRAP) # define CMAKE_BOOT_MINGW #endif @@ -101,16 +97,13 @@ #if !defined(CMAKE_BOOTSTRAP) # include "cmGlobalNinjaGenerator.h" #endif -#include "cmExtraCodeLiteGenerator.h" -#if !defined(CMAKE_BOOT_MINGW) +#if !defined(CMAKE_BOOTSTRAP) # include "cmExtraCodeBlocksGenerator.h" -#endif -#include "cmExtraKateGenerator.h" -#include "cmExtraSublimeTextGenerator.h" - -#ifdef CMAKE_USE_ECLIPSE +# include "cmExtraCodeLiteGenerator.h" # include "cmExtraEclipseCDT4Generator.h" +# include "cmExtraKateGenerator.h" +# include "cmExtraSublimeTextGenerator.h" #endif #if defined(__linux__) || defined(_WIN32) @@ -201,7 +194,7 @@ cmake::cmake(Role role, cmState::Mode mode) }; // The "c" extension MUST precede the "C" extension. - setupExts(this->SourceFileExtensions, + setupExts(this->CLikeSourceFileExtensions, { "c", "C", "c++", "cc", "cpp", "cxx", "cu", "m", "M", "mm" }); setupExts(this->HeaderFileExtensions, { "h", "hh", "h++", "hm", "hpp", "hxx", "in", "txx" }); @@ -780,8 +773,7 @@ void cmake::SetArgs(const std::vector<std::string>& args) std::cout << "Warn about uninitialized values.\n"; this->SetWarnUninitialized(true); } else if (cmHasLiteralPrefix(arg, "--warn-unused-vars")) { - std::cout << "Finding unused variables.\n"; - this->SetWarnUnused(true); + // Option was removed. } else if (cmHasLiteralPrefix(arg, "--no-warn-unused-cli")) { std::cout << "Not searching for unused variables given on the " << "command line.\n"; @@ -1137,13 +1129,9 @@ void cmake::AddDefaultExtraGenerators() #if !defined(CMAKE_BOOTSTRAP) this->ExtraGenerators.push_back(cmExtraCodeBlocksGenerator::GetFactory()); this->ExtraGenerators.push_back(cmExtraCodeLiteGenerator::GetFactory()); - this->ExtraGenerators.push_back(cmExtraSublimeTextGenerator::GetFactory()); - this->ExtraGenerators.push_back(cmExtraKateGenerator::GetFactory()); - -# ifdef CMAKE_USE_ECLIPSE this->ExtraGenerators.push_back(cmExtraEclipseCDT4Generator::GetFactory()); -# endif - + this->ExtraGenerators.push_back(cmExtraKateGenerator::GetFactory()); + this->ExtraGenerators.push_back(cmExtraSublimeTextGenerator::GetFactory()); #endif } @@ -1383,7 +1371,7 @@ struct SaveCacheEntry int cmake::HandleDeleteCacheVariables(const std::string& var) { - std::vector<std::string> argsSplit = cmExpandedList(std::string(var), true); + std::vector<std::string> argsSplit = cmExpandedList(var, true); // erase the property to avoid infinite recursion this->State->SetGlobalProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_", ""); if (this->State->GetIsInTryCompile()) { @@ -1970,6 +1958,17 @@ void cmake::AddGlobCacheEntry(bool recurse, bool listDirectories, backtrace); } +std::vector<std::string> cmake::GetAllExtensions() const +{ + std::vector<std::string> allExt = this->CLikeSourceFileExtensions.ordered; + allExt.insert(allExt.end(), this->HeaderFileExtensions.ordered.begin(), + this->HeaderFileExtensions.ordered.end()); + // cuda extensions are also in SourceFileExtensions so we ignore it here + allExt.insert(allExt.end(), this->FortranFileExtensions.ordered.begin(), + this->FortranFileExtensions.ordered.end()); + return allExt; +} + std::string cmake::StripExtension(const std::string& file) const { auto dotpos = file.rfind('.'); @@ -1979,7 +1978,7 @@ std::string cmake::StripExtension(const std::string& file) const #else auto ext = cm::string_view(file).substr(dotpos + 1); #endif - if (this->IsSourceExtension(ext) || this->IsHeaderExtension(ext)) { + if (this->IsAKnownExtension(ext)) { return file.substr(0, dotpos); } } diff --git a/Source/cmake.h b/Source/cmake.h index 086ec87..0c4f429 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -264,44 +264,33 @@ public: this->GeneratorToolsetSet = true; } - const std::vector<std::string>& GetSourceExtensions() const + bool IsAKnownSourceExtension(cm::string_view ext) const { - return this->SourceFileExtensions.ordered; + return this->CLikeSourceFileExtensions.Test(ext) || + this->CudaFileExtensions.Test(ext) || + this->FortranFileExtensions.Test(ext); } - bool IsSourceExtension(cm::string_view ext) const + bool IsACLikeSourceExtension(cm::string_view ext) const { - return this->SourceFileExtensions.Test(ext); + return this->CLikeSourceFileExtensions.Test(ext); } - const std::vector<std::string>& GetHeaderExtensions() const - { - return this->HeaderFileExtensions.ordered; - } - - bool IsHeaderExtension(cm::string_view ext) const - { - return this->HeaderFileExtensions.Test(ext); - } - - const std::vector<std::string>& GetCudaExtensions() const + bool IsAKnownExtension(cm::string_view ext) const { - return this->CudaFileExtensions.ordered; + return this->IsAKnownSourceExtension(ext) || this->IsAHeaderExtension(ext); } - bool IsCudaExtension(cm::string_view ext) const - { - return this->CudaFileExtensions.Test(ext); - } + std::vector<std::string> GetAllExtensions() const; - const std::vector<std::string>& GetFortranExtensions() const + const std::vector<std::string>& GetHeaderExtensions() const { - return this->FortranFileExtensions.ordered; + return this->HeaderFileExtensions.ordered; } - bool IsFortranExtension(cm::string_view ext) const + bool IsAHeaderExtension(cm::string_view ext) const { - return this->FortranFileExtensions.Test(ext); + return this->HeaderFileExtensions.Test(ext); } // Strips the extension (if present and known) from a filename @@ -461,8 +450,6 @@ public: bool GetWarnUninitialized() { return this->WarnUninitialized; } void SetWarnUninitialized(bool b) { this->WarnUninitialized = b; } - bool GetWarnUnused() { return this->WarnUnused; } - void SetWarnUnused(bool b) { this->WarnUnused = b; } bool GetWarnUnusedCli() { return this->WarnUnusedCli; } void SetWarnUnusedCli(bool b) { this->WarnUnusedCli = b; } bool GetCheckSystemVars() { return this->CheckSystemVars; } @@ -616,7 +603,6 @@ private: TraceFormat TraceFormatVar = TRACE_HUMAN; cmGeneratedFileStream TraceFile; bool WarnUninitialized = false; - bool WarnUnused = false; bool WarnUnusedCli = true; bool CheckSystemVars = false; std::map<std::string, bool> UsedCliVariables; @@ -628,7 +614,7 @@ private: std::string CheckStampList; std::string VSSolutionFile; std::string EnvironmentGenerator; - FileExtensions SourceFileExtensions; + FileExtensions CLikeSourceFileExtensions; FileExtensions HeaderFileExtensions; FileExtensions CudaFileExtensions; FileExtensions FortranFileExtensions; diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index e0c17f8..7c66c5c 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -3,11 +3,13 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include <algorithm> #include <cassert> #include <cctype> #include <climits> #include <cstring> #include <iostream> +#include <sstream> #include <string> #include <vector> @@ -91,13 +93,14 @@ const char* cmDocumentationOptions[][2] = { { "--trace-redirect=<file>", "Redirect trace output to a file instead of stderr." }, { "--warn-uninitialized", "Warn about uninitialized values." }, - { "--warn-unused-vars", "Warn about unused variables." }, { "--no-warn-unused-cli", "Don't warn about command line options." }, { "--check-system-vars", "Find problems with variable usage in system " "files." }, # if !defined(CMAKE_BOOTSTRAP) - { "--profiling-format=<fmt>", "Output data for profiling CMake scripts." }, + { "--profiling-format=<fmt>", + "Output data for profiling CMake scripts. Supported formats: " + "google-trace" }, { "--profiling-output=<file>", "Select an output path for the profiling data enabled through " "--profiling-format." }, @@ -517,6 +520,121 @@ int do_build(int ac, char const* const* av) #endif } +bool parse_default_directory_permissions(const std::string& permissions, + std::string& parsedPermissionsVar) +{ + std::vector<std::string> parsedPermissions; + enum Doing + { + DoingNone, + DoingOwner, + DoingGroup, + DoingWorld, + DoingOwnerAssignment, + DoingGroupAssignment, + DoingWorldAssignment, + }; + Doing doing = DoingNone; + + auto uniquePushBack = [&parsedPermissions](const std::string& e) { + if (std::find(parsedPermissions.begin(), parsedPermissions.end(), e) == + parsedPermissions.end()) { + parsedPermissions.push_back(e); + } + }; + + for (auto const& e : permissions) { + switch (doing) { + case DoingNone: + if (e == 'u') { + doing = DoingOwner; + } else if (e == 'g') { + doing = DoingGroup; + } else if (e == 'o') { + doing = DoingWorld; + } else { + return false; + } + break; + case DoingOwner: + if (e == '=') { + doing = DoingOwnerAssignment; + } else { + return false; + } + break; + case DoingGroup: + if (e == '=') { + doing = DoingGroupAssignment; + } else { + return false; + } + break; + case DoingWorld: + if (e == '=') { + doing = DoingWorldAssignment; + } else { + return false; + } + break; + case DoingOwnerAssignment: + if (e == 'r') { + uniquePushBack("OWNER_READ"); + } else if (e == 'w') { + uniquePushBack("OWNER_WRITE"); + } else if (e == 'x') { + uniquePushBack("OWNER_EXECUTE"); + } else if (e == ',') { + doing = DoingNone; + } else { + return false; + } + break; + case DoingGroupAssignment: + if (e == 'r') { + uniquePushBack("GROUP_READ"); + } else if (e == 'w') { + uniquePushBack("GROUP_WRITE"); + } else if (e == 'x') { + uniquePushBack("GROUP_EXECUTE"); + } else if (e == ',') { + doing = DoingNone; + } else { + return false; + } + break; + case DoingWorldAssignment: + if (e == 'r') { + uniquePushBack("WORLD_READ"); + } else if (e == 'w') { + uniquePushBack("WORLD_WRITE"); + } else if (e == 'x') { + uniquePushBack("WORLD_EXECUTE"); + } else if (e == ',') { + doing = DoingNone; + } else { + return false; + } + break; + } + } + if (doing != DoingOwnerAssignment && doing != DoingGroupAssignment && + doing != DoingWorldAssignment) { + return false; + } + + std::ostringstream oss; + for (auto i = 0u; i < parsedPermissions.size(); i++) { + if (i != 0) { + oss << ";"; + } + oss << parsedPermissions[i]; + } + + parsedPermissionsVar = oss.str(); + return true; +} + int do_install(int ac, char const* const* av) { #ifdef CMAKE_BOOTSTRAP @@ -527,6 +645,7 @@ int do_install(int ac, char const* const* av) std::string config; std::string component; + std::string defaultDirectoryPermissions; std::string prefix; std::string dir; bool strip = false; @@ -539,6 +658,7 @@ int do_install(int ac, char const* const* av) DoingConfig, DoingComponent, DoingPrefix, + DoingDefaultDirectoryPermissions, }; Doing doing = DoingDir; @@ -557,6 +677,8 @@ int do_install(int ac, char const* const* av) (strcmp(av[i], "-v") == 0)) { verbose = true; doing = DoingNone; + } else if (strcmp(av[i], "--default-directory-permissions") == 0) { + doing = DoingDefaultDirectoryPermissions; } else { switch (doing) { case DoingDir: @@ -575,6 +697,10 @@ int do_install(int ac, char const* const* av) prefix = av[i]; doing = DoingNone; break; + case DoingDefaultDirectoryPermissions: + defaultDirectoryPermissions = av[i]; + doing = DoingNone; + break; default: std::cerr << "Unknown argument " << av[i] << std::endl; dir.clear(); @@ -591,6 +717,8 @@ int do_install(int ac, char const* const* av) " <dir> = Project binary directory to install.\n" " --config <cfg> = For multi-configuration tools, choose <cfg>.\n" " --component <comp> = Component-based install. Only install <comp>.\n" + " --default-directory-permissions <permission> \n" + " Default install permission. Use default permission <permission>.\n" " --prefix <prefix> = The installation prefix CMAKE_INSTALL_PREFIX.\n" " --strip = Performing install/strip.\n" " -v --verbose = Enable verbose output.\n" @@ -631,6 +759,18 @@ int do_install(int ac, char const* const* av) args.emplace_back("-DCMAKE_INSTALL_CONFIG_NAME=" + config); } + if (!defaultDirectoryPermissions.empty()) { + std::string parsedPermissionsVar; + if (!parse_default_directory_permissions(defaultDirectoryPermissions, + parsedPermissionsVar)) { + std::cerr << "--default-directory-permissions is in incorrect format" + << std::endl; + return 1; + } + args.emplace_back("-DCMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS=" + + parsedPermissionsVar); + } + args.emplace_back("-P"); args.emplace_back(dir + "/cmake_install.cmake"); diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index de76d73..49e8a4f 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -582,12 +582,10 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args) filesDiffer = cmsys::SystemTools::TextFilesDiffer(args[3], args[4]); } else { ::CMakeCommandUsage(args[0].c_str()); - return 1; + return 2; } if (filesDiffer) { - std::cerr << "Files \"" << args[args.size() - 2] << "\" to \"" - << args[args.size() - 1] << "\" are different.\n"; return 1; } return 0; @@ -602,8 +600,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args) } cmsys::ifstream fin(args[3].c_str(), std::ios::in | std::ios::binary); if (!fin) { - std::cerr << "could not open object list file: " << args[3].c_str() - << "\n"; + std::cerr << "could not open object list file: " << args[3] << "\n"; return 1; } std::vector<std::string> files; @@ -626,13 +623,12 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args) } FILE* fout = cmsys::SystemTools::Fopen(args[2], "w+"); if (!fout) { - std::cerr << "could not open output .def file: " << args[2].c_str() - << "\n"; + std::cerr << "could not open output .def file: " << args[2] << "\n"; return 1; } bindexplib deffile; if (args.size() >= 5) { - auto a = args[4]; + std::string const& a = args[4]; if (cmHasLiteralPrefix(a, "--nm=")) { deffile.SetNmPath(a.substr(5)); std::cerr << a.substr(5) << "\n"; @@ -640,7 +636,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args) std::cerr << "unknown argument: " << a << "\n"; } } - for (auto const& file : files) { + for (std::string const& file : files) { std::string const& ext = cmSystemTools::GetFilenameLastExtension(file); if (cmSystemTools::LowerCase(ext) == ".def") { if (!deffile.AddDefinitionFile(file.c_str())) { @@ -1022,7 +1018,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args) // Command to create a symbolic link. Fails on platforms not // supporting them. if (args[1] == "create_symlink" && args.size() == 4) { - const char* destinationFileName = args[3].c_str(); + std::string const& destinationFileName = args[3]; if ((cmSystemTools::FileExists(destinationFileName) || cmSystemTools::FileIsSymlink(destinationFileName)) && !cmSystemTools::RemoveFile(destinationFileName)) { @@ -1379,15 +1375,12 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args) #if defined(_WIN32) && !defined(__CYGWIN__) // Write registry value if (args[1] == "write_regv" && args.size() > 3) { - return cmSystemTools::WriteRegistryValue(args[2].c_str(), - args[3].c_str()) - ? 0 - : 1; + return cmSystemTools::WriteRegistryValue(args[2], args[3]) ? 0 : 1; } // Delete registry value if (args[1] == "delete_regv" && args.size() > 2) { - return cmSystemTools::DeleteRegistryValue(args[2].c_str()) ? 0 : 1; + return cmSystemTools::DeleteRegistryValue(args[2]) ? 0 : 1; } // Remove file diff --git a/Tests/CMakeLib/CMakeLists.txt b/Tests/CMakeLib/CMakeLists.txt index bb50d76..0b2c8f6 100644 --- a/Tests/CMakeLib/CMakeLists.txt +++ b/Tests/CMakeLib/CMakeLists.txt @@ -29,6 +29,9 @@ set(CMakeLib_TESTS testCMExtMemory.cxx testCMExtAlgorithm.cxx ) +if (CMake_TEST_FILESYSTEM_PATH OR NOT CMake_HAVE_CXX_FILESYSTEM) + list(APPEND CMakeLib_TESTS testCMFilesystemPath.cxx) +endif() add_executable(testUVProcessChainHelper testUVProcessChainHelper.cxx) diff --git a/Tests/CMakeLib/PseudoMemcheck/CMakeLists.txt b/Tests/CMakeLib/PseudoMemcheck/CMakeLists.txt index 7c84ee1..4bef6c5 100644 --- a/Tests/CMakeLib/PseudoMemcheck/CMakeLists.txt +++ b/Tests/CMakeLib/PseudoMemcheck/CMakeLists.txt @@ -15,6 +15,9 @@ target_link_libraries(pseudo_purify CMakeLib) add_executable(pseudo_BC "${CMAKE_CURRENT_BINARY_DIR}/ret0.cxx") set_target_properties(pseudo_BC PROPERTIES OUTPUT_NAME BC) target_link_libraries(pseudo_BC CMakeLib) +add_executable(pseudo_cuda-memcheck "${CMAKE_CURRENT_BINARY_DIR}/ret0.cxx") +set_target_properties(pseudo_cuda-memcheck PROPERTIES OUTPUT_NAME cuda-memcheck) +target_link_libraries(pseudo_cuda-memcheck CMakeLib) # binary to be used as pre- and post-memcheck command that fails add_executable(memcheck_fail "${CMAKE_CURRENT_BINARY_DIR}/ret1.cxx") diff --git a/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in b/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in index 3183bc0..f37ad59 100644 --- a/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in +++ b/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in @@ -1,8 +1,14 @@ -#include <cmSystemTools.h> -#include "cmsys/Encoding.hxx" #include <string> +#include <vector> + +#include "cmsys/Encoding.hxx" + +#include <cmSystemTools.h> +// clang-format off #define RETVAL @_retval@ +#define CMAKE_COMMAND "@CMAKE_COMMAND@" +// clang-format on int main(int ac, char** av) { @@ -14,6 +20,9 @@ int main(int ac, char** av) std::string exename = argv[0]; std::string logarg; bool nextarg = false; + // execute the part after the last argument? + // the logfile path gets passed as environment variable PSEUDO_LOGFILE + bool exec = false; if (exename.find("valgrind") != std::string::npos) { logarg = "--log-file="; @@ -26,6 +35,10 @@ int main(int ac, char** av) } else if (exename.find("BC") != std::string::npos) { nextarg = true; logarg = "/X"; + } else if (exename.find("cuda-memcheck") != std::string::npos) { + nextarg = true; + exec = true; + logarg = "--log-file"; } if (!logarg.empty()) { @@ -45,8 +58,25 @@ int main(int ac, char** av) } } + // find the last argument position + int lastarg_pos = 1; + for (int i = 1; i < argc; ++i) { + std::string arg = argv[i]; + if (arg.find("--") == 0) { + lastarg_pos = i; + } + } + if (!logfile.empty()) { cmSystemTools::Touch(logfile, true); + // execute everything after the last argument with additional environment + int callarg_pos = lastarg_pos + (nextarg ? 2 : 1); + if (exec && callarg_pos < argc) { + std::vector<std::string> callargs{ CMAKE_COMMAND, "-E", "env", + "PSEUDO_LOGFILE=" + logfile }; + callargs.insert(callargs.end(), &argv[callarg_pos], &argv[argc]); + cmSystemTools::RunSingleCommand(callargs); + } } } diff --git a/Tests/CMakeLib/testCMFilesystemPath.cxx b/Tests/CMakeLib/testCMFilesystemPath.cxx new file mode 100644 index 0000000..1e84520 --- /dev/null +++ b/Tests/CMakeLib/testCMFilesystemPath.cxx @@ -0,0 +1,1006 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#include <algorithm> +#include <iostream> +#include <sstream> +#include <string> +#include <vector> + +#include <cm/filesystem> +#include <cm/iomanip> + +namespace { + +namespace fs = cm::filesystem; + +void checkResult(bool success) +{ + if (!success) { + std::cout << " => failed"; + } + std::cout << std::endl; +} + +bool testConstructors() +{ + std::cout << "testConstructors()"; + + bool result = true; + + { + fs::path p; + if (p != fs::path()) { + result = false; + } + } + { + fs::path p1("/a/b/c"); + fs::path p2("/a/b/c"); + if (p1 != p2) { + result = false; + } + if (p1.string() != p2.string()) { + result = false; + } + if (p1.string() != "/a/b/c") { + result = false; + } + } + { + std::string s("/a/b/c"); + fs::path p1(s); + fs::path p2(s.begin(), s.end()); + if (p1 != p2) { + result = false; + } + if (p1.string() != s || p2.string() != s) { + result = false; + } +#if CM_FILESYSTEM_SOURCE_TRAITS_ITERATOR + std::string s2(s); + s2 += '\0'; + fs::path p3(s2.begin()); + if (p1 != p3 || p3.string() != s) { + result = false; + } +#endif + } + { + std::wstring s(L"/a/b/c"); + fs::path p1(s); + fs::path p2(s.begin(), s.end()); + if (p1 != p2) { + result = false; + } + if (p1.wstring() != s || p2.wstring() != s) { + result = false; + } +#if CM_FILESYSTEM_SOURCE_TRAITS_ITERATOR + std::wstring s2(s); + s2 += L'\0'; + fs::path p3(s2.begin()); + if (p1 != p3 || p3.wstring() != s) { + result = false; + } +#endif + } + { + std::string s("/a/b/c"); + fs::path::string_type ws; + for (auto c : s) { + ws += fs::path::value_type(c); + } + fs::path p1(ws); + fs::path p2(ws.begin(), ws.end()); + if (p1 != p2) { + result = false; + } + if (p1.native() != ws || p2.native() != ws) { + result = false; + } +#if CM_FILESYSTEM_SOURCE_TRAITS_ITERATOR + fs::path::string_type ws2(ws); + ws2 += fs::path::value_type('\0'); + fs::path p3(ws2.begin()); + if (p1 != p3 || p3.native() != ws) { + result = false; + } +#endif + } + + checkResult(result); + + return result; +} + +bool testConcatenation() +{ + std::cout << "testConcatenation()"; + + bool result = true; + + { + fs::path p("/a/b"); + p /= "c"; + if (!(p.string() == "/a/b/c" || p.string() == "/a/b\\c")) { + result = false; + } + p += "d"; + if (!(p.string() == "/a/b/cd" || p.string() == "/a/b\\cd")) { + result = false; + } + fs::path p2("x/y"); + p /= p2; + if (!(p.string() == "/a/b/cd/x/y" || p.string() == "/a/b\\cd\\x/y")) { + result = false; + } + p = p / p2; + if (!(p.string() == "/a/b/cd/x/y/x/y" || + p.string() == "/a/b\\cd\\x/y\\x/y")) { + result = false; + } + } + { + fs::path p("a"); + p /= ""; + if (!(p.string() == "a/" || p.string() == "a\\")) { + result = false; + } + p /= "/b"; + if (p.string() != "/b") { + result = false; + } + } +#if defined(_WIN32) + { + fs::path p("a"); + p /= "c:/b"; + if (p.string() != "c:/b") { + result = false; + } + p = fs::path("a") / "c:"; + if (p.string() != "c:") { + result = false; + } + p = fs::path("c:") / ""; + if (p.string() != "c:") { + result = false; + } + p = fs::path("c:a") / "/b"; + if (p.string() != "c:/b") { + result = false; + } + p = fs::path("c:a") / "c:b"; + if (p.string() != "c:a\\b") { + result = false; + } + p = fs::path("//host") / "b"; + if (p.string() != "//host\\b") { + result = false; + } + p = fs::path("//host/") / "b"; + if (p.string() != "//host/b") { + result = false; + } + } +#endif + + checkResult(result); + + return result; +} + +bool testModifiers() +{ + std::cout << "testModifiers()"; + + bool result = true; + + { + std::string s("a///b/"); + fs::path p(s); + std::replace( + s.begin(), s.end(), '/', + static_cast<std::string::value_type>(fs::path::preferred_separator)); + p.make_preferred(); + if (p.string() != s) { + result = false; + } + } + { + fs::path p("a/b/c.e.f"); + p.remove_filename(); + if (p.string() != "a/b/") { + result = false; + } + p.remove_filename(); + if (p.string() != "a/b/") { + result = false; + } + } + { + fs::path p("a/b/c.e.f"); + p.replace_filename("x.y"); + if (p.string() != "a/b/x.y") { + result = false; + } + } + { + fs::path p("a/b/c.e.f"); + p.replace_extension(".x"); + if (p.string() != "a/b/c.e.x") { + result = false; + } + p.replace_extension(".y"); + if (p.string() != "a/b/c.e.y") { + result = false; + } + p.replace_extension(); + if (p.string() != "a/b/c.e") { + result = false; + } + p = "/a/b"; + p.replace_extension(".x"); + if (p.string() != "/a/b.x") { + result = false; + } + p = "/a/b/"; + p.replace_extension(".x"); + if (p.string() != "/a/b/.x") { + result = false; + } + } + + checkResult(result); + + return result; +} + +bool testObservers() +{ + std::cout << "testObservers()"; + + bool result = true; + + { + std::string s("a/b/c"); + fs::path p(s); + fs::path::string_type st; + for (auto c : s) { + st += static_cast<fs::path::value_type>(c); + } + if (p.native() != st || static_cast<fs::path::string_type>(p) != st || + p.c_str() != st) { + result = false; + } + } + { + std::string s("a//b//c"); + std::wstring ws(L"a//b//c"); + fs::path p(s); + if (p.string() != s || p.wstring() != ws) { + result = false; + } + } + { + std::string s("a/b/c"); + std::wstring ws; + for (auto c : s) { + ws += static_cast<std::wstring::value_type>(c); + } + std::string ns(s); + std::replace( + ns.begin(), ns.end(), '/', + static_cast<std::string::value_type>(fs::path::preferred_separator)); + fs::path p(ns); + if (p.generic_string() != s || p.generic_wstring() != ws) { + result = false; + } + } + + checkResult(result); + + return result; +} + +bool testCompare() +{ + std::cout << "testCompare()"; + + bool result = true; + + { + std::string s("a/b/c"); + fs::path p1(s); + fs::path p2(s); + if (p1.compare(p2) != 0) { + result = false; + } + p2 = "a/b"; + if (p1.compare(p2) <= 0) { + result = false; + } + p2 = "a/d"; + if (p1.compare(p2) >= 0) { + result = false; + } + p2 = "a/b/d"; + if (p1.compare(p2) >= 0) { + result = false; + } + p2 = "a/b/a"; + if (p1.compare(p2) <= 0) { + result = false; + } + p2 = "a/b/c/d"; + if (p1.compare(p2) >= 0) { + result = false; + } + p1 = "a"; + p2 = "b"; + if (p1.compare(p2) == 0) { + result = false; + } + } + { + // LWG 3096 (https://cplusplus.github.io/LWG/issue3096) + // fs::path p1("/a/"); + // fs::path p2("/a/."); + // if (p1.compare(p2) != 0) { + // result = false; + // } + } + + checkResult(result); + + return result; +} + +bool testGeneration() +{ + std::cout << "testGeneration()"; + + bool result = true; + + { + fs::path p("a/./b/.."); + if (p.lexically_normal().generic_string() != "a/") { + result = false; + } + p = "a/.///b/../"; + if (p.lexically_normal().generic_string() != "a/") { + result = false; + } + } +#if defined(_WIN32) + { + fs::path p("//host/./b/.."); + if (p.lexically_normal().string() != "\\\\host\\") { + result = false; + } + p = "//host/.///b/../"; + if (p.lexically_normal().string() != "\\\\host\\") { + result = false; + } + p = "c://a/.///b/../"; + if (p.lexically_normal().string() != "c:\\a\\") { + result = false; + } + } +#endif + + { + if (fs::path("/a//d").lexically_relative("/a/b/c") != "../../d") { + result = false; + } + if (fs::path("/a//b///c").lexically_relative("/a/d") != "../b/c") { + result = false; + } + if (fs::path("a/b/c").lexically_relative("a") != "b/c") { + result = false; + } + if (fs::path("a/b/c").lexically_relative("a/b/c/x/y") != "../..") { + result = false; + } + if (fs::path("a/b/c").lexically_relative("a/b/c") != ".") { + result = false; + } + if (fs::path("a/b").lexically_relative("c/d") != "../../a/b") { + result = false; + } + } + { +#if defined(_WIN32) + if (fs::path("/a/d").lexically_relative("e/d/c") != "/a/d") { + result = false; + } + if (!fs::path("c:/a/d").lexically_relative("e/d/c").empty()) { + result = false; + } +#else + if (!fs::path("/a/d").lexically_relative("e/d/c").empty()) { + result = false; + } +#endif + } + { +#if defined(_WIN32) + if (fs::path("c:/a/d").lexically_proximate("e/d/c") != "c:/a/d") { + result = false; + } +#else + if (fs::path("/a/d").lexically_proximate("e/d/c") != "/a/d") { + result = false; + } +#endif + if (fs::path("/a/d").lexically_proximate("/a/b/c") != "../../d") { + result = false; + } + } + // LWG 3070 + { +#if defined(_WIN32) + if (!fs::path("/a:/b:").lexically_relative("/a:/c:").empty()) { + result = false; + } + if (fs::path("c:/a/b").lexically_relative("c:/a/d") != "../b") { + result = false; + } + if (!fs::path("c:/a/b:").lexically_relative("c:/a/d").empty()) { + result = false; + } + if (!fs::path("c:/a/b").lexically_relative("c:/a/d:").empty()) { + result = false; + } +#else + if (fs::path("/a:/b:").lexically_relative("/a:/c:") != "../b:") { + result = false; + } +#endif + } + // LWG 3096 + { + if (fs::path("/a").lexically_relative("/a/.") != ".") { + result = false; + } + if (fs::path("/a").lexically_relative("/a/") != ".") { + result = false; + } + if (fs::path("a/b/c").lexically_relative("a/b/c") != ".") { + result = false; + } + if (fs::path("a/b/c").lexically_relative("a/b/c/") != ".") { + result = false; + } + if (fs::path("a/b/c").lexically_relative("a/b/c/.") != ".") { + result = false; + } + if (fs::path("a/b/c/").lexically_relative("a/b/c") != ".") { + result = false; + } + if (fs::path("a/b/c/.").lexically_relative("a/b/c") != ".") { + result = false; + } + if (fs::path("a/b/c/.").lexically_relative("a/b/c/") != ".") { + result = false; + } + } + + checkResult(result); + + return result; +} + +bool testDecomposition() +{ + std::cout << "testDecomposition()"; + + bool result = true; + + { + if (!fs::path("/a/b").root_name().empty()) { + result = false; + } +#if defined(_WIN32) + if (fs::path("c:/a/b").root_name() != "c:") { + result = false; + } + if (fs::path("c:a/b").root_name() != "c:") { + result = false; + } + if (fs::path("c:").root_name() != "c:") { + result = false; + } + if (fs::path("//host/b").root_name() != "//host") { + result = false; + } + if (fs::path("//host").root_name() != "//host") { + result = false; + } +#endif + } + { + if (!fs::path("a/b").root_directory().empty()) { + result = false; + } + if (fs::path("/a/b").root_directory() != "/") { + result = false; + } +#if defined(_WIN32) + if (!fs::path("c:a/b").root_directory().empty()) { + result = false; + } + if (fs::path("/a/b").root_directory() != "/") { + result = false; + } + if (fs::path("c:/a/b").root_directory() != "/") { + result = false; + } + if (fs::path("//host/b").root_directory() != "/") { + result = false; + } +#endif + } + { + if (!fs::path("a/b").root_path().empty()) { + result = false; + } + if (fs::path("/a/b").root_path() != "/") { + result = false; + } +#if defined(_WIN32) + if (fs::path("c:a/b").root_path() != "c:") { + result = false; + } + if (fs::path("/a/b").root_path() != "/") { + result = false; + } + if (fs::path("c:/a/b").root_path() != "c:/") { + result = false; + } + if (fs::path("//host/b").root_path() != "//host/") { + result = false; + } +#endif + } + { + if (!fs::path("/").relative_path().empty()) { + result = false; + } + if (fs::path("a/b").relative_path() != "a/b") { + result = false; + } + if (fs::path("/a/b").relative_path() != "a/b") { + result = false; + } +#if defined(_WIN32) + if (fs::path("c:a/b").relative_path() != "a/b") { + result = false; + } + if (fs::path("/a/b").relative_path() != "a/b") { + result = false; + } + if (fs::path("c:/a/b").relative_path() != "a/b") { + result = false; + } + if (fs::path("//host/b").relative_path() != "b") { + result = false; + } +#endif + } + { + if (fs::path("/a/b").parent_path() != "/a") { + result = false; + } + if (fs::path("/a/b/").parent_path() != "/a/b") { + result = false; + } + if (fs::path("/a/b/.").parent_path() != "/a/b") { + result = false; + } + if (fs::path("/").parent_path() != "/") { + result = false; + } +#if defined(_WIN32) + if (fs::path("c:/a/b").parent_path() != "c:/a") { + result = false; + } + if (fs::path("c:/").parent_path() != "c:/") { + result = false; + } + if (fs::path("c:").parent_path() != "c:") { + result = false; + } + if (fs::path("//host/").parent_path() != "//host/") { + result = false; + } + if (fs::path("//host").parent_path() != "//host") { + result = false; + } +#endif + } + { + if (fs::path("/a/b.txt").filename() != "b.txt") { + result = false; + } + if (fs::path("/a/.b").filename() != ".b") { + result = false; + } + if (fs::path("/foo/bar/").filename() != "") { + result = false; + } + if (fs::path("/foo/.").filename() != ".") { + result = false; + } + if (fs::path("/foo/..").filename() != "..") { + result = false; + } + if (fs::path(".").filename() != ".") { + result = false; + } + if (fs::path("..").filename() != "..") { + result = false; + } + if (!fs::path("/").filename().empty()) { + result = false; + } +#if defined(_WIN32) + if (fs::path("c:a").filename() != "a") { + result = false; + } + if (fs::path("c:/a").filename() != "a") { + result = false; + } + if (!fs::path("c:").filename().empty()) { + result = false; + } + if (!fs::path("c:/").filename().empty()) { + result = false; + } + if (!fs::path("//host").filename().empty()) { + result = false; + } +#endif + } + { + if (fs::path("/a/b.txt").stem() != "b") { + result = false; + } + if (fs::path("/a/b.c.txt").stem() != "b.c") { + result = false; + } + if (fs::path("/a/.b").stem() != ".b") { + result = false; + } + if (fs::path("/a/b").stem() != "b") { + result = false; + } + if (fs::path("/a/b/.").stem() != ".") { + result = false; + } + if (fs::path("/a/b/..").stem() != "..") { + result = false; + } + if (!fs::path("/a/b/").stem().empty()) { + result = false; + } +#if defined(_WIN32) + if (!fs::path("c:/a/b/").stem().empty()) { + result = false; + } + if (!fs::path("c:/").stem().empty()) { + result = false; + } + if (!fs::path("c:").stem().empty()) { + result = false; + } + if (!fs::path("//host/").stem().empty()) { + result = false; + } + if (!fs::path("//host").stem().empty()) { + result = false; + } +#endif + } + { + if (fs::path("/a/b.txt").extension() != ".txt") { + result = false; + } + if (fs::path("/a/b.").extension() != ".") { + result = false; + } + if (!fs::path("/a/b").extension().empty()) { + result = false; + } + if (fs::path("/a/b.txt/b.cc").extension() != ".cc") { + result = false; + } + if (fs::path("/a/b.txt/b.").extension() != ".") { + result = false; + } + if (!fs::path("/a/b.txt/b").extension().empty()) { + result = false; + } + if (!fs::path("/a/.").extension().empty()) { + result = false; + } + if (!fs::path("/a/..").extension().empty()) { + result = false; + } + if (!fs::path("/a/.hidden").extension().empty()) { + result = false; + } + if (fs::path("/a/..b").extension() != ".b") { + result = false; + } + } + + checkResult(result); + + return result; +} + +bool testQueries() +{ + std::cout << "testQueries()"; + + bool result = true; + + { + if (fs::path("/a/b").has_root_name()) { + result = false; + } + fs::path p("/a/b"); + if (!p.has_root_directory() || !p.has_root_path()) { + result = false; + } + if (!fs::path("/a/b").has_root_path() || fs::path("a/b").has_root_path()) { + result = false; + } + if (!fs::path("/a/b").has_relative_path() || + fs::path("/").has_relative_path()) { + result = false; + } + if (!fs::path("/a/b").has_parent_path() || + !fs::path("/").has_parent_path() || fs::path("a").has_parent_path()) { + result = false; + } + if (!fs::path("/a/b").has_filename() || !fs::path("a.b").has_filename() || + fs::path("/a/").has_filename() || fs::path("/").has_filename()) { + result = false; + } + if (!fs::path("/a/b").has_stem() || !fs::path("a.b").has_stem() || + !fs::path("/.a").has_stem() || fs::path("/a/").has_stem() || + fs::path("/").has_stem()) { + result = false; + } + if (!fs::path("/a/b.c").has_extension() || + !fs::path("a.b").has_extension() || fs::path("/.a").has_extension() || + fs::path("/a/").has_extension() || fs::path("/").has_extension()) { + result = false; + } +#if defined(_WIN32) + p = "c:/a/b"; + if (!fs::path("c:/a/b").has_root_name() || !p.has_root_directory() || + !p.has_root_path()) { + result = false; + } + p = "c:a/b"; + if (!p.has_root_name() || p.has_root_directory() || !p.has_root_path()) { + result = false; + } + p = "//host/b"; + if (!p.has_root_name() || !p.has_root_directory() || !p.has_root_path()) { + result = false; + } + p = "//host"; + if (!p.has_root_name() || p.has_root_directory() || !p.has_root_path()) { + result = false; + } + if (!fs::path("c:/a/b").has_relative_path() || + !fs::path("c:a/b").has_relative_path() || + !fs::path("//host/b").has_relative_path()) { + result = false; + } + if (!fs::path("c:/a/b").has_parent_path() || + !fs::path("c:/").has_parent_path() || + !fs::path("c:").has_parent_path() || + !fs::path("//host/").has_parent_path() || + !fs::path("//host").has_parent_path()) { + result = false; + } +#endif + } + { +#if defined(_WIN32) + fs::path p("c:/a"); +#else + fs::path p("/a"); +#endif + if (!p.is_absolute() || p.is_relative()) { + result = false; + } + p = "a/b"; + if (p.is_absolute() || !p.is_relative()) { + result = false; + } +#if defined(_WIN32) + p = "c:/a/b"; + if (!p.is_absolute() || p.is_relative()) { + result = false; + } + p = "//host/b"; + if (!p.is_absolute() || p.is_relative()) { + result = false; + } + p = "/a"; + if (p.is_absolute() || !p.is_relative()) { + result = false; + } + p = "c:a"; + if (p.is_absolute() || !p.is_relative()) { + result = false; + } +#endif + } + + checkResult(result); + + return result; +} + +bool testIterators() +{ + std::cout << "testIterators()"; + + bool result = true; + + { + fs::path p("/a/b/"); +#if defined(_WIN32) + std::vector<fs::path::string_type> ref{ L"/", L"a", L"b", L"" }; +#else + std::vector<fs::path::string_type> ref{ "/", "a", "b", "" }; +#endif + std::vector<fs::path::string_type> res; + for (auto i = p.begin(), e = p.end(); i != e; ++i) { + res.push_back(*i); + } + if (res != ref) { + result = false; + } + res.clear(); + for (const auto& e : p) { + res.push_back(e); + } + if (res != ref) { + result = false; + } + } + { + fs::path p("/a/b/"); +#if defined(_WIN32) + std::vector<fs::path::string_type> ref{ L"", L"b", L"a", L"/" }; +#else + std::vector<fs::path::string_type> ref{ "", "b", "a", "/" }; +#endif + std::vector<fs::path::string_type> res; + auto i = p.end(), b = p.begin(); + do { + res.push_back(*--i); + } while (i != b); + if (res != ref) { + result = false; + } + } + + checkResult(result); + + return result; +} + +bool testNonMemberFunctions() +{ + std::cout << "testNonMemberFunctions()"; + + bool result = true; + + { + fs::path p1("/a/b/"); + fs::path p2("/c/d"); + fs::swap(p1, p2); + if (p1.string() != "/c/d" || p2.string() != "/a/b/") + result = false; + } + { + auto h1 = fs::hash_value(fs::path("/a//b//")); + auto h2 = fs::hash_value(fs::path("/a/b/")); + if (h1 != h2) + result = false; + } + { + fs::path p1("/a/b/"); + fs::path p2("/c/d"); + if (p1 == p2) + result = false; + p1 = "/a//b//"; + p2 = "/a/b/"; + if (p1 != p2) + result = false; + } + { + fs::path p = "/a"; + p = p / "b" / "c"; + if (p.generic_string() != "/a/b/c") { + result = false; + } + fs::path::string_type ref; + ref += fs::path::value_type('/'); + ref += fs::path::value_type('a'); + ref += fs::path::preferred_separator; + ref += fs::path::value_type('b'); + ref += fs::path::preferred_separator; + ref += fs::path::value_type('c'); + if (p.native() != ref) { + result = false; + } + } + { + fs::path p("/a b\\c/"); + std::ostringstream oss; + oss << p; + if (oss.str() != "\"/a b\\\\c/\"") { + result = false; + } + std::istringstream iss(oss.str()); + fs::path p2; + iss >> p2; + if (p2 != p) { + result = false; + } + } + + checkResult(result); + + return result; +} +} + +int testCMFilesystemPath(int /*unused*/, char* /*unused*/ []) +{ + int result = 0; + + if (!testConstructors()) { + result = 1; + } + if (!testConcatenation()) { + result = 1; + } + if (!testModifiers()) { + result = 1; + } + if (!testObservers()) { + result = 1; + } + if (!testCompare()) { + result = 1; + } + if (!testGeneration()) { + result = 1; + } + if (!testDecomposition()) { + result = 1; + } + if (!testQueries()) { + result = 1; + } + if (!testIterators()) { + result = 1; + } + if (!testNonMemberFunctions()) { + result = 1; + } + + return result; +} diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index db6dbf3..19aa4c4 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -206,6 +206,26 @@ if(BUILD_TESTING) set(${reg} 0) endif() endforeach() + if(COMMAND cmake_host_system_information) + set(info_vs15 "VS_15_DIR") + set(info_vs16 "VS_16_DIR") + set(vs_versions) + if(WIN32) + if(NOT CMAKE_VERSION VERSION_LESS 3.14) + set(vs_versions vs15 vs16) + elseif(NOT CMAKE_VERSION VERSION_LESS 3.8) + set(vs_versions vs15) + endif() + endif() + foreach(info ${vs_versions}) + cmake_host_system_information(RESULT found QUERY "${info_${info}}") + if(found) + set(${info} 1) + else() + set(${info} 0) + endif() + endforeach() + endif() endif() #--------------------------------------------------------------------------- @@ -697,38 +717,28 @@ if(BUILD_TESTING) # build the "Simple" test with the ExtraGenerators, if available # This doesn't test whether the generated project files work (unfortunately), # mainly it tests that cmake doesn't crash when generating these project files. - if(${CMAKE_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_GENERATOR} MATCHES "Ninja") - - # check which generators we have - execute_process(COMMAND ${CMAKE_CMAKE_COMMAND} --help - OUTPUT_VARIABLE cmakeOutput ERROR_VARIABLE cmakeOutput) - - set(extraGenerators - "CodeBlocks" - "CodeLite" - "Eclipse CDT4" - "Kate" - "Sublime Text 2") - - foreach(extraGenerator ${extraGenerators}) - if ("${cmakeOutput}" MATCHES "${extraGenerator} - ${CMAKE_GENERATOR}") - set(extraGeneratorTestName "Simple_${extraGenerator}Generator") - string(REPLACE " " "" extraGeneratorTestName ${extraGeneratorTestName}) - - add_test(${extraGeneratorTestName} ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/Simple" - "${CMake_BINARY_DIR}/Tests/${extraGeneratorTestName}" - --build-two-config - --build-generator "${extraGenerator} - ${CMAKE_GENERATOR}" - --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" - --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" - --build-project Simple - --test-command Simple) - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${extraGeneratorTestName}") - endif () - endforeach(extraGenerator) - + if(CMAKE_GENERATOR MATCHES "^(Unix Makefiles|Ninja)$" + AND NOT "${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + foreach(extraGenerator + "CodeBlocks" + "CodeLite" + "Eclipse CDT4" + "Kate" + "Sublime Text 2" + ) + string(REPLACE " " "" extraGeneratorTestName "Simple_${extraGenerator}Generator") + add_test(${extraGeneratorTestName} ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/Simple" + "${CMake_BINARY_DIR}/Tests/${extraGeneratorTestName}" + --build-two-config + --build-generator "${extraGenerator} - ${CMAKE_GENERATOR}" + --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" + --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" + --build-project Simple + --test-command Simple) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${extraGeneratorTestName}") + endforeach() endif() # test for correct sub-project generation @@ -1451,6 +1461,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH Patch PostgreSQL Protobuf + SDL SQLite3 TIFF Vulkan @@ -2315,32 +2326,41 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH endforeach() endif() + macro(add_test_VSAndroid name generator platform) + add_test(NAME "VSAndroid.${name}.${platform}" COMMAND ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/VSAndroid" + "${CMake_BINARY_DIR}/Tests/VSAndroid/${name}/${platform}" + --build-generator "${generator}" + --build-project VSAndroid + --build-config $<CONFIGURATION> + --build-options -DCMAKE_SYSTEM_NAME=Android "-A${platform}" + ) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSAndroid/${name}") + endmacro() if(tegra AND NOT "${CMake_SOURCE_DIR};${CMake_BINARY_DIR}" MATCHES " ") - macro(add_test_VSNsightTegra name generator) - add_test(NAME VSNsightTegra.${name} COMMAND ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/VSNsightTegra" - "${CMake_BINARY_DIR}/Tests/VSNsightTegra/${name}" - --build-generator "${generator}" - --build-project VSNsightTegra - --build-config $<CONFIGURATION> - --build-options -DCMAKE_SYSTEM_NAME=Android - ) - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSNsightTegra/${name}") - endmacro() if(vs10) - add_test_VSNsightTegra(vs10 "Visual Studio 10 2010") + add_test_VSAndroid(vs10 "Visual Studio 10 2010" "Tegra-Android") endif() if(vs11) - add_test_VSNsightTegra(vs11 "Visual Studio 11 2012") + add_test_VSAndroid(vs11 "Visual Studio 11 2012" "Tegra-Android") endif() if(vs12) - add_test_VSNsightTegra(vs12 "Visual Studio 12 2013") + add_test_VSAndroid(vs12 "Visual Studio 12 2013" "Tegra-Android") endif() if(vs14) - add_test_VSNsightTegra(vs14 "Visual Studio 14 2015") + add_test_VSAndroid(vs14 "Visual Studio 14 2015" "Tegra-Android") endif() endif() + if(vs14 AND CMake_TEST_ANDROID_VS14) + add_test_VSAndroid(vs14 "Visual Studio 14 2015" "ARM") + endif() + if(vs15 AND CMake_TEST_ANDROID_VS15) + add_test_VSAndroid(vs15 "Visual Studio 15 2017" "ARM") + endif() + if(vs16 AND CMake_TEST_ANDROID_VS16) + add_test_VSAndroid(vs16 "Visual Studio 16 2019" "ARM") + endif() if (APPLE) if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") @@ -2397,36 +2417,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest") endif() - add_test(WarnUnusedUnusedViaSet ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/VariableUnusedViaSet" - "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaSet" - ${build_generator_args} - --build-noclean - --build-project WarnUnusedUnusedViaSet - --build-options - "--warn-unused-vars") - set_tests_properties(WarnUnusedUnusedViaSet PROPERTIES - PASS_REGULAR_EXPRESSION "unused variable \\(changing definition\\) 'UNUSED_VARIABLE'") - set_tests_properties(WarnUnusedUnusedViaSet PROPERTIES - FAIL_REGULAR_EXPRESSION "unused variable \\(unsetting\\) 'UNUSED_VARIABLE'") - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaSet") - - add_test(WarnUnusedUnusedViaUnset ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/VariableUnusedViaUnset" - "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset" - ${build_generator_args} - --build-noclean - --build-project WarnUnusedUnusedViaUnset - --build-options - "--warn-unused-vars") - set_tests_properties(WarnUnusedUnusedViaUnset PROPERTIES - PASS_REGULAR_EXPRESSION "CMake Warning \\(dev\\) at CMakeLists.txt:7 \\(set\\):") - set_tests_properties(WarnUnusedUnusedViaUnset PROPERTIES - FAIL_REGULAR_EXPRESSION "CMakeLists.txt:5 \\(set\\):") - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset") - add_test(WarnUnusedCliUnused ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/WarnUnusedCliUnused" diff --git a/Tests/COnly/CMakeLists.txt b/Tests/COnly/CMakeLists.txt index 20615fe..1c24017 100644 --- a/Tests/COnly/CMakeLists.txt +++ b/Tests/COnly/CMakeLists.txt @@ -1,5 +1,5 @@ # a simple C only test case -cmake_minimum_required (VERSION 2.6) +cmake_minimum_required(VERSION 2.8.12) project (COnly C) set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake index 253d128..f3d3ad0 100644 --- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake +++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake @@ -88,12 +88,14 @@ if(CPackGen MATCHES "DragNDrop") set(expected_file_mask "${CPackComponentsForAll_BINARY_DIR}/MyLib-*.dmg") if(${CPackComponentWay} STREQUAL "default") set(expected_count 1) + set(expect_dmg_sla 1) elseif(${CPackComponentWay} STREQUAL "OnePackPerGroup") set(expected_count 3) elseif(${CPackComponentWay} STREQUAL "IgnoreGroup") set(expected_count 4) elseif(${CPackComponentWay} STREQUAL "AllInOne") set(expected_count 1) + set(expect_dmg_sla 1) endif() endif() @@ -138,6 +140,36 @@ if(expected_file_mask) if(NOT actual_count EQUAL expected_count) message(FATAL_ERROR "error: expected_count=${expected_count} does not match actual_count=${actual_count}: CPackComponents test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error})") endif() + + if(expect_dmg_sla) + execute_process(COMMAND hdiutil udifderez -xml "${expected_file}" OUTPUT_VARIABLE out ERROR_VARIABLE err RESULT_VARIABLE res) + if(NOT res EQUAL 0) + string(REPLACE "\n" "\n " err " ${err}") + message(FATAL_ERROR "error: running 'hdiutil udifderez -xml' on\n ${expected_file}\nfailed with:\n${err}") + endif() + foreach(key "LPic" "STR#" "TEXT") + if(NOT out MATCHES "<key>${key}</key>") + string(REPLACE "\n" "\n " out " ${out}") + message(FATAL_ERROR "error: running 'hdiutil udifderez -xml' on\n ${expected_file}\ndid not show '${key}' key:\n${out}") + endif() + endforeach() + foreach(line + # LPic first and last base64 lines + "\tAAIAEQADAAEAAAAAAAIAAAAIAAMAAAABAAQAAAAEAAUAAAAOAAYA\n" + "\tAA0AAABbAAQAAAAzAA8AAQAMABAAAAALAA4AAA==\n" + # STR# first and last base64 lines + "\tAAkHRW5nbGlzaAVBZ3JlZQhEaXNhZ3JlZQVQcmludAdTYXZlLi4u\n" + "\tdGVkIGEgcHJpbnRlci4=\n" + # TEXT first and last base64 lines + "\tTElDRU5TRQ0tLS0tLS0tDVRoaXMgaXMgYW4gaW5zdGFsbGVyIGNy\n" + "\tTm8gbGljZW5zZSBwcm92aWRlZC4NDQ==\n" + ) + if(NOT out MATCHES "${line}") + string(REPLACE "\n" "\n " out " ${out}") + message(FATAL_ERROR "error: running 'hdiutil udifderez -xml' on\n ${expected_file}\ndid not show '${line}':\n${out}") + endif() + endforeach() + endif() endif() # Validate content diff --git a/Tests/CSharpOnly/CMakeLists.txt b/Tests/CSharpOnly/CMakeLists.txt index 42cbe2e..195af05 100644 --- a/Tests/CSharpOnly/CMakeLists.txt +++ b/Tests/CSharpOnly/CMakeLists.txt @@ -1,3 +1,4 @@ +cmake_minimum_required(VERSION 3.3) # a simple CSharp only test case project (CSharpOnly CSharp) diff --git a/Tests/CxxOnly/CMakeLists.txt b/Tests/CxxOnly/CMakeLists.txt index 8207dd1..09689cb 100644 --- a/Tests/CxxOnly/CMakeLists.txt +++ b/Tests/CxxOnly/CMakeLists.txt @@ -1,4 +1,5 @@ # a simple CXX only test case +cmake_minimum_required(VERSION 2.8.12) project (CxxOnly CXX) set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") diff --git a/Tests/FindSDL/CMakeLists.txt b/Tests/FindSDL/CMakeLists.txt new file mode 100644 index 0000000..e786204 --- /dev/null +++ b/Tests/FindSDL/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindSDL.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindSDL/Test" + "${CMake_BINARY_DIR}/Tests/FindSDL/Test" + ${build_generator_args} + --build-project TestFindSDL + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindSDL/Test/CMakeLists.txt b/Tests/FindSDL/Test/CMakeLists.txt new file mode 100644 index 0000000..61d4f4b --- /dev/null +++ b/Tests/FindSDL/Test/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.1) +project(TestFindSDL C) +include(CTest) + +find_package(SDL) + +add_definitions( + -DCMAKE_EXPECTED_SDL_VERSION_MAJOR=${SDL_VERSION_MAJOR} + -DCMAKE_EXPECTED_SDL_VERSION_MINOR=${SDL_VERSION_MINOR} + -DCMAKE_EXPECTED_SDL_VERSION_PATCH=${SDL_VERSION_PATCH}) + +add_executable(test_sdl_tgt main.c) +target_link_libraries(test_sdl_tgt SDL::SDL) +add_test(NAME test_sdl_tgt COMMAND test_sdl_tgt) + +add_executable(test_sdl_var main.c) +target_include_directories(test_sdl_var PRIVATE ${SDL_INCLUDE_DIRS}) +target_link_libraries(test_sdl_var PRIVATE ${SDL_LIBRARIES}) +add_test(NAME test_sdl_var COMMAND test_sdl_var) diff --git a/Tests/FindSDL/Test/main.c b/Tests/FindSDL/Test/main.c new file mode 100644 index 0000000..057289c --- /dev/null +++ b/Tests/FindSDL/Test/main.c @@ -0,0 +1,18 @@ +#include <SDL.h> + +int main() +{ + // Test 1 requires headers only. + SDL_version compiled; + SDL_VERSION(&compiled); + if (compiled.major != CMAKE_EXPECTED_SDL_VERSION_MAJOR || + compiled.minor != CMAKE_EXPECTED_SDL_VERSION_MINOR || + compiled.patch != CMAKE_EXPECTED_SDL_VERSION_PATCH) + return 1; + + // Test 2 requires to link to the library. + if (SDL_WasInit(SDL_INIT_VIDEO | SDL_INIT_AUDIO) != 0) + return 2; + + return 0; +} diff --git a/Tests/FindTIFF/Test/CMakeLists.txt b/Tests/FindTIFF/Test/CMakeLists.txt index 85453ed..e235db3 100644 --- a/Tests/FindTIFF/Test/CMakeLists.txt +++ b/Tests/FindTIFF/Test/CMakeLists.txt @@ -1,14 +1,23 @@ cmake_minimum_required(VERSION 3.1) -project(TestFindTIFF C) +project(TestFindTIFF) include(CTest) -find_package(TIFF REQUIRED) +find_package(TIFF REQUIRED COMPONENTS CXX) add_executable(test_tiff_tgt main.c) target_link_libraries(test_tiff_tgt TIFF::TIFF) add_test(NAME test_tiff_tgt COMMAND test_tiff_tgt) +add_executable(test_tiffxx_tgt main.cxx) +target_link_libraries(test_tiffxx_tgt TIFF::CXX) +add_test(NAME test_tiffxx_tgt COMMAND test_tiffxx_tgt) + add_executable(test_tiff_var main.c) target_include_directories(test_tiff_var PRIVATE ${TIFF_INCLUDE_DIRS}) target_link_libraries(test_tiff_var PRIVATE ${TIFF_LIBRARIES}) add_test(NAME test_tiff_var COMMAND test_tiff_var) + +add_executable(test_tiffxx_var main.cxx) +target_include_directories(test_tiffxx_var PRIVATE ${TIFF_INCLUDE_DIRS}) +target_link_libraries(test_tiffxx_var PRIVATE ${TIFF_LIBRARIES}) +add_test(NAME test_tiffxx_var COMMAND test_tiffxx_var) diff --git a/Tests/FindTIFF/Test/main.cxx b/Tests/FindTIFF/Test/main.cxx new file mode 100644 index 0000000..f80a31f --- /dev/null +++ b/Tests/FindTIFF/Test/main.cxx @@ -0,0 +1,16 @@ +#include <fstream> + +#include <assert.h> +#include <tiffio.hxx> + +int main() +{ + /* Without any TIFF file to open, test that the call fails as + expected. This tests that linking worked. */ + TIFF* tiff = TIFFOpen("invalid.tiff", "r"); + assert(!tiff); + + std::ifstream s; + TIFF* tiffxx = TIFFStreamOpen("invalid.tiff", &s); + return 0; +} diff --git a/Tests/FindVulkan/Test/CMakeLists.txt b/Tests/FindVulkan/Test/CMakeLists.txt index 0b13d53..9d36a0d 100644 --- a/Tests/FindVulkan/Test/CMakeLists.txt +++ b/Tests/FindVulkan/Test/CMakeLists.txt @@ -13,3 +13,12 @@ add_executable(test_var main.c) target_include_directories(test_var PRIVATE ${Vulkan_INCLUDE_DIRS}) target_link_libraries(test_var PRIVATE ${Vulkan_LIBRARIES}) add_test(NAME test_var COMMAND test_var) + +if(Vulkan_GLSLC_EXECUTABLE) + add_test(NAME test_glslc + COMMAND ${CMAKE_COMMAND} + "-DVULKAN_GLSLC_EXECUTABLE=${Vulkan_GLSLC_EXECUTABLE}" + "-DVULKAN_GLSLC_EXECUTABLE_TARGET=$<TARGET_FILE:Vulkan::glslc>" + -P "${CMAKE_CURRENT_LIST_DIR}/Run-glslc.cmake" + ) +endif() diff --git a/Tests/FindVulkan/Test/Run-glslc.cmake b/Tests/FindVulkan/Test/Run-glslc.cmake new file mode 100644 index 0000000..086eb9d --- /dev/null +++ b/Tests/FindVulkan/Test/Run-glslc.cmake @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.12) + +function(run_glslc exe exe_display) + execute_process(COMMAND ${exe} --help + OUTPUT_VARIABLE output + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE result + ) + + if(NOT result EQUAL 0) + message(SEND_ERROR "Result of ${exe_display} --help is ${result}, should be 0") + endif() + + if(NOT output MATCHES "^glslc - Compile shaders into SPIR-V") + message(SEND_ERROR "Output of ${exe_display} --help is \"${output}\", should begin with \"glslc - Compile shaders into SPIR-V\"") + endif() +endfunction() + +run_glslc("${VULKAN_GLSLC_EXECUTABLE}" "\${VULKAN_GLSLC_EXECUTABLE}") +run_glslc("${VULKAN_GLSLC_EXECUTABLE_TARGET}" "Vulkan::glslc") diff --git a/Tests/FindVulkan/Test/main.c b/Tests/FindVulkan/Test/main.c index b29c9ec..1bff651 100644 --- a/Tests/FindVulkan/Test/main.c +++ b/Tests/FindVulkan/Test/main.c @@ -2,10 +2,10 @@ int main() { - VkInstanceCreateInfo instanceCreateInfo = {}; + VkInstanceCreateInfo instanceCreateInfo = { 0 }; instanceCreateInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; - VkApplicationInfo applicationInfo = {}; + VkApplicationInfo applicationInfo = { 0 }; applicationInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; applicationInfo.apiVersion = VK_API_VERSION_1_0; applicationInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0); diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt index d24df2d..637f581 100644 --- a/Tests/FortranOnly/CMakeLists.txt +++ b/Tests/FortranOnly/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required(VERSION 2.8.12) project(FortranOnly Fortran) message("CTEST_FULL_OUTPUT ") diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt index 9d51342..ebbe288 100644 --- a/Tests/GeneratorExpression/CMakeLists.txt +++ b/Tests/GeneratorExpression/CMakeLists.txt @@ -40,9 +40,9 @@ add_custom_target(check-part1 ALL -Dtest_and_0_invalidcontent=$<AND:0,invalidcontent> -Dtest_config_0=$<CONFIG:$<CONFIGURATION>x> -Dtest_config_1=$<CONFIG:$<CONFIGURATION>> - -Dtest_config_debug=$<CONFIG:Debug>$<CONFIG:DEBUG>$<CONFIG:DeBuG> - -Dtest_config_release=$<CONFIG:Release>$<CONFIG:RELEASE>$<CONFIG:ReLeAsE> - -Dtest_config_relwithdebinfo=$<CONFIG:RelWithDebInfo>$<CONFIG:RELWITHDEBINFO>$<CONFIG:relwithdebinfo> + -Dtest_config_debug=$<CONFIG:Debug,DEBUG,DeBuG> + -Dtest_config_release=$<CONFIG:Release>$<CONFIG:RELEASE,ReLeAsE> + -Dtest_config_relwithdebinfo=$<CONFIG:RelWithDebInfo,RELWITHDEBINFO>$<CONFIG:relwithdebinfo> -Dtest_config_minsizerel=$<CONFIG:MinSizeRel>$<CONFIG:MINSIZEREL>$<CONFIG:minsizerel> -Dtest_not_0=$<NOT:0> -Dtest_not_1=$<NOT:1> @@ -180,9 +180,7 @@ set_property(TARGET imported3 PROPERTY IMPORTED_LOCATION_DEBUG debug_loc) set_property(TARGET imported3 APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<$<CONFIG:DEBUG>:$<TARGET_PROPERTY:imported1,INTERFACE_INCLUDE_DIRECTORIES>>) set_property(TARGET imported3 APPEND PROPERTY - INTERFACE_INCLUDE_DIRECTORIES $<$<CONFIG:RELEASE>:$<TARGET_PROPERTY:imported2,INTERFACE_INCLUDE_DIRECTORIES>>) -set_property(TARGET imported3 APPEND PROPERTY - INTERFACE_INCLUDE_DIRECTORIES $<$<CONFIG:RELWITHDEBINFO>:$<TARGET_PROPERTY:imported2,INTERFACE_INCLUDE_DIRECTORIES>>) + INTERFACE_INCLUDE_DIRECTORIES $<$<CONFIG:RELEASE,RELWITHDEBINFO>:$<TARGET_PROPERTY:imported2,INTERFACE_INCLUDE_DIRECTORIES>>) set_property(TARGET imported3 APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<$<CONFIG:MINSIZEREL>:$<TARGET_PROPERTY:imported2,INTERFACE_INCLUDE_DIRECTORIES>>) diff --git a/Tests/GeneratorExpression/check-part3.cmake b/Tests/GeneratorExpression/check-part3.cmake index 4fb7308..b5eafa6 100644 --- a/Tests/GeneratorExpression/check-part3.cmake +++ b/Tests/GeneratorExpression/check-part3.cmake @@ -13,7 +13,7 @@ if(config AND NOT config STREQUAL NoConfig) message(SEND_ERROR "test_imported_includes is not correct: ${test_imported_includes}") endif() else() - if(NOT "${test_imported_includes}" MATCHES "^;;;$") + if(NOT "${test_imported_includes}" MATCHES "^;;$") message(SEND_ERROR "test_imported_includes is not an empty list: ${test_imported_includes}") endif() endif() diff --git a/Tests/RunCMake/Android/RunCMakeTest.cmake b/Tests/RunCMake/Android/RunCMakeTest.cmake index 45798ce..81dd090 100644 --- a/Tests/RunCMake/Android/RunCMakeTest.cmake +++ b/Tests/RunCMake/Android/RunCMakeTest.cmake @@ -18,15 +18,33 @@ function(run_Android case) file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") run_cmake(${case}) - run_cmake_command(${case}-build ${CMAKE_COMMAND} --build .) + set(configs ".") + if(RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(configs Release Debug) + endif() + foreach(config IN LISTS configs) + set(build_suffix) + set(config_arg) + if(RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(build_suffix "-${config}") + set(config_arg --config "${config}") + endif() + run_cmake_command(${case}-build${build_suffix} ${CMAKE_COMMAND} --build . ${config_arg}) + endforeach() endfunction() +set(RunCMake_GENERATOR_PLATFORM_OLD "${RunCMake_GENERATOR_PLATFORM}") + +if(RunCMake_GENERATOR MATCHES "Visual Studio") + set(RunCMake_GENERATOR_PLATFORM "ARM") +endif() set(RunCMake_TEST_OPTIONS -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSROOT=${CMAKE_CURRENT_SOURCE_DIR} ) run_cmake(BadSYSROOT) unset(RunCMake_TEST_OPTIONS) +set(RunCMake_GENERATOR_PLATFORM "${RunCMake_GENERATOR_PLATFORM_OLD}") foreach(ndk IN LISTS TEST_ANDROID_NDK) # Load available toolchain versions and abis. @@ -70,6 +88,9 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK) if(_versions MATCHES "clang") set(_versions "clang" ${_versions}) endif() + if(RunCMake_GENERATOR MATCHES "Visual Studio") + set(_versions "clang") + endif() list(REMOVE_DUPLICATES _versions) list(SORT _versions) set(_versions ";${_versions}") @@ -77,44 +98,58 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK) list(REMOVE_DUPLICATES _abis_${vers}) endforeach() + set(ndk_arg -DCMAKE_ANDROID_NDK=${ndk}) + if(RunCMake_GENERATOR MATCHES "Visual Studio") + set(ndk_arg) + endif() + # Test failure cases. message(STATUS "ndk='${ndk}'") + if(RunCMake_GENERATOR MATCHES "Visual Studio") + set(RunCMake_GENERATOR_PLATFORM "ARM") + endif() set(RunCMake_TEST_OPTIONS -DCMAKE_SYSTEM_NAME=Android - -DCMAKE_ANDROID_NDK=${ndk} + ${ndk_arg} -DCMAKE_ANDROID_ARCH_ABI=badabi ) run_cmake(ndk-badabi) + if(RunCMake_GENERATOR MATCHES "Visual Studio") + set(RunCMake_GENERATOR_PLATFORM "x86") + endif() set(RunCMake_TEST_OPTIONS -DCMAKE_SYSTEM_NAME=Android - -DCMAKE_ANDROID_NDK=${ndk} + ${ndk_arg} -DCMAKE_ANDROID_ARCH_ABI=x86 -DCMAKE_ANDROID_ARM_MODE=0 ) run_cmake(ndk-badarm) + if(RunCMake_GENERATOR MATCHES "Visual Studio") + set(RunCMake_GENERATOR_PLATFORM "ARM") + endif() if("armeabi" IN_LIST _abis_) set(RunCMake_TEST_OPTIONS -DCMAKE_SYSTEM_NAME=Android - -DCMAKE_ANDROID_NDK=${ndk} + ${ndk_arg} -DCMAKE_ANDROID_ARM_NEON=0 ) run_cmake(ndk-badneon) endif() set(RunCMake_TEST_OPTIONS -DCMAKE_SYSTEM_NAME=Android - -DCMAKE_ANDROID_NDK=${ndk} + ${ndk_arg} -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=badver ) run_cmake(ndk-badver) set(RunCMake_TEST_OPTIONS -DCMAKE_SYSTEM_NAME=Android - -DCMAKE_ANDROID_NDK=${ndk} + ${ndk_arg} -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=1.0 ) run_cmake(ndk-badvernum) set(RunCMake_TEST_OPTIONS -DCMAKE_SYSTEM_NAME=Android - -DCMAKE_ANDROID_NDK=${ndk} + ${ndk_arg} -DCMAKE_ANDROID_STL_TYPE=badstl ) run_cmake(ndk-badstl) @@ -131,6 +166,7 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK) run_cmake(ndk-sysroot-armeabi) unset(RunCMake_TEST_OPTIONS) endif() + set(RunCMake_GENERATOR_PLATFORM "${RunCMake_GENERATOR_PLATFORM_OLD}") # Find available STLs. set(stl_types @@ -157,23 +193,41 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK) armeabi-v6 armeabi-v7a arm64-v8a - mips - mips64 x86 x86_64 ) + if(NOT RunCMake_GENERATOR MATCHES "Visual Studio") + list(APPEND abi_names mips mips64) + endif() + set(abi_to_arch_armeabi ARM) + set(abi_to_arch_armeabi-v6 ARM) + set(abi_to_arch_armeabi-v7a ARM) + set(abi_to_arch_arm64-v8a ARM64) + set(abi_to_arch_x86 x86) + set(abi_to_arch_x86_64 x64) # Test all combinations. foreach(vers IN LISTS _versions) foreach(stl IN LISTS stl_types) - foreach(config Release Debug) + set(configs Release Debug) + set(foreach_list "${configs}") + if(RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(foreach_list ".") + endif() + foreach(config IN LISTS foreach_list) # Test this combination for all available abis. - message(STATUS "ndk='${ndk}' vers='${vers}' stl='${stl}' config='${config}'") + set(config_status " config='${config}'") + set(build_type_arg "-DCMAKE_BUILD_TYPE=${config}") + if(RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(config_status) + string(REPLACE ";" "\\\\;" build_type_arg "-DCMAKE_CONFIGURATION_TYPES=${configs}") + endif() + message(STATUS "ndk='${ndk}' vers='${vers}' stl='${stl}'${config_status}") set(RunCMake_TEST_OPTIONS - -DCMAKE_ANDROID_NDK=${ndk} + ${ndk_arg} -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=${vers} -DCMAKE_ANDROID_STL_TYPE=${stl} - -DCMAKE_BUILD_TYPE=${config} + "${build_type_arg}" ) foreach(abi IN LISTS abi_names) # Skip ABIs not supported by this compiler. @@ -182,6 +236,9 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK) endif() # Run the tests for this combination. + if(RunCMake_GENERATOR MATCHES "Visual Studio") + set(RunCMake_GENERATOR_PLATFORM "${abi_to_arch_${abi}}") + endif() if("${abi}" STREQUAL "armeabi") run_Android(ndk-armeabi-thumb) # default: -DCMAKE_ANDROID_ARCH_ABI=armeabi -DCMAKE_ANDROID_ARM_MODE=0 run_Android(ndk-armeabi-arm -DCMAKE_ANDROID_ARM_MODE=1) # default: -DCMAKE_ANDROID_ARCH_ABI=armeabi @@ -191,6 +248,7 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK) run_Android(ndk-${abi}-neon -DCMAKE_ANDROID_ARCH_ABI=${abi} -DCMAKE_ANDROID_ARM_NEON=1) endif() endif() + set(RunCMake_GENERATOR_PLATFORM "${RunCMake_GENERATOR_PLATFORM_OLD}") endforeach() unset(RunCMake_TEST_OPTIONS) endforeach() diff --git a/Tests/RunCMake/Android/common.cmake b/Tests/RunCMake/Android/common.cmake index d96ab86..32412aa 100644 --- a/Tests/RunCMake/Android/common.cmake +++ b/Tests/RunCMake/Android/common.cmake @@ -96,7 +96,7 @@ add_executable(android_c android.c) add_executable(android_cxx android.cxx) add_library(android_cxx_lib SHARED android_lib.cxx) -set(objdump "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}objdump") +set(objdump "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}objdump${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}") if(NOT EXISTS "${objdump}") message(FATAL_ERROR "Expected tool missing:\n ${objdump}") endif() diff --git a/Tests/RunCMake/Android/ndk-arm64-v8a-stderr.txt b/Tests/RunCMake/Android/ndk-arm64-v8a-stderr.txt new file mode 100644 index 0000000..a3b3634 --- /dev/null +++ b/Tests/RunCMake/Android/ndk-arm64-v8a-stderr.txt @@ -0,0 +1,7 @@ +^(CMake Warning: + You are using Visual Studio tools for Android, which does not support + standalone executables\. However, the following executable targets do not + have the ANDROID_GUI property set, and thus will not be built as expected\. + They will be built as shared libraries with executable filenames: + + android_c, android_cxx, android_sysinc_c, android_sysinc_cxx)?$ diff --git a/Tests/RunCMake/Android/ndk-armeabi-arm-stderr.txt b/Tests/RunCMake/Android/ndk-armeabi-arm-stderr.txt new file mode 100644 index 0000000..a3b3634 --- /dev/null +++ b/Tests/RunCMake/Android/ndk-armeabi-arm-stderr.txt @@ -0,0 +1,7 @@ +^(CMake Warning: + You are using Visual Studio tools for Android, which does not support + standalone executables\. However, the following executable targets do not + have the ANDROID_GUI property set, and thus will not be built as expected\. + They will be built as shared libraries with executable filenames: + + android_c, android_cxx, android_sysinc_c, android_sysinc_cxx)?$ diff --git a/Tests/RunCMake/Android/ndk-armeabi-thumb-stderr.txt b/Tests/RunCMake/Android/ndk-armeabi-thumb-stderr.txt new file mode 100644 index 0000000..a3b3634 --- /dev/null +++ b/Tests/RunCMake/Android/ndk-armeabi-thumb-stderr.txt @@ -0,0 +1,7 @@ +^(CMake Warning: + You are using Visual Studio tools for Android, which does not support + standalone executables\. However, the following executable targets do not + have the ANDROID_GUI property set, and thus will not be built as expected\. + They will be built as shared libraries with executable filenames: + + android_c, android_cxx, android_sysinc_c, android_sysinc_cxx)?$ diff --git a/Tests/RunCMake/Android/ndk-armeabi-v7a-neon-stderr.txt b/Tests/RunCMake/Android/ndk-armeabi-v7a-neon-stderr.txt new file mode 100644 index 0000000..a3b3634 --- /dev/null +++ b/Tests/RunCMake/Android/ndk-armeabi-v7a-neon-stderr.txt @@ -0,0 +1,7 @@ +^(CMake Warning: + You are using Visual Studio tools for Android, which does not support + standalone executables\. However, the following executable targets do not + have the ANDROID_GUI property set, and thus will not be built as expected\. + They will be built as shared libraries with executable filenames: + + android_c, android_cxx, android_sysinc_c, android_sysinc_cxx)?$ diff --git a/Tests/RunCMake/Android/ndk-armeabi-v7a-stderr.txt b/Tests/RunCMake/Android/ndk-armeabi-v7a-stderr.txt new file mode 100644 index 0000000..a3b3634 --- /dev/null +++ b/Tests/RunCMake/Android/ndk-armeabi-v7a-stderr.txt @@ -0,0 +1,7 @@ +^(CMake Warning: + You are using Visual Studio tools for Android, which does not support + standalone executables\. However, the following executable targets do not + have the ANDROID_GUI property set, and thus will not be built as expected\. + They will be built as shared libraries with executable filenames: + + android_c, android_cxx, android_sysinc_c, android_sysinc_cxx)?$ diff --git a/Tests/RunCMake/Android/ndk-x86-stderr.txt b/Tests/RunCMake/Android/ndk-x86-stderr.txt new file mode 100644 index 0000000..a3b3634 --- /dev/null +++ b/Tests/RunCMake/Android/ndk-x86-stderr.txt @@ -0,0 +1,7 @@ +^(CMake Warning: + You are using Visual Studio tools for Android, which does not support + standalone executables\. However, the following executable targets do not + have the ANDROID_GUI property set, and thus will not be built as expected\. + They will be built as shared libraries with executable filenames: + + android_c, android_cxx, android_sysinc_c, android_sysinc_cxx)?$ diff --git a/Tests/RunCMake/Android/ndk-x86_64-stderr.txt b/Tests/RunCMake/Android/ndk-x86_64-stderr.txt new file mode 100644 index 0000000..a3b3634 --- /dev/null +++ b/Tests/RunCMake/Android/ndk-x86_64-stderr.txt @@ -0,0 +1,7 @@ +^(CMake Warning: + You are using Visual Studio tools for Android, which does not support + standalone executables\. However, the following executable targets do not + have the ANDROID_GUI property set, and thus will not be built as expected\. + They will be built as shared libraries with executable filenames: + + android_c, android_cxx, android_sysinc_c, android_sysinc_cxx)?$ diff --git a/Tests/RunCMake/CMP0019/CMP0019-NEW-stderr.txt b/Tests/RunCMake/CMP0019/CMP0019-NEW-stderr.txt new file mode 100644 index 0000000..66a58fb --- /dev/null +++ b/Tests/RunCMake/CMP0019/CMP0019-NEW-stderr.txt @@ -0,0 +1,6 @@ +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions.$ diff --git a/Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt b/Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt index 048762d..a446211 100644 --- a/Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt +++ b/Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt @@ -1,4 +1,11 @@ -^CMake Deprecation Warning at CMP0019-OLD.cmake:[0-9]+ \(cmake_policy\): +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions. ++ +CMake Deprecation Warning at CMP0019-OLD.cmake:[0-9]+ \(cmake_policy\): The OLD behavior for policy CMP0019 will be removed from a future version of CMake. diff --git a/Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt b/Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt index 1e4b47d..f7b9c0e 100644 --- a/Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt +++ b/Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt @@ -1,3 +1,10 @@ +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions. ++ CMake Warning \(dev\) in CMakeLists.txt: Policy CMP0019 is not set: Do not re-expand variables in include and link information. Run "cmake --help-policy CMP0019" for policy details. Use diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe-stderr.txt new file mode 100644 index 0000000..66a58fb --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe-stderr.txt @@ -0,0 +1,6 @@ +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions.$ diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared-stderr.txt new file mode 100644 index 0000000..66a58fb --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared-stderr.txt @@ -0,0 +1,6 @@ +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions.$ diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-NEW-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-NEW-stderr.txt new file mode 100644 index 0000000..66a58fb --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-NEW-stderr.txt @@ -0,0 +1,6 @@ +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions.$ diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-link_libraries-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-link_libraries-stderr.txt new file mode 100644 index 0000000..66a58fb --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-link_libraries-stderr.txt @@ -0,0 +1,6 @@ +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions.$ diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-stderr.txt new file mode 100644 index 0000000..66a58fb --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-stderr.txt @@ -0,0 +1,6 @@ +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions.$ diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt index 6a6a0c7..87404d3 100644 --- a/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt @@ -1,3 +1,10 @@ +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions. ++ CMake Warning \(dev\) in CMakeLists.txt: Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link interface. Run "cmake --help-policy CMP0022" for policy details. Use the diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt index 2f7dfbf..5d75720 100644 --- a/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt @@ -1,4 +1,11 @@ -^CMake Warning \(dev\) in CMakeLists.txt: +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions. ++ +CMake Warning \(dev\) in CMakeLists.txt: Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link interface. Run "cmake --help-policy CMP0022" for policy details. Use the cmake_policy command to set the policy and suppress this warning. diff --git a/Tests/RunCMake/CMP0022/CMP0022-export-exe-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-export-exe-stderr.txt new file mode 100644 index 0000000..66a58fb --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-export-exe-stderr.txt @@ -0,0 +1,6 @@ +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions.$ diff --git a/Tests/RunCMake/CMP0026/CMakeLists.txt b/Tests/RunCMake/CMP0026/CMakeLists.txt index 12cd3c7..4b3de84 100644 --- a/Tests/RunCMake/CMP0026/CMakeLists.txt +++ b/Tests/RunCMake/CMP0026/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0027/CMakeLists.txt b/Tests/RunCMake/CMP0027/CMakeLists.txt index 12cd3c7..4b3de84 100644 --- a/Tests/RunCMake/CMP0027/CMakeLists.txt +++ b/Tests/RunCMake/CMP0027/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0028/CMakeLists.txt b/Tests/RunCMake/CMP0028/CMakeLists.txt index 144cdb4..4f867df 100644 --- a/Tests/RunCMake/CMP0028/CMakeLists.txt +++ b/Tests/RunCMake/CMP0028/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} CXX) include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) # policy used at end of dir diff --git a/Tests/RunCMake/CMP0037/CMakeLists.txt b/Tests/RunCMake/CMP0037/CMakeLists.txt index 12cd3c7..4b3de84 100644 --- a/Tests/RunCMake/CMP0037/CMakeLists.txt +++ b/Tests/RunCMake/CMP0037/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0041/CMakeLists.txt b/Tests/RunCMake/CMP0041/CMakeLists.txt index f452db1..a06591c 100644 --- a/Tests/RunCMake/CMP0041/CMakeLists.txt +++ b/Tests/RunCMake/CMP0041/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} CXX) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0042/CMakeLists.txt b/Tests/RunCMake/CMP0042/CMakeLists.txt index f452db1..a06591c 100644 --- a/Tests/RunCMake/CMP0042/CMakeLists.txt +++ b/Tests/RunCMake/CMP0042/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} CXX) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0043/CMakeLists.txt b/Tests/RunCMake/CMP0043/CMakeLists.txt index d027f3e..cc8a6f8 100644 --- a/Tests/RunCMake/CMP0043/CMakeLists.txt +++ b/Tests/RunCMake/CMP0043/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} CXX) include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) # policy used at end of dir diff --git a/Tests/RunCMake/CMP0045/CMakeLists.txt b/Tests/RunCMake/CMP0045/CMakeLists.txt index f452db1..a06591c 100644 --- a/Tests/RunCMake/CMP0045/CMakeLists.txt +++ b/Tests/RunCMake/CMP0045/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} CXX) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 36409d8..b037a6d 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -163,6 +163,7 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) -DPSEUDO_BC=$<TARGET_FILE:pseudo_BC> -DPSEUDO_PURIFY=$<TARGET_FILE:pseudo_purify> -DPSEUDO_VALGRIND=$<TARGET_FILE:pseudo_valgrind> + -DPSEUDO_CUDA_MEMCHECK=$<TARGET_FILE:pseudo_cuda-memcheck> -DPSEUDO_BC_NOLOG=$<TARGET_FILE:pseudonl_BC> -DPSEUDO_PURIFY_NOLOG=$<TARGET_FILE:pseudonl_purify> -DPSEUDO_VALGRIND_NOLOG=$<TARGET_FILE:pseudonl_valgrind> @@ -687,8 +688,8 @@ add_RunCMake_test(AutoExportDll add_RunCMake_test(AndroidMK) if(CMake_TEST_ANDROID_NDK OR CMake_TEST_ANDROID_STANDALONE_TOOLCHAIN) - if(NOT "${CMAKE_GENERATOR}" MATCHES "Make|Ninja") - message(FATAL_ERROR "Android tests supported only by Makefile and Ninja generators") + if(NOT "${CMAKE_GENERATOR}" MATCHES "Make|Ninja|Visual Studio 1[456]") + message(FATAL_ERROR "Android tests supported only by Makefile, Ninja, and Visual Studio >= 14 generators") endif() foreach(v TEST_ANDROID_NDK TEST_ANDROID_STANDALONE_TOOLCHAIN) if(CMake_${v}) diff --git a/Tests/RunCMake/CPack/DragNDrop/Accept.txt b/Tests/RunCMake/CPack/DragNDrop/Accept.txt new file mode 100644 index 0000000..975fbec --- /dev/null +++ b/Tests/RunCMake/CPack/DragNDrop/Accept.txt @@ -0,0 +1 @@ +y diff --git a/Tests/RunCMake/CPack/DragNDrop/Helpers.cmake b/Tests/RunCMake/CPack/DragNDrop/Helpers.cmake index 023e597..896fba7 100644 --- a/Tests/RunCMake/CPack/DragNDrop/Helpers.cmake +++ b/Tests/RunCMake/CPack/DragNDrop/Helpers.cmake @@ -5,6 +5,7 @@ function(getPackageContent FILE RESULT_VAR) file(REMOVE_RECURSE "${path_}/content") file(MAKE_DIRECTORY "${path_}/content") execute_process(COMMAND ${HDIUTIL_EXECUTABLE} attach -mountroot ${path_}/content -nobrowse ${FILE} + INPUT_FILE "${src_dir}/DragNDrop/Accept.txt" RESULT_VARIABLE attach_result_ ERROR_VARIABLE attach_error_ OUTPUT_STRIP_TRAILING_WHITESPACE) diff --git a/Tests/RunCMake/CPack/DragNDrop/packaging_MONOLITHIC_default.cmake b/Tests/RunCMake/CPack/DragNDrop/packaging_MONOLITHIC_default.cmake new file mode 100644 index 0000000..ca27890 --- /dev/null +++ b/Tests/RunCMake/CPack/DragNDrop/packaging_MONOLITHIC_default.cmake @@ -0,0 +1,2 @@ +set(CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK ON) +set(CPACK_DMG_VOLUME_NAME "volume-name") diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index 064b4dc..530bcdf 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -10,6 +10,7 @@ run_cpack_test(DEBUGINFO "RPM.DEBUGINFO;DEB.DEBUGINFO" true "COMPONENT") run_cpack_test_subtests(DEFAULT_PERMISSIONS "CMAKE_var_set;CPACK_var_set;both_set;invalid_CMAKE_var;invalid_CPACK_var" "RPM.DEFAULT_PERMISSIONS;DEB.DEFAULT_PERMISSIONS" false "MONOLITHIC;COMPONENT") run_cpack_test(DEPENDENCIES "RPM.DEPENDENCIES;DEB.DEPENDENCIES" true "COMPONENT") run_cpack_test(DIST "RPM.DIST" false "MONOLITHIC") +run_cpack_test(DMG_SLA "DragNDrop" false "MONOLITHIC") run_cpack_test(EMPTY_DIR "RPM.EMPTY_DIR;DEB.EMPTY_DIR;TGZ" true "MONOLITHIC;COMPONENT") run_cpack_test(VERSION "RPM.VERSION;DEB.VERSION" false "MONOLITHIC;COMPONENT") run_cpack_test(EXTRA "DEB.EXTRA" false "COMPONENT") @@ -46,3 +47,4 @@ run_cpack_test_subtests( "MONOLITHIC;COMPONENT" ) run_cpack_test(PROJECT_META "RPM.PROJECT_META;DEB.PROJECT_META" false "MONOLITHIC;COMPONENT") +run_cpack_test_package_target(PRE_POST_SCRIPTS "ZIP" false "MONOLITHIC;COMPONENT") diff --git a/Tests/RunCMake/CPack/tests/DMG_SLA/English.license.rtf b/Tests/RunCMake/CPack/tests/DMG_SLA/English.license.rtf new file mode 100644 index 0000000..c1da711 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DMG_SLA/English.license.rtf @@ -0,0 +1,7 @@ +{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033{\fonttbl{\f0\fnil\fcharset0 Calibri;}} +{\colortbl ;\red0\green0\blue255;} +{\*\generator Riched20 10.0.18362}\viewkind4\uc1 +\pard\sa200\sl276\slmult1\b\f0\fs22\lang9 LICENSE\b0\par +This is an installer created using CPack ({{\field{\*\fldinst{HYPERLINK https://cmake.org }}{\fldrslt{https://cmake.org\ul0\cf0}}}}\f0\fs22 ). No license provided.\par +\par +} diff --git a/Tests/RunCMake/CPack/tests/DMG_SLA/English.menu.txt b/Tests/RunCMake/CPack/tests/DMG_SLA/English.menu.txt new file mode 100644 index 0000000..b2cbc25 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DMG_SLA/English.menu.txt @@ -0,0 +1,9 @@ +English +Agree +Disagree +Print +Save... +You agree to the License Agreement terms when you click the "Agree" button. +Software License Agreement +This text cannot be saved. This disk may be full or locked or the file may be locked. +Unable to print. Make sure you have selected a printer. diff --git a/Tests/RunCMake/CPack/tests/DMG_SLA/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DMG_SLA/ExpectedFiles.cmake new file mode 100644 index 0000000..d1a3a5f --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DMG_SLA/ExpectedFiles.cmake @@ -0,0 +1,2 @@ +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_CONTENT_1_LIST "/foo;/foo/CMakeLists.txt") diff --git a/Tests/RunCMake/CPack/tests/DMG_SLA/German.license.txt b/Tests/RunCMake/CPack/tests/DMG_SLA/German.license.txt new file mode 100644 index 0000000..0edd1f2 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DMG_SLA/German.license.txt @@ -0,0 +1,3 @@ +LIZENZ +------ +Dies ist ein Installationsprogramm, das mit erstellt wurde CPack (https://cmake.org). Keine Lizenz angegeben. diff --git a/Tests/RunCMake/CPack/tests/DMG_SLA/German.menu.txt b/Tests/RunCMake/CPack/tests/DMG_SLA/German.menu.txt new file mode 100644 index 0000000..7724818 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DMG_SLA/German.menu.txt @@ -0,0 +1,9 @@ +German +Akzeptieren +Ablehnen +Drucken +Speichern... +Klicken Sie auf "Akzeptieren", wenn Sie mit den Bestimmungen des Software-Lizenzvertrages einverstanden sind. +Software-Lizenzvertrag +Dieser Text kann nicht gesichert werden. Diese Festplatte ist mšglicherweise voll oder geschŸtzt oder der Ordner ist geschŸtzt. +Es kann nicht gedruckt werden. Bitte stellen Sie sicher, dass ein Drucker ausgewŠhlt ist. diff --git a/Tests/RunCMake/CPack/tests/DMG_SLA/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/DMG_SLA/VerifyResult.cmake new file mode 100644 index 0000000..010e14c --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DMG_SLA/VerifyResult.cmake @@ -0,0 +1,33 @@ +set(dmg "${bin_dir}/${FOUND_FILE_1}") +execute_process(COMMAND hdiutil udifderez -xml "${dmg}" OUTPUT_VARIABLE out ERROR_VARIABLE err RESULT_VARIABLE res) +if(NOT res EQUAL 0) + string(REPLACE "\n" "\n " err " ${err}") + message(FATAL_ERROR "Running 'hdiutil udifderez -xml' on\n ${dmg}\nfailed with:\n${err}") +endif() +foreach(key "LPic" "STR#" "TEXT" "RTF ") + if(NOT out MATCHES "<key>${key}</key>") + string(REPLACE "\n" "\n " out " ${out}") + message(FATAL_ERROR "error: running 'hdiutil udifderez -xml' on\n ${dmg}\ndid not show '${key}' key:\n${out}") + endif() +endforeach() +foreach(line + # LPic + "\tAAAAAgAAAAAAAAADAAEAAA==\n" + # STR# English first and last base64 lines + "\tAAkHRW5nbGlzaAVBZ3JlZQhEaXNhZ3JlZQVQcmludAdTYXZlLi4u\n" + "\tZCBhIHByaW50ZXIu\n" + # STR# German first and last base64 lines + "\tAAkGR2VybWFuC0FremVwdGllcmVuCEFibGVobmVuB0RydWNrZW4M\n" + "\tYXVzZ2V3wopobHQgaXN0Lg==\n" + # RTF English first and last base64 lines + "\te1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZGVmZjBcbm91aWNvbXBh\n" + "\tdmlkZWQuXHBhcg1ccGFyDX0NDQ==\n" + # TEXT German first and last base64 lines + "\tTElaRU5aDS0tLS0tLQ1EaWVzIGlzdCBlaW4gSW5zdGFsbGF0aW9u\n" + "\tZ2ViZW4uDQ0=\n" + ) + if(NOT out MATCHES "${line}") + string(REPLACE "\n" "\n " out " ${out}") + message(FATAL_ERROR "error: running 'hdiutil udifderez -xml' on\n ${dmg}\ndid not show '${line}':\n${out}") + endif() +endforeach() diff --git a/Tests/RunCMake/CPack/tests/DMG_SLA/test.cmake b/Tests/RunCMake/CPack/tests/DMG_SLA/test.cmake new file mode 100644 index 0000000..2804b0b --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DMG_SLA/test.cmake @@ -0,0 +1,3 @@ +install(FILES CMakeLists.txt DESTINATION foo) +set(CPACK_DMG_SLA_DIR "${CMAKE_CURRENT_LIST_DIR}") +set(CPACK_DMG_SLA_LANGUAGES English German) diff --git a/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake b/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake index 6f7c4c2..3db8014 100644 --- a/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake +++ b/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake @@ -29,3 +29,11 @@ expect_file(${CPACK_TEMPORARY_DIRECTORY}/f3/share/cpack-test/f3.txt) expect_file(${CPACK_TEMPORARY_DIRECTORY}/f4/share/cpack-test/f4.txt) message(STATUS "This status message is expected to be visible") + +set( + CPACK_EXTERNAL_BUILT_PACKAGES + ${CPACK_TEMPORARY_DIRECTORY}/f1/share/cpack-test/f1.txt + ${CPACK_TEMPORARY_DIRECTORY}/f2/share/cpack-test/f2.txt + ${CPACK_TEMPORARY_DIRECTORY}/f3/share/cpack-test/f3.txt + ${CPACK_TEMPORARY_DIRECTORY}/f4/share/cpack-test/f4.txt + ) diff --git a/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt b/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt index 37d635f..587b2e8 100644 --- a/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt +++ b/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt @@ -1 +1,11 @@ -- This status message is expected to be visible +CPack: - package: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/external-0\.1\.1-.*\.json generated\. +CPack: - checksum file: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/external-0\.1\.1-.*\.json\.sha1 generated\. +CPack: - package: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f1\.txt generated\. +CPack: - checksum file: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f1\.txt\.sha1 generated\. +CPack: - package: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f2\.txt generated\. +CPack: - checksum file: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f2\.txt\.sha1 generated\. +CPack: - package: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f3\.txt generated\. +CPack: - checksum file: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f3\.txt\.sha1 generated\. +CPack: - package: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f4\.txt generated\. +CPack: - checksum file: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f4\.txt\.sha1 generated\. diff --git a/Tests/RunCMake/CPack/tests/EXTERNAL/test.cmake b/Tests/RunCMake/CPack/tests/EXTERNAL/test.cmake index bc9766b..d4781ba 100644 --- a/Tests/RunCMake/CPack/tests/EXTERNAL/test.cmake +++ b/Tests/RunCMake/CPack/tests/EXTERNAL/test.cmake @@ -17,6 +17,7 @@ elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "invalid_bad") elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "stage_and_package") set(CPACK_EXTERNAL_ENABLE_STAGING 1) set(CPACK_EXTERNAL_PACKAGE_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/create_package.cmake") + set(CPACK_PACKAGE_CHECKSUM SHA1) endif() file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/f1.txt" test1) diff --git a/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ExpectedFiles.cmake new file mode 100644 index 0000000..63a36a3 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ExpectedFiles.cmake @@ -0,0 +1,19 @@ +set(SATU "/satu;/satu/CMakeLists.txt") +set(DUA "/dua;/dua/CMakeLists.txt") + +if(GENERATOR_TYPE STREQUAL ZIP) + set(_ext "zip") +elseif(GENERATOR_TYPE STREQUAL TGZ) + set(_ext "tar.gz") +endif() + +if(PACKAGING_TYPE STREQUAL "COMPONENT") + set(EXPECTED_FILES_COUNT "2") + set(EXPECTED_FILE_1 "*-satu.${_ext}") + set(EXPECTED_FILE_CONTENT_1_LIST ${SATU}) + set(EXPECTED_FILE_2 "*-dua.${_ext}") + set(EXPECTED_FILE_CONTENT_2_LIST ${DUA}) +else() + set(EXPECTED_FILES_COUNT "1") + set(EXPECTED_FILE_CONTENT_1_LIST ${SATU} ${DUA}) +endif() diff --git a/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ZIP_COMPONENT-stdout.txt b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ZIP_COMPONENT-stdout.txt new file mode 100644 index 0000000..319d0da --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ZIP_COMPONENT-stdout.txt @@ -0,0 +1,4 @@ +-- The message from .*/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/pre\.cmake and generator ZIP +.* +-- The message from .*/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/post\.cmake and generator ZIP +-- Built packages: .*/_CPack_Packages/.*/pre_post_scripts-.*-dua.zip;.*/_CPack_Packages/.*/pre_post_scripts-.*-satu.zip diff --git a/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ZIP_MONOLITHIC-stdout.txt b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ZIP_MONOLITHIC-stdout.txt new file mode 100644 index 0000000..632c4d1 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ZIP_MONOLITHIC-stdout.txt @@ -0,0 +1,4 @@ +-- The message from .*/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/pre\.cmake and generator ZIP +.* +-- The message from .*/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/post\.cmake and generator ZIP +-- Built packages: .*/_CPack_Packages/.*/pre_post_scripts-0\.1\.1-.*\.zip diff --git a/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/post.cmake b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/post.cmake new file mode 100644 index 0000000..cf0b149 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/post.cmake @@ -0,0 +1,2 @@ +message(STATUS "The message from ${CMAKE_CURRENT_LIST_FILE} and generator ${CPACK_GENERATOR}") +message(STATUS "Built packages: ${CPACK_PACKAGE_FILES}") diff --git a/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/pre.cmake b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/pre.cmake new file mode 100644 index 0000000..b04aa6b --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/pre.cmake @@ -0,0 +1 @@ +message(STATUS "The message from ${CMAKE_CURRENT_LIST_FILE} and generator ${CPACK_GENERATOR}") diff --git a/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/test.cmake b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/test.cmake new file mode 100644 index 0000000..f1b6d5f --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/test.cmake @@ -0,0 +1,9 @@ +install(FILES CMakeLists.txt DESTINATION satu COMPONENT satu) +install(FILES CMakeLists.txt DESTINATION dua COMPONENT dua) + +set(CPACK_PRE_BUILD_SCRIPTS "${CMAKE_CURRENT_LIST_DIR}/pre.cmake") +set(CPACK_POST_BUILD_SCRIPTS "${CMAKE_CURRENT_LIST_DIR}/post.cmake") + +if(PACKAGING_TYPE STREQUAL "COMPONENT") + set(CPACK_COMPONENTS_ALL satu dua) +endif() diff --git a/Tests/RunCMake/CTest/CMakeLists.txt b/Tests/RunCMake/CTest/CMakeLists.txt index 73e6a78..f1a83e8 100644 --- a/Tests/RunCMake/CTest/CMakeLists.txt +++ b/Tests/RunCMake/CTest/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) if(NOT NoProject) project(${RunCMake_TEST} NONE) endif() diff --git a/Tests/RunCMake/CheckModules/CMakeLists.txt b/Tests/RunCMake/CheckModules/CMakeLists.txt index 9872df2..842c5cf 100644 --- a/Tests/RunCMake/CheckModules/CMakeLists.txt +++ b/Tests/RunCMake/CheckModules/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 2.8.12) cmake_policy(SET CMP0054 NEW) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-fail-result.txt b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-fail-result.txt new file mode 100644 index 0000000..d197c91 --- /dev/null +++ b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-fail-result.txt @@ -0,0 +1 @@ +[^0] diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-fail-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-fail-stderr.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-fail-stderr.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt b/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt index d2a2831..cf2c087 100644 --- a/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt +++ b/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt @@ -5,3 +5,4 @@ add_custom_command( add_custom_target(CustomTarget ALL DEPENDS output.txt) add_custom_target(CustomTarget2 ALL DEPENDS output.txt) add_custom_target(CustomTarget3 ALL DEPENDS output.txt) +add_custom_target(CustomTargetFail COMMAND DoesNotExist) diff --git a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt index 03286f1..e24e131 100644 --- a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt +++ b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt @@ -1 +1 @@ -^{"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":1}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":true,"version":{.*}}$ +^{"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":2}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":true,"version":{.*}}$ diff --git a/Tests/RunCMake/CommandLine/E_compare_files-different-eol-stderr.txt b/Tests/RunCMake/CommandLine/E_compare_files-different-eol-stderr.txt deleted file mode 100644 index 4729ccb..0000000 --- a/Tests/RunCMake/CommandLine/E_compare_files-different-eol-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^Files ".*/compare_files/lf" to ".*/compare_files/crlf" are different.$ diff --git a/Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-stderr.txt b/Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-stderr.txt deleted file mode 100644 index 8a9ca81..0000000 --- a/Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^Files "nonexistent_a" to "nonexistent_b" are different.$ diff --git a/Tests/RunCMake/CommandLine/E_compare_files-invalid-arguments-result.txt b/Tests/RunCMake/CommandLine/E_compare_files-invalid-arguments-result.txt new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_compare_files-invalid-arguments-result.txt @@ -0,0 +1 @@ +2 diff --git a/Tests/RunCMake/CommandLine/E_compare_files-invalid-arguments-stderr.txt b/Tests/RunCMake/CommandLine/E_compare_files-invalid-arguments-stderr.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_compare_files-invalid-arguments-stderr.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/CommandLine/ProfilingTest-check.cmake b/Tests/RunCMake/CommandLine/ProfilingTest-check.cmake index 19ece86..2e8eac1 100644 --- a/Tests/RunCMake/CommandLine/ProfilingTest-check.cmake +++ b/Tests/RunCMake/CommandLine/ProfilingTest-check.cmake @@ -16,3 +16,16 @@ if (NOT JSON_TRAILER MATCHES "^}]$") set(RunCMake_TEST_FAILED "Expected valid JSON end") return() endif() + +file(STRINGS ${ProfilingTestOutput} upperCaseCommand + REGEX [["name"[ ]*:[ ]*"__TESTING_COMMAND_CASE"]]) +if (NOT "${upperCaseCommand}" STREQUAL "") + set(RunCMake_TEST_FAILED "Command name not stored in lowercase") +endif() +file(STRINGS ${ProfilingTestOutput} lowerCaseCommand + REGEX [["name"[ ]*:[ ]*"__testing_command_case"]]) +list(LENGTH lowerCaseCommand numInvocations) +if (NOT numInvocations EQUAL 1) + set(RunCMake_TEST_FAILED + "Unexpected number of lowercase command names: ${numInvocations}") +endif() diff --git a/Tests/RunCMake/CommandLine/ProfilingTest.cmake b/Tests/RunCMake/CommandLine/ProfilingTest.cmake index 837f4bf..4cf0c30 100644 --- a/Tests/RunCMake/CommandLine/ProfilingTest.cmake +++ b/Tests/RunCMake/CommandLine/ProfilingTest.cmake @@ -1 +1,5 @@ -# This file is intentionally left blank +function(__testing_command_case) +endfunction() + +# This must not appear in the profiling output as uppercase +__TESTING_COMMAND_CASE() diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 973391d..6d69945 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -22,6 +22,7 @@ run_cmake_command(E_compare_files-different-eol ${CMAKE_COMMAND} -E compare_file run_cmake_command(E_compare_files-ignore-eol-same ${CMAKE_COMMAND} -E compare_files --ignore-eol ${RunCMake_SOURCE_DIR}/compare_files/lf ${RunCMake_SOURCE_DIR}/compare_files/crlf) run_cmake_command(E_compare_files-ignore-eol-empty ${CMAKE_COMMAND} -E compare_files --ignore-eol ${RunCMake_SOURCE_DIR}/compare_files/empty1 ${RunCMake_SOURCE_DIR}/compare_files/empty2) run_cmake_command(E_compare_files-ignore-eol-nonexistent ${CMAKE_COMMAND} -E compare_files --ignore-eol nonexistent_a nonexistent_b) +run_cmake_command(E_compare_files-invalid-arguments ${CMAKE_COMMAND} -E compare_files file1.txt file2.txt file3.txt) run_cmake_command(E_echo_append ${CMAKE_COMMAND} -E echo_append) run_cmake_command(E_rename-no-arg ${CMAKE_COMMAND} -E rename) run_cmake_command(E_server-arg ${CMAKE_COMMAND} -E server --extra-arg) @@ -66,6 +67,32 @@ run_cmake_command(install-bad-dir run_cmake_command(install-options-to-vars ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-install-options-to-vars --strip --prefix /var/test --config sample --component pack) +run_cmake_command(install-default-dir-permissions-all + ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars + --default-directory-permissions u=rwx,g=rx,o=rx) +run_cmake_command(install-default-dir-permissions-afew + ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars + --default-directory-permissions u=rwx,g=rx) +run_cmake_command(install-default-dir-permissions-none + ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars) +run_cmake_command(install-default-dir-permissions-invalid-comma1 + ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars + --default-directory-permissions u=rwxg=,x) +run_cmake_command(install-default-dir-permissions-invalid-comma2 + ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars + --default-directory-permissions u=rwxg,=x) +run_cmake_command(install-default-dir-permissions-comma-at-the-end + ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars + --default-directory-permissions u=rwx,) +run_cmake_command(install-default-dir-permissions-invalid-assignment + ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars + --default-directory-permissions u=rwx,=x) +run_cmake_command(install-default-dir-permissions-assignment-at-the-end + ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars + --default-directory-permissions u=rwx,g=) +run_cmake_command(install-default-dir-permissions-assignment-at-the-beginning + ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars + --default-directory-permissions =u=rwx,g=rx) run_cmake_command(cache-bad-entry ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}/cache-bad-entry/) @@ -134,6 +161,8 @@ function(run_BuildDir) ${CMAKE_COMMAND} --build BuildDir-build --target CustomTarget) run_cmake_command(BuildDir--build-multiple-targets ${CMAKE_COMMAND} -E chdir .. ${CMAKE_COMMAND} --build BuildDir-build -t CustomTarget2 --target CustomTarget3) + run_cmake_command(BuildDir--build-multiple-targets-fail ${CMAKE_COMMAND} -E chdir .. + ${CMAKE_COMMAND} --build BuildDir-build -t CustomTargetFail --target CustomTarget3) run_cmake_command(BuildDir--build-multiple-targets-jobs ${CMAKE_COMMAND} -E chdir .. ${CMAKE_COMMAND} --build BuildDir-build --target CustomTarget CustomTarget2 -j2 --target CustomTarget3) run_cmake_command(BuildDir--build-multiple-targets-with-clean-first ${CMAKE_COMMAND} -E chdir .. diff --git a/Tests/RunCMake/CommandLine/dir-permissions-install-options-to-vars/cmake_install.cmake b/Tests/RunCMake/CommandLine/dir-permissions-install-options-to-vars/cmake_install.cmake new file mode 100644 index 0000000..42ef745 --- /dev/null +++ b/Tests/RunCMake/CommandLine/dir-permissions-install-options-to-vars/cmake_install.cmake @@ -0,0 +1,3 @@ +if(CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS) + message("CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS is ${CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS}") +endif() diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-stderr.txt new file mode 100644 index 0000000..42f4b3f --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-stderr.txt @@ -0,0 +1 @@ +CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS is OWNER_READ;OWNER_WRITE;OWNER_EXECUTE;GROUP_READ;GROUP_EXECUTE diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-stderr.txt new file mode 100644 index 0000000..813d9c3 --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-stderr.txt @@ -0,0 +1 @@ +CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS is OWNER_READ;OWNER_WRITE;OWNER_EXECUTE;GROUP_READ;GROUP_EXECUTE;WORLD_READ;WORLD_EXECUTE diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-stderr.txt new file mode 100644 index 0000000..1b80952 --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-stderr.txt @@ -0,0 +1 @@ +--default-directory-permissions is in incorrect format diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-stderr.txt new file mode 100644 index 0000000..6680932 --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-stderr.txt @@ -0,0 +1 @@ +CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS is OWNER_READ;OWNER_WRITE;OWNER_EXECUTE diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-stderr.txt new file mode 100644 index 0000000..1b80952 --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-stderr.txt @@ -0,0 +1 @@ +--default-directory-permissions is in incorrect format diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-stderr.txt new file mode 100644 index 0000000..1b80952 --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-stderr.txt @@ -0,0 +1 @@ +--default-directory-permissions is in incorrect format diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-stderr.txt new file mode 100644 index 0000000..1b80952 --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-stderr.txt @@ -0,0 +1 @@ +--default-directory-permissions is in incorrect format diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-stderr.txt new file mode 100644 index 0000000..1b80952 --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-stderr.txt @@ -0,0 +1 @@ +--default-directory-permissions is in incorrect format diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/CompatibleInterface/CMakeLists.txt b/Tests/RunCMake/CompatibleInterface/CMakeLists.txt index f452db1..ebab7a3 100644 --- a/Tests/RunCMake/CompatibleInterface/CMakeLists.txt +++ b/Tests/RunCMake/CompatibleInterface/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} CXX) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake b/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake index 0196611..64b52d9 100644 --- a/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake +++ b/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.3) project(CompatibleInterface) diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-builtin-prop.cmake b/Tests/RunCMake/CompatibleInterface/InterfaceString-builtin-prop.cmake index 5772856..f072eb0 100644 --- a/Tests/RunCMake/CompatibleInterface/InterfaceString-builtin-prop.cmake +++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-builtin-prop.cmake @@ -5,5 +5,5 @@ add_library(bar UNKNOWN IMPORTED) set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_STRING INCLUDE_DIRECTORIES) add_executable(user main.cpp) -set_property(TARGET user PROPERTY INCLUDE_DIRECTORIES bar_inc) +set_property(TARGET user PROPERTY INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/bar_inc) target_link_libraries(user foo bar) diff --git a/Tests/RunCMake/CompilerChange/CMakeLists.txt b/Tests/RunCMake/CompilerChange/CMakeLists.txt index b4b3016..14c47ad 100644 --- a/Tests/RunCMake/CompilerChange/CMakeLists.txt +++ b/Tests/RunCMake/CompilerChange/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) if(NOT RunCMake_TEST) set(RunCMake_TEST "$ENV{RunCMake_TEST}") # needed when cache is deleted endif() diff --git a/Tests/RunCMake/CompilerNotFound/CMakeLists.txt b/Tests/RunCMake/CompilerNotFound/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/CompilerNotFound/CMakeLists.txt +++ b/Tests/RunCMake/CompilerNotFound/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/Configure/CMakeLists.txt b/Tests/RunCMake/Configure/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/Configure/CMakeLists.txt +++ b/Tests/RunCMake/Configure/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/DisallowedCommands/CMakeLists.txt b/Tests/RunCMake/DisallowedCommands/CMakeLists.txt index 12cd3c7..4b3de84 100644 --- a/Tests/RunCMake/DisallowedCommands/CMakeLists.txt +++ b/Tests/RunCMake/DisallowedCommands/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt b/Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt +++ b/Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/ExternalData/CMakeLists.txt b/Tests/RunCMake/ExternalData/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/ExternalData/CMakeLists.txt +++ b/Tests/RunCMake/ExternalData/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/FPHSA/CMakeLists.txt b/Tests/RunCMake/FPHSA/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/FPHSA/CMakeLists.txt +++ b/Tests/RunCMake/FPHSA/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/FeatureSummary/CMakeLists.txt b/Tests/RunCMake/FeatureSummary/CMakeLists.txt index 72abfc8..74b3ff8 100644 --- a/Tests/RunCMake/FeatureSummary/CMakeLists.txt +++ b/Tests/RunCMake/FeatureSummary/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py index a3dd9ff..b567bf1 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py +++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py @@ -12,7 +12,7 @@ def read_codemodel_json_data(filename): def check_objects(o, g): assert is_list(o) assert len(o) == 1 - check_index_object(o[0], "codemodel", 2, 1, check_object_codemodel(g)) + check_index_object(o[0], "codemodel", 2, 2, check_object_codemodel(g)) def check_backtrace(t, b, backtrace): btg = t["backtraceGraph"] @@ -42,6 +42,16 @@ def check_backtrace(t, b, backtrace): assert b is None +def check_backtraces(t, actual, expected): + assert is_list(actual) + assert is_list(expected) + assert len(actual) == len(expected) + + i = 0 + while i < len(actual): + check_backtrace(t, actual[i], expected[i]) + i += 1 + def check_directory(c): def _check(actual, expected): assert is_dict(actual) @@ -421,6 +431,19 @@ def check_target(c): missing_exception=lambda e: "Precompile header: %s" % e["header"], extra_exception=lambda a: "Precompile header: %s" % a["header"]) + if "languageStandard" in expected: + expected_keys.append("languageStandard") + + def check_language_standard(actual, expected): + assert is_dict(actual) + expected_keys = ["backtraces", "standard"] + assert actual["standard"] == expected["standard"] + check_backtraces(obj, actual["backtraces"], expected["backtraces"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + + check_language_standard(actual["languageStandard"], expected["languageStandard"]) + if expected["defines"] is not None: expected_keys.append("defines") @@ -544,6 +567,8 @@ def gen_check_targets(c, g, inSource): read_codemodel_json_data("targets/zero_check_cxx.json"), read_codemodel_json_data("targets/cxx_lib.json"), read_codemodel_json_data("targets/cxx_exe.json"), + read_codemodel_json_data("targets/cxx_standard_compile_feature_exe.json"), + read_codemodel_json_data("targets/cxx_standard_exe.json"), read_codemodel_json_data("targets/cxx_shared_lib.json"), read_codemodel_json_data("targets/cxx_shared_exe.json"), read_codemodel_json_data("targets/cxx_static_lib.json"), @@ -592,6 +617,12 @@ def gen_check_targets(c, g, inSource): e["sources"] = precompile_header_data["sources"] e["sourceGroups"] = precompile_header_data["sourceGroups"] + if os.path.exists(os.path.join(reply_dir, "..", "..", "..", "..", "cxx", "cxx_std_11.txt")): + for e in expected: + if e["name"] == "cxx_standard_compile_feature_exe": + language_standard_data = read_codemodel_json_data("targets/cxx_standard_compile_feature_exe_languagestandard.json") + e["compileGroups"][0]["languageStandard"] = language_standard_data["languageStandard"] + if not os.path.exists(os.path.join(reply_dir, "..", "..", "..", "..", "ipo_enabled.txt")): for e in expected: try: diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json index ebe717a..a51b6eb 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json @@ -7,6 +7,8 @@ "^ALL_BUILD::@a56b12a3f5c0529fb296$", "^ZERO_CHECK::@a56b12a3f5c0529fb296$", "^cxx_exe::@a56b12a3f5c0529fb296$", + "^cxx_standard_compile_feature_exe::@a56b12a3f5c0529fb296$", + "^cxx_standard_exe::@a56b12a3f5c0529fb296$", "^cxx_lib::@a56b12a3f5c0529fb296$", "^cxx_shared_exe::@a56b12a3f5c0529fb296$", "^cxx_shared_lib::@a56b12a3f5c0529fb296$", diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json index 296ae6c..363e853 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json @@ -10,6 +10,8 @@ "^ZERO_CHECK::@a56b12a3f5c0529fb296$", "^cxx_lib::@a56b12a3f5c0529fb296$", "^cxx_exe::@a56b12a3f5c0529fb296$", + "^cxx_standard_compile_feature_exe::@a56b12a3f5c0529fb296$", + "^cxx_standard_exe::@a56b12a3f5c0529fb296$", "^cxx_shared_lib::@a56b12a3f5c0529fb296$", "^cxx_shared_exe::@a56b12a3f5c0529fb296$", "^cxx_static_lib::@a56b12a3f5c0529fb296$", diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json index 92a7944..1f443b1 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json @@ -80,6 +80,14 @@ "backtrace": null }, { + "id": "^cxx_standard_compile_feature_exe::@a56b12a3f5c0529fb296$", + "backtrace": null + }, + { + "id": "^cxx_standard_exe::@a56b12a3f5c0529fb296$", + "backtrace": null + }, + { "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$", "backtrace": null }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json index b4def78..59bd750 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json @@ -116,6 +116,14 @@ "backtrace": null }, { + "id": "^cxx_standard_compile_feature_exe::@a56b12a3f5c0529fb296$", + "backtrace": null + }, + { + "id": "^cxx_standard_exe::@a56b12a3f5c0529fb296$", + "backtrace": null + }, + { "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$", "backtrace": null }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json new file mode 100644 index 0000000..d6d573f --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json @@ -0,0 +1,110 @@ +{ + "name": "cxx_standard_compile_feature_exe", + "id": "^cxx_standard_compile_feature_exe::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "EXECUTABLE", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 26, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$" + ] + } + ], + "compileGroups": [ + { + "language": "CXX", + "languageStandard" : + { + "backtraces": [ + [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 27, + "command": "set_property", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + ], + "standard" : "98" + }, + "sourcePaths": [ + "^empty\\.cxx$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 26, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^cxx_standard_compile_feature_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_standard_compile_feature_exe(\\.exe)?$", + "_dllExtra": false + }, + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_standard_compile_feature_exe\\.pdb$", + "_dllExtra": true + } + ], + "build": "^cxx$", + "source": "^cxx$", + "install": null, + "link": { + "language": "CXX", + "lto": null, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe_languagestandard.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe_languagestandard.json new file mode 100644 index 0000000..0c4eabb --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe_languagestandard.json @@ -0,0 +1,36 @@ +{ + "languageStandard" : + { + "backtraces": [ + [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 29, + "command": "target_compile_features", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 30, + "command": "target_compile_features", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + ], + "standard" : "11" + } +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json new file mode 100644 index 0000000..9cb2832 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json @@ -0,0 +1,110 @@ +{ + "name": "cxx_standard_exe", + "id": "^cxx_standard_exe::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "EXECUTABLE", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 23, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$" + ] + } + ], + "compileGroups": [ + { + "language": "CXX", + "languageStandard" : + { + "backtraces": [ + [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 24, + "command": "set_property", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + ], + "standard" : "17" + }, + "sourcePaths": [ + "^empty\\.cxx$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 23, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^cxx_standard_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_standard_exe(\\.exe)?$", + "_dllExtra": false + }, + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_standard_exe\\.pdb$", + "_dllExtra": true + } + ], + "build": "^cxx$", + "source": "^cxx$", + "install": null, + "link": { + "language": "CXX", + "lto": null, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt b/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt index fa51195..76235f5 100644 --- a/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt +++ b/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt @@ -19,3 +19,14 @@ target_link_options(cxx_exe PUBLIC TargetLinkOptions) target_link_directories(cxx_exe PUBLIC "${CMAKE_BINARY_DIR}/TargetLinkDir") target_precompile_headers(cxx_exe PUBLIC ../empty.h) + +add_executable(cxx_standard_exe ../empty.cxx) +set_property(TARGET cxx_standard_exe PROPERTY CXX_STANDARD 17) + +add_executable(cxx_standard_compile_feature_exe ../empty.cxx) +set_property(TARGET cxx_standard_compile_feature_exe PROPERTY CXX_STANDARD 98) +if(CMAKE_CXX_STANDARD_DEFAULT AND DEFINED CMAKE_CXX11_STANDARD_COMPILE_OPTION) + target_compile_features(cxx_standard_compile_feature_exe PRIVATE cxx_std_11) + target_compile_features(cxx_standard_compile_feature_exe PRIVATE cxx_decltype) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cxx_std_11.txt" "") +endif() diff --git a/Tests/RunCMake/File_Generate/AdjacentInOut.cmake b/Tests/RunCMake/File_Generate/AdjacentInOut.cmake new file mode 100644 index 0000000..828c2ee --- /dev/null +++ b/Tests/RunCMake/File_Generate/AdjacentInOut.cmake @@ -0,0 +1,6 @@ +cmake_policy(SET CMP0070 NEW) +if(EXISTS "${CMAKE_CURRENT_BINARY_DIR}/AdjacentInOut.txt") + message(FATAL_ERROR "CMake should not re-run during the build!") +endif() +configure_file(AdjacentInOut.in ${CMAKE_CURRENT_BINARY_DIR}/AdjacentInOut.txt.tmp) +file(GENERATE OUTPUT AdjacentInOut.txt INPUT ${CMAKE_CURRENT_BINARY_DIR}/AdjacentInOut.txt.tmp) diff --git a/Tests/RunCMake/File_Generate/AdjacentInOut.in b/Tests/RunCMake/File_Generate/AdjacentInOut.in new file mode 100644 index 0000000..bfbbda7 --- /dev/null +++ b/Tests/RunCMake/File_Generate/AdjacentInOut.in @@ -0,0 +1 @@ +Sample Text File diff --git a/Tests/RunCMake/File_Generate/CMakeLists.txt b/Tests/RunCMake/File_Generate/CMakeLists.txt index bc0cf5d..3178de5 100644 --- a/Tests/RunCMake/File_Generate/CMakeLists.txt +++ b/Tests/RunCMake/File_Generate/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) if(NOT TEST_FILE) set(TEST_FILE ${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake index 94aaca8..5987417 100644 --- a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake +++ b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake @@ -72,6 +72,7 @@ if (UNIX AND EXISTS /bin/sh) if (NOT script_output STREQUAL SUCCESS) message(SEND_ERROR "Generated script did not execute correctly:\n${script_output}\n====\n${script_error}") endif() + unset(RunCMake_TEST_NO_CLEAN) endif() if (RunCMake_GENERATOR MATCHES Makefiles) @@ -104,3 +105,10 @@ if (RunCMake_GENERATOR MATCHES Makefiles) message(SEND_ERROR "File did not re-generate: \"${RunCMake_BINARY_DIR}/ReRunCMake-build/output_file.txt\"") endif() endif() + +set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/AdjacentInOut-build) +run_cmake(AdjacentInOut) +set(RunCMake_TEST_NO_CLEAN 1) +run_cmake_command(AdjacentInOut-nowork ${CMAKE_COMMAND} --build .) +unset(RunCMake_TEST_BINARY_DIR) +unset(RunCMake_TEST_NO_CLEAN) diff --git a/Tests/RunCMake/FindOpenGL/CMP0072-OLD-stderr.txt b/Tests/RunCMake/FindOpenGL/CMP0072-OLD-stderr.txt new file mode 100644 index 0000000..68d23d4 --- /dev/null +++ b/Tests/RunCMake/FindOpenGL/CMP0072-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0072-OLD.cmake:1 \(cmake_policy\): + The OLD behavior for policy CMP0072 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/FindPkgConfig/CMakeLists.txt b/Tests/RunCMake/FindPkgConfig/CMakeLists.txt index 72abfc8..74b3ff8 100644 --- a/Tests/RunCMake/FindPkgConfig/CMakeLists.txt +++ b/Tests/RunCMake/FindPkgConfig/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt index 42dd0ce..130de2b 100644 --- a/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt +++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt @@ -10,15 +10,6 @@ Call Stack \(most recent call first\): CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): Error evaluating generator expression: - \$<CONFIG:Foo,Bar> - - \$<CONFIG> expression requires one or zero parameters. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -+ -CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): - Error evaluating generator expression: - \$<CONFIG:Foo-Bar> Expression syntax not recognized. diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake b/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake index 5c22aaa..1735ab7 100644 --- a/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake +++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake @@ -1,6 +1,5 @@ add_custom_target(check ALL COMMAND check $<CONFIG:.> - $<CONFIG:Foo,Bar> $<CONFIG:Foo-Bar> $<$<CONFIG:Foo-Nested>:foo> VERBATIM) diff --git a/Tests/RunCMake/GeneratorExpression/CMakeLists.txt b/Tests/RunCMake/GeneratorExpression/CMakeLists.txt index 12cd3c7..4b3de84 100644 --- a/Tests/RunCMake/GeneratorExpression/CMakeLists.txt +++ b/Tests/RunCMake/GeneratorExpression/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/GeneratorExpression/CONFIG-empty-entries-check.cmake b/Tests/RunCMake/GeneratorExpression/CONFIG-empty-entries-check.cmake new file mode 100644 index 0000000..b43256b --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/CONFIG-empty-entries-check.cmake @@ -0,0 +1,6 @@ +file(READ "${RunCMake_TEST_BINARY_DIR}/CONFIG-empty-entries-generated.txt" content) + +set(expected "1234") +if(NOT content STREQUAL expected) + set(RunCMake_TEST_FAILED "actual content:\n [[${content}]]\nbut expected:\n [[${expected}]]") +endif() diff --git a/Tests/RunCMake/GeneratorExpression/CONFIG-empty-entries.cmake b/Tests/RunCMake/GeneratorExpression/CONFIG-empty-entries.cmake new file mode 100644 index 0000000..a4d53f9 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/CONFIG-empty-entries.cmake @@ -0,0 +1,9 @@ +cmake_policy(SET CMP0070 NEW) + +set(text) +string(APPEND text "$<$<CONFIG:>:1>") +string(APPEND text "$<$<CONFIG:Release,>:2>") +string(APPEND text "$<$<CONFIG:,Release>:3>") +string(APPEND text "$<$<CONFIG:Release,,Debug>:4>") +string(APPEND text "$<$<CONFIG:Release,Debug>:5>") +file(GENERATE OUTPUT CONFIG-empty-entries-generated.txt CONTENT ${text}) diff --git a/Tests/RunCMake/GeneratorExpression/CONFIG-multiple-entries-check.cmake b/Tests/RunCMake/GeneratorExpression/CONFIG-multiple-entries-check.cmake new file mode 100644 index 0000000..66f42c7 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/CONFIG-multiple-entries-check.cmake @@ -0,0 +1,6 @@ +file(READ "${RunCMake_TEST_BINARY_DIR}/CONFIG-multiple-entries-generated.txt" content) + +set(expected "14") +if(NOT content STREQUAL expected) + set(RunCMake_TEST_FAILED "actual content:\n [[${content}]]\nbut expected:\n [[${expected}]]") +endif() diff --git a/Tests/RunCMake/GeneratorExpression/CONFIG-multiple-entries.cmake b/Tests/RunCMake/GeneratorExpression/CONFIG-multiple-entries.cmake new file mode 100644 index 0000000..6829282 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/CONFIG-multiple-entries.cmake @@ -0,0 +1,8 @@ +cmake_policy(SET CMP0070 NEW) + +set(text) +string(APPEND text "$<$<CONFIG:CustomConfig>:1>") +string(APPEND text "$<$<CONFIG:Release>:2>") +string(APPEND text "$<$<CONFIG:Debug,Release>:3>") +string(APPEND text "$<$<CONFIG:Release,CustomConfig,Debug>:4>") +file(GENERATE OUTPUT CONFIG-multiple-entries-generated.txt CONTENT "${text}") diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake index 0278cf6..6349112 100644 --- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake @@ -12,6 +12,7 @@ run_cmake(BadTargetTypeInterface) run_cmake(BadTargetTypeObject) run_cmake(BadInstallPrefix) run_cmake(BadSHELL_PATH) +run_cmake(BadCONFIG) run_cmake(CMP0044-WARN) run_cmake(NonValidTarget-C_COMPILER_ID) run_cmake(NonValidTarget-CXX_COMPILER_ID) @@ -44,6 +45,19 @@ run_cmake(FILTER-InvalidOperator) run_cmake(FILTER-Exclude) run_cmake(FILTER-Include) +if(RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(RunCMake_TEST_OPTIONS [==[-DCMAKE_CONFIGURATION_TYPES=CustomConfig]==]) +else() + set(RunCMake_TEST_OPTIONS [==[-DCMAKE_BUILD_TYPE=CustomConfig]==]) +endif() +run_cmake(CONFIG-multiple-entries) +if(RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(RunCMake_TEST_OPTIONS [==[-DCMAKE_CONFIGURATION_TYPES=]==]) +else() + set(RunCMake_TEST_OPTIONS [==[-DCMAKE_BUILD_TYPE=]==]) +endif() +run_cmake(CONFIG-empty-entries) + set(RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0085:STRING=OLD) run_cmake(CMP0085-OLD) unset(RunCMake_TEST_OPTIONS) diff --git a/Tests/RunCMake/GeneratorPlatform/CMakeLists.txt b/Tests/RunCMake/GeneratorPlatform/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/GeneratorPlatform/CMakeLists.txt +++ b/Tests/RunCMake/GeneratorPlatform/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/GeneratorToolset/CMakeLists.txt b/Tests/RunCMake/GeneratorToolset/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/GeneratorToolset/CMakeLists.txt +++ b/Tests/RunCMake/GeneratorToolset/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/GoogleTest/GoogleTestXML-special-result-check.cmake b/Tests/RunCMake/GoogleTest/GoogleTestXML-special-result-check.cmake new file mode 100644 index 0000000..fea0a6b --- /dev/null +++ b/Tests/RunCMake/GoogleTest/GoogleTestXML-special-result-check.cmake @@ -0,0 +1,28 @@ +set(RESULT_FILES + "${RunCMake_TEST_BINARY_DIR}/GoogleTestXMLSpecial/cases.case/0.xml" + "${RunCMake_TEST_BINARY_DIR}/GoogleTestXMLSpecial/cases.case/1.xml" + "${RunCMake_TEST_BINARY_DIR}/GoogleTestXMLSpecial/cases.case/2.xml" +) + +# Check result files exist +foreach(file ${RESULT_FILES}) + if(NOT EXISTS ${file}) + if(NOT ${RunCMake_TEST_FAILED} STREQUAL "") + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}\n") + endif() + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}Result XML file ${file} was not created") + endif() +endforeach() + +# and no other xml files are created +file(GLOB_RECURSE file_list "${RunCMake_TEST_BINARY_DIR}/GoogleTestXMLSpecial/*/*.xml" LIST_DIRECTORIES false) + +foreach(file ${file_list}) + list(FIND RESULT_FILES "${file}" idx) + if(-1 EQUAL ${idx}) + if(NOT ${RunCMake_TEST_FAILED} STREQUAL "") + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}\n") + endif() + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}Invalid file ${file} was created") + endif() +endforeach() diff --git a/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake b/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake index 29bd05e..fb91c0e 100644 --- a/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake +++ b/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake @@ -3,6 +3,17 @@ include(GoogleTest) enable_testing() +# This creates the folder structure for the paramterized tests +# to avoid handling missing folders in C++ +# +# This must match the match the name defined in xml_output.cpp +# for every instance of tests with GetParam. +# +# The folder name is created fom the test name (output of the line +# without leading spaces: "GoogleTestXMLSpecial/cases.") and +# the parts until the last slash ("case/"). These parts are concatenated. +file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/GoogleTestXMLSpecial/cases.case") + add_executable(xml_output xml_output.cpp) gtest_discover_tests( xml_output diff --git a/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake b/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake index efd22be..530c8ab 100644 --- a/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake +++ b/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake @@ -101,6 +101,13 @@ function(run_GoogleTestXML DISCOVERY_MODE) -R GoogleTestXML --no-label-summary ) + + run_cmake_command(GoogleTestXML-special-result + ${CMAKE_CTEST_COMMAND} + -C Debug + -R GoogleTestXMLSpecial + --no-label-summary + ) endfunction() function(run_GoogleTest_discovery_timeout DISCOVERY_MODE) diff --git a/Tests/RunCMake/GoogleTest/xml_output.cpp b/Tests/RunCMake/GoogleTest/xml_output.cpp index e130231..82f0d02 100644 --- a/Tests/RunCMake/GoogleTest/xml_output.cpp +++ b/Tests/RunCMake/GoogleTest/xml_output.cpp @@ -13,11 +13,22 @@ int main(int argc, char** argv) // This actually defines the name of the file passed in the 2nd run std::cout << "GoogleTestXML." << std::endl; std::cout << " Foo" << std::endl; + // When changing these names, make sure to adapt the folder creation + // in GoogleTestXML.cmake + std::cout << "GoogleTestXMLSpecial/cases." << std::endl; + std::cout << " case/0 # GetParam() = 42" << std::endl; + std::cout << " case/1 # GetParam() = \"string\"" << std::endl; + std::cout << " case/2 # GetParam() = \"path/like\"" << std::endl; } else if (param.find("--gtest_output=xml:") != std::string::npos) { std::string::size_type split = param.find(":"); std::string filepath = param.substr(split + 1); // The full file path is passed std::ofstream ostrm(filepath.c_str(), std::ios::binary); + if (!ostrm) { + std::cerr << "Failed to create file: " << filepath.c_str() + << std::endl; + return 1; + } ostrm << "--gtest_output=xml: mockup file\n"; } } diff --git a/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake b/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake index 10cd2bc..4ce6b5c 100644 --- a/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake +++ b/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake @@ -9,6 +9,7 @@ # - All library depend on a common INTERFACE library holding compiler flags # - We have a custom target to generate a man page # - Someone has added an UNKNOWN, IMPORTED crypto mining library! +# - We have a circular dependency between two libraries add_subdirectory(test_project/third_party_project) @@ -23,6 +24,13 @@ target_link_libraries(CoreLibrary PUBLIC CompilerFlags) target_link_libraries(CoreLibrary PRIVATE SeriousLoggingLibrary) +add_library(SystemLibrary STATIC test_project/system_library.c) + +# Create a circular dependency. +# See https://gitlab.kitware.com/cmake/cmake/issues/20720 +target_link_libraries(CoreLibrary PRIVATE SystemLibrary) +target_link_libraries(SystemLibrary PRIVATE CoreLibrary) + add_library(GraphicLibraryObjects OBJECT test_project/graphic_library.c) add_library(GraphicLibrary SHARED) diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot index 8b0365a..31d88df 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot @@ -28,25 +28,28 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "node5" [ label = "GenerateManPage", shape = box ]; - "node1" -> "node5" // ConsoleApplication -> GenerateManPage - "node6" [ label = "GraphicApplication", shape = egg ]; - "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node7" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node8" [ label = "\"-lm\"", shape = septagon ]; - "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm" - "node7" -> "node0" // GraphicLibrary -> CompilerFlags - "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node9" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary - "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node6" [ label = "GenerateManPage", shape = box ]; + "node1" -> "node6" // ConsoleApplication -> GenerateManPage + "node7" [ label = "GraphicApplication", shape = egg ]; + "node7" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node8" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node9" [ label = "\"-lm\"", shape = septagon ]; + "node8" -> "node9" [ style = dotted ] // GraphicLibrary -> "-lm" + "node8" -> "node0" // GraphicLibrary -> CompilerFlags + "node8" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node10" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node8" -> "node10" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node7" -> "node8" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node11" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node11" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node11" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node12" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node12" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node12" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot index 1bbf25a..26f2f64 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot @@ -28,23 +28,26 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "node5" [ label = "GraphicApplication", shape = egg ]; - "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node7" [ label = "\"-lm\"", shape = septagon ]; - "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" - "node6" -> "node0" // GraphicLibrary -> CompilerFlags - "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node8" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary - "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node6" [ label = "GraphicApplication", shape = egg ]; + "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node7" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node8" [ label = "\"-lm\"", shape = septagon ]; + "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm" + "node7" -> "node0" // GraphicLibrary -> CompilerFlags + "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node9" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot index 1bbf25a..26f2f64 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot @@ -28,23 +28,26 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "node5" [ label = "GraphicApplication", shape = egg ]; - "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node7" [ label = "\"-lm\"", shape = septagon ]; - "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" - "node6" -> "node0" // GraphicLibrary -> CompilerFlags - "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node8" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary - "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node6" [ label = "GraphicApplication", shape = egg ]; + "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node7" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node8" [ label = "\"-lm\"", shape = septagon ]; + "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm" + "node7" -> "node0" // GraphicLibrary -> CompilerFlags + "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node9" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot index 558a470..7f2e01c 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot @@ -27,18 +27,21 @@ subgraph clusterLegend { "node1" -> "node0" // CoreLibrary -> CompilerFlags "node2" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node1" -> "node2" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary - "node3" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node4" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node5" [ label = "\"-lm\"", shape = septagon ]; - "node4" -> "node5" [ style = dotted ] // GraphicLibrary -> "-lm" - "node4" -> "node0" // GraphicLibrary -> CompilerFlags - "node4" -> "node1" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node6" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node4" -> "node6" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "node7" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node7" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "node7" -> "node1" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node8" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node8" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "node8" -> "node1" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node3" [ label = "SystemLibrary", shape = octagon ]; + "node3" -> "node1" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node1" -> "node3" [ style = dotted ] // CoreLibrary -> SystemLibrary + "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node5" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node6" [ label = "\"-lm\"", shape = septagon ]; + "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> "-lm" + "node5" -> "node0" // GraphicLibrary -> CompilerFlags + "node5" -> "node1" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node7" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node5" -> "node7" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node8" -> "node1" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node9" -> "node1" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot index 660af37..db675a8 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot @@ -28,19 +28,22 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "GraphicApplication", shape = egg ]; - "node4" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node5" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node5" -> "node0" // GraphicLibrary -> CompilerFlags - "node5" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node6" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "node4" -> "node5" [ style = dotted ] // GraphicApplication -> GraphicLibrary - "node7" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node7" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "node7" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node8" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node8" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "node8" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node5" [ label = "GraphicApplication", shape = egg ]; + "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node6" -> "node0" // GraphicLibrary -> CompilerFlags + "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node7" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot index 5af7fec..234ee39 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot @@ -28,8 +28,11 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "node5" [ label = "\"-lm\"", shape = septagon ]; + "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node6" [ label = "\"-lm\"", shape = septagon ]; } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot index 94ec41c..6dea88c 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot @@ -24,20 +24,23 @@ subgraph clusterLegend { } "node0" [ label = "ConsoleApplication", shape = egg ]; "node1" [ label = "CoreLibrary", shape = octagon ]; + "node2" [ label = "SystemLibrary", shape = octagon ]; + "node2" -> "node1" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node1" -> "node2" [ style = dotted ] // CoreLibrary -> SystemLibrary "node0" -> "node1" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node2" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node0" -> "node2" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "node3" [ label = "GraphicApplication", shape = egg ]; - "node3" -> "node1" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node4" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node5" [ label = "\"-lm\"", shape = septagon ]; - "node4" -> "node5" [ style = dotted ] // GraphicLibrary -> "-lm" - "node4" -> "node1" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node6" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node4" -> "node6" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "node3" -> "node4" [ style = dotted ] // GraphicApplication -> GraphicLibrary - "node7" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node7" -> "node1" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node8" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node8" -> "node1" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node3" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node0" -> "node3" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node4" [ label = "GraphicApplication", shape = egg ]; + "node4" -> "node1" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node5" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node6" [ label = "\"-lm\"", shape = septagon ]; + "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> "-lm" + "node5" -> "node1" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node7" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node5" -> "node7" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node4" -> "node5" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node8" -> "node1" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node9" -> "node1" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot index 65b7a71..df3d10a 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot @@ -28,17 +28,20 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "node5" [ label = "GraphicApplication", shape = egg ]; - "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node7" [ label = "\"-lm\"", shape = septagon ]; - "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" - "node6" -> "node0" // GraphicLibrary -> CompilerFlags - "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node8" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node6" [ label = "GraphicApplication", shape = egg ]; + "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node7" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node8" [ label = "\"-lm\"", shape = septagon ]; + "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm" + "node7" -> "node0" // GraphicLibrary -> CompilerFlags + "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node9" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot index 8116bc9..8f832a8 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot @@ -28,21 +28,24 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "node5" [ label = "GraphicApplication", shape = egg ]; - "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node7" [ label = "\"-lm\"", shape = septagon ]; - "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" - "node6" -> "node0" // GraphicLibrary -> CompilerFlags - "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary - "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node6" [ label = "GraphicApplication", shape = egg ]; + "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node7" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node8" [ label = "\"-lm\"", shape = septagon ]; + "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm" + "node7" -> "node0" // GraphicLibrary -> CompilerFlags + "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot index 1bbf25a..26f2f64 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot @@ -28,23 +28,26 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "node5" [ label = "GraphicApplication", shape = egg ]; - "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node7" [ label = "\"-lm\"", shape = septagon ]; - "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" - "node6" -> "node0" // GraphicLibrary -> CompilerFlags - "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node8" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary - "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node6" [ label = "GraphicApplication", shape = egg ]; + "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node7" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node8" [ label = "\"-lm\"", shape = septagon ]; + "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm" + "node7" -> "node0" // GraphicLibrary -> CompilerFlags + "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node9" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot index 439d1f7..e127daa 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot @@ -28,17 +28,20 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "node5" [ label = "GraphicApplication", shape = egg ]; - "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node6" [ label = "\"-lm\"", shape = septagon ]; - "node7" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node6" [ label = "GraphicApplication", shape = egg ]; + "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node7" [ label = "\"-lm\"", shape = septagon ]; + "node8" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot index 1be6550..4f242bb 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot @@ -28,21 +28,24 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "GraphicApplication", shape = egg ]; - "node4" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node5" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node6" [ label = "\"-lm\"", shape = septagon ]; - "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> "-lm" - "node5" -> "node0" // GraphicLibrary -> CompilerFlags - "node5" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node7" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node5" -> "node7" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "node4" -> "node5" [ style = dotted ] // GraphicApplication -> GraphicLibrary - "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node5" [ label = "GraphicApplication", shape = egg ]; + "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node7" [ label = "\"-lm\"", shape = septagon ]; + "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" + "node6" -> "node0" // GraphicLibrary -> CompilerFlags + "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node8" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot index 1cfbe0f..c664af8 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot @@ -28,23 +28,26 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "node5" [ label = "GraphicApplication", shape = egg ]; - "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node7" [ label = "\"-lm\"", shape = septagon ]; - "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" - "node6" -> "node0" // GraphicLibrary -> CompilerFlags - "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node8" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary - "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node6" [ label = "GraphicApplication", shape = egg ]; + "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node7" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node8" [ label = "\"-lm\"", shape = septagon ]; + "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm" + "node7" -> "node0" // GraphicLibrary -> CompilerFlags + "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node9" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot index 9653c33..5579306 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot @@ -28,23 +28,26 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "node5" [ label = "GraphicApplication", shape = egg ]; - "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node7" [ label = "\"-lm\"", shape = septagon ]; - "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" - "node6" -> "node0" // GraphicLibrary -> CompilerFlags - "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node8" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary - "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node6" [ label = "GraphicApplication", shape = egg ]; + "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node7" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node8" [ label = "\"-lm\"", shape = septagon ]; + "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm" + "node7" -> "node0" // GraphicLibrary -> CompilerFlags + "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node9" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot index 82d96d0..3bf20ec 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot @@ -28,23 +28,26 @@ subgraph clusterLegend { "point2" -> "point0" // CoreLibrary -> CompilerFlags "point3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "point2" -> "point3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "point4" [ label = "SystemLibrary", shape = octagon ]; + "point4" -> "point2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "point2" -> "point4" [ style = dotted ] // CoreLibrary -> SystemLibrary "point1" -> "point2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "point4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "point1" -> "point4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "point5" [ label = "GraphicApplication", shape = egg ]; - "point5" -> "point2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "point6" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "point7" [ label = "\"-lm\"", shape = septagon ]; - "point6" -> "point7" [ style = dotted ] // GraphicLibrary -> "-lm" - "point6" -> "point0" // GraphicLibrary -> CompilerFlags - "point6" -> "point2" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "point8" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "point6" -> "point8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "point5" -> "point6" [ style = dotted ] // GraphicApplication -> GraphicLibrary - "point9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "point9" -> "point0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "point9" -> "point2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "point10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "point10" -> "point0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "point10" -> "point2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "point5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "point1" -> "point5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "point6" [ label = "GraphicApplication", shape = egg ]; + "point6" -> "point2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "point7" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "point8" [ label = "\"-lm\"", shape = septagon ]; + "point7" -> "point8" [ style = dotted ] // GraphicLibrary -> "-lm" + "point7" -> "point0" // GraphicLibrary -> CompilerFlags + "point7" -> "point2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "point9" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "point7" -> "point9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "point6" -> "point7" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "point10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "point10" -> "point0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "point10" -> "point2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "point11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "point11" -> "point0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "point11" -> "point2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/test_project/system_library.c b/Tests/RunCMake/Graphviz/test_project/system_library.c new file mode 100644 index 0000000..5d67079 --- /dev/null +++ b/Tests/RunCMake/Graphviz/test_project/system_library.c @@ -0,0 +1,3 @@ +void initialize_system() +{ +} diff --git a/Tests/RunCMake/IncompatibleQt/CMakeLists.txt b/Tests/RunCMake/IncompatibleQt/CMakeLists.txt index f452db1..ebab7a3 100644 --- a/Tests/RunCMake/IncompatibleQt/CMakeLists.txt +++ b/Tests/RunCMake/IncompatibleQt/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} CXX) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/Languages/CMakeLists.txt b/Tests/RunCMake/Languages/CMakeLists.txt index 8996fef..74b3ff8 100644 --- a/Tests/RunCMake/Languages/CMakeLists.txt +++ b/Tests/RunCMake/Languages/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) -cmake_policy(SET CMP0042 NEW) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt b/Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt index 411cd7c..5c7882d 100644 --- a/Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt +++ b/Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt @@ -3,7 +3,7 @@ CMake Error at MissingSource.cmake:1 \(add_library\): missing.c - Tried extensions( \.[A-Za-z+]+| - )* + Tried extensions \.c \.C .* +.* Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/ObsoleteQtMacros/CMakeLists.txt b/Tests/RunCMake/ObsoleteQtMacros/CMakeLists.txt index 65ac8e8..44b5d30 100644 --- a/Tests/RunCMake/ObsoleteQtMacros/CMakeLists.txt +++ b/Tests/RunCMake/ObsoleteQtMacros/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST}) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/PositionIndependentCode/CMakeLists.txt b/Tests/RunCMake/PositionIndependentCode/CMakeLists.txt index 90afc12..c3922d6 100644 --- a/Tests/RunCMake/PositionIndependentCode/CMakeLists.txt +++ b/Tests/RunCMake/PositionIndependentCode/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} CXX) # MSVC creates extra targets which pollute the stderr unless we set this. diff --git a/Tests/RunCMake/SourceProperties/CMakeLists.txt b/Tests/RunCMake/SourceProperties/CMakeLists.txt index a17c8cd..e93f0b6 100644 --- a/Tests/RunCMake/SourceProperties/CMakeLists.txt +++ b/Tests/RunCMake/SourceProperties/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} C) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/TargetObjects/CMakeLists.txt b/Tests/RunCMake/TargetObjects/CMakeLists.txt index be9d403..44b5d30 100644 --- a/Tests/RunCMake/TargetObjects/CMakeLists.txt +++ b/Tests/RunCMake/TargetObjects/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST}) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/TargetPolicies/CMakeLists.txt b/Tests/RunCMake/TargetPolicies/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/TargetPolicies/CMakeLists.txt +++ b/Tests/RunCMake/TargetPolicies/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/TargetProperties/CMakeLists.txt b/Tests/RunCMake/TargetProperties/CMakeLists.txt index be9d403..44b5d30 100644 --- a/Tests/RunCMake/TargetProperties/CMakeLists.txt +++ b/Tests/RunCMake/TargetProperties/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST}) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt index 90afc12..c3922d6 100644 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} CXX) # MSVC creates extra targets which pollute the stderr unless we set this. diff --git a/Tests/RunCMake/TargetSources/CMakeLists.txt b/Tests/RunCMake/TargetSources/CMakeLists.txt index f452db1..a06591c 100644 --- a/Tests/RunCMake/TargetSources/CMakeLists.txt +++ b/Tests/RunCMake/TargetSources/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} CXX) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/VSSolution/CMakeLists.txt b/Tests/RunCMake/VSSolution/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/VSSolution/CMakeLists.txt +++ b/Tests/RunCMake/VSSolution/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/XcodeProject/CMakeLists.txt b/Tests/RunCMake/XcodeProject/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/XcodeProject/CMakeLists.txt +++ b/Tests/RunCMake/XcodeProject/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake b/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake index ab31387..75da7b1 100644 --- a/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake +++ b/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.5) +cmake_minimum_required(VERSION 3.3) project(XcodeInstallIOS) diff --git a/Tests/RunCMake/add_dependencies/CMakeLists.txt b/Tests/RunCMake/add_dependencies/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/add_dependencies/CMakeLists.txt +++ b/Tests/RunCMake/add_dependencies/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/alias_targets/CMakeLists.txt b/Tests/RunCMake/alias_targets/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/alias_targets/CMakeLists.txt +++ b/Tests/RunCMake/alias_targets/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/alias_targets/get_property-subdir/CMakeLists.txt b/Tests/RunCMake/alias_targets/get_property-subdir/CMakeLists.txt index bfd9840..b114b75 100644 --- a/Tests/RunCMake/alias_targets/get_property-subdir/CMakeLists.txt +++ b/Tests/RunCMake/alias_targets/get_property-subdir/CMakeLists.txt @@ -6,3 +6,10 @@ check_property (alias::import-local-subdir ALIASED_TARGET "import-local") check_property (alias::import-local-subdir IMPORTED "TRUE") check_property (alias::import-local-subdir ALIAS_GLOBAL "FALSE") check_property (alias::import-local-subdir IMPORT_LOCAL_PROPERTY "IMPORT_LOCAL") + + +# non-global alias defined in parent directory must be visible in sub-directory +check_property (alias::import-local ALIASED_TARGET "import-local") +check_property (alias::import-local IMPORTED "TRUE") +check_property (alias::import-local ALIAS_GLOBAL "FALSE") +check_property (alias::import-local IMPORT_LOCAL_PROPERTY "IMPORT_LOCAL") diff --git a/Tests/RunCMake/alias_targets/invalid-name.cmake b/Tests/RunCMake/alias_targets/invalid-name.cmake index bbd39e3..01983e5 100644 --- a/Tests/RunCMake/alias_targets/invalid-name.cmake +++ b/Tests/RunCMake/alias_targets/invalid-name.cmake @@ -1,4 +1,4 @@ - +cmake_minimum_required(VERSION 2.8.12) enable_language(CXX) add_library(foo empty.cpp) diff --git a/Tests/RunCMake/build_command/CMakeLists.txt b/Tests/RunCMake/build_command/CMakeLists.txt index 73e6a78..f1a83e8 100644 --- a/Tests/RunCMake/build_command/CMakeLists.txt +++ b/Tests/RunCMake/build_command/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) if(NOT NoProject) project(${RunCMake_TEST} NONE) endif() diff --git a/Tests/RunCMake/cmake_minimum_required/Before2812-stderr.txt b/Tests/RunCMake/cmake_minimum_required/Before2812-stderr.txt new file mode 100644 index 0000000..7d40dcb --- /dev/null +++ b/Tests/RunCMake/cmake_minimum_required/Before2812-stderr.txt @@ -0,0 +1,26 @@ +^CMake Deprecation Warning at Before2812.cmake:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Deprecation Warning at Before2812.cmake:2 \(cmake_policy\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Deprecation Warning at Before2812.cmake:6 \(cmake_policy\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/cmake_minimum_required/Before2812.cmake b/Tests/RunCMake/cmake_minimum_required/Before2812.cmake new file mode 100644 index 0000000..220e359 --- /dev/null +++ b/Tests/RunCMake/cmake_minimum_required/Before2812.cmake @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 2.8.11) +cmake_policy(VERSION 2.6) +cmake_policy(PUSH) +cmake_policy(VERSION 2.6) # simulate pre-3.18 install(EXPORT)-generated call +cmake_policy(POP) +cmake_policy(VERSION 2.8.11) diff --git a/Tests/RunCMake/cmake_minimum_required/CMakeLists.txt b/Tests/RunCMake/cmake_minimum_required/CMakeLists.txt index e8db6b0..667561e 100644 --- a/Tests/RunCMake/cmake_minimum_required/CMakeLists.txt +++ b/Tests/RunCMake/cmake_minimum_required/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} NONE) -include(${RunCMake_TEST}.cmake) +include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) diff --git a/Tests/RunCMake/cmake_minimum_required/CompatBefore24-stderr.txt b/Tests/RunCMake/cmake_minimum_required/CompatBefore24-stderr.txt index a874466..81d26d2 100644 --- a/Tests/RunCMake/cmake_minimum_required/CompatBefore24-stderr.txt +++ b/Tests/RunCMake/cmake_minimum_required/CompatBefore24-stderr.txt @@ -1,3 +1,12 @@ +^CMake Deprecation Warning at CompatBefore24.cmake:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ CMake Error in CMakeLists.txt: You have set CMAKE_BACKWARDS_COMPATIBILITY to a CMake version less than 2.4. This version of CMake only supports backwards compatibility with diff --git a/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake b/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake index 1030211..3a959bb 100644 --- a/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake +++ b/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake @@ -4,6 +4,7 @@ run_cmake(Before24) run_cmake(CompatBefore24) run_cmake(Future) run_cmake(PolicyBefore24) +run_cmake(Before2812) run_cmake(Range) run_cmake(RangeBad) run_cmake(Unknown) diff --git a/Tests/RunCMake/configure_file/NoSourcePermissions.cmake b/Tests/RunCMake/configure_file/NoSourcePermissions.cmake new file mode 100644 index 0000000..c6ad131 --- /dev/null +++ b/Tests/RunCMake/configure_file/NoSourcePermissions.cmake @@ -0,0 +1,10 @@ +configure_file(NoSourcePermissions.sh NoSourcePermissions.sh.out + NO_SOURCE_PERMISSIONS) + +if (UNIX) + execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/NoSourcePermissions.sh.out + RESULT_VARIABLE result) + if (result EQUAL "0") + message(FATAL_ERROR "Copied file has executable permissions") + endif() +endif() diff --git a/Tests/RunCMake/configure_file/NoSourcePermissions.sh b/Tests/RunCMake/configure_file/NoSourcePermissions.sh new file mode 100755 index 0000000..0aa8f41 --- /dev/null +++ b/Tests/RunCMake/configure_file/NoSourcePermissions.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +#Testing NO_SOURCE_PERMISSIONS option of configure_file. diff --git a/Tests/RunCMake/configure_file/RunCMakeTest.cmake b/Tests/RunCMake/configure_file/RunCMakeTest.cmake index 32a0770..71694fb 100644 --- a/Tests/RunCMake/configure_file/RunCMakeTest.cmake +++ b/Tests/RunCMake/configure_file/RunCMakeTest.cmake @@ -15,6 +15,7 @@ run_cmake(NewLineStyle-NoArg) run_cmake(NewLineStyle-WrongArg) run_cmake(NewLineStyle-ValidArg) run_cmake(NewLineStyle-COPYONLY) +run_cmake(NoSourcePermissions) if(RunCMake_GENERATOR MATCHES "Make") # Use a single build tree for a few tests without cleaning. diff --git a/Tests/RunCMake/ctest_memcheck/CMakeLists.txt.in b/Tests/RunCMake/ctest_memcheck/CMakeLists.txt.in index 3b8edf4..68a0fcb 100644 --- a/Tests/RunCMake/ctest_memcheck/CMakeLists.txt.in +++ b/Tests/RunCMake/ctest_memcheck/CMakeLists.txt.in @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.9) +cmake_minimum_required(VERSION 3.3) project(CTestTestMemcheck@CASE_NAME@ NONE) include(CTest) diff --git a/Tests/RunCMake/ctest_memcheck/DummyCudaMemcheck-result.txt b/Tests/RunCMake/ctest_memcheck/DummyCudaMemcheck-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/ctest_memcheck/DummyCudaMemcheck-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/ctest_memcheck/DummyCudaMemcheck-stderr.txt b/Tests/RunCMake/ctest_memcheck/DummyCudaMemcheck-stderr.txt new file mode 100644 index 0000000..31dedd2 --- /dev/null +++ b/Tests/RunCMake/ctest_memcheck/DummyCudaMemcheck-stderr.txt @@ -0,0 +1 @@ +Defect count: 20 diff --git a/Tests/RunCMake/ctest_memcheck/DummyCudaMemcheck-stdout.txt b/Tests/RunCMake/ctest_memcheck/DummyCudaMemcheck-stdout.txt new file mode 100644 index 0000000..aa3e698 --- /dev/null +++ b/Tests/RunCMake/ctest_memcheck/DummyCudaMemcheck-stdout.txt @@ -0,0 +1,10 @@ +Memory checking results: +Uninitialized __global__ memory read - 1 +Unused memory - 1 +Barrier error - 2 +Invalid __global__ read - 1 +cudaErrorLaunchFailure - 2 +Memory leak - 1 +Potential WAR hazard detected - 4 +Potential RAW hazard detected - 4 +Race reported - 4 diff --git a/Tests/RunCMake/ctest_memcheck/RunCMakeTest.cmake b/Tests/RunCMake/ctest_memcheck/RunCMakeTest.cmake index ab4c5ab..2b3165b 100644 --- a/Tests/RunCMake/ctest_memcheck/RunCMakeTest.cmake +++ b/Tests/RunCMake/ctest_memcheck/RunCMakeTest.cmake @@ -175,3 +175,15 @@ unset(CMAKELISTS_EXTRA_CODE) unset(CTEST_EXTRA_CODE) unset(CTEST_MEMCHECK_ARGS) unset(CTEST_SUFFIX_CODE) + +#----------------------------------------------------------------------------- +set(CMAKELISTS_EXTRA_CODE +"add_test(NAME TestSan COMMAND \"${CMAKE_COMMAND}\" +-P \"${RunCMake_SOURCE_DIR}/testCudaMemcheck.cmake\") +") +set(CTEST_SUFFIX_CODE "message(\"Defect count: \${defect_count}\")") +set(CTEST_MEMCHECK_ARGS "DEFECT_COUNT defect_count") +run_mc_test(DummyCudaMemcheck "${PSEUDO_CUDA_MEMCHECK}") +unset(CTEST_MEMCHECK_ARGS) +unset(CTEST_SUFFIX_CODE) +unset(CTEST_EXTRA_CODE) diff --git a/Tests/RunCMake/ctest_memcheck/test.cmake.in b/Tests/RunCMake/ctest_memcheck/test.cmake.in index 50b4b6a..eedf080 100644 --- a/Tests/RunCMake/ctest_memcheck/test.cmake.in +++ b/Tests/RunCMake/ctest_memcheck/test.cmake.in @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.9) +cmake_minimum_required(VERSION 3.3) # Settings: set(CTEST_SITE "@SITE@") diff --git a/Tests/RunCMake/ctest_memcheck/testCudaMemcheck.cmake b/Tests/RunCMake/ctest_memcheck/testCudaMemcheck.cmake new file mode 100644 index 0000000..d7d8213 --- /dev/null +++ b/Tests/RunCMake/ctest_memcheck/testCudaMemcheck.cmake @@ -0,0 +1,264 @@ +# this file simulates an execution of cuda-memcheck + +set(LOG_FILE "$ENV{PSEUDO_LOGFILE}") +message("LOG_FILE=[${LOG_FILE}]") + +# clear the log file +file(REMOVE "${LOG_FILE}") + +# create an error of each type of sanitizer tool and failure + +# initcheck +file(APPEND "${LOG_FILE}" +"========= CUDA-MEMCHECK +========= Uninitialized __global__ memory read of size 4 +========= at 0x00000020 in test(int*, int*) +========= by thread (0,0,0) in block (0,0,0) +========= Address 0x1303d80000 +========= Saved host backtrace up to driver entry point +========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6] +========= Host Frame:./uninit-read [0x101d9] +========= Host Frame:./uninit-read [0x10267] +========= Host Frame:./uninit-read [0x465b5] +========= Host Frame:./uninit-read [0x3342] +========= Host Frame:./uninit-read [0x3143] +========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505] +========= Host Frame:./uninit-read [0x31e2] +========= +========= Unused memory in allocation 0x1303d80000 of size 16 bytes +========= Not written any memory. +========= 100.00% of allocation were unused. +========= Saved host backtrace up to driver entry point +========= Host Frame:/lib64/libcuda.so.1 (cuMemAlloc_v2 + 0x1b7) [0x26ec97] +========= Host Frame:./uninit-read [0x2bbd3] +========= Host Frame:./uninit-read [0x71ab] +========= Host Frame:./uninit-read [0x3c84f] +========= Host Frame:./uninit-read [0x3111] +========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505] +========= Host Frame:./uninit-read [0x31e2] +========= +========= ERROR SUMMARY: 2 errors +") + + +# synccheck +file(APPEND "${LOG_FILE}" +"========= CUDA-MEMCHECK +========= Barrier error detected. Divergent thread(s) in warp +========= at 0x00000058 in test(int*, int*) +========= by thread (1,0,0) in block (0,0,0) +========= Device Frame:test(int*, int*) (test(int*, int*) : 0x60) +========= Saved host backtrace up to driver entry point at kernel launch time +========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6] +========= Host Frame:./sync [0x101d9] +========= Host Frame:./sync [0x10267] +========= Host Frame:./sync [0x465b5] +========= Host Frame:./sync [0x3342] +========= Host Frame:./sync [0x314a] +========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505] +========= Host Frame:./sync [0x31e2] +========= +========= Barrier error detected. Divergent thread(s) in warp +========= at 0x00000058 in test(int*, int*) +========= by thread (0,0,0) in block (0,0,0) +========= Device Frame:test(int*, int*) (test(int*, int*) : 0x60) +========= Saved host backtrace up to driver entry point at kernel launch time +========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6] +========= Host Frame:./sync [0x101d9] +========= Host Frame:./sync [0x10267] +========= Host Frame:./sync [0x465b5] +========= Host Frame:./sync [0x3342] +========= Host Frame:./sync [0x314a] +========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505] +========= Host Frame:./sync [0x31e2] +========= +========= ERROR SUMMARY: 2 errors +") + +# memcheck +file(APPEND "${LOG_FILE}" +"========= CUDA-MEMCHECK +========= Invalid __global__ read of size 4 +========= at 0x00000020 in test(int*, int*) +========= by thread (0,0,0) in block (0,0,0) +========= Address 0x00000000 is out of bounds +========= Saved host backtrace up to driver entry point at kernel launch time +========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6] +========= Host Frame:./invalid-read [0x101d9] +========= Host Frame:./invalid-read [0x10267] +========= Host Frame:./invalid-read [0x465b5] +========= Host Frame:./invalid-read [0x3342] +========= Host Frame:./invalid-read [0x3142] +========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505] +========= Host Frame:./invalid-read [0x31e2] +========= +========= Program hit cudaErrorLaunchFailure (error 719) due to \"unspecified launch failure\" on CUDA API call to cudaDeviceSynchronize. +========= Saved host backtrace up to driver entry point at error +========= Host Frame:/lib64/libcuda.so.1 [0x3ac5a3] +========= Host Frame:./invalid-read [0x2e576] +========= Host Frame:./invalid-read [0x3147] +========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505] +========= Host Frame:./invalid-read [0x31e2] +========= +========= Program hit cudaErrorLaunchFailure (error 719) due to \"unspecified launch failure\" on CUDA API call to cudaFree. +========= Saved host backtrace up to driver entry point at error +========= Host Frame:/lib64/libcuda.so.1 [0x3ac5a3] +========= Host Frame:./invalid-read [0x3c106] +========= Host Frame:./invalid-read [0x3150] +========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505] +========= Host Frame:./invalid-read [0x31e2] +========= +========= LEAK SUMMARY: 0 bytes leaked in 0 allocations +========= ERROR SUMMARY: 3 errors +") + +# memcheck with leak-check full +file(APPEND "${LOG_FILE}" +"========= CUDA-MEMCHECK +========= Leaked 10 bytes at 0x1303d80000 +========= Saved host backtrace up to driver entry point at cudaMalloc time +========= Host Frame:/lib64/libcuda.so.1 (cuMemAlloc_v2 + 0x1b7) [0x26ec97] +========= Host Frame:./leak [0x2bab3] +========= Host Frame:./leak [0x708b] +========= Host Frame:./leak [0x3c72f] +========= Host Frame:./leak [0x3113] +========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505] +========= Host Frame:./leak [0x3174] +========= +========= LEAK SUMMARY: 10 bytes leaked in 1 allocations +========= ERROR SUMMARY: 1 error +") + +# racecheck with racecheck-report all +file(APPEND "${LOG_FILE}" +"========= CUDA-MEMCHECK +========= WARN:(Warp Level Programming) Potential WAR hazard detected at __shared__ 0x3 in block (0, 0, 0) : +========= Read Thread (31, 0, 0) at 0x00000170 in ./race.cu:4:test(int*, int*) +========= Write Thread (0, 0, 0) at 0x000001a8 in ./race.cu:4:test(int*, int*) +========= Current Value : 0, Incoming Value : 0 +========= Saved host backtrace up to driver entry point at kernel launch time +========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6] +========= Host Frame:./race [0x101d9] +========= Host Frame:./race [0x10267] +========= Host Frame:./race [0x465b5] +========= Host Frame:./race [0x3342] +========= Host Frame:./race [0x314a] +========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505] +========= Host Frame:./race [0x31e2] +========= +========= WARN:(Warp Level Programming) Potential WAR hazard detected at __shared__ 0x2 in block (0, 0, 0) : +========= Read Thread (31, 0, 0) at 0x00000170 in ./race.cu:4:test(int*, int*) +========= Write Thread (0, 0, 0) at 0x000001a8 in ./race.cu:4:test(int*, int*) +========= Current Value : 0, Incoming Value : 0 +========= Saved host backtrace up to driver entry point at kernel launch time +========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6] +========= Host Frame:./race [0x101d9] +========= Host Frame:./race [0x10267] +========= Host Frame:./race [0x465b5] +========= Host Frame:./race [0x3342] +========= Host Frame:./race [0x314a] +========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505] +========= Host Frame:./race [0x31e2] +========= +========= WARN:(Warp Level Programming) Potential WAR hazard detected at __shared__ 0x1 in block (0, 0, 0) : +========= Read Thread (31, 0, 0) at 0x00000170 in ./race.cu:4:test(int*, int*) +========= Write Thread (0, 0, 0) at 0x000001a8 in ./race.cu:4:test(int*, int*) +========= Current Value : 0, Incoming Value : 0 +========= Saved host backtrace up to driver entry point at kernel launch time +========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6] +========= Host Frame:./race [0x101d9] +========= Host Frame:./race [0x10267] +========= Host Frame:./race [0x465b5] +========= Host Frame:./race [0x3342] +========= Host Frame:./race [0x314a] +========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505] +========= Host Frame:./race [0x31e2] +========= +========= WARN:(Warp Level Programming) Potential WAR hazard detected at __shared__ 0x0 in block (0, 0, 0) : +========= Read Thread (31, 0, 0) at 0x00000170 in ./race.cu:4:test(int*, int*) +========= Write Thread (0, 0, 0) at 0x000001a8 in ./race.cu:4:test(int*, int*) +========= Current Value : 0, Incoming Value : 1 +========= Saved host backtrace up to driver entry point at kernel launch time +========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6] +========= Host Frame:./race [0x101d9] +========= Host Frame:./race [0x10267] +========= Host Frame:./race [0x465b5] +========= Host Frame:./race [0x3342] +========= Host Frame:./race [0x314a] +========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505] +========= Host Frame:./race [0x31e2] +========= +========= WARN:(Warp Level Programming) Potential RAW hazard detected at __shared__ 0x3 in block (0, 0, 0) : +========= Write Thread (31, 0, 0) at 0x00000148 in ./race.cu:3:test(int*, int*) +========= Read Thread (0, 0, 0) at 0x00000170 in ./race.cu:4:test(int*, int*) +========= Current Value : 0 +========= Saved host backtrace up to driver entry point at kernel launch time +========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6] +========= Host Frame:./race [0x101d9] +========= Host Frame:./race [0x10267] +========= Host Frame:./race [0x465b5] +========= Host Frame:./race [0x3342] +========= Host Frame:./race [0x314a] +========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505] +========= Host Frame:./race [0x31e2] +========= +========= WARN:(Warp Level Programming) Potential RAW hazard detected at __shared__ 0x2 in block (0, 0, 0) : +========= Write Thread (31, 0, 0) at 0x00000148 in ./race.cu:3:test(int*, int*) +========= Read Thread (0, 0, 0) at 0x00000170 in ./race.cu:4:test(int*, int*) +========= Current Value : 0 +========= Saved host backtrace up to driver entry point at kernel launch time +========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6] +========= Host Frame:./race [0x101d9] +========= Host Frame:./race [0x10267] +========= Host Frame:./race [0x465b5] +========= Host Frame:./race [0x3342] +========= Host Frame:./race [0x314a] +========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505] +========= Host Frame:./race [0x31e2] +========= +========= WARN:(Warp Level Programming) Potential RAW hazard detected at __shared__ 0x1 in block (0, 0, 0) : +========= Write Thread (31, 0, 0) at 0x00000148 in ./race.cu:3:test(int*, int*) +========= Read Thread (0, 0, 0) at 0x00000170 in ./race.cu:4:test(int*, int*) +========= Current Value : 0 +========= Saved host backtrace up to driver entry point at kernel launch time +========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6] +========= Host Frame:./race [0x101d9] +========= Host Frame:./race [0x10267] +========= Host Frame:./race [0x465b5] +========= Host Frame:./race [0x3342] +========= Host Frame:./race [0x314a] +========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505] +========= Host Frame:./race [0x31e2] +========= +========= WARN:(Warp Level Programming) Potential RAW hazard detected at __shared__ 0x0 in block (0, 0, 0) : +========= Write Thread (31, 0, 0) at 0x00000148 in ./race.cu:3:test(int*, int*) +========= Read Thread (0, 0, 0) at 0x00000170 in ./race.cu:4:test(int*, int*) +========= Current Value : 0 +========= Saved host backtrace up to driver entry point at kernel launch time +========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6] +========= Host Frame:./race [0x101d9] +========= Host Frame:./race [0x10267] +========= Host Frame:./race [0x465b5] +========= Host Frame:./race [0x3342] +========= Host Frame:./race [0x314a] +========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505] +========= Host Frame:./race [0x31e2] +========= +========= WARN: Race reported between Read access at 0x00000170 in ./race.cu:4:test(int*, int*) +========= and Write access at 0x00000148 in ./race.cu:3:test(int*, int*) [4 hazards] +========= and Write access at 0x000001a8 in ./race.cu:4:test(int*, int*) [4 hazards] +========= +========= WARN: Race reported between Write access at 0x00000148 in ./race.cu:3:test(int*, int*) +========= and Write access at 0x00000148 in ./race.cu:3:test(int*, int*) [124 hazards] +========= and Read access at 0x00000170 in ./race.cu:4:test(int*, int*) [4 hazards] +========= +========= WARN: Race reported between Write access at 0x000001a8 in ./race.cu:4:test(int*, int*) +========= and Write access at 0x000001a8 in ./race.cu:4:test(int*, int*) [124 hazards] +========= and Read access at 0x00000170 in ./race.cu:4:test(int*, int*) [4 hazards] +========= +========= WARN: Race reported between Write access at 0x00000148 in ./race.cu:3:test(int*, int*) +========= and Write access at 0x00000148 in ./race.cu:3:test(int*, int*) [124 hazards] +========= and Read access at 0x00000170 in ./race.cu:4:test(int*, int*) [4 hazards] +========= +========= RACECHECK SUMMARY: 12 hazards displayed (0 errors, 12 warnings) +") diff --git a/Tests/RunCMake/export/CMakeLists.txt b/Tests/RunCMake/export/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/export/CMakeLists.txt +++ b/Tests/RunCMake/export/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/find_dependency/CMakeLists.txt b/Tests/RunCMake/find_dependency/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/find_dependency/CMakeLists.txt +++ b/Tests/RunCMake/find_dependency/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/find_package/CMakeLists.txt b/Tests/RunCMake/find_package/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/find_package/CMakeLists.txt +++ b/Tests/RunCMake/find_package/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/find_package/MissingNormalWarnNoModuleOld-stderr.txt b/Tests/RunCMake/find_package/MissingNormalWarnNoModuleOld-stderr.txt index b336b56..ebfd7d0 100644 --- a/Tests/RunCMake/find_package/MissingNormalWarnNoModuleOld-stderr.txt +++ b/Tests/RunCMake/find_package/MissingNormalWarnNoModuleOld-stderr.txt @@ -1,9 +1,10 @@ CMake Warning \(dev\) at MissingNormalWarnNoModuleOld.cmake:2 \(find_package\): - find_package called without NO_MODULE option and no FindNotHere.cmake - module is in CMAKE_MODULE_PATH. Add NO_MODULE to exclusively request - Config mode and search for a package configuration file provided by NotHere - \(NotHereConfig.cmake or nothere-config.cmake\). Otherwise make - FindNotHere.cmake available in CMAKE_MODULE_PATH. + find_package called without either MODULE or CONFIG option and no + FindNotHere.cmake module is in CMAKE_MODULE_PATH. Add MODULE to + exclusively request Module mode and fail if FindNotHere.cmake is missing. + Add CONFIG to exclusively request Config mode and search for a package + configuration file provided by NotHere \(NotHereConfig.cmake or + nothere-config.cmake\). \(Variable CMAKE_FIND_PACKAGE_WARN_NO_MODULE enabled this warning.\) Call Stack \(most recent call first\): diff --git a/Tests/RunCMake/find_program/BundleSpaceInName-stdout.txt b/Tests/RunCMake/find_program/BundleSpaceInName-stdout.txt new file mode 100644 index 0000000..331d465 --- /dev/null +++ b/Tests/RunCMake/find_program/BundleSpaceInName-stdout.txt @@ -0,0 +1 @@ +-- FakeApp_EXECUTABLE='.*/Tests/RunCMake/find_program/BundleSpaceInName-build/Fake app.app/Contents/MacOS/Fake app' diff --git a/Tests/RunCMake/find_program/BundleSpaceInName.cmake b/Tests/RunCMake/find_program/BundleSpaceInName.cmake new file mode 100644 index 0000000..9152d5b --- /dev/null +++ b/Tests/RunCMake/find_program/BundleSpaceInName.cmake @@ -0,0 +1,8 @@ +set(fakeApp "${CMAKE_CURRENT_BINARY_DIR}/Fake app.app/Contents/MacOS/Fake app") +file(WRITE "${fakeApp}" "#!/bin/sh\n") +execute_process(COMMAND chmod a+rx "${fakeApp}") + +find_program(FakeApp_EXECUTABLE NAMES "Fake app" NO_DEFAULT_PATH + PATHS "${CMAKE_CURRENT_BINARY_DIR}" +) +message(STATUS "FakeApp_EXECUTABLE='${FakeApp_EXECUTABLE}'") diff --git a/Tests/RunCMake/find_program/ExeNoRead.cmake b/Tests/RunCMake/find_program/CMP0109-Common.cmake index 7e22dc5..525413a 100644 --- a/Tests/RunCMake/find_program/ExeNoRead.cmake +++ b/Tests/RunCMake/find_program/CMP0109-Common.cmake @@ -1,4 +1,7 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ExeNoRead" "#!/bin/sh\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ReadNoExe" "#ReadNoExe") execute_process(COMMAND chmod -r+x "${CMAKE_CURRENT_BINARY_DIR}/ExeNoRead") find_program(ExeNoRead_EXECUTABLE NAMES ExeNoRead NO_DEFAULT_PATH PATHS "${CMAKE_CURRENT_BINARY_DIR}") message(STATUS "ExeNoRead_EXECUTABLE='${ExeNoRead_EXECUTABLE}'") +find_program(ReadNoExe_EXECUTABLE NAMES ReadNoExe NO_DEFAULT_PATH PATHS "${CMAKE_CURRENT_BINARY_DIR}") +message(STATUS "ReadNoExe_EXECUTABLE='${ReadNoExe_EXECUTABLE}'") diff --git a/Tests/RunCMake/find_program/CMP0109-NEW-stdout.txt b/Tests/RunCMake/find_program/CMP0109-NEW-stdout.txt new file mode 100644 index 0000000..2744463 --- /dev/null +++ b/Tests/RunCMake/find_program/CMP0109-NEW-stdout.txt @@ -0,0 +1,2 @@ +-- ExeNoRead_EXECUTABLE='.*/Tests/RunCMake/find_program/CMP0109-NEW-build/ExeNoRead' +-- ReadNoExe_EXECUTABLE='ReadNoExe_EXECUTABLE-NOTFOUND' diff --git a/Tests/RunCMake/find_program/CMP0109-NEW.cmake b/Tests/RunCMake/find_program/CMP0109-NEW.cmake new file mode 100644 index 0000000..b4a4033 --- /dev/null +++ b/Tests/RunCMake/find_program/CMP0109-NEW.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0109 NEW) +include(CMP0109-Common.cmake) diff --git a/Tests/RunCMake/find_program/CMP0109-OLD-stdout.txt b/Tests/RunCMake/find_program/CMP0109-OLD-stdout.txt new file mode 100644 index 0000000..1a0e2a8 --- /dev/null +++ b/Tests/RunCMake/find_program/CMP0109-OLD-stdout.txt @@ -0,0 +1,2 @@ +-- ExeNoRead_EXECUTABLE='ExeNoRead_EXECUTABLE-NOTFOUND' +-- ReadNoExe_EXECUTABLE='.*/Tests/RunCMake/find_program/CMP0109-OLD-build/ReadNoExe' diff --git a/Tests/RunCMake/find_program/CMP0109-OLD.cmake b/Tests/RunCMake/find_program/CMP0109-OLD.cmake new file mode 100644 index 0000000..8260161 --- /dev/null +++ b/Tests/RunCMake/find_program/CMP0109-OLD.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0109 OLD) +include(CMP0109-Common.cmake) diff --git a/Tests/RunCMake/find_program/CMP0109-WARN-stderr.txt b/Tests/RunCMake/find_program/CMP0109-WARN-stderr.txt new file mode 100644 index 0000000..202fc6d --- /dev/null +++ b/Tests/RunCMake/find_program/CMP0109-WARN-stderr.txt @@ -0,0 +1,29 @@ +^CMake Warning \(dev\) at CMP0109-Common.cmake:4 \(find_program\): + Policy CMP0109 is not set: find_program\(\) requires permission to execute + but not to read. Run "cmake --help-policy CMP0109" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + The file + + .*/Tests/RunCMake/find_program/CMP0109-WARN-build/ExeNoRead + + is executable but not readable. CMake is ignoring it for compatibility. +Call Stack \(most recent call first\): + CMP0109-WARN.cmake:1 \(include\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. ++ +CMake Warning \(dev\) at CMP0109-Common.cmake:6 \(find_program\): + Policy CMP0109 is not set: find_program\(\) requires permission to execute + but not to read. Run "cmake --help-policy CMP0109" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + The file + + .*/Tests/RunCMake/find_program/CMP0109-WARN-build/ReadNoExe + + is readable but not executable. CMake is using it for compatibility. +Call Stack \(most recent call first\): + CMP0109-WARN.cmake:1 \(include\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/find_program/CMP0109-WARN-stdout.txt b/Tests/RunCMake/find_program/CMP0109-WARN-stdout.txt new file mode 100644 index 0000000..baf560f --- /dev/null +++ b/Tests/RunCMake/find_program/CMP0109-WARN-stdout.txt @@ -0,0 +1,2 @@ +-- ExeNoRead_EXECUTABLE='ExeNoRead_EXECUTABLE-NOTFOUND' +-- ReadNoExe_EXECUTABLE='.*/Tests/RunCMake/find_program/CMP0109-WARN-build/ReadNoExe' diff --git a/Tests/RunCMake/find_program/CMP0109-WARN.cmake b/Tests/RunCMake/find_program/CMP0109-WARN.cmake new file mode 100644 index 0000000..a3d59af --- /dev/null +++ b/Tests/RunCMake/find_program/CMP0109-WARN.cmake @@ -0,0 +1 @@ +include(CMP0109-Common.cmake) diff --git a/Tests/RunCMake/find_program/ExeNoRead-stdout.txt b/Tests/RunCMake/find_program/ExeNoRead-stdout.txt deleted file mode 100644 index f231178..0000000 --- a/Tests/RunCMake/find_program/ExeNoRead-stdout.txt +++ /dev/null @@ -1 +0,0 @@ --- ExeNoRead_EXECUTABLE='ExeNoRead_EXECUTABLE-NOTFOUND' diff --git a/Tests/RunCMake/find_program/RunCMakeTest.cmake b/Tests/RunCMake/find_program/RunCMakeTest.cmake index 2bb777b..3e23920 100644 --- a/Tests/RunCMake/find_program/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_program/RunCMakeTest.cmake @@ -17,6 +17,12 @@ else() OUTPUT_STRIP_TRAILING_WHITESPACE) if(NOT "${uid}" STREQUAL "0") - run_cmake(ExeNoRead) + run_cmake(CMP0109-WARN) + run_cmake(CMP0109-OLD) + run_cmake(CMP0109-NEW) endif() endif() + +if(APPLE) + run_cmake(BundleSpaceInName) +endif() diff --git a/Tests/RunCMake/get_filename_component/IncorrectArguments-result.txt b/Tests/RunCMake/get_filename_component/IncorrectArguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/get_filename_component/IncorrectArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/get_filename_component/IncorrectArguments-stderr.txt b/Tests/RunCMake/get_filename_component/IncorrectArguments-stderr.txt new file mode 100644 index 0000000..af08afa --- /dev/null +++ b/Tests/RunCMake/get_filename_component/IncorrectArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at IncorrectArguments.cmake:1 \(get_filename_component\): + get_filename_component called with incorrect number of arguments +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/get_filename_component/IncorrectArguments.cmake b/Tests/RunCMake/get_filename_component/IncorrectArguments.cmake new file mode 100644 index 0000000..e329e29 --- /dev/null +++ b/Tests/RunCMake/get_filename_component/IncorrectArguments.cmake @@ -0,0 +1,2 @@ +get_filename_component(var) +message("The error is fatal, so this should not print") diff --git a/Tests/RunCMake/get_filename_component/RunCMakeTest.cmake b/Tests/RunCMake/get_filename_component/RunCMakeTest.cmake index 156fc8f..a7820a0 100644 --- a/Tests/RunCMake/get_filename_component/RunCMakeTest.cmake +++ b/Tests/RunCMake/get_filename_component/RunCMakeTest.cmake @@ -1,4 +1,5 @@ include(RunCMake) +run_cmake(IncorrectArguments) run_cmake(KnownComponents) run_cmake(UnknownComponent) diff --git a/Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt b/Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt index b146e5b..f86a688 100644 --- a/Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt +++ b/Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt @@ -1,4 +1,4 @@ -CMake Error at UnknownComponent.cmake:1 \(get_filename_component\): +^CMake Error at UnknownComponent.cmake:1 \(get_filename_component\): get_filename_component unknown component BOGUS Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/get_filename_component/UnknownComponent.cmake b/Tests/RunCMake/get_filename_component/UnknownComponent.cmake index 06abc51..19521ba 100644 --- a/Tests/RunCMake/get_filename_component/UnknownComponent.cmake +++ b/Tests/RunCMake/get_filename_component/UnknownComponent.cmake @@ -1 +1,2 @@ get_filename_component(var "/path/to/filename.ext.in" BOGUS) +message("The error is fatal, so this should not print") diff --git a/Tests/RunCMake/get_property/CMakeLists.txt b/Tests/RunCMake/get_property/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/get_property/CMakeLists.txt +++ b/Tests/RunCMake/get_property/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/if/CMakeLists.txt b/Tests/RunCMake/if/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/if/CMakeLists.txt +++ b/Tests/RunCMake/if/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/include/CMakeLists.txt b/Tests/RunCMake/include/CMakeLists.txt index 12cd3c7..4b3de84 100644 --- a/Tests/RunCMake/include/CMakeLists.txt +++ b/Tests/RunCMake/include/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/include_external_msproject/CMakeLists.txt b/Tests/RunCMake/include_external_msproject/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/include_external_msproject/CMakeLists.txt +++ b/Tests/RunCMake/include_external_msproject/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/interface_library/CMakeLists.txt b/Tests/RunCMake/interface_library/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/interface_library/CMakeLists.txt +++ b/Tests/RunCMake/interface_library/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/interface_library/global-interface-stderr.txt b/Tests/RunCMake/interface_library/global-interface-stderr.txt index 23b45d9..38585eb 100644 --- a/Tests/RunCMake/interface_library/global-interface-stderr.txt +++ b/Tests/RunCMake/interface_library/global-interface-stderr.txt @@ -3,7 +3,7 @@ CMake Error at global-interface.cmake:2 \(add_library\): GLOBAL - Tried extensions( \.[A-Za-z+]+| - )* + Tried extensions \.c \.C .* +.* Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/interface_library/invalid_name.cmake b/Tests/RunCMake/interface_library/invalid_name.cmake index 9a965aa..575fcc6 100644 --- a/Tests/RunCMake/interface_library/invalid_name.cmake +++ b/Tests/RunCMake/interface_library/invalid_name.cmake @@ -1,4 +1,4 @@ - +cmake_minimum_required(VERSION 2.8.12) add_library(if$ace INTERFACE) add_library(iface::target INTERFACE) diff --git a/Tests/RunCMake/list/CMakeLists.txt b/Tests/RunCMake/list/CMakeLists.txt index 12cd3c7..4b3de84 100644 --- a/Tests/RunCMake/list/CMakeLists.txt +++ b/Tests/RunCMake/list/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/list/GET-CMP0007-WARN-stderr.txt b/Tests/RunCMake/list/GET-CMP0007-WARN-stderr.txt index a0f8837..9103bd2 100644 --- a/Tests/RunCMake/list/GET-CMP0007-WARN-stderr.txt +++ b/Tests/RunCMake/list/GET-CMP0007-WARN-stderr.txt @@ -1,4 +1,13 @@ -^CMake Warning \(dev\) at GET-CMP0007-WARN.cmake:4 \(list\): +^CMake Deprecation Warning at GET-CMP0007-WARN.cmake:1 \(cmake_policy\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Warning \(dev\) at GET-CMP0007-WARN.cmake:4 \(list\): Policy CMP0007 is not set: list command no longer ignores empty elements. Run "cmake --help-policy CMP0007" for policy details. Use the cmake_policy command to set the policy and suppress this warning. List has value = diff --git a/Tests/RunCMake/math/CMakeLists.txt b/Tests/RunCMake/math/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/math/CMakeLists.txt +++ b/Tests/RunCMake/math/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/message/CMakeLists.txt b/Tests/RunCMake/message/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/message/CMakeLists.txt +++ b/Tests/RunCMake/message/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/no_install_prefix/CMakeLists.txt b/Tests/RunCMake/no_install_prefix/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/no_install_prefix/CMakeLists.txt +++ b/Tests/RunCMake/no_install_prefix/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/project/CMakeLists.txt b/Tests/RunCMake/project/CMakeLists.txt index 12cd3c7..4b3de84 100644 --- a/Tests/RunCMake/project/CMakeLists.txt +++ b/Tests/RunCMake/project/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/string/CMakeLists.txt b/Tests/RunCMake/string/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/string/CMakeLists.txt +++ b/Tests/RunCMake/string/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/target_link_libraries-ALIAS/AliasTargets.cmake b/Tests/RunCMake/target_link_libraries-ALIAS/AliasTargets.cmake index 73f8a7d..316b74b 100644 --- a/Tests/RunCMake/target_link_libraries-ALIAS/AliasTargets.cmake +++ b/Tests/RunCMake/target_link_libraries-ALIAS/AliasTargets.cmake @@ -15,22 +15,25 @@ endif() add_library(import-local SHARED IMPORTED) set_property(TARGET import-local PROPERTY IMPORTED_LOCATION "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}func${CMAKE_SHARED_LIBRARY_SUFFIX}") set_property(TARGET import-local PROPERTY IMPORTED_IMPLIB "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}func${CMAKE_IMPORT_LIBRARY_SUFFIX}") -add_library(alias-local ALIAS import-local) +add_library(alias::local ALIAS import-local) add_library (lib-local SHARED lib.c) -target_link_libraries (lib-local PRIVATE import-local) +target_link_libraries (lib-local PRIVATE alias::local) add_executable (main-local main.c) -target_link_libraries (main-local PRIVATE import-local) +target_link_libraries (main-local PRIVATE alias::local) add_library(import-global SHARED IMPORTED GLOBAL) set_property(TARGET import-global PROPERTY IMPORTED_LOCATION "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}func${CMAKE_SHARED_LIBRARY_SUFFIX}") set_property(TARGET import-global PROPERTY IMPORTED_IMPLIB "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}func${CMAKE_IMPORT_LIBRARY_SUFFIX}") -add_library(alias-global ALIAS import-global) +add_library(alias::global ALIAS import-global) add_library (lib-global SHARED lib.c) -target_link_libraries (lib-global PRIVATE import-global) +target_link_libraries (lib-global PRIVATE alias::global) add_executable (main-global main.c) -target_link_libraries (main-global PRIVATE import-global) +target_link_libraries (main-global PRIVATE alias::global) + + +add_subdirectory(sub_dir) diff --git a/Tests/RunCMake/target_link_libraries-ALIAS/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries-ALIAS/RunCMakeTest.cmake index 4d24a6e..42ec47e 100644 --- a/Tests/RunCMake/target_link_libraries-ALIAS/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_link_libraries-ALIAS/RunCMakeTest.cmake @@ -19,5 +19,7 @@ run_cmake_target(AliasTargets lib-local lib-local --config Release) run_cmake_target(AliasTargets main-local main-local --config Release) run_cmake_target(AliasTargets lib-global lib-global --config Release) run_cmake_target(AliasTargets main-global main-global --config Release) +run_cmake_target(AliasTargets lib-sub lib-sub --config Release) +run_cmake_target(AliasTargets main-sub main-sub --config Release) unset(RunCMake_TEST_OPTIONS) unset(RunCMake_TEST_OUTPUT_MERGE) diff --git a/Tests/RunCMake/target_link_libraries-ALIAS/sub_dir/CMakeLists.txt b/Tests/RunCMake/target_link_libraries-ALIAS/sub_dir/CMakeLists.txt new file mode 100644 index 0000000..326e964 --- /dev/null +++ b/Tests/RunCMake/target_link_libraries-ALIAS/sub_dir/CMakeLists.txt @@ -0,0 +1,7 @@ + + +add_library (lib-sub SHARED ../lib.c) +target_link_libraries (lib-sub PRIVATE alias::local) + +add_executable (main-sub ../main.c) +target_link_libraries (main-sub PRIVATE alias::local) diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2.cmake b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2.cmake index 2e9cba8..6c72546 100644 --- a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2.cmake +++ b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2.cmake @@ -1,4 +1,4 @@ - +cmake_minimum_required(VERSION 2.8.11) project(CMP0022-WARN) add_library(foo SHARED empty_vs6_1.cpp) diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-WARN.cmake b/Tests/RunCMake/target_link_libraries/CMP0023-WARN.cmake index fcc8da0..dfdf70b 100644 --- a/Tests/RunCMake/target_link_libraries/CMP0023-WARN.cmake +++ b/Tests/RunCMake/target_link_libraries/CMP0023-WARN.cmake @@ -1,4 +1,4 @@ - +cmake_minimum_required(VERSION 2.8.11) project(CMP0022-WARN) add_library(foo SHARED empty_vs6_1.cpp) diff --git a/Tests/RunCMake/target_link_libraries/CMakeLists.txt b/Tests/RunCMake/target_link_libraries/CMakeLists.txt index 8f85fbf..667561e 100644 --- a/Tests/RunCMake/target_link_libraries/CMakeLists.txt +++ b/Tests/RunCMake/target_link_libraries/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) diff --git a/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotExported.cmake b/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotExported.cmake index 9b97918..9f86b18 100644 --- a/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotExported.cmake +++ b/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotExported.cmake @@ -1,4 +1,3 @@ -cmake_policy(SET CMP0022 NEW) enable_language(C) add_library(foo STATIC empty.c) add_library(not_exported STATIC empty.c) diff --git a/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotTarget.cmake b/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotTarget.cmake index 7122ae9..20ec438 100644 --- a/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotTarget.cmake +++ b/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotTarget.cmake @@ -1,4 +1,3 @@ -cmake_policy(SET CMP0022 NEW) enable_language(C) add_library(foo STATIC empty.c) target_link_libraries(foo PRIVATE not_a_target) diff --git a/Tests/RunCMake/try_compile/CMP0056.cmake b/Tests/RunCMake/try_compile/CMP0056.cmake index e8d3d4a..2ab79d5 100644 --- a/Tests/RunCMake/try_compile/CMP0056.cmake +++ b/Tests/RunCMake/try_compile/CMP0056.cmake @@ -1,3 +1,4 @@ +cmake_minimum_required(VERSION 3.1) enable_language(C) set(obj "${CMAKE_C_OUTPUT_EXTENSION}") if(BORLAND) diff --git a/Tests/RunCMake/try_compile/CMakeLists.txt b/Tests/RunCMake/try_compile/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/try_compile/CMakeLists.txt +++ b/Tests/RunCMake/try_compile/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/try_compile/proj/CMakeLists.txt b/Tests/RunCMake/try_compile/proj/CMakeLists.txt index 78a87c0..652f5b6 100644 --- a/Tests/RunCMake/try_compile/proj/CMakeLists.txt +++ b/Tests/RunCMake/try_compile/proj/CMakeLists.txt @@ -1,2 +1,2 @@ -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.3) project(TestProject NONE) diff --git a/Tests/RunCMake/try_run/CMakeLists.txt b/Tests/RunCMake/try_run/CMakeLists.txt index e034780..e93f0b6 100644 --- a/Tests/RunCMake/try_run/CMakeLists.txt +++ b/Tests/RunCMake/try_run/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.0) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} C) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/variable_watch/CMakeLists.txt b/Tests/RunCMake/variable_watch/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/variable_watch/CMakeLists.txt +++ b/Tests/RunCMake/variable_watch/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/while/CMakeLists.txt b/Tests/RunCMake/while/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/while/CMakeLists.txt +++ b/Tests/RunCMake/while/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/SetLang/CMakeLists.txt b/Tests/SetLang/CMakeLists.txt index f24e5cb..af90f11 100644 --- a/Tests/SetLang/CMakeLists.txt +++ b/Tests/SetLang/CMakeLists.txt @@ -8,3 +8,10 @@ add_executable(SetLang bar.c) set_source_files_properties(foo.c bar.c PROPERTIES LANGUAGE CXX) target_link_libraries(SetLang foo) set_target_properties(SetLang PROPERTIES LINKER_LANGUAGE CXX) + +if((CMAKE_C_COMPILER_ID MATCHES "(GNU|Clang|MSVC|Borland|Embarcadero|Intel|TI|XL)")) + add_library(zoom zoom.zzz) + set_source_files_properties(zoom.zzz PROPERTIES LANGUAGE CXX) + target_link_libraries(SetLang zoom) + target_compile_definitions(SetLang PRIVATE WITH_ZOOM) +endif() diff --git a/Tests/SetLang/bar.c b/Tests/SetLang/bar.c index b934356..515e8c2 100644 --- a/Tests/SetLang/bar.c +++ b/Tests/SetLang/bar.c @@ -1,10 +1,22 @@ #include <stdio.h> int foo(); + +#ifdef WITH_ZOOM +int zoom(); +#endif + class A { public: - A() { this->i = foo(); } + A() + { + this->i = foo(); +#ifdef WITH_ZOOM + i += zoom(); + i -= zoom(); +#endif + } int i; }; diff --git a/Tests/SetLang/zoom.zzz b/Tests/SetLang/zoom.zzz new file mode 100644 index 0000000..a0c8899 --- /dev/null +++ b/Tests/SetLang/zoom.zzz @@ -0,0 +1,7 @@ +int zoom() +{ + int r = 10; + r++; + int ret = r + 10; + return ret; +} diff --git a/Tests/VSNsightTegra/AndroidManifest.xml b/Tests/VSAndroid/AndroidManifest.xml index 951e8f3..951e8f3 100644 --- a/Tests/VSNsightTegra/AndroidManifest.xml +++ b/Tests/VSAndroid/AndroidManifest.xml diff --git a/Tests/VSNsightTegra/CMakeLists.txt b/Tests/VSAndroid/CMakeLists.txt index 6d74f2f..73b1e07 100644 --- a/Tests/VSNsightTegra/CMakeLists.txt +++ b/Tests/VSAndroid/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.3) -project(VSNsightTegra C CXX) +project(VSAndroid C CXX) set(CMAKE_ANDROID_ARCH armv7-a) set(CMAKE_ANDROID_STL_TYPE stlport_shared) diff --git a/Tests/VSNsightTegra/build.xml b/Tests/VSAndroid/build.xml index 17a2cc0..17a2cc0 100644 --- a/Tests/VSNsightTegra/build.xml +++ b/Tests/VSAndroid/build.xml diff --git a/Tests/VSNsightTegra/jni/first.c b/Tests/VSAndroid/jni/first.c index b9dee27..b9dee27 100644 --- a/Tests/VSNsightTegra/jni/first.c +++ b/Tests/VSAndroid/jni/first.c diff --git a/Tests/VSNsightTegra/jni/first.h b/Tests/VSAndroid/jni/first.h index 9dfd8b8..9dfd8b8 100644 --- a/Tests/VSNsightTegra/jni/first.h +++ b/Tests/VSAndroid/jni/first.h diff --git a/Tests/VSNsightTegra/jni/second.c b/Tests/VSAndroid/jni/second.c index 30bdc17..30bdc17 100644 --- a/Tests/VSNsightTegra/jni/second.c +++ b/Tests/VSAndroid/jni/second.c diff --git a/Tests/VSNsightTegra/proguard-android.txt b/Tests/VSAndroid/proguard-android.txt index fe73bae..fe73bae 100644 --- a/Tests/VSNsightTegra/proguard-android.txt +++ b/Tests/VSAndroid/proguard-android.txt diff --git a/Tests/VSNsightTegra/res/values/strings.xml b/Tests/VSAndroid/res/values/strings.xml index 858cdb4..858cdb4 100644 --- a/Tests/VSNsightTegra/res/values/strings.xml +++ b/Tests/VSAndroid/res/values/strings.xml diff --git a/Tests/VSNsightTegra/src/com/example/twolibs/TwoLibs.java b/Tests/VSAndroid/src/com/example/twolibs/TwoLibs.java index ef9da01..ef9da01 100644 --- a/Tests/VSNsightTegra/src/com/example/twolibs/TwoLibs.java +++ b/Tests/VSAndroid/src/com/example/twolibs/TwoLibs.java diff --git a/Tests/VSWinStorePhone/CMakeLists.txt b/Tests/VSWinStorePhone/CMakeLists.txt index 558d5de..56e4c1d 100644 --- a/Tests/VSWinStorePhone/CMakeLists.txt +++ b/Tests/VSWinStorePhone/CMakeLists.txt @@ -114,7 +114,7 @@ set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_LOCATION "Assets") set_property(SOURCE ${STRING_FILES} PROPERTY VS_TOOL_OVERRIDE "PRIResource") set_property(SOURCE ${DEBUG_CONTENT_FILES} PROPERTY VS_DEPLOYMENT_CONTENT $<CONFIG:Debug>) set_property(SOURCE ${RELEASE_CONTENT_FILES} PROPERTY - VS_DEPLOYMENT_CONTENT $<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>,$<CONFIG:MinSizeRel>>) + VS_DEPLOYMENT_CONTENT $<CONFIG:Release,RelWithDebInfo,MinSizeRel>) set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_TYPE Pixel) set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_ENTRYPOINT mainPS) diff --git a/Tests/VariableUnusedViaSet/CMakeLists.txt b/Tests/VariableUnusedViaSet/CMakeLists.txt deleted file mode 100644 index 0123ab2..0000000 --- a/Tests/VariableUnusedViaSet/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -set(UNUSED_VARIABLE) -# Warning should occur here -set(UNUSED_VARIABLE "Usage") -message(STATUS "${UNUSED_VARIABLE}") diff --git a/Tests/VariableUnusedViaUnset/CMakeLists.txt b/Tests/VariableUnusedViaUnset/CMakeLists.txt deleted file mode 100644 index 4b4031d..0000000 --- a/Tests/VariableUnusedViaUnset/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# NOTE: Changing lines in here changes the test results since the first -# instance shouldn't warn, but the second should and they have the same message - -# A warning should NOT be issued for this line: -set(UNUSED_VARIABLE) -# Warning should occur here: -set(UNUSED_VARIABLE) -message(STATUS "${UNUSED_VARIABLE}") diff --git a/Tests/XCTest/StaticLibExample/StaticLibExample.c b/Tests/XCTest/StaticLibExample/StaticLibExample.c index b198f80..8d16eb5 100644 --- a/Tests/XCTest/StaticLibExample/StaticLibExample.c +++ b/Tests/XCTest/StaticLibExample/StaticLibExample.c @@ -1,6 +1,6 @@ #include "StaticLibExample.h" -int FourtyFour() +int FourtyFour(void) { return 44; } diff --git a/Tests/XCTest/StaticLibExample/StaticLibExample.h b/Tests/XCTest/StaticLibExample/StaticLibExample.h index 147a909..88695b1 100644 --- a/Tests/XCTest/StaticLibExample/StaticLibExample.h +++ b/Tests/XCTest/StaticLibExample/StaticLibExample.h @@ -1 +1 @@ -int FourtyFour(); +int FourtyFour(void); diff --git a/Utilities/Sphinx/CTestConfig.cmake b/Utilities/Sphinx/CTestConfig.cmake index 9607e38..e5f4260 100644 --- a/Utilities/Sphinx/CTestConfig.cmake +++ b/Utilities/Sphinx/CTestConfig.cmake @@ -6,7 +6,9 @@ set(CTEST_PROJECT_NAME "CMake") set(CTEST_NIGHTLY_START_TIME "1:00:00 UTC") -set(CTEST_DROP_METHOD "http") +if(NOT CTEST_DROP_METHOD STREQUAL "https") + set(CTEST_DROP_METHOD "http") +endif() set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=CMake") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Utilities/Sphinx/update_versions.py b/Utilities/Sphinx/update_versions.py new file mode 100755 index 0000000..893e7a7 --- /dev/null +++ b/Utilities/Sphinx/update_versions.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python3 +""" +This script inserts "versionadded" directive into every .rst document +and every .cmake module with .rst documentation comment. +""" +import re +import pathlib +import subprocess +import argparse + +tag_re = re.compile(r'^v3\.(\d+)\.(\d+)(?:-rc(\d+))?$') +path_re = re.compile(r'Help/(?!dev|guide|manual|cpack_|release).*\.rst|Modules/[^/]*\.cmake$') + +def git_root(): + result = subprocess.run( + ['git', 'rev-parse', '--show-toplevel'], check=True, universal_newlines=True, capture_output=True) + return pathlib.Path(result.stdout.strip()) + +def git_tags(): + result = subprocess.run(['git', 'tag'], check=True, universal_newlines=True, capture_output=True) + return [tag for tag in result.stdout.splitlines() if tag_re.match(tag)] + +def git_list_tree(ref): + result = subprocess.run( + ['git', 'ls-tree', '-r', '--full-name', '--name-only', ref, ':/'], + check=True, universal_newlines=True, capture_output=True) + return [path for path in result.stdout.splitlines() if path_re.match(path)] + +def tag_version(tag): + return re.sub(r'^v|\.0(-rc\d+)?$', '', tag) + +def tag_sortkey(tag): + return tuple(int(part or '1000') for part in tag_re.match(tag).groups()) + +def make_version_map(baseline, since, next_version): + versions = {} + if next_version: + for path in git_list_tree('HEAD'): + versions[path] = next_version + for tag in sorted(git_tags(), key=tag_sortkey, reverse=True): + version = tag_version(tag) + for path in git_list_tree(tag): + versions[path] = version + if baseline: + for path in git_list_tree(baseline): + versions[path] = None + if since: + for path in git_list_tree(since): + versions.pop(path, None) + return versions + +cmake_version_re = re.compile( + rb'set\(CMake_VERSION_MAJOR\s+(\d+)\)\s+set\(CMake_VERSION_MINOR\s+(\d+)\)\s+set\(CMake_VERSION_PATCH\s+(\d+)\)', re.S) + +def cmake_version(path): + match = cmake_version_re.search(path.read_bytes()) + major, minor, patch = map(int, match.groups()) + minor += patch > 20000000 + return f'{major}.{minor}' + +stamp_re = re.compile( + rb'(?P<PREFIX>(^|\[\.rst:\r?\n)[^\r\n]+\r?\n[*^\-=#]+(?P<NL>\r?\n))(?P<STAMP>\s*\.\. versionadded::[^\r\n]*\r?\n)?') +stamp_pattern_add = rb'\g<PREFIX>\g<NL>.. versionadded:: VERSION\g<NL>' +stamp_pattern_remove = rb'\g<PREFIX>' + +def update_file(path, version, overwrite): + try: + data = path.read_bytes() + except FileNotFoundError as e: + return False + + def _replacement(match): + if not overwrite and match.start('STAMP') != -1: + return match.group() + if version: + pattern = stamp_pattern_add.replace(b'VERSION', version.encode('utf-8')) + else: + pattern = stamp_pattern_remove + return match.expand(pattern) + + new_data, nrepl = stamp_re.subn(_replacement, data, 1) + if nrepl and new_data != data: + path.write_bytes(new_data) + return True + return False + +def update_repo(repo_root, version_map, overwrite): + total = 0 + for path, version in version_map.items(): + if update_file(repo_root / path, version, overwrite): + print(f"Version {version or '<none>':6} for {path}") + total += 1 + print(f"Updated {total} file(s)") + +def main(): + parser = argparse.ArgumentParser(allow_abbrev=False) + parser.add_argument('--overwrite', action='store_true', help="overwrite existing version tags") + parser.add_argument('--baseline', metavar='TAG', default='v3.0.0', + help="files present in this tag won't be stamped (default: v3.0.0)") + parser.add_argument('--since', metavar='TAG', + help="apply changes only to files added after this tag") + parser.add_argument('--next-version', metavar='VER', + help="version for files not present in any tag (default: from CMakeVersion.cmake)") + args = parser.parse_args() + + try: + repo_root = git_root() + next_version = args.next_version or cmake_version(repo_root / 'Source/CMakeVersion.cmake') + version_map = make_version_map(args.baseline, args.since, next_version) + update_repo(repo_root, version_map, args.overwrite) + except subprocess.CalledProcessError as e: + print(f"Command '{' '.join(e.cmd)}' returned code {e.returncode}:\n{e.stderr.strip()}") + +if __name__ == '__main__': + main() diff --git a/Utilities/std/CMakeLists.txt b/Utilities/std/CMakeLists.txt index 17a7aaa..23d9104 100644 --- a/Utilities/std/CMakeLists.txt +++ b/Utilities/std/CMakeLists.txt @@ -4,7 +4,9 @@ set(CMAKE_CXX_EXTENSIONS FALSE) # source files for CMake std library -set(SRCS cm/bits/string_view.cxx +set(SRCS cm/bits/fs_path.cxx + cm/bits/string_view.cxx + cm/filesystem cm/memory cm/optional cm/shared_mutex diff --git a/Utilities/std/cm/bits/fs_path.cxx b/Utilities/std/cm/bits/fs_path.cxx new file mode 100644 index 0000000..71386bb --- /dev/null +++ b/Utilities/std/cm/bits/fs_path.cxx @@ -0,0 +1,989 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#include <cm/filesystem> // IWYU pragma: associated + +#if !defined(CMake_HAVE_CXX_FILESYSTEM) + +# include <algorithm> +# include <cassert> +# include <cstddef> +# include <cstdlib> +# include <functional> +# include <string> +# include <utility> +# include <vector> +# if defined(_WIN32) +# include <cctype> +# include <iterator> +# endif + +# include <cm/memory> +# include <cm/string_view> +# include <cmext/string_view> + +namespace cm { +namespace filesystem { +namespace internals { + +class path_parser +{ +# if defined(__SUNPRO_CC) && defined(__sparc) + // Oracle DeveloperStudio C++ compiler generates wrong code if enum size + // is different than the default. + using enum_size = int; +# else + using enum_size = unsigned char; +# endif + + enum class state : enum_size + { + before_begin, + in_root_name, + in_root_dir, + in_filename, + trailing_separator, + at_end + }; + + using pointer = char const*; + +public: + enum class seek_position : enum_size + { + root_name = static_cast<enum_size>(state::in_root_name), + root_directory = static_cast<enum_size>(state::in_root_dir) + }; + enum class peek_fragment : enum_size + { + remainder, + path + }; + + path_parser(cm::string_view path, bool set_at_end = false) + : State(set_at_end ? state::at_end : state::before_begin) + , Path(path) + { + } + + path_parser(const path_parser&) = default; + + ~path_parser() = default; + + void reset() noexcept { this->set_state(state::before_begin); } + + void increment() noexcept + { + const pointer start = this->next_token(); + const pointer end = this->after_end(); + + if (start == end) { + this->set_state(state::at_end); + return; + } + + switch (this->State) { + case state::before_begin: { + auto pos = this->consume_root_name(start, end); + if (pos) { + this->set_state(state::in_root_name); + } else { + pos = this->consume_separator(start, end); + if (pos) { + this->set_state(state::in_root_dir); + } else { + this->consume_filename(start, end); + this->set_state(state::in_filename); + } + } + break; + } + case state::in_root_name: { + auto pos = this->consume_separator(start, end); + if (pos) { + this->set_state(state::in_root_dir); + } else { + this->consume_filename(start, end); + this->set_state(state::in_filename); + } + break; + } + case state::in_root_dir: { + this->consume_filename(start, end); + this->set_state(state::in_filename); + break; + } + case state::in_filename: { + auto posSep = this->consume_separator(start, end); + if (posSep != end) { + auto pos = this->consume_filename(posSep, end); + if (pos) { + return; + } + } + set_state(state::trailing_separator); + break; + } + case state::trailing_separator: { + this->set_state(state::at_end); + break; + } + case state::at_end: + // unreachable + std::abort(); + } + } + + void decrement() noexcept + { + const pointer rstart = this->current_token() - 1; + const pointer rend = this->before_start(); + + if (rstart == rend) { + this->set_state(state::before_begin); + return; + } + + switch (this->State) { + case state::at_end: { + auto posSep = this->consume_separator(rstart, rend); + if (posSep) { + if (posSep == rend) { + this->set_state(state::in_root_dir); + } else { + auto pos = this->consume_root_name(posSep, rend, true); + if (pos == rend) { + this->set_state(state::in_root_dir); + } else { + this->set_state(state::trailing_separator); + } + } + } else { + auto pos = this->consume_root_name(rstart, rend); + if (pos == rend) { + this->set_state(state::in_root_name); + } else { + this->consume_filename(rstart, rend); + this->set_state(state::in_filename); + } + } + break; + } + case state::trailing_separator: { + this->consume_filename(rstart, rend); + this->set_state(state::in_filename); + break; + } + case state::in_filename: { + auto posSep = this->consume_separator(rstart, rend); + if (posSep == rend) { + this->set_state(state::in_root_dir); + } else { + auto pos = this->consume_root_name(posSep, rend, true); + if (pos == rend) { + this->set_state(state::in_root_dir); + } else { + this->consume_filename(posSep, rend); + this->set_state(state::in_filename); + } + } + break; + } + case state::in_root_dir: { + auto pos = this->consume_root_name(rstart, rend); + if (pos) { + this->set_state(state::in_root_name); + } + break; + } + case state::in_root_name: + case state::before_begin: { + // unreachable + std::abort(); + } + } + } + + path_parser& operator++() noexcept + { + this->increment(); + return *this; + } + + path_parser& operator--() noexcept + { + this->decrement(); + return *this; + } + + cm::string_view operator*() const noexcept + { + switch (this->State) { + case state::before_begin: + case state::at_end: + return cm::string_view(); + case state::trailing_separator: + return ""; + case state::in_root_dir: + case state::in_root_name: + case state::in_filename: + return this->Entry; + default: + // unreachable + std::abort(); + } + } + + void seek(seek_position position) + { + state s = static_cast<state>(static_cast<int>(position)); + + while (this->State <= s) { + this->increment(); + } + } + + cm::string_view peek(peek_fragment fragment) + { + if (fragment == peek_fragment::remainder) { + // peek-up remain part of the initial path + return { this->Entry.data(), + std::size_t(&this->Path.back() - this->Entry.data() + 1) }; + } + if (fragment == peek_fragment::path) { + // peek-up full path until current position + return { this->Path.data(), + std::size_t(&this->Entry.back() - this->Path.data() + 1) }; + } + return {}; + } + + bool in_root_name() const { return this->State == state::in_root_name; } + bool in_root_directory() const { return this->State == state::in_root_dir; } + bool at_end() const { return this->State == state::at_end; } + + bool at_start() const { return this->Entry.data() == this->Path.data(); } + +private: + void set_state(state newState) noexcept + { + this->State = newState; + if (newState == state::before_begin || newState == state::at_end) { + this->Entry = {}; + } + } + + pointer before_start() const noexcept { return this->Path.data() - 1; } + pointer after_end() const noexcept + { + return this->Path.data() + this->Path.size(); + } + + pointer current_token() const noexcept + { + switch (this->State) { + case state::before_begin: + case state::in_root_name: + return &this->Path.front(); + case state::in_root_dir: + case state::in_filename: + case state::trailing_separator: + return &this->Entry.front(); + case state::at_end: + return &this->Path.back() + 1; + default: + // unreachable + std::abort(); + } + } + pointer next_token() const noexcept + { + switch (this->State) { + case state::before_begin: + return this->Path.data(); + case state::in_root_name: + case state::in_root_dir: + case state::in_filename: + return &this->Entry.back() + 1; + case state::trailing_separator: + case state::at_end: + return after_end(); + default: + // unreachable + std::abort(); + } + } + + pointer consume_separator(pointer ptr, pointer end) noexcept + { + if (ptr == end || + (*ptr != '/' +# if defined(_WIN32) + && *ptr != '\\' +# endif + )) { + return nullptr; + } + const auto step = ptr < end ? 1 : -1; + ptr += step; + while (ptr != end && + (*ptr == '/' +# if defined(_WIN32) + || *ptr == ' \\' +# endif + )) { + ptr += step; + } + if (step == 1) { + this->Entry = cm::string_view(ptr - 1, 1); + } else { + this->Entry = cm::string_view(ptr + 1, 1); + } + + return ptr; + } + + pointer consume_filename(pointer ptr, pointer end) noexcept + { + auto start = ptr; + + if (ptr == end || *ptr == '/' +# if defined(_WIN32) + || *ptr == '\\' +# endif + ) { + return nullptr; + } + const auto step = ptr < end ? 1 : -1; + ptr += step; + while (ptr != end && *ptr != '/' +# if defined(_WIN32) + && *ptr != '\\' +# endif + ) { + ptr += step; + } + +# if defined(_WIN32) + if (step == -1 && (start - ptr) >= 2 && ptr == end) { + // rollback drive name consumption, if any + if (this->is_drive_name(ptr + 1)) { + ptr += 2; + } + if (ptr == start) { + return nullptr; + } + } +# endif + + if (step == 1) { + this->Entry = cm::string_view(start, ptr - start); + } else { + this->Entry = cm::string_view(ptr + 1, start - ptr); + } + + return ptr; + } + +# if defined(_WIN32) + bool is_drive_name(pointer ptr) + { + return std::toupper(ptr[0]) >= 'A' && std::toupper(ptr[0]) <= 'Z' && + ptr[1] == ':'; + } +# endif + + pointer consume_root_name(pointer ptr, pointer end, + bool check_only = false) noexcept + { +# if defined(_WIN32) + if (ptr < end) { + if ((end - ptr) >= 2 && this->is_drive_name(ptr)) { + // Drive letter (X:) is a root name + if (!check_only) { + this->Entry = cm::string_view(ptr, 2); + } + return ptr + 2; + } + if ((end - ptr) > 2 && (ptr[0] == '/' || ptr[0] == '\\') && + (ptr[1] == '/' || ptr[1] == '\\') && + (ptr[2] != '/' && ptr[2] != '\\')) { + // server name (//server) is a root name + auto pos = std::find(ptr + 2, end, '/'); + if (!check_only) { + this->Entry = cm::string_view(ptr, pos - ptr); + } + return pos; + } + } else { + if ((ptr - end) >= 2 && this->is_drive_name(ptr - 1)) { + // Drive letter (X:) is a root name + if (!check_only) { + this->Entry = cm::string_view(ptr - 1, 2); + } + return ptr - 2; + } + if ((ptr - end) > 2 && (ptr[0] != '/' && ptr[0] != '\\')) { + std::reverse_iterator<pointer> start(ptr); + std::reverse_iterator<pointer> stop(end); + auto res = std::find_if(start, stop, + [](char c) { return c == '/' || c == '\\'; }); + pointer pos = res.base() - 1; + if ((pos - 1) > end && (pos[-1] == '/' || pos[-1] == '\\')) { + // server name (//server) is a root name + if (!check_only) { + this->Entry = cm::string_view(pos - 1, ptr - pos + 2); + } + return pos - 2; + } + } + } +# else + (void)ptr; + (void)end; + (void)check_only; +# endif + return nullptr; + } + + state State; + const cm::string_view Path; + cm::string_view Entry; +}; + +// class unicode_helper +void unicode_helper::append(std::string& str, std::uint32_t codepoint) +{ + if (codepoint <= 0x7f) { + str.push_back(static_cast<char>(codepoint)); + } else if (codepoint >= 0x80 && codepoint <= 0x7ff) { + str.push_back(static_cast<char>((codepoint >> 6) + 192)); + str.push_back(static_cast<char>((codepoint & 0x3f) + 128)); + } else if ((codepoint >= 0x800 && codepoint <= 0xd7ff) || + (codepoint >= 0xe000 && codepoint <= 0xffff)) { + str.push_back(static_cast<char>((codepoint >> 12) + 224)); + str.push_back(static_cast<char>(((codepoint & 0xfff) >> 6) + 128)); + str.push_back(static_cast<char>((codepoint & 0x3f) + 128)); + } else if (codepoint >= 0x10000 && codepoint <= 0x10ffff) { + str.push_back(static_cast<char>((codepoint >> 18) + 240)); + str.push_back(static_cast<char>(((codepoint & 0x3ffff) >> 12) + 128)); + str.push_back(static_cast<char>(((codepoint & 0xfff) >> 6) + 128)); + str.push_back(static_cast<char>((codepoint & 0x3f) + 128)); + } else { + append(str, 0xfffd); + } +} + +unicode_helper::utf8_state unicode_helper::decode(const utf8_state state, + const std::uint8_t fragment, + std::uint32_t& codepoint) +{ + const std::uint32_t utf8_state_info[] = { + // encoded states + 0x11111111u, 0x11111111u, 0x77777777u, 0x77777777u, 0x88888888u, + 0x88888888u, 0x88888888u, 0x88888888u, 0x22222299u, 0x22222222u, + 0x22222222u, 0x22222222u, 0x3333333au, 0x33433333u, 0x9995666bu, + 0x99999999u, 0x88888880u, 0x22818108u, 0x88888881u, 0x88888882u, + 0x88888884u, 0x88888887u, 0x88888886u, 0x82218108u, 0x82281108u, + 0x88888888u, 0x88888883u, 0x88888885u, 0u, 0u, + 0u, 0u, + }; + std::uint8_t category = fragment < 128 + ? 0 + : (utf8_state_info[(fragment >> 3) & 0xf] >> ((fragment & 7) << 2)) & 0xf; + codepoint = (state ? (codepoint << 6) | (fragment & 0x3fu) + : (0xffu >> category) & fragment); + return state == s_reject + ? s_reject + : static_cast<utf8_state>( + (utf8_state_info[category + 16] >> (state << 2)) & 0xf); +} + +} // internals + +// Class path +path& path::operator/=(const path& p) +{ + if (p.is_absolute() || + (p.has_root_name() && p.get_root_name() != this->get_root_name())) { + this->path_ = p.path_; + return *this; + } + if (p.has_root_directory()) { + this->path_ = static_cast<std::string>(this->get_root_name()); + this->path_ += static_cast<std::string>(p.get_root_directory()); + } else if (this->has_filename()) { + this->path_ += this->preferred_separator; +# if defined(_WIN32) + // special case: "//host" / "b" => "//host/b" + } else if (this->has_root_name() && !this->has_root_directory()) { + if (this->path_.length() >= 3 && + (this->path_[0] == '/' || this->path_[0] == '\\') && + (this->path_[1] == '/' || this->path_[1] == '\\') && + (this->path_[2] != '/' || this->path_[2] != '\\')) { + this->path_ += this->preferred_separator; + } +# endif + } + + this->path_ += p.get_relative_path(); + return *this; +} + +path path::lexically_normal() const +{ + if (this->path_.empty()) { + return *this; + } + + const cm::string_view dot = "."_s; + const cm::string_view dotdot = ".."_s; + + std::vector<cm::string_view> root_parts; + std::vector<cm::string_view> parts; + bool root_directory_defined = false; + bool need_final_separator = false; + std::size_t path_size = 0; + + internals::path_parser parser(this->path_); + ++parser; + while (!parser.at_end()) { + auto part = *parser; + + if (parser.in_root_name() || parser.in_root_directory()) { + if (parser.in_root_directory()) { + root_directory_defined = true; + } + root_parts.push_back(part); + path_size += part.size(); + } else if (part == dotdot) { + if (!parts.empty() && parts.back() != dotdot) { + need_final_separator = true; + path_size -= parts.back().size(); + parts.pop_back(); + } else if ((parts.empty() || parts.back() == dotdot) && + !root_directory_defined) { + parts.push_back(dotdot); + path_size += 2; + } + + } else if (part == dot || part.empty()) { + need_final_separator = true; + if (part.empty()) { + parts.push_back(part); + } + } else { + // filename + need_final_separator = false; + parts.push_back(part); + path_size += part.size(); + } + ++parser; + } + + // no final separator if last element of path is ".." + need_final_separator = + need_final_separator && !parts.empty() && parts.back() != dotdot; + + // build final path + //// compute final size of path + path_size += parts.size() + (need_final_separator ? 1 : 0); + + std::string np; + np.reserve(path_size); + for (const auto& p : root_parts) { + np += p; + } + // convert any slash to the preferred_separator + if (static_cast<std::string::value_type>(this->preferred_separator) != '/') { + std::replace( + np.begin(), np.end(), '/', + static_cast<std::string::value_type>(this->preferred_separator)); + } + for (const auto& p : parts) { + if (!p.empty()) { + np += p; + np += static_cast<std::string::value_type>(this->preferred_separator); + } + } + if (!parts.empty() && !need_final_separator) { + // remove extra separator + np.pop_back(); + } + if (np.empty()) { + np.assign(1, '.'); + } + + return path(std::move(np)); +} + +path path::lexically_relative(const path& base) const +{ + internals::path_parser parser(this->path_); + ++parser; + internals::path_parser parserbase(base.path_); + ++parserbase; + cm::string_view this_root_name, base_root_name; + cm::string_view this_root_dir, base_root_dir; + + if (parser.in_root_name()) { + this_root_name = *parser; + ++parser; + } + if (parser.in_root_directory()) { + this_root_dir = *parser; + ++parser; + } + if (parserbase.in_root_name()) { + base_root_name = *parserbase; + ++parserbase; + } + if (parserbase.in_root_directory()) { + base_root_dir = *parserbase; + ++parserbase; + } + + auto is_path_absolute = [](cm::string_view rn, cm::string_view rd) -> bool { +# if defined(_WIN32) + return !rn.empty() && !rd.empty(); +# else + (void)rn; + return !rd.empty(); +# endif + }; + + if (this_root_name != base_root_name || + is_path_absolute(this_root_name, this_root_dir) != + is_path_absolute(base_root_name, base_root_dir) || + (this_root_dir.empty() && !base_root_dir.empty())) { + return path(); + } + +# if defined(_WIN32) + // LWG3070 handle special case: filename can also be a root-name + auto is_drive_name = [](cm::string_view item) -> bool { + return item.length() == 2 && item[1] == ':'; + }; + parser.reset(); + parser.seek(internals::path_parser::seek_position::root_directory); + while (!parser.at_end()) { + if (is_drive_name(*parser)) { + return path(); + } + ++parser; + } + parserbase.reset(); + parserbase.seek(internals::path_parser::seek_position::root_directory); + while (!parserbase.at_end()) { + if (is_drive_name(*parserbase)) { + return path(); + } + ++parserbase; + } +# endif + + const cm::string_view dot = "."_s; + const cm::string_view dotdot = ".."_s; + + auto a = this->begin(), aend = this->end(); + auto b = base.begin(), bend = base.end(); + while (a != aend && b != bend && a->string() == b->string()) { + ++a; + ++b; + } + + int count = 0; + for (; b != bend; ++b) { + auto part = *b; + if (part == dotdot) { + --count; + } else if (part.string() != dot && !part.empty()) { + ++count; + } + } + + if (count == 0 && (a == this->end() || a->empty())) { + return path(dot); + } + if (count >= 0) { + path result; + path p_dotdot(dotdot); + for (int i = 0; i < count; ++i) { + result /= p_dotdot; + } + for (; a != aend; ++a) { + result /= *a; + } + return result; + } + // count < 0 + return path(); +} + +path::path_type path::get_generic() const +{ + auto gen_path = this->path_; + auto start = gen_path.begin(); +# if defined(_WIN32) + std::replace(gen_path.begin(), gen_path.end(), '\\', '/'); + // preserve special syntax for root_name ('//server' or '//?') + if (gen_path.length() > 2 && gen_path[2] != '/') { + start += 2; + } +# endif + // remove duplicate separators + auto new_end = std::unique(start, gen_path.end(), [](char lhs, char rhs) { + return lhs == rhs && lhs == '/'; + }); + gen_path.erase(new_end, gen_path.end()); + return gen_path; +} + +cm::string_view path::get_root_name() const +{ + internals::path_parser parser(this->path_); + ++parser; + if (parser.in_root_name()) { + return *parser; + } + return {}; +} + +cm::string_view path::get_root_directory() const +{ + internals::path_parser parser(this->path_); + ++parser; + if (parser.in_root_name()) { + ++parser; + } + if (parser.in_root_directory()) { + return *parser; + } + return {}; +} + +cm::string_view path::get_relative_path() const +{ + internals::path_parser parser(this->path_); + parser.seek(internals::path_parser::seek_position::root_directory); + if (parser.at_end()) { + return {}; + } + return parser.peek(internals::path_parser::peek_fragment::remainder); +} + +cm::string_view path::get_parent_path() const +{ + if (!this->has_relative_path()) { + return this->path_; + } + + // peek-up full path minus last element + internals::path_parser parser(this->path_, true); + --parser; + if (parser.at_start()) { + return {}; + } + --parser; + return parser.peek(internals::path_parser::peek_fragment::path); +} + +cm::string_view path::get_filename() const +{ + { + internals::path_parser parser(this->path_); + parser.seek(internals::path_parser::seek_position::root_directory); + if (parser.at_end()) { + return {}; + } + } + { + internals::path_parser parser(this->path_, true); + return *(--parser); + } +} + +cm::string_view path::get_filename_fragment(filename_fragment fragment) const +{ + auto file = this->get_filename(); + + if (file == "." || file == ".." || file.empty()) { + return fragment == filename_fragment::stem ? file : cm::string_view{}; + } + + auto pos = file.find_last_of('.'); + if (pos == cm::string_view::npos || pos == 0) { + return fragment == filename_fragment::stem ? file : cm::string_view{}; + } + return fragment == filename_fragment::stem ? file.substr(0, pos) + : file.substr(pos); +} + +int path::compare_path(cm::string_view str) const +{ + internals::path_parser this_pp(this->path_); + ++this_pp; + internals::path_parser other_pp(str); + ++other_pp; + + // compare root_name part + { + bool compare_root_names = false; + cm::string_view this_root_name, other_root_name; + int res; + + if (this_pp.in_root_name()) { + compare_root_names = true; + this_root_name = *this_pp; + ++this_pp; + } + if (other_pp.in_root_name()) { + compare_root_names = true; + other_root_name = *other_pp; + ++other_pp; + } + if (compare_root_names && + (res = this_root_name.compare(other_root_name) != 0)) { + return res; + } + } + + // compare root_directory part + { + if (!this_pp.in_root_directory() && other_pp.in_root_directory()) { + return -1; + } else if (this_pp.in_root_directory() && !other_pp.in_root_directory()) { + return 1; + } + if (this_pp.in_root_directory()) { + ++this_pp; + } + if (other_pp.in_root_directory()) { + ++other_pp; + } + } + + // compare various parts of the paths + while (!this_pp.at_end() && !other_pp.at_end()) { + int res; + if ((res = (*this_pp).compare(*other_pp)) != 0) { + return res; + } + ++this_pp; + ++other_pp; + } + + // final step + if (this_pp.at_end() && !other_pp.at_end()) { + return -1; + } else if (!this_pp.at_end() && other_pp.at_end()) { + return 1; + } + + return 0; +} + +// Class path::iterator +path::iterator::iterator() + : path_(nullptr) +{ +} +path::iterator::iterator(const iterator& other) +{ + this->path_ = other.path_; + if (other.parser_) { + this->parser_ = cm::make_unique<internals::path_parser>(*other.parser_); + this->path_element_ = path(**this->parser_); + } +} +path::iterator::iterator(const path* p, bool at_end) + : path_(p) + , parser_(cm::make_unique<internals::path_parser>(p->path_, at_end)) +{ + if (!at_end) { + ++(*this->parser_); + this->path_element_ = path(**this->parser_); + } +} + +path::iterator::~iterator() = default; + +path::iterator& path::iterator::operator=(const iterator& other) +{ + this->path_ = other.path_; + if (other.parser_) { + this->parser_ = cm::make_unique<internals::path_parser>(*other.parser_); + this->path_element_ = path(**this->parser_); + } + + return *this; +} + +path::iterator& path::iterator::operator++() +{ + assert(this->parser_); + + if (this->parser_) { + assert(!this->parser_->at_end()); + + if (!this->parser_->at_end()) { + ++(*this->parser_); + if (this->parser_->at_end()) { + this->path_element_ = path(); + } else { + this->path_element_ = path(**this->parser_); + } + } + } + + return *this; +} + +path::iterator& path::iterator::operator--() +{ + assert(this->parser_); + + if (this->parser_) { + assert(!this->parser_->at_start()); + + if (!this->parser_->at_start()) { + --(*this->parser_); + this->path_element_ = path(**this->parser_); + } + } + + return *this; +} + +bool operator==(const path::iterator& lhs, const path::iterator& rhs) +{ + return lhs.path_ == rhs.path_ && lhs.parser_ != nullptr && + ((lhs.parser_->at_end() && rhs.parser_->at_end()) || + (lhs.parser_->at_start() && rhs.parser_->at_start()) || + ((**lhs.parser_).data() == (**rhs.parser_).data())); +} + +std::size_t hash_value(const path& p) noexcept +{ + internals::path_parser parser(p.path_); + std::hash<cm::string_view> hasher; + std::size_t value = 0; + + while (!parser.at_end()) { + value = hasher(*parser) + 0x9e3779b9 + (value << 6) + (value >> 2); + ++parser; + } + + return value; +} +} // filesystem +} // cm + +#else + +// Avoid empty translation unit. +void cm_filesystem_path_cxx() +{ +} + +#endif diff --git a/Utilities/std/cm/filesystem b/Utilities/std/cm/filesystem new file mode 100644 index 0000000..d7ade34 --- /dev/null +++ b/Utilities/std/cm/filesystem @@ -0,0 +1,1173 @@ +// -*-c++-*- +// vim: set ft=cpp: + +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#ifndef cm_filesystem +#define cm_filesystem + +#include "cmSTL.hxx" // IWYU pragma: keep + +#if defined(CMake_HAVE_CXX_FILESYSTEM) + +# include <filesystem> // IWYU pragma: export + +#else + +# include <cstddef> +# include <cstdint> +# include <iostream> +# include <iterator> +# include <memory> +# include <string> +# include <utility> + +# include <cm/iomanip> +# include <cm/string_view> +# include <cm/type_traits> +# include <cmext/iterator> + +# if defined(_WIN32) +# include <algorithm> +# endif + +#endif + +namespace cm { +namespace filesystem { + +#if defined(CMake_HAVE_CXX_FILESYSTEM) + +using std::filesystem::path; +using std::filesystem::swap; +using std::filesystem::hash_value; + +#else + +# if !defined(CM_FILESYSTEM_SOURCE_TRAITS_ITERATOR) +// Oracle DeveloperStudio C++ compiler on Solaris/Sparc fails to compile +// the source_traits for iterator check. So disable it for now. +# define CM_FILESYSTEM_SOURCE_TRAITS_ITERATOR 0 +# endif + +namespace internals { + +class path_parser; + +class unicode_helper +{ +protected: + using utf8_state = unsigned char; + static const utf8_state s_start = 0; + static const utf8_state s_reject = 8; + + static inline bool in_range(std::uint32_t c, std::uint32_t lo, + std::uint32_t hi) + { + return (static_cast<std::uint32_t>(c - lo) < (hi - lo + 1)); + } + + static inline bool is_surrogate(std::uint32_t c) + { + return in_range(c, 0xd800, 0xdfff); + } + + static inline bool is_high_surrogate(std::uint32_t c) + { + return (c & 0xfffffc00) == 0xd800; + } + + static inline bool is_low_surrogate(std::uint32_t c) + { + return (c & 0xfffffc00) == 0xdc00; + } + + static void append(std::string& str, std::uint32_t codepoint); + + static utf8_state decode(const utf8_state state, const std::uint8_t fragment, + std::uint32_t& codepoint); +}; + +template <typename Char, typename = void> +class unicode +{ +}; + +template <typename Char> +class unicode<Char, typename std::enable_if<(sizeof(Char) == 4)>::type> + : public unicode_helper +{ +public: + // UTF32 -> UTF8 + static std::string to_utf8(const std::wstring& str) + { + std::string result; + for (auto c : str) { + append(result, c); + } + return result; + } + static std::string to_utf8(Char c) + { + std::string result; + append(result, c); + return result; + } + + // UTF8 -> UTF32 + static std::wstring from_utf8(const std::string& str) + { + std::wstring result; + result.reserve(str.length()); + auto iter = str.begin(); + utf8_state state = s_start; + std::uint32_t codepoint = 0; + while (iter < str.end()) { + if ((state = decode(state, static_cast<std::uint8_t>(*iter++), + codepoint)) == s_start) { + result += static_cast<std::wstring::value_type>(codepoint); + codepoint = 0; + } else if (state == s_reject) { + result += static_cast<std::wstring::value_type>(0xfffd); + state = s_start; + codepoint = 0; + } + } + if (state) { + result += static_cast<std::wstring::value_type>(0xfffd); + } + return result; + } + static std::wstring from_utf8(char c) + { + std::wstring result; + utf8_state state = s_start; + std::uint32_t codepoint = 0; + if ((state = decode(state, static_cast<std::uint8_t>(c), codepoint)) == + s_start) { + result += static_cast<std::wstring::value_type>(codepoint); + } else { + result += static_cast<std::wstring::value_type>(0xfffd); + } + + return result; + } +}; + +template <typename Char> +class unicode<Char, typename std::enable_if<(sizeof(Char) == 2)>::type> + : public unicode_helper +{ +public: + // UTF16 -> UTF8 + static std::string to_utf8(const std::wstring& str) + { + std::string result; + for (auto iter = str.begin(); iter != str.end(); ++iter) { + std::uint32_t c = *iter; + if (is_surrogate(c)) { + ++iter; + if (iter != str.end() && is_high_surrogate(c) && + is_low_surrogate(*iter)) { + append(result, (std::uint32_t(c) << 10) + *iter - 0x35fdc00); + } else { + append(result, 0xfffd); + if (iter == str.end()) { + break; + } + } + } else { + append(result, c); + } + } + return result; + } + static std::string to_utf8(Char c) + { + std::string result; + if (is_surrogate(c)) { + append(result, 0xfffd); + } else { + append(result, c); + } + return result; + } + + // UTF8 -> UTF16 + static std::wstring from_utf8(const std::string& str) + { + std::wstring result; + result.reserve(str.length()); + auto iter = str.begin(); + utf8_state state = s_start; + std::uint32_t codepoint = 0; + while (iter < str.end()) { + if ((state = decode(state, static_cast<std::uint8_t>(*iter++), + codepoint)) == s_start) { + if (codepoint <= 0xffff) { + result += static_cast<std::wstring::value_type>(codepoint); + } else { + codepoint -= 0x10000; + result += + static_cast<std::wstring::value_type>((codepoint >> 10) + 0xd800); + result += static_cast<std::wstring::value_type>((codepoint & 0x3ff) + + 0xdc00); + } + codepoint = 0; + } else if (state == s_reject) { + result += static_cast<std::wstring::value_type>(0xfffd); + state = s_start; + codepoint = 0; + } + } + if (state) { + result += static_cast<std::wstring::value_type>(0xfffd); + } + return result; + } + static std::wstring from_utf8(char c) + { + std::wstring result; + utf8_state state = s_start; + std::uint32_t codepoint = 0; + if ((state = decode(state, static_cast<std::uint8_t>(c), codepoint)) == + s_start) { + if (codepoint <= 0xffff) { + result += static_cast<std::wstring::value_type>(codepoint); + } else { + codepoint -= 0x10000; + result += + static_cast<std::wstring::value_type>((codepoint >> 10) + 0xd800); + result += + static_cast<std::wstring::value_type>((codepoint & 0x3ff) + 0xdc00); + } + } else { + result += static_cast<std::wstring::value_type>(0xfffd); + } + return result; + } +}; + +template <typename In, typename Out> +class unicode_converter; + +template <> +class unicode_converter<char, wchar_t> +{ +public: + std::wstring operator()(const std::string& in) + { + return unicode<wchar_t>::from_utf8(in); + } + std::wstring operator()(const char* in) + { + return unicode<wchar_t>::from_utf8(in); + } + std::wstring operator()(char in) { return unicode<wchar_t>::from_utf8(in); } +}; +template <> +class unicode_converter<wchar_t, char> +{ +public: + std::string operator()(const std::wstring& in) + { + return unicode<wchar_t>::to_utf8(in); + } + std::string operator()(const wchar_t* in) + { + return unicode<wchar_t>::to_utf8(in); + } + std::string operator()(wchar_t in) { return unicode<wchar_t>::to_utf8(in); } +}; +template <> +class unicode_converter<char, char> +{ +public: + std::string operator()(const std::string& in) { return in; } + std::string operator()(const char* in) { return std::string(in); } + std::string operator()(char in) { return std::string(1, in); } +}; +template <> +class unicode_converter<wchar_t, wchar_t> +{ +public: + std::wstring operator()(const std::wstring& in) { return in; } + std::wstring operator()(const wchar_t* in) { return std::wstring(in); } + std::wstring operator()(wchar_t in) { return std::wstring(1, in); } +}; + +template <typename In> +struct string_converter +{ +}; + +template <> +struct string_converter<char> +{ + // some compilers, like gcc 4.8 does not implement the following C++11 + // signature: + // std::string::string(const string&, const Allocator&) + // As workaround, use char* pointer. + template <typename Char, typename Traits, typename Alloc> + static std::basic_string<Char, Traits, Alloc> to(const std::string& in, + const Alloc& a) + { + return std::basic_string<Char, Traits, Alloc>( + unicode_converter<char, Char>()(in).c_str(), a); + } + template <typename Char, typename Traits, typename Alloc> + static std::basic_string<Char, Traits, Alloc> to(const char* in, + const Alloc& a) + { + return std::basic_string<Char, Traits, Alloc>( + unicode_converter<char, Char>()(in).c_str(), a); + } + template <typename Char, typename Traits, typename Alloc> + static std::basic_string<Char, Traits, Alloc> to(char in, const Alloc& a) + { + return std::basic_string<Char, Traits, Alloc>( + unicode_converter<char, Char>()(in).c_str(), a); + } + + template <typename Char> + static std::basic_string<Char> to(const std::string& in) + { + return std::basic_string<Char>(unicode_converter<char, Char>()(in)); + } + template <typename Char> + static std::basic_string<Char> to(const char* in) + { + return std::basic_string<Char>(unicode_converter<char, Char>()(in)); + } + template <typename Char> + static std::basic_string<Char> to(char in) + { + return std::basic_string<Char>(unicode_converter<char, Char>()(in)); + } +}; +template <> +struct string_converter<wchar_t> +{ + // some compilers, like gcc 4.8 does not implement the following C++11 + // signature: + // std::string::string(const string&, const Allocator&) + // As workaround, use char* pointer. + template <typename Char, typename Traits, typename Alloc> + static std::basic_string<Char, Traits, Alloc> to(const std::wstring& in, + const Alloc& a) + { + return std::basic_string<Char, Traits, Alloc>( + unicode_converter<wchar_t, Char>()(in).c_str(), a); + } + template <typename Char, typename Traits, typename Alloc> + static std::basic_string<Char, Traits, Alloc> to(const wchar_t* in, + const Alloc& a) + { + return std::basic_string<Char, Traits, Alloc>( + unicode_converter<wchar_t, Char>()(in).c_str(), a); + } + template <typename Char, typename Traits, typename Alloc> + static std::basic_string<Char, Traits, Alloc> to(wchar_t in, const Alloc& a) + { + return std::basic_string<Char, Traits, Alloc>( + unicode_converter<wchar_t, Char>()(in).c_str(), a); + } + + template <typename Char> + static std::basic_string<Char> to(const std::wstring& in) + { + return std::basic_string<Char>(unicode_converter<wchar_t, Char>()(in)); + } + template <typename Char> + static std::basic_string<Char> to(const wchar_t* in) + { + return std::basic_string<Char>(unicode_converter<wchar_t, Char>()(in)); + } + template <typename Char> + static std::basic_string<Char> to(wchar_t in) + { + return std::basic_string<Char>(unicode_converter<wchar_t, Char>()(in)); + } +}; + +template <typename T, typename = void> +struct source_traits +{ +}; + +template <typename T, std::size_t N> +struct source_traits<T[N]> +{ + using value_type = T; +}; + +template <typename Char, typename Traits, typename Alloc> +struct source_traits<std::basic_string<Char, Traits, Alloc>> +{ + using value_type = + typename std::basic_string<Char, Traits, Alloc>::value_type; +}; + +template <> +struct source_traits<cm::string_view> +{ + using value_type = cm::string_view::value_type; +}; + +# if CM_FILESYSTEM_SOURCE_TRAITS_ITERATOR +template <typename T> +struct source_traits<T, cm::enable_if_t<cm::is_iterator<T>::value, void>> +{ + using value_type = + typename std::iterator_traits<typename std::decay<T>::type>::value_type; +}; +# endif + +template <typename In, typename Out> +struct source_converter +{ +}; + +template <> +struct source_converter<char, char> +{ + template <typename Iterator> + static void append_range(std::string& p, Iterator b, Iterator e) + { + if (b == e) { + return; + } + p.append(b, e); + } + template <typename Iterator> + static void append_range(std::string& p, Iterator b) + { + char e = '\0'; + + if (*b == e) { + return; + } + for (; *b != e; ++b) { + p.push_back(*b); + } + } + + static void append_source(std::string& p, const cm::string_view s) + { + append_range(p, s.begin(), s.end()); + } + template <typename Traits, typename Alloc> + static void append_source(std::string& p, + const std::basic_string<char, Traits, Alloc>& s) + { + append_range(p, s.begin(), s.end()); + } + template <typename Source> + static void append_source(std::string& p, const Source& s) + { + append_range(p, s); + } + + static void set_source(std::string& p, std::string&& s) { p = std::move(s); } +}; + +template <> +struct source_converter<wchar_t, char> +{ + template <typename Iterator> + static void append_range(std::string& p, Iterator b, Iterator e) + { + if (b == e) { + return; + } + + std::wstring tmp(b, e); + std::string dest = string_converter<wchar_t>::to<char>(tmp); + p.append(dest.begin(), dest.end()); + } + template <typename Iterator> + static void append_range(std::string& p, Iterator b) + { + wchar_t e = '\0'; + + if (*b == e) { + return; + } + std::wstring tmp; + for (; *b != e; ++b) { + tmp.push_back(*b); + } + + std::string dest = string_converter<wchar_t>::to<char>(tmp); + p.append(dest.begin(), dest.end()); + } + + template <typename Traits, typename Alloc> + static void append_source(std::string& p, + const std::basic_string<wchar_t, Traits, Alloc>& s) + { + append_range(p, s.begin(), s.end()); + } + template <typename Source> + static void append_source(std::string& p, const Source& s) + { + append_range(p, s); + } + + static void set_source(std::string& p, std::wstring&& s) + { + p = string_converter<wchar_t>::to<char>(s); + } +}; + +template <typename T> +struct is_pathable_string : std::false_type +{ +}; +template <typename Traits, typename Alloc> +struct is_pathable_string<std::basic_string<char, Traits, Alloc>> + : std::true_type +{ +}; +template <typename Traits, typename Alloc> +struct is_pathable_string<std::basic_string<wchar_t, Traits, Alloc>> + : std::true_type +{ +}; +template <> +struct is_pathable_string<cm::string_view> : std::true_type +{ +}; + +template <typename T, typename = void> +struct is_pathable_char_array : std::false_type +{ +}; +template <typename T> +struct is_pathable_char_array< + T, + cm::enable_if_t< + std::is_same<char*, typename std::decay<T>::type>::value || + std::is_same<wchar_t*, typename std::decay<T>::type>::value, + void>> + : bool_constant<std::is_same<char*, typename std::decay<T>::type>::value || + std::is_same<wchar_t*, typename std::decay<T>::type>::value> +{ +}; + +template <typename T, typename = void> +struct is_pathable_iterator : std::false_type +{ +}; +template <typename T> +struct is_pathable_iterator< + T, + cm::enable_if_t< + is_input_iterator<T>::value && + (std::is_same<char, + typename std::iterator_traits< + typename std::decay<T>::type>::value_type>::value || + std::is_same<wchar_t, + typename std::iterator_traits< + typename std::decay<T>::type>::value_type>::value), + void>> + : bool_constant< + std::is_same<char, + typename std::iterator_traits< + typename std::decay<T>::type>::value_type>::value || + std::is_same<wchar_t, + typename std::iterator_traits< + typename std::decay<T>::type>::value_type>::value> +{ +}; + +# if defined(__SUNPRO_CC) && defined(__sparc) +// Oracle DeveloperStudio C++ compiler on Solaris/Sparc fails to compile +// the full 'is_pathable' check. We use it only to improve error messages +// via 'enable_if' when calling methods with incorrect types. Just +// pretend all types are allowed so we can at least compile valid code. +template <typename T> +struct is_pathable : std::true_type +{ +}; +# else +template <typename T> +struct is_pathable + : bool_constant<is_pathable_string<T>::value || + is_pathable_char_array<T>::value || + is_pathable_iterator<T>::value> +{ +}; +# endif +} + +class path +{ + using path_type = std::string; + + template <typename Source> + using enable_if_pathable = + enable_if_t<internals::is_pathable<Source>::value, path&>; + + enum class filename_fragment : unsigned char + { + stem, + extension + }; + +public: +# if defined(_WIN32) + using value_type = wchar_t; +# else + using value_type = char; +# endif + using string_type = std::basic_string<value_type>; + + class iterator; + using const_iterator = iterator; + + enum format : unsigned char + { + auto_format, + native_format, + generic_format + }; + +# if defined(_WIN32) + static constexpr value_type preferred_separator = L'\\'; +# else + static constexpr value_type preferred_separator = '/'; +# endif + + // Constructors + // ============ + path() noexcept {} + path(const path& p) + : path_(p.path_) + { + } + path(path&& p) noexcept + : path_(std::move(p.path_)) + { + } + path(string_type&& source, format fmt = auto_format) + { + (void)fmt; + internals::source_converter<value_type, path_type::value_type>::set_source( + this->path_, std::move(source)); + } + template <typename Source, typename = enable_if_pathable<Source>> + path(const Source& source, format fmt = auto_format) + { + (void)fmt; + internals::source_converter< + typename internals::source_traits<Source>::value_type, + path_type::value_type>::append_source(this->path_, source); + } + template <typename Iterator, typename = enable_if_pathable<Iterator>> + path(const Iterator first, Iterator last, format fmt = auto_format) + { + (void)fmt; + internals::source_converter< + typename std::iterator_traits<Iterator>::value_type, + path_type::value_type>::append_range(this->path_, first, last); + } + + ~path() = default; + + // Assignments + // =========== + path& operator=(const path& p) + { + if (this != &p) { + this->path_ = p.path_; + } + return *this; + } + path& operator=(path&& p) noexcept + { + if (this != &p) { + this->path_ = std::move(p.path_); + } + return *this; + } + path& operator=(string_type&& source) { return this->assign(source); } + template <typename Source, typename = enable_if_pathable<Source>> + path& operator=(const Source& source) + { + return this->assign(source); + } + + path& assign(string_type&& source) + { + internals::source_converter<value_type, path_type::value_type>::set_source( + this->path_, std::move(source)); + return *this; + } + template <typename Source, typename = enable_if_pathable<Source>> + path& assign(const Source& source) + { + this->path_.clear(); + internals::source_converter< + typename internals::source_traits<Source>::value_type, + path_type::value_type>::append_source(this->path_, source); + return *this; + } + template <typename Iterator, typename = enable_if_pathable<Iterator>> + path& assign(Iterator first, Iterator last) + { + this->path_.clear(); + internals::source_converter< + typename std::iterator_traits<Iterator>::value_type, + path_type::value_type>::append_range(this->path_, first, last); + return *this; + } + + // Concatenation + // ============= + path& operator/=(const path& p); + + template <typename Source, typename = enable_if_pathable<Source>> + path& append(const Source& source) + { + return this->operator/=(path(source)); + } + template <typename Source> + path& operator/=(const Source& source) + { + return this->append(source); + } + + template <typename Iterator, typename = enable_if_pathable<Iterator>> + path& append(Iterator first, Iterator last) + { + return this->operator/=(path(first, last)); + } + + path& operator+=(const path& p) + { + this->path_ += p.path_; + return *this; + } + path& operator+=(const string_type& str) + { + this->path_ += + internals::string_converter<value_type>::to<path_type::value_type>(str); + return *this; + } + path& operator+=(cm::string_view str) + { + this->path_.append(str.begin(), str.end()); + return *this; + } + path& operator+=(const value_type* str) + { + this->path_ += + internals::string_converter<value_type>::to<path_type::value_type>(str); + return *this; + } + path& operator+=(const value_type c) + { + this->path_ += + internals::string_converter<value_type>::to<path_type::value_type>(c); + return *this; + } + template <typename Source, typename = enable_if_pathable<Source>> + path& concat(const Source& source) + { + internals::source_converter< + typename internals::source_traits<Source>::value_type, + path_type::value_type>::append_source(this->path_, source); + return *this; + } + template <typename Source> + path& operator+=(const Source& source) + { + return this->concat(source); + } + template <typename Iterator, typename = enable_if_pathable<Iterator>> + path& concat(Iterator first, Iterator last) + { + internals::source_converter< + typename std::iterator_traits<Iterator>::value_type, + path_type::value_type>::append_range(this->path_, first, last); + return *this; + } + + // Modifiers + // ========= + void clear() noexcept { this->path_.clear(); } + + path& make_preferred() + { +# if defined(_WIN32) + std::replace( + this->path_.begin(), this->path_.end(), '/', + static_cast<path_type::value_type>(this->preferred_separator)); +# endif + return *this; + } + + path& remove_filename() + { + auto fname = this->get_filename(); + if (!fname.empty()) { + this->path_.erase(fname.data() - this->path_.data()); + } + return *this; + } + + path& replace_filename(const path& replacement) + { + this->remove_filename(); + this->operator/=(replacement); + return *this; + } + + path& replace_extension(const path& replacement = path()) + { + auto ext = this->get_filename_fragment(filename_fragment::extension); + if (!ext.empty()) { + this->path_.erase(ext.data() - this->path_.data()); + } + if (!replacement.path_.empty()) { + if (replacement.path_[0] != '.') { + this->path_ += '.'; + } + this->path_.append(replacement.path_); + } + return *this; + } + + void swap(path& other) noexcept { this->path_.swap(other.path_); } + + // Format observers + // ================ + const string_type& native() const noexcept + { +# if defined(_WIN32) + this->native_path_ = internals::string_converter< + path_type::value_type>::to<string_type::value_type>(this->path_); + return this->native_path_; +# else + return this->path_; +# endif + } + const value_type* c_str() const noexcept { return this->native().c_str(); } + operator string_type() const { return this->native(); } + + template < + typename Char, typename Traits = std::char_traits<Char>, + typename Alloc = std::allocator<Char>, + cm::enable_if_t<(std::is_same<Char, char>::value && + std::is_same<Traits, std::char_traits<char>>::value) || + (std::is_same<Char, wchar_t>::value && + std::is_same<Traits, std::char_traits<wchar_t>>::value), + int> = 1> + std::basic_string<Char, Traits, Alloc> string(const Alloc& a = Alloc()) const + { + return internals::string_converter<path_type::value_type>::to<Char, Traits, + Alloc>( + this->path_, a); + } + const std::string string() const { return this->path_; } + std::wstring wstring() const + { + std::string out = this->string(); + return internals::string_converter<path_type::value_type>::to< + std::wstring::value_type>(out); + } + + template < + typename Char, typename Traits = std::char_traits<Char>, + typename Alloc = std::allocator<Char>, + cm::enable_if_t<(std::is_same<Char, char>::value && + std::is_same<Traits, std::char_traits<char>>::value) || + (std::is_same<Char, wchar_t>::value && + std::is_same<Traits, std::char_traits<wchar_t>>::value), + int> = 1> + std::basic_string<Char, Traits, Alloc> generic_string( + const Alloc& a = Alloc()) const + { + return internals::string_converter<path_type::value_type>::to<Char, Traits, + Alloc>( + this->get_generic(), a); + } + std::string generic_string() const { return this->get_generic(); } + std::wstring generic_wstring() const + { + auto dest = this->generic_string(); + return internals::string_converter<path_type::value_type>::to< + std::wstring::value_type>(dest); + } + + // Compare + // ======= + int compare(const path& p) const noexcept + { + return this->compare_path(p.path_); + } + int compare(const string_type& str) const + { + return this->compare_path( + internals::string_converter<value_type>::to<path_type::value_type>(str)); + } + int compare(const value_type* str) const + { + return this->compare_path( + internals::string_converter<value_type>::to<path_type::value_type>(str)); + } + int compare(cm::string_view str) const { return this->compare_path(str); } + + // Generation + // ========== + path lexically_normal() const; + + path lexically_relative(const path& base) const; + + path lexically_proximate(const path& base) const + { + path result = this->lexically_relative(base); + return result.empty() ? *this : result; + } + + // Decomposition + // ============= + path root_name() const { return get_root_name(); } + + path root_directory() const { return this->get_root_directory(); } + + path root_path() const + { + return this->root_name().append(this->get_root_directory()); + } + + path relative_path() const { return this->get_relative_path(); } + + path parent_path() const { return this->get_parent_path(); } + + path filename() const { return this->get_filename(); } + + path stem() const + { + return this->get_filename_fragment(filename_fragment::stem); + } + path extension() const + { + return this->get_filename_fragment(filename_fragment::extension); + } + + // Queries + // ======= + bool empty() const noexcept { return this->path_.empty(); } + + bool has_root_name() const { return !this->get_root_name().empty(); } + + bool has_root_directory() const + { + return !this->get_root_directory().empty(); + } + + bool has_root_path() const + { + return this->has_root_name() || this->has_root_directory(); + } + + bool has_relative_path() const { return !this->get_relative_path().empty(); } + + bool has_parent_path() const { return !this->get_parent_path().empty(); } + + bool has_filename() const { return !this->get_filename().empty(); } + + bool has_stem() const + { + return !this->get_filename_fragment(filename_fragment::stem).empty(); + } + bool has_extension() const + { + return !this->get_filename_fragment(filename_fragment::extension).empty(); + } + + bool is_absolute() const + { +# if defined(_WIN32) + return this->has_root_name() && this->has_root_directory(); +# else + return this->has_root_directory(); +# endif + } + + bool is_relative() const { return !this->is_absolute(); } + + // Iterators + // ========= + inline iterator begin() const; + inline iterator end() const; + + // Non-members + // =========== + friend inline bool operator==(const path& lhs, const path& rhs) noexcept + { + return lhs.compare(rhs) == 0; + } + friend inline bool operator!=(const path& lhs, const path& rhs) noexcept + { + return lhs.compare(rhs) != 0; + } + friend inline bool operator<(const path& lhs, const path& rhs) noexcept + { + return lhs.compare(rhs) < 0; + } + friend inline bool operator<=(const path& lhs, const path& rhs) noexcept + { + return lhs.compare(rhs) <= 0; + } + friend inline bool operator>(const path& lhs, const path& rhs) noexcept + { + return lhs.compare(rhs) > 0; + } + friend inline bool operator>=(const path& lhs, const path& rhs) noexcept + { + return lhs.compare(rhs) >= 0; + } + + friend inline path operator/(const path& lhs, const path& rhs) + { + path result(lhs); + result /= rhs; + + return result; + } + + template <typename Char, typename Traits> + friend inline cm::enable_if_t< + (std::is_same<Char, path::value_type>::value && + std::is_same<Traits, std::char_traits<path::value_type>>::value) || + (std::is_same<Char, path::path_type::value_type>::value && + std::is_same<Traits, + std::char_traits<path::path_type::value_type>>::value), + std::basic_ostream<Char, Traits>&> + operator<<(std::basic_ostream<Char, Traits>& os, const path& p) + { + os << cm::quoted(p.string<Char, Traits>()); + return os; + } + + template <typename Char, typename Traits> + friend inline cm::enable_if_t< + (std::is_same<Char, path::value_type>::value && + std::is_same<Traits, std::char_traits<path::value_type>>::value) || + (std::is_same<Char, path::path_type::value_type>::value && + std::is_same<Traits, + std::char_traits<path::path_type::value_type>>::value), + std::basic_istream<Char, Traits>&> + operator>>(std::basic_istream<Char, Traits>& is, path& p) + { + std::basic_string<Char, Traits> tmp; + is >> cm::quoted(tmp); + p = tmp; + return is; + } + +private: + friend class iterator; + friend std::size_t hash_value(const path& p) noexcept; + + path_type get_generic() const; + + cm::string_view get_root_name() const; + cm::string_view get_root_directory() const; + cm::string_view get_relative_path() const; + cm::string_view get_parent_path() const; + cm::string_view get_filename() const; + cm::string_view get_filename_fragment(filename_fragment fragment) const; + + int compare_path(cm::string_view str) const; + + path_type path_; +# if defined(_WIN32) + mutable string_type native_path_; +# endif +}; + +class path::iterator +{ +public: + using iterator_category = std::bidirectional_iterator_tag; + + using value_type = path; + using difference_type = std::ptrdiff_t; + using pointer = const path*; + using reference = const path&; + + iterator(); + iterator(const iterator& other); + + ~iterator(); + + iterator& operator=(const iterator& other); + + reference operator*() const { return this->path_element_; } + + pointer operator->() const { return &this->path_element_; } + + iterator& operator++(); + + iterator operator++(int) + { + iterator it(*this); + this->operator++(); + return it; + } + + iterator& operator--(); + + iterator operator--(int) + { + iterator it(*this); + this->operator--(); + return it; + } + +private: + friend class path; + friend bool operator==(const iterator&, const iterator&); + + iterator(const path* p, bool at_end = false); + + const path* path_; + std::unique_ptr<internals::path_parser> parser_; + path path_element_; +}; + +inline path::iterator path::begin() const +{ + return iterator(this); +} +inline path::iterator path::end() const +{ + return iterator(this, true); +} + +bool operator==(const path::iterator& lhs, const path::iterator& rhs); + +inline bool operator!=(const path::iterator& lhs, const path::iterator& rhs) +{ + return !(lhs == rhs); +} + +// Non-member functions +// ==================== +inline void swap(path& lhs, path& rhs) noexcept +{ + lhs.swap(rhs); +} + +std::size_t hash_value(const path& p) noexcept; + +#endif + +} // namespace filesystem +} // namespace cm + +#endif diff --git a/Utilities/std/cm/iomanip b/Utilities/std/cm/iomanip new file mode 100644 index 0000000..6f68530 --- /dev/null +++ b/Utilities/std/cm/iomanip @@ -0,0 +1,183 @@ +// -*-c++-*- +// vim: set ft=cpp: + +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#ifndef cm_iomanip +#define cm_iomanip + +#include <iomanip> // IWYU pragma: export +#if __cplusplus < 201402L || defined(_MSVC_LANG) && _MSVC_LANG < 201402L +# include <ios> +# include <iostream> +# include <sstream> +# include <string> +# include <type_traits> +#endif +#if __cplusplus < 201703L || defined(_MSVC_LANG) && _MSVC_LANG < 201703L +# include <cm/string_view> +#endif + +namespace cm { + +#if __cplusplus >= 201402L || defined(_MSVC_LANG) && _MSVC_LANG >= 201402L + +using std::quoted; + +# if __cplusplus < 201703L || defined(_MSVC_LANG) && _MSVC_LANG < 201703L + +inline auto quoted(cm::string_view str, char delim = '"', char escape = '\\') +{ + return std::quoted(static_cast<std::string>(str), delim, escape); +} + +# endif + +#else + +namespace internals { + +// Struct for delimited strings. +template <typename String, typename Char> +struct quoted_string +{ + static_assert(std::is_reference<String>::value || + std::is_pointer<String>::value, + "String type must be pointer or reference"); + + quoted_string(String str, Char del, Char esc) + : string_(str) + , delim_{ del } + , escape_{ esc } + { + } + + quoted_string& operator=(quoted_string&) = delete; + + String string_; + Char delim_; + Char escape_; +}; + +template <> +struct quoted_string<cm::string_view, char> +{ + quoted_string(cm::string_view str, char del, char esc) + : string_(str) + , delim_{ del } + , escape_{ esc } + { + } + + quoted_string& operator=(quoted_string&) = delete; + + cm::string_view string_; + char delim_; + char escape_; +}; + +template <typename Char, typename Traits> +std::basic_ostream<Char, Traits>& operator<<( + std::basic_ostream<Char, Traits>& os, + const quoted_string<const Char*, Char>& str) +{ + std::basic_ostringstream<Char, Traits> ostr; + ostr << str.delim_; + for (const Char* c = str.string_; *c; ++c) { + if (*c == str.delim_ || *c == str.escape_) + ostr << str.escape_; + ostr << *c; + } + ostr << str.delim_; + + return os << ostr.str(); +} + +template <typename Char, typename Traits, typename String> +std::basic_ostream<Char, Traits>& operator<<( + std::basic_ostream<Char, Traits>& os, const quoted_string<String, Char>& str) +{ + std::basic_ostringstream<Char, Traits> ostr; + ostr << str.delim_; + for (auto c : str.string_) { + if (c == str.delim_ || c == str.escape_) + ostr << str.escape_; + ostr << c; + } + ostr << str.delim_; + + return os << ostr.str(); +} + +template <typename Char, typename Traits, typename Alloc> +std::basic_istream<Char, Traits>& operator>>( + std::basic_istream<Char, Traits>& is, + const quoted_string<std::basic_string<Char, Traits, Alloc>&, Char>& str) +{ + Char c; + is >> c; + if (!is.good()) + return is; + if (c != str.delim_) { + is.unget(); + is >> str.string_; + return is; + } + str.string_.clear(); + std::ios_base::fmtflags flags = + is.flags(is.flags() & ~std::ios_base::skipws); + do { + is >> c; + if (!is.good()) + break; + if (c == str.escape_) { + is >> c; + if (!is.good()) + break; + } else if (c == str.delim_) + break; + str.string_ += c; + } while (true); + is.setf(flags); + + return is; +} +} + +template <typename Char> +inline internals::quoted_string<const Char*, Char> quoted( + const Char* str, Char delim = Char('"'), Char escape = Char('\\')) +{ + return internals::quoted_string<const Char*, Char>(str, delim, escape); +} + +template <typename Char, typename Traits, typename Alloc> +inline internals::quoted_string<const std::basic_string<Char, Traits, Alloc>&, + Char> +quoted(const std::basic_string<Char, Traits, Alloc>& str, + Char delim = Char('"'), Char escape = Char('\\')) +{ + return internals::quoted_string< + const std::basic_string<Char, Traits, Alloc>&, Char>(str, delim, escape); +} + +template <typename Char, typename Traits, typename Alloc> +inline internals::quoted_string<std::basic_string<Char, Traits, Alloc>&, Char> +quoted(std::basic_string<Char, Traits, Alloc>& str, Char delim = Char('"'), + Char escape = Char('\\')) +{ + return internals::quoted_string<std::basic_string<Char, Traits, Alloc>&, + Char>(str, delim, escape); +} + +inline internals::quoted_string<cm::string_view, char> quoted( + cm::string_view str, char delim = '"', char escape = '\\') +{ + return internals::quoted_string<cm::string_view, char>(str, delim, escape); +} + +#endif + +} // namespace cm + +#endif diff --git a/Utilities/std/cm/memory b/Utilities/std/cm/memory index dd0f822..5611f6b 100644 --- a/Utilities/std/cm/memory +++ b/Utilities/std/cm/memory @@ -6,7 +6,10 @@ #ifndef cm_memory #define cm_memory +#include "cmSTL.hxx" // IWYU pragma: keep + #include <memory> // IWYU pragma: export + #if !defined(CMake_HAVE_CXX_MAKE_UNIQUE) # include <cstddef> # include <type_traits> diff --git a/Utilities/std/cmSTL.hxx.in b/Utilities/std/cmSTL.hxx.in new file mode 100644 index 0000000..9c8605c --- /dev/null +++ b/Utilities/std/cmSTL.hxx.in @@ -0,0 +1,10 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#ifndef cmSTL_hxx +#define cmSTL_hxx + +/* Whether CMake is using its own STL implementation. */ +#cmakedefine CMake_HAVE_CXX_MAKE_UNIQUE +#cmakedefine CMake_HAVE_CXX_FILESYSTEM + +#endif @@ -432,6 +432,7 @@ CMAKE_CXX_SOURCES="\ cmSiteNameCommand \ cmSourceFile \ cmSourceFileLocation \ + cmStandardLevelResolver \ cmState \ cmStateDirectory \ cmStateSnapshot \ @@ -478,6 +479,7 @@ if ${cmake_system_mingw}; then fi CMAKE_STD_CXX_HEADERS="\ + filesystem \ memory \ optional \ shared_mutex \ @@ -485,6 +487,7 @@ CMAKE_STD_CXX_HEADERS="\ utility \ " CMAKE_STD_CXX_SOURCES="\ + fs_path \ string_view \ " @@ -631,6 +634,8 @@ Configuration: --system-libuv use system-installed libuv library --no-system-libuv use cmake-provided libuv library (default) + --bootstrap-system-libuv use system-installed libuv library for boostrap + --qt-gui build the Qt-based GUI (requires Qt >= 4.2) --no-qt-gui do not build the Qt-based GUI (default) --qt-qmake=<qmake> use <qmake> as the qmake executable to find Qt @@ -853,6 +858,7 @@ cmake_verbose= cmake_parallel_make= cmake_ccache_enabled= cmake_prefix_dir="${cmake_default_prefix}" +bootstrap_system_libuv= while test $# != 0; do case "$1" in --prefix=*) dir=`cmake_arg "$1"` @@ -872,6 +878,7 @@ while test $# != 0; do --no-system-bzip2|--no-system-curl|--no-system-expat|--no-system-jsoncpp|--no-system-libarchive|--no-system-librhash|--no-system-zlib|--no-system-liblzma|--no-system-zstd|--no-system-libuv) lib=`cmake_arg "$1" "--no-system-"` cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper $lib`=0" ;; + --bootstrap-system-libuv) bootstrap_system_libuv="1" ;; --qt-gui) cmake_bootstrap_qt_gui="1" ;; --no-qt-gui) cmake_bootstrap_qt_gui="0" ;; --qt-qmake=*) cmake_bootstrap_qt_qmake=`cmake_arg "$1"` ;; @@ -1247,7 +1254,7 @@ echo "C++ compiler on this system is: ${cmake_cxx_compiler} ${cmake_cxx_flags}" #----------------------------------------------------------------------------- # Test CXX features -cmake_cxx_features="make_unique" +cmake_cxx_features="make_unique filesystem" for feature in ${cmake_cxx_features}; do eval "cmake_have_cxx_${feature}=0" @@ -1267,6 +1274,9 @@ for feature in ${cmake_cxx_features}; do fi done +cmake_generate_file "${cmake_bootstrap_dir}/cmSTL.hxx" "" + + #----------------------------------------------------------------------------- # Test Make @@ -1487,9 +1497,11 @@ objs="" for a in ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES} ${CMAKE_STD_CXX_SOURCES} ${LexerParser_CXX_SOURCES} ${LexerParser_C_SOURCES} ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES}; do objs="${objs} ${a}.o" done -for a in ${LIBUV_C_SOURCES}; do - objs="${objs} uv-`cmake_obj ${a}`" -done +if test "x${bootstrap_system_libuv}" = "x"; then + for a in ${LIBUV_C_SOURCES}; do + objs="${objs} uv-`cmake_obj ${a}`" + done +fi libs="" @@ -1527,14 +1539,20 @@ else ;; esac fi -uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/include"`" -if ${cmake_system_mingw}; then - uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/src/win"`" +if test "x${bootstrap_system_libuv}" = "x"; then + uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/include"`" + if ${cmake_system_mingw}; then + uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/src/win"`" + else + uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/src/unix"`" + fi + uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/src"`" else - uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/src/unix"`" + if test `which pkg-config`; then + uv_c_flags="${uv_c_flags} `pkg-config --cflags libuv`" + fi + libs="${libs} -luv" fi -uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/src"`" - if test "x${cmake_ansi_cxx_flags}" != "x"; then cmake_cxx_flags="${cmake_ansi_cxx_flags} ${cmake_cxx_flags}" fi @@ -1616,11 +1634,13 @@ for a in ${KWSYS_CXX_SOURCES}; do echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile" echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} -DKWSYS_NAMESPACE=cmsys ${src_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile" done -for a in ${LIBUV_C_SOURCES}; do - src=`cmake_escape "${cmake_source_dir}/Utilities/cmlibuv/${a}"` - echo "uv-`cmake_obj ${a}` : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile" - echo " ${cmake_c_compiler} ${cmake_c_flags} ${uv_c_flags} -c ${src} -o uv-`cmake_obj ${a}`" >> "${cmake_bootstrap_dir}/Makefile" -done +if test "x${bootstrap_system_libuv}" = "x"; then + for a in ${LIBUV_C_SOURCES}; do + src=`cmake_escape "${cmake_source_dir}/Utilities/cmlibuv/${a}"` + echo "uv-`cmake_obj ${a}` : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile" + echo " ${cmake_c_compiler} ${cmake_c_flags} ${uv_c_flags} -c ${src} -o uv-`cmake_obj ${a}`" >> "${cmake_bootstrap_dir}/Makefile" + done +fi echo ' rebuild_cache: cd "${cmake_binary_dir}" && "${cmake_source_dir}/bootstrap" |