diff options
86 files changed, 579 insertions, 412 deletions
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 66d3049..2e369e3 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -397,9 +397,10 @@ Variables for Languages /variable/CMAKE_LANG_COMPILER_EXTERNAL_TOOLCHAIN /variable/CMAKE_LANG_COMPILER_ID /variable/CMAKE_LANG_COMPILER_LOADED + /variable/CMAKE_LANG_COMPILER_PREDEFINES_COMMAND /variable/CMAKE_LANG_COMPILER_TARGET /variable/CMAKE_LANG_COMPILER_VERSION - /variable/CMAKE_LANG_COMPILER_PREDEFINES_COMMAND + /variable/CMAKE_LANG_COMPILER_VERSION_INTERNAL /variable/CMAKE_LANG_COMPILE_OBJECT /variable/CMAKE_LANG_CREATE_SHARED_LIBRARY /variable/CMAKE_LANG_CREATE_SHARED_MODULE diff --git a/Help/release/3.10.rst b/Help/release/3.10.rst new file mode 100644 index 0000000..2e32401 --- /dev/null +++ b/Help/release/3.10.rst @@ -0,0 +1,266 @@ +CMake 3.10 Release Notes +************************ + +.. only:: html + + .. contents:: + +Changes made since CMake 3.9 include the following. + +New Features +============ + +Platforms +--------- + +* The `flang`_ Fortran compiler is now supported, with compiler id ``Flang``. + +* A new minimal platform file for ``Midipix`` was added. + +* Support for the MSVC ARM64 architecture was added. + Visual Studio 2017 Update 4 and above offer an ARM64 toolchain. + +* Support for the IAR ARM Compiler was improved. + +.. _`flang`: https://github.com/flang-compiler/flang + +Generators +---------- + +* The :ref:`Makefile Generators` and the :generator:`Ninja` generator learned + to add compiler launcher tools like ccache along with the compiler for the + ``CUDA`` language (``C`` and ``CXX`` were supported previously). See the + :variable:`CMAKE_<LANG>_COMPILER_LAUNCHER` variable and + :prop_tgt:`<LANG>_COMPILER_LAUNCHER` target property for details. + +* The :generator:`CodeBlocks` extra generator learned to optionally exclude + files from outside the project root directory from the generated project. + See the :variable:`CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES` variable. + +Commands +-------- + +* The :command:`cmake_host_system_information` command learned more keys + to get information about the processor capabilities and the host OS + version. + +* The :command:`configure_file` command learned to support indented + ``# cmakedefine`` and ``# cmakedefine01``. Spaces and/or tabs between + the ``#`` character and the ``cmakedefine``/``cmakedefine01`` words + are now understood and preserved in the output. + +* The :command:`execute_process` command gained a ``RESULTS_VARIABLE`` + option to collect a list of results from all children in a pipeline + of processes when multiple ``COMMAND`` arguments are given. + +* The :command:`include_guard` command was introduced to allow guarding + CMake scripts from being included more than once. The command supports + ``DIRECTORY`` and ``GLOBAL`` options to adjust the corresponding include guard + scope. If no options given, include guard is similar to basic variable-based + check. + +* The :command:`string` command learned a new ``PREPEND`` subcommand. + +* The :command:`string(TIMESTAMP)` command now supports ``%A`` + for full weekday name and ``%B`` for full month name. + +Variables +--------- + +* A :variable:`CMAKE_DIRECTORY_LABELS` variable was added to specify + labels for all tests in a directory. + +Properties +---------- + +* A :prop_tgt:`<LANG>_CPPCHECK` target property and supporting + :variable:`CMAKE_<LANG>_CPPCHECK` variable were introduced to tell + the :ref:`Makefile Generators` and the :generator:`Ninja` generator to + run ``cppcheck`` with the compiler for ``C`` and ``CXX`` languages. + +* A :prop_dir:`LABELS` directory property was added to specify labels + for all targets and tests in a directory. + +* A :prop_dir:`TEST_INCLUDE_FILES` directory property was added to + list any number of files to be included when running tests with + :manual:`ctest(1)`. This generalizes the :prop_dir:`TEST_INCLUDE_FILE` + property. + +* The :prop_tgt:`VS_DOTNET_REFERENCEPROP_<refname>_TAG_<tagname>` + target property was added to support custom XML tags for reference + assemblies in C# targets. + +* Source file properties :prop_sf:`VS_SHADER_OUTPUT_HEADER_FILE` and + :prop_sf:`VS_SHADER_VARIABLE_NAME` have been added to specify more + details of ``.hlsl`` sources with :ref:`Visual Studio Generators`. + +Modules +------- + +* The :module:`FindCurses` module gained a ``CURSES_NEED_WIDE`` option + to request the wide-character variant. + +* The :module:`FindEXPAT` module now provides imported targets. + +* The :module:`FindFreetype` module now provides imported targets. + +* :module:`FindMPI` gained a number of new features, including: + + * Language-specific components have been added to the module. + * Many more MPI environments are now supported. + * The environmental support for Fortran has been improved. + * A user now has fine-grained control over the MPI selection process, + including passing custom parameters to the MPI compiler. + * The version of the implemented MPI standard is now being exposed. + * MPI-2 C++ bindings can now be detected and also suppressed if so desired. + * The available Fortran bindings are now being detected and verified. + * Various MPI-3 information can be requested, including the library version + and Fortran capabilities of the individual bindings. + * Statically linked MPI implementations are supported. + +* A :module:`FindOpenACC` module was added to detect compiler support + for OpenACC. Currently only supports PGI, GNU and Cray compilers. + +* The :module:`FindOpenGL` module gained support for GLVND on Linux. + +* The :module:`FindOpenMP` module gained support for + language-specific components. + +* A :module:`FindPatch` module was added to find the ``patch`` + command-line executable. + +* The :module:`FindProtobuf` module :command:`protobuf_generate_cpp` command + gained a ``DESCRIPTORS`` option to generate descriptor files. + +* The :module:`GoogleTest` module gained a new command + :command:`gtest_discover_tests` implementing dynamic (build-time) test + discovery. Unlike the source parsing approach, dynamic discovery executes + the test (in 'list available tests' mode) at build time to discover tests. + This is robust against unusual ways of labeling tests, provides much better + support for advanced features such as parameterized tests, and does not + require re-running CMake to discover added or removed tests within a test + executable. + +* The :module:`InstallRequiredSystemLibraries` module gained support + for installing Intel compiler runtimes. + +Autogen +------- + +* When using :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC` with a + multi configuration generator (e.g. :generator:`Xcode`), + included ``*.moc``, ``moc_*.cpp`` and ``ui_*.h`` files are generated in + ``<AUTOGEN_BUILD_DIR>/include_<CONFIG>`` instead of + ``<AUTOGEN_BUILD_DIR>/include``. + +* When using :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC`, + source files that are :prop_sf:`GENERATED` will be processed as well. + They were ignored by :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` + in earlier releases. + See policy :policy:`CMP0071`. + +* When using :prop_tgt:`AUTOMOC`, CMake searches for the strings ``Q_OBJECT``, + ``Q_GADGET`` or ``Q_NAMESPACE`` in a source file to determine if it needs + to be ``moc`` processed. The new variable + :variable:`CMAKE_AUTOMOC_MACRO_NAMES` allows to register additional + strings (macro names) so search for. + +* When using :prop_tgt:`AUTOMOC`, CMake searches for the strings ``Q_OBJECT``, + ``Q_GADGET`` or ``Q_NAMESPACE`` in a source file to determine if it needs + to be ``moc`` processed. The new target property + :prop_tgt:`AUTOMOC_MACRO_NAMES` allows to register additional strings + (macro names) so search for. + +* When using :prop_tgt:`AUTOMOC`, the new variable + :variable:`CMAKE_AUTOMOC_COMPILER_PREDEFINES` allows to default + enable or disable the generation of the compiler pre definitions file + ``moc_predefs.h``. + +* When using :prop_tgt:`AUTOMOC`, the new boolean target property + :prop_tgt:`AUTOMOC_COMPILER_PREDEFINES` allows to enable or disable the + generation of the compiler pre definitions file ``moc_predefs.h``. + +CTest +----- + +* A :variable:`CTEST_LABELS_FOR_SUBPROJECTS` CTest module variable and CTest + script variable were added to specify a list of labels that should be + treated as subprojects by CDash. To use this value in both the CTest module + and the ctest command line :ref:`Dashboard Client` mode (e.g. ``ctest -S``) + set it in the ``CTestConfig.cmake`` config file. + +CPack +----- + +* CPack gained a ``FREEBSD`` generator for FreeBSD ``pkg(8)``, configured + by the :module:`CPackFreeBSD` module. + +* The CPack ``DEB`` generator, configured by the :module:`CPackDeb` module, + was enabled on Windows. While not fully featured (due to the lack of + external UNIX tools) this will allow building basic cross-platform Debian + packages. + +* The :module:`CPackDeb` module learned to set package release version in + ``Version`` info property. + See the :variable:`CPACK_DEBIAN_PACKAGE_RELEASE` variable. + +* The :module:`CPackDeb` module learned more strict package version checking + that complies with Debian rules. + +* The :module:`CPackIFW` module :command:`cpack_ifw_configure_component` and + :command:`cpack_ifw_configure_component_group` commands gained a new + ``REPLACES`` and ``CHECKABLE`` options. + +* The :module:`CPackIFW` module gained new + :variable:`CPACK_IFW_PACKAGE_FILE_EXTENSION` variable to customize + target binary format. + +* The :module:`CPackIFW` module gained new + :variable:`CPACK_IFW_REPOSITORIES_DIRECTORIES` variable to specify + additional repositories dirs that will be used to resolve and + repack dependent components. This feature available only + since QtIFW 3.1. + +* Modules :module:`CPackRPM` and :module:`CPackDeb` learned to set package epoch + version. + See :variable:`CPACK_RPM_PACKAGE_EPOCH` and + :variable:`CPACK_DEBIAN_PACKAGE_EPOCH` variables. + +Other +----- + +* The :manual:`cmake(1)` ``-E`` mode gained support for ``sha1sum``, + ``sha224sum``, ``sha256sum``, ``sha384sum``, and ``sha512sum``. + +* The graphviz output now distinguishes among the different dependency types + ``PUBLIC``, ``PRIVATE`` and ``INTERFACE`` and represents them in the output + graph as solid, dashed and dotted edges. + +Deprecated and Removed Features +=============================== + +* Support for building CMake itself with C++98 compilers was dropped. + CMake is now implemented using C++11. + +* Support for building CMake on HP-UX has been dropped pending better + support for C++11 and a port of libuv. See `CMake Issue 17137`_. + Use CMake 3.9 or lower instead for HP-UX support. + +.. _`CMake Issue 17137`: https://gitlab.kitware.com/cmake/cmake/issues/17137 + +Other Changes +============= + +* On FreeBSD the C++ compiler named ``c++`` is now the preferred default. + +* The :command:`file(GENERATE)` command now interprets relative paths + given to its ``OUTPUT`` and ``INPUT`` arguments with respect to the + caller's current binary and source directories, respectively. + See policy :policy:`CMP0070`. + +* The :command:`get_filename_component` ``PROGRAM`` mode semantics + have been revised to not tolerate unquoted spaces in the path + to the program while also accepting arguments. While technically + incompatible with the old behavior, it is expected that behavior + under typical use cases with properly-quoted command-lines has + not changed. diff --git a/Help/release/dev/0-sample-topic.rst b/Help/release/dev/0-sample-topic.rst deleted file mode 100644 index e4cc01e..0000000 --- a/Help/release/dev/0-sample-topic.rst +++ /dev/null @@ -1,7 +0,0 @@ -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/FindCurses-wide.rst b/Help/release/dev/FindCurses-wide.rst deleted file mode 100644 index 63fb671..0000000 --- a/Help/release/dev/FindCurses-wide.rst +++ /dev/null @@ -1,5 +0,0 @@ -FindCurses-wide ---------------- - -* The :module:`FindCurses` module gained a ``CURSES_NEED_WIDE`` option - to request the wide-character variant. diff --git a/Help/release/dev/FindEXPAT-importedtargets.rst b/Help/release/dev/FindEXPAT-importedtargets.rst deleted file mode 100644 index ea73551..0000000 --- a/Help/release/dev/FindEXPAT-importedtargets.rst +++ /dev/null @@ -1,4 +0,0 @@ -FindEXPAT-importedtargets -------------------------- - -* The :module:`FindEXPAT` module now provides imported targets. diff --git a/Help/release/dev/FindFreetype-importedtargets.rst b/Help/release/dev/FindFreetype-importedtargets.rst deleted file mode 100644 index a895883..0000000 --- a/Help/release/dev/FindFreetype-importedtargets.rst +++ /dev/null @@ -1,4 +0,0 @@ -FindFreetype-importedtargets ----------------------------- - -* The :module:`FindFreetype` module now provides imported targets. diff --git a/Help/release/dev/FindMPI-overhaul.rst b/Help/release/dev/FindMPI-overhaul.rst deleted file mode 100644 index 3bff602..0000000 --- a/Help/release/dev/FindMPI-overhaul.rst +++ /dev/null @@ -1,16 +0,0 @@ -findmpi-overhaul ----------------- - -* :module:`FindMPI` gained a number of new features, including: - - * Language-specific components have been added to the module. - * Many more MPI environments are now supported. - * The environmental support for Fortran has been improved. - * A user now has fine-grained control over the MPI selection process, - including passing custom parameters to the MPI compiler. - * The version of the implemented MPI standard is now being exposed. - * MPI-2 C++ bindings can now be detected and also suppressed if so desired. - * The available Fortran bindings are now being detected and verified. - * Various MPI-3 information can be requested, including the library version - and Fortran capabilities of the individual bindings. - * Statically linked MPI implementations are supported. diff --git a/Help/release/dev/FindOpenACC.rst b/Help/release/dev/FindOpenACC.rst deleted file mode 100644 index f6acbdf..0000000 --- a/Help/release/dev/FindOpenACC.rst +++ /dev/null @@ -1,5 +0,0 @@ -FindOpenACC ------------ - -* A :module:`FindOpenACC` module was added to detect compiler support - for OpenACC. Currently only supports PGI, GNU and Cray compilers. diff --git a/Help/release/dev/FindOpenGL-glvnd.rst b/Help/release/dev/FindOpenGL-glvnd.rst deleted file mode 100644 index b3c8d53..0000000 --- a/Help/release/dev/FindOpenGL-glvnd.rst +++ /dev/null @@ -1,4 +0,0 @@ -FindOpenGL-glvnd ----------------- - -* The :module:`FindOpenGL` module gained support for GLVND on Linux. diff --git a/Help/release/dev/GoogleTest.rst b/Help/release/dev/GoogleTest.rst deleted file mode 100644 index 1e4a10e..0000000 --- a/Help/release/dev/GoogleTest.rst +++ /dev/null @@ -1,11 +0,0 @@ -GoogleTest ----------- - -* The :module:`GoogleTest` module gained a new command - :command:`gtest_discover_tests` implementing dynamic (build-time) test - discovery. Unlike the source parsing approach, dynamic discovery executes - the test (in 'list available tests' mode) at build time to discover tests. - This is robust against unusual ways of labeling tests, provides much better - support for advanced features such as parameterized tests, and does not - require re-running CMake to discover added or removed tests within a test - executable. diff --git a/Help/release/dev/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname.rst b/Help/release/dev/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname.rst deleted file mode 100644 index 0e258fd..0000000 --- a/Help/release/dev/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname.rst +++ /dev/null @@ -1,6 +0,0 @@ -vs-dotnet-custom-reference-tags -------------------------------- - -* The :prop_tgt:`VS_DOTNET_REFERENCEPROP_<refname>_TAG_<tagname>` - target property was added to support custom XML tags for reference - assemblies in C# targets. diff --git a/Help/release/dev/add-cppcheck.rst b/Help/release/dev/add-cppcheck.rst deleted file mode 100644 index bf3472a..0000000 --- a/Help/release/dev/add-cppcheck.rst +++ /dev/null @@ -1,7 +0,0 @@ -add-cppcheck ------------- - -* A :prop_tgt:`<LANG>_CPPCHECK` target property and supporting - :variable:`CMAKE_<LANG>_CPPCHECK` variable were introduced to tell - the :ref:`Makefile Generators` and the :generator:`Ninja` generator to - run ``cppcheck`` with the compiler for ``C`` and ``CXX`` languages. diff --git a/Help/release/dev/add-vs-shader-properties.rst b/Help/release/dev/add-vs-shader-properties.rst deleted file mode 100644 index c48b984..0000000 --- a/Help/release/dev/add-vs-shader-properties.rst +++ /dev/null @@ -1,6 +0,0 @@ -add-vs-shader-properties ------------------------- - -* Source file properties :prop_sf:`VS_SHADER_OUTPUT_HEADER_FILE` and - :prop_sf:`VS_SHADER_VARIABLE_NAME` have been added to specify more - details of ``.hlsl`` sources with :ref:`Visual Studio Generators`. diff --git a/Help/release/dev/autogen-configs.rst b/Help/release/dev/autogen-configs.rst deleted file mode 100644 index 7613c68..0000000 --- a/Help/release/dev/autogen-configs.rst +++ /dev/null @@ -1,8 +0,0 @@ -autogen-configs ---------------- - -* When using :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC` with a - multi configuration generator (e.g. :generator:`Xcode`), - included ``*.moc``, ``moc_*.cpp`` and ``ui_*.h`` files are generated in - ``<AUTOGEN_BUILD_DIR>/include_<CONFIG>`` instead of - ``<AUTOGEN_BUILD_DIR>/include``. diff --git a/Help/release/dev/autogen-generated-files.rst b/Help/release/dev/autogen-generated-files.rst deleted file mode 100644 index da2fc4e..0000000 --- a/Help/release/dev/autogen-generated-files.rst +++ /dev/null @@ -1,8 +0,0 @@ -autogen-generated-files ------------------------ - -* When using :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC`, - source files that are :prop_sf:`GENERATED` will be processed as well. - They were ignored by :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` - in earlier releases. - See policy :policy:`CMP0071`. diff --git a/Help/release/dev/autogen-macro-names.rst b/Help/release/dev/autogen-macro-names.rst deleted file mode 100644 index 6471295..0000000 --- a/Help/release/dev/autogen-macro-names.rst +++ /dev/null @@ -1,14 +0,0 @@ -autogen-macro-names -------------------- - -* When using :prop_tgt:`AUTOMOC`, CMake searches for the strings ``Q_OBJECT``, - ``Q_GADGET`` or ``Q_NAMESPACE`` in a source file to determine if it needs - to be ``moc`` processed. The new variable - :variable:`CMAKE_AUTOMOC_MACRO_NAMES` allows to register additional - strings (macro names) so search for. - -* When using :prop_tgt:`AUTOMOC`, CMake searches for the strings ``Q_OBJECT``, - ``Q_GADGET`` or ``Q_NAMESPACE`` in a source file to determine if it needs - to be ``moc`` processed. The new target property - :prop_tgt:`AUTOMOC_MACRO_NAMES` allows to register additional strings - (macro names) so search for. diff --git a/Help/release/dev/autogen-predefs.rst b/Help/release/dev/autogen-predefs.rst deleted file mode 100644 index c390e2a..0000000 --- a/Help/release/dev/autogen-predefs.rst +++ /dev/null @@ -1,11 +0,0 @@ -autogen-predefs ---------------- - -* When using :prop_tgt:`AUTOMOC`, the new variable - :variable:`CMAKE_AUTOMOC_COMPILER_PREDEFINES` allows to default - enable or disable the generation of the compiler pre definitions file - ``moc_predefs.h``. - -* When using :prop_tgt:`AUTOMOC`, the new boolean target property - :prop_tgt:`AUTOMOC_COMPILER_PREDEFINES` allows to enable or disable the - generation of the compiler pre definitions file ``moc_predefs.h``. diff --git a/Help/release/dev/cmake-command-mode-shasum.rst b/Help/release/dev/cmake-command-mode-shasum.rst deleted file mode 100644 index 681e0c0..0000000 --- a/Help/release/dev/cmake-command-mode-shasum.rst +++ /dev/null @@ -1,5 +0,0 @@ -cmake-command-mode-shasum -------------------------- - -* Added sha1sum, sha224sum, sha256sum, sha384sum and sha512sum - as an equivalent to existing md5sum to cmake command mode. diff --git a/Help/release/dev/cmake_host_system_information-extend.rst b/Help/release/dev/cmake_host_system_information-extend.rst deleted file mode 100644 index d1c882d..0000000 --- a/Help/release/dev/cmake_host_system_information-extend.rst +++ /dev/null @@ -1,6 +0,0 @@ -cmake_host_system_information-extend ------------------------------------- - -* The :command:`cmake_host_system_information` command learned more keys - to get information about the processor capabilities and the host OS - version. diff --git a/Help/release/dev/codeblocks-exclude-external.rst b/Help/release/dev/codeblocks-exclude-external.rst deleted file mode 100644 index 4c758e3..0000000 --- a/Help/release/dev/codeblocks-exclude-external.rst +++ /dev/null @@ -1,6 +0,0 @@ -codeblocks-exclude-external ---------------------------- - -* A :variable:`CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES` variable was added - to tell the :generator:`CodeBlocks` extra generator to exclude files - from outside the project root directory from the generated project files. diff --git a/Help/release/dev/cpack-freebsd-pkg.rst b/Help/release/dev/cpack-freebsd-pkg.rst deleted file mode 100644 index 1732581..0000000 --- a/Help/release/dev/cpack-freebsd-pkg.rst +++ /dev/null @@ -1,5 +0,0 @@ -cpack-freebsd-pkg ------------------ - -* CPack gained a ``FREEBSD`` generator for FreeBSD ``pkg(8)``, configured - by the :module:`CPackFreeBSD` module. diff --git a/Help/release/dev/cpack-rpm-deb-version.rst b/Help/release/dev/cpack-rpm-deb-version.rst deleted file mode 100644 index a64e8bd..0000000 --- a/Help/release/dev/cpack-rpm-deb-version.rst +++ /dev/null @@ -1,14 +0,0 @@ -cpack-rpm-deb-version ---------------------- - -* Modules :module:`CPackRPM` and :module:`CPackDeb` learned to set package epoch - version. - See :variable:`CPACK_RPM_PACKAGE_EPOCH` and - :variable:`CPACK_DEBIAN_PACKAGE_EPOCH` variables. - -* The :module:`CPackDeb` module learned to set package release version in - `Version` info property. - See :variable:`CPACK_DEBIAN_PACKAGE_RELEASE` variable. - -* The :module:`CPackDeb` module learned more strict package version checking - that complies with Debian rules. diff --git a/Help/release/dev/cpackifw-options.rst b/Help/release/dev/cpackifw-options.rst deleted file mode 100644 index 7c471f4..0000000 --- a/Help/release/dev/cpackifw-options.rst +++ /dev/null @@ -1,6 +0,0 @@ -cpackifw-options ----------------- - -* The :module:`CPackIFW` module :command:`cpack_ifw_configure_component` and - :command:`cpack_ifw_configure_component_group` commands gained a new - ``REPLACES`` and ``CHECKABLE`` options. diff --git a/Help/release/dev/cpackifw-package-file-extension.rst b/Help/release/dev/cpackifw-package-file-extension.rst deleted file mode 100644 index e264081..0000000 --- a/Help/release/dev/cpackifw-package-file-extension.rst +++ /dev/null @@ -1,6 +0,0 @@ -cpackifw-package-file-extension -------------------------------- - -* The :module:`CPackIFW` module gained new - :variable:`CPACK_IFW_PACKAGE_FILE_EXTENSION` variable to customize - target binary format. diff --git a/Help/release/dev/cpackifw-repositories-directories.rst b/Help/release/dev/cpackifw-repositories-directories.rst deleted file mode 100644 index cda74b8..0000000 --- a/Help/release/dev/cpackifw-repositories-directories.rst +++ /dev/null @@ -1,8 +0,0 @@ -cpackifw-repositories-directories ---------------------------------- - -* The :module:`CPackIFW` module gained new - :variable:`CPACK_IFW_REPOSITORIES_DIRECTORIES` variable to specify - additional repositories dirs that will be used to resolve and - repack dependent components. This feature available only - since QtIFW 3.1. diff --git a/Help/release/dev/cuda-compiler-launcher.rst b/Help/release/dev/cuda-compiler-launcher.rst deleted file mode 100644 index f217780..0000000 --- a/Help/release/dev/cuda-compiler-launcher.rst +++ /dev/null @@ -1,8 +0,0 @@ -cuda-compiler-launcher ----------------------- - -* The :ref:`Makefile Generators` and the :generator:`Ninja` generator learned - to add compiler launcher tools like ccache along with the compiler for the - ``CUDA`` language (``C`` and ``CXX`` were supported previously). See the - :variable:`CMAKE_<LANG>_COMPILER_LAUNCHER` variable and - :prop_tgt:`<LANG>_COMPILER_LAUNCHER` target property for details. diff --git a/Help/release/dev/deb-on-windows.rst b/Help/release/dev/deb-on-windows.rst deleted file mode 100644 index b307720..0000000 --- a/Help/release/dev/deb-on-windows.rst +++ /dev/null @@ -1,7 +0,0 @@ -deb-on-windows --------------- - -* The CPack ``DEB`` generator, configured by the :module:`CPackDeb` module, - was enabled on Windows. While not fully featured (due to the lack of - external UNIX tools) this will allow building basic cross-platform Debian - packages. diff --git a/Help/release/dev/drop-HP-UX.rst b/Help/release/dev/drop-HP-UX.rst deleted file mode 100644 index 199fa09..0000000 --- a/Help/release/dev/drop-HP-UX.rst +++ /dev/null @@ -1,8 +0,0 @@ -drop-HP-UX ----------- - -* Support for building CMake on HP-UX has been dropped pending better - support for C++11 and a port of libuv. See `CMake Issue 17137`_. - Use CMake 3.9 or lower instead for HP-UX support. - -.. _`CMake Issue 17137`: https://gitlab.kitware.com/cmake/cmake/issues/17137 diff --git a/Help/release/dev/execute_process-pipeline-results.rst b/Help/release/dev/execute_process-pipeline-results.rst deleted file mode 100644 index 9755ef5..0000000 --- a/Help/release/dev/execute_process-pipeline-results.rst +++ /dev/null @@ -1,6 +0,0 @@ -execute_process-pipeline-results --------------------------------- - -* The :command:`execute_process` command gained a ``RESULTS_VARIABLE`` - option to collect a list of results from all children in a pipeline - of processes when multiple ``COMMAND`` arguments are given. diff --git a/Help/release/dev/file-generate-relative-paths.rst b/Help/release/dev/file-generate-relative-paths.rst deleted file mode 100644 index fdeb9e0e..0000000 --- a/Help/release/dev/file-generate-relative-paths.rst +++ /dev/null @@ -1,7 +0,0 @@ -file-generate-relative-paths ----------------------------- - -* The :command:`file(GENERATE)` command now interprets relative paths - given to its ``OUTPUT`` and ``INPUT`` arguments with respect to the - caller's current binary and source directories, respectively. - See policy :policy:`CMP0070`. diff --git a/Help/release/dev/find-patch.rst b/Help/release/dev/find-patch.rst deleted file mode 100644 index d720c81..0000000 --- a/Help/release/dev/find-patch.rst +++ /dev/null @@ -1,5 +0,0 @@ -find-patch ----------- - -* A :module:`FindPatch` module was added to find the ``patch`` - command-line executable. diff --git a/Help/release/dev/findopenmp-components.rst b/Help/release/dev/findopenmp-components.rst deleted file mode 100644 index 243abfa..0000000 --- a/Help/release/dev/findopenmp-components.rst +++ /dev/null @@ -1,5 +0,0 @@ -findopenmp-components ---------------------- - -* The :module:`FindOpenMP` module gained support for - language-specific components. diff --git a/Help/release/dev/flang.rst b/Help/release/dev/flang.rst deleted file mode 100644 index 9849f14..0000000 --- a/Help/release/dev/flang.rst +++ /dev/null @@ -1,6 +0,0 @@ -flang ------ - -* The `flang`_ Fortran compiler is now supported, with compiler id ``Flang``. - -.. _`flang`: https://github.com/flang-compiler/flang diff --git a/Help/release/dev/freebsd-compiler-name.rst b/Help/release/dev/freebsd-compiler-name.rst deleted file mode 100644 index ece7596..0000000 --- a/Help/release/dev/freebsd-compiler-name.rst +++ /dev/null @@ -1,4 +0,0 @@ -freebsd-compiler-name ---------------------- - -* On FreeBSD the C++ compiler named ``c++`` is now the preferred default. diff --git a/Help/release/dev/get_filename_component-fix-program-split.rst b/Help/release/dev/get_filename_component-fix-program-split.rst deleted file mode 100644 index 55c8719..0000000 --- a/Help/release/dev/get_filename_component-fix-program-split.rst +++ /dev/null @@ -1,9 +0,0 @@ -get_filename_component-fix-program-split ----------------------------------------- - -* The :command:`get_filename_component` ``PROGRAM`` mode semantics - have been revised to not tolerate unquoted spaces in the path - to the program while also accepting arguments. While technically - incompatible with the old behavior, it is expected that behavior - under typical use cases with properly-quoted command-lines has - not changed. diff --git a/Help/release/dev/graphviz-line-styles.rst b/Help/release/dev/graphviz-line-styles.rst deleted file mode 100644 index d24f236..0000000 --- a/Help/release/dev/graphviz-line-styles.rst +++ /dev/null @@ -1,6 +0,0 @@ -graphviz-line-styles -------------------------- - -* The graphviz output now distinguishes between the different dependency types - ``PUBLIC``, ``PRIVATE`` and ``INTERFACE`` and represents them in the output graph - as solid, dashed and dotted edges. diff --git a/Help/release/dev/iar.rst b/Help/release/dev/iar.rst deleted file mode 100644 index c6678eb..0000000 --- a/Help/release/dev/iar.rst +++ /dev/null @@ -1,4 +0,0 @@ -iar ---- - -* Support for the IAR ARM Compiler was improved. diff --git a/Help/release/dev/include-guard.rst b/Help/release/dev/include-guard.rst deleted file mode 100644 index 9b0c64c..0000000 --- a/Help/release/dev/include-guard.rst +++ /dev/null @@ -1,8 +0,0 @@ -include_guard -------------- - -* The :command:`include_guard` command was introduced to allow guarding - CMake scripts from being included more than once. The command supports - ``DIRECTORY`` and ``GLOBAL`` options to adjust the corresponding include guard - scope. If no options given, include guard is similar to basic variable-based - check. diff --git a/Help/release/dev/indented_cmakedefine.rst b/Help/release/dev/indented_cmakedefine.rst deleted file mode 100644 index fd28b25..0000000 --- a/Help/release/dev/indented_cmakedefine.rst +++ /dev/null @@ -1,7 +0,0 @@ -indented_cmakedefine --------------------- - -* The :command:`configure_file` command learned to support indented - ``# cmakedefine`` and ``# cmakedefine01``. Spaces and/or tabs between - the ``#`` character and the ``cmakedefine``/``cmakedefine01`` words - are now understood and preserved in the output. diff --git a/Help/release/dev/irsl-intel.rst b/Help/release/dev/irsl-intel.rst deleted file mode 100644 index 330fcc6..0000000 --- a/Help/release/dev/irsl-intel.rst +++ /dev/null @@ -1,5 +0,0 @@ -irsl-intel ----------- - -* The :module:`InstallRequiredSystemLibraries` gained support for installing - Intel compiler runtimes. diff --git a/Help/release/dev/labels_for_subprojects.rst b/Help/release/dev/labels_for_subprojects.rst deleted file mode 100644 index 7344502..0000000 --- a/Help/release/dev/labels_for_subprojects.rst +++ /dev/null @@ -1,14 +0,0 @@ -labels_for_subprojects ----------------------- - -* A :variable:`CTEST_LABELS_FOR_SUBPROJECTS` CTest module variable and CTest - script variable was added to specify a list of labels that should be treated - as subprojects by CDash. To use this value in both the CTest module and the - ctest command line `Dashboard Client` mode (e.g. ctest -S) set it in the - CTestConfig.cmake config file. - -* A :prop_dir:`LABELS` directory property was added to specify labels - for all targets and tests in a directory. - -* A :variable:`CMAKE_DIRECTORY_LABELS` variable was added to specify - labels for all tests in a directory. diff --git a/Help/release/dev/midipix-support.rst b/Help/release/dev/midipix-support.rst deleted file mode 100644 index adc971e..0000000 --- a/Help/release/dev/midipix-support.rst +++ /dev/null @@ -1,4 +0,0 @@ -midipix-support ---------------- - -* A new minimal platform file for ``Midipix`` was added. diff --git a/Help/release/dev/msvc-arm64.rst b/Help/release/dev/msvc-arm64.rst deleted file mode 100644 index c8fadd4..0000000 --- a/Help/release/dev/msvc-arm64.rst +++ /dev/null @@ -1,5 +0,0 @@ -msvc-arm64 ----------- - -* Support for the MSVC ARM64 architecture was added. - Visual Studio 2017 Update 4 and above offer an ARM64 toolchain. diff --git a/Help/release/dev/require-c++11.rst b/Help/release/dev/require-c++11.rst deleted file mode 100644 index 7b849e7..0000000 --- a/Help/release/dev/require-c++11.rst +++ /dev/null @@ -1,5 +0,0 @@ -require-c++11 -------------- - -* Support for building CMake itself with C++98 compilers was dropped. - CMake is now implemented using C++11. diff --git a/Help/release/dev/string_prepend.rst b/Help/release/dev/string_prepend.rst deleted file mode 100644 index f896e91..0000000 --- a/Help/release/dev/string_prepend.rst +++ /dev/null @@ -1,4 +0,0 @@ -string_prepend --------------- - -* The :command:`string` command learned a new ``PREPEND`` subcommand. diff --git a/Help/release/dev/test_include_files.rst b/Help/release/dev/test_include_files.rst deleted file mode 100644 index b75dd0d..0000000 --- a/Help/release/dev/test_include_files.rst +++ /dev/null @@ -1,7 +0,0 @@ -test_include_files ------------------- - -* A :prop_dir:`TEST_INCLUDE_FILES` directory property was added to - list any number of files to be included when running tests with - :manual:`ctest(1)`. This generalizes the :prop_dir:`TEST_INCLUDE_FILE` - property. diff --git a/Help/release/dev/timestamp.rst b/Help/release/dev/timestamp.rst deleted file mode 100644 index e40009e..0000000 --- a/Help/release/dev/timestamp.rst +++ /dev/null @@ -1,5 +0,0 @@ -timestamp ---------- - -* The :command:`string(TIMESTAMP)` command now supports ``%A`` - for full weekday name and ``%B`` for full month name. diff --git a/Help/release/index.rst b/Help/release/index.rst index 6c68e65..0c7572f 100644 --- a/Help/release/index.rst +++ b/Help/release/index.rst @@ -7,14 +7,13 @@ CMake Release Notes This file should include the adjacent "dev.txt" file in development versions but not in release versions. -.. include:: dev.txt - Releases ======== .. toctree:: :maxdepth: 1 + 3.10 <3.10> 3.9 <3.9> 3.8 <3.8> 3.7 <3.7> diff --git a/Help/variable/CMAKE_LANG_COMPILER_VERSION_INTERNAL.rst b/Help/variable/CMAKE_LANG_COMPILER_VERSION_INTERNAL.rst new file mode 100644 index 0000000..c3cd980 --- /dev/null +++ b/Help/variable/CMAKE_LANG_COMPILER_VERSION_INTERNAL.rst @@ -0,0 +1,8 @@ +CMAKE_<LANG>_COMPILER_VERSION_INTERNAL +-------------------------------------- + +An internal variable subject to change. + +This is used to identify the variant of a compiler based on an internal +version number. For some compilers this is needed to determine the +correct usage. diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in index 92259dd..8ad0c01 100644 --- a/Modules/CMakeCCompiler.cmake.in +++ b/Modules/CMakeCCompiler.cmake.in @@ -2,6 +2,7 @@ set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@") set(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@") set(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@") set(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@") +set(CMAKE_C_COMPILER_VERSION_INTERNAL "@CMAKE_C_COMPILER_VERSION_INTERNAL@") set(CMAKE_C_COMPILER_WRAPPER "@CMAKE_C_COMPILER_WRAPPER@") set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "@CMAKE_C_STANDARD_COMPUTED_DEFAULT@") set(CMAKE_C_COMPILE_FEATURES "@CMAKE_C_COMPILE_FEATURES@") diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in index 95184c9..10f7318 100644 --- a/Modules/CMakeCCompilerId.c.in +++ b/Modules/CMakeCCompilerId.c.in @@ -67,6 +67,9 @@ int main(int argc, char* argv[]) #ifdef COMPILER_VERSION_MAJOR require += info_version[argc]; #endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif #ifdef SIMULATE_ID require += info_simulate[argc]; #endif diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in index 47fc624..df57a4f 100644 --- a/Modules/CMakeCXXCompiler.cmake.in +++ b/Modules/CMakeCXXCompiler.cmake.in @@ -2,6 +2,7 @@ set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@") set(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@") set(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@") set(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@") +set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "@CMAKE_CXX_COMPILER_VERSION_INTERNAL@") set(CMAKE_CXX_COMPILER_WRAPPER "@CMAKE_CXX_COMPILER_WRAPPER@") set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "@CMAKE_CXX_STANDARD_COMPUTED_DEFAULT@") set(CMAKE_CXX_COMPILE_FEATURES "@CMAKE_CXX_COMPILE_FEATURES@") diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in index 6572bb3..4cb2267 100644 --- a/Modules/CMakeCXXCompilerId.cpp.in +++ b/Modules/CMakeCXXCompilerId.cpp.in @@ -55,6 +55,9 @@ int main(int argc, char* argv[]) #ifdef COMPILER_VERSION_MAJOR require += info_version[argc]; #endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif #ifdef SIMULATE_ID require += info_simulate[argc]; #endif diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake index 89ac9fa..c9cd7e2 100644 --- a/Modules/CMakeDetermineCUDACompiler.cmake +++ b/Modules/CMakeDetermineCUDACompiler.cmake @@ -87,6 +87,15 @@ if(${CMAKE_GENERATOR} MATCHES "Visual Studio") elseif(CMAKE_CUDA_COMPILER_ID STREQUAL NVIDIA) set(_nvcc_log "") string(REPLACE "\r" "" _nvcc_output_orig "${CMAKE_CUDA_COMPILER_PRODUCED_OUTPUT}") + if(_nvcc_output_orig MATCHES "#\\\$ +PATH= *([^\n]*)\n") + set(_nvcc_path "${CMAKE_MATCH_1}") + string(APPEND _nvcc_log " found 'PATH=' string: [${_nvcc_path}]\n") + string(REPLACE ":" ";" _nvcc_path "${_nvcc_path}") + else() + set(_nvcc_path "") + string(REPLACE "\n" "\n " _nvcc_output_log "\n${_nvcc_output_orig}") + string(APPEND _nvcc_log " no 'PATH=' string found in nvcc output:${_nvcc_output_log}\n") + endif() if(_nvcc_output_orig MATCHES "#\\\$ +LIBRARIES= *([^\n]*)\n") set(_nvcc_libraries "${CMAKE_MATCH_1}") string(APPEND _nvcc_log " found 'LIBRARIES=' string: [${_nvcc_libraries}]\n") @@ -131,7 +140,26 @@ elseif(CMAKE_CUDA_COMPILER_ID STREQUAL NVIDIA) else() #extract the compiler that is being used for linking separate_arguments(_nvcc_link_line_args UNIX_COMMAND "${_nvcc_link_line}") - list(GET _nvcc_link_line_args 0 CMAKE_CUDA_HOST_LINK_LAUNCHER) + list(GET _nvcc_link_line_args 0 _nvcc_host_link_launcher) + if(IS_ABSOLUTE "${_nvcc_host_link_launcher}") + string(APPEND _nvcc_log " extracted link launcher absolute path: [${_nvcc_host_link_launcher}]\n") + set(CMAKE_CUDA_HOST_LINK_LAUNCHER "${_nvcc_host_link_launcher}") + else() + string(APPEND _nvcc_log " extracted link launcher name: [${_nvcc_host_link_launcher}]\n") + find_program(_nvcc_find_host_link_launcher + NAMES ${_nvcc_host_link_launcher} + PATHS ${_nvcc_path} NO_DEFAULT_PATH) + find_program(_nvcc_find_host_link_launcher + NAMES ${_nvcc_host_link_launcher}) + if(_nvcc_find_host_link_launcher) + string(APPEND _nvcc_log " found link launcher absolute path: [${_nvcc_find_host_link_launcher}]\n") + set(CMAKE_CUDA_HOST_LINK_LAUNCHER "${_nvcc_find_host_link_launcher}") + else() + string(APPEND _nvcc_log " could not find link launcher absolute path\n") + set(CMAKE_CUDA_HOST_LINK_LAUNCHER "${_nvcc_host_link_launcher}") + endif() + unset(_nvcc_find_host_link_launcher CACHE) + endif() endif() #prefix the line with cuda-fake-ld so that implicit link info believes it is diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index cddc966..7efe739 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -108,6 +108,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) set(CMAKE_${lang}_XCODE_CURRENT_ARCH "${CMAKE_${lang}_XCODE_CURRENT_ARCH}" PARENT_SCOPE) set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "${CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE) + set(CMAKE_${lang}_COMPILER_VERSION_INTERNAL "${CMAKE_${lang}_COMPILER_VERSION_INTERNAL}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_WRAPPER "${CMAKE_${lang}_COMPILER_WRAPPER}" PARENT_SCOPE) set(CMAKE_${lang}_SIMULATE_ID "${CMAKE_${lang}_SIMULATE_ID}" PARENT_SCOPE) set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_${lang}_SIMULATE_VERSION}" PARENT_SCOPE) @@ -473,6 +474,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) set(COMPILER_VERSION_MINOR 0) set(COMPILER_VERSION_PATCH 0) set(COMPILER_VERSION_TWEAK 0) + set(COMPILER_VERSION_INTERNAL "") set(HAVE_COMPILER_VERSION_MAJOR 0) set(HAVE_COMPILER_VERSION_MINOR 0) set(HAVE_COMPILER_VERSION_PATCH 0) @@ -514,6 +516,10 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) string(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${CMAKE_MATCH_1}") string(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}") endif() + if("${info}" MATCHES "INFO:compiler_version_internal\\[([^]\"]*)\\]") + string(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION_INTERNAL "${CMAKE_MATCH_1}") + string(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION_INTERNAL "${COMPILER_VERSION_INTERNAL}") + endif() foreach(comp MAJOR MINOR PATCH TWEAK) foreach(digit 1 2 3 4 5 6 7 8 9) if("${info}" MATCHES "INFO:compiler_version_${comp}_digit_${digit}\\[([0-9])\\]") @@ -589,6 +595,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) set(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID "${ARCHITECTURE_ID}") set(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}") set(CMAKE_${lang}_COMPILER_VERSION "${COMPILER_VERSION}") + set(CMAKE_${lang}_COMPILER_VERSION_INTERNAL "${COMPILER_VERSION_INTERNAL}") set(CMAKE_${lang}_SIMULATE_ID "${SIMULATE_ID}") set(CMAKE_${lang}_SIMULATE_VERSION "${SIMULATE_VERSION}") endif() @@ -640,6 +647,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE) + set(CMAKE_${lang}_COMPILER_VERSION_INTERNAL "${CMAKE_${lang}_COMPILER_VERSION_INTERNAL}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_WRAPPER "${COMPILER_WRAPPER}" PARENT_SCOPE) set(CMAKE_${lang}_SIMULATE_ID "${CMAKE_${lang}_SIMULATE_ID}" PARENT_SCOPE) set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_${lang}_SIMULATE_VERSION}" PARENT_SCOPE) diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in index a6a9c0a..dd77379 100644 --- a/Modules/CMakePlatformId.h.in +++ b/Modules/CMakePlatformId.h.in @@ -201,6 +201,15 @@ char const info_version[] = { ']','\0'}; #endif +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#endif + /* Construct a string literal encoding the version number components. */ #ifdef SIMULATE_VERSION_MAJOR char const info_simulate_version[] = { diff --git a/Modules/Compiler/IAR-DetermineCompiler.cmake b/Modules/Compiler/IAR-DetermineCompiler.cmake index 4ef587b..a1bffeb 100644 --- a/Modules/Compiler/IAR-DetermineCompiler.cmake +++ b/Modules/Compiler/IAR-DetermineCompiler.cmake @@ -2,8 +2,10 @@ # http://www.iar.com # http://supp.iar.com/FilesPublic/UPDINFO/004916/arm/doc/EWARM_DevelopmentGuide.ENU.pdf # -# __IAR_SYSTEMS_ICC__ An integer that identifies the IAR compiler platform. The current value is 8. Note that -# the number could be higher in a future version of the product +# __IAR_SYSTEMS_ICC__ An integer that identifies the IAR compiler platform: +# 9 and higher means C11 and C++14 as language default +# 8 means C99 and C++03 as language default +# 7 and lower means C89 and EC++ as language default. # __ICCARM__ An integer that is set to 1 when the code is compiled with the IAR C/C++ Compiler for ARM # __VER__ An integer that identifies the version number of the IAR compiler in use. For example, # version 5.11.3 is returned as 5011003. @@ -15,4 +17,5 @@ set(_compiler_id_version_compute " # define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@((__VER__) / 1000000) # define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(((__VER__) / 1000) % 1000) # define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@((__VER__) % 1000) +# define @PREFIX@COMPILER_VERSION_INTERNAL @MACRO_DEC@(__IAR_SYSTEMS_ICC__) # endif") diff --git a/Modules/FindCUDA/run_nvcc.cmake b/Modules/FindCUDA/run_nvcc.cmake index ec5a099..f78119d 100644 --- a/Modules/FindCUDA/run_nvcc.cmake +++ b/Modules/FindCUDA/run_nvcc.cmake @@ -50,6 +50,8 @@ # generated_cubin_file:STRING=<> File to generate. This argument must be passed # in if build_cubin is true. +cmake_policy(PUSH) +cmake_policy(SET CMP0007 NEW) if(NOT generated_file) message(FATAL_ERROR "You must specify generated_file on the command line") endif() @@ -179,13 +181,8 @@ cuda_execute_process( set(depends_CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}") set(CUDA_VERSION @CUDA_VERSION@) if(CUDA_VERSION VERSION_LESS "3.0") - cmake_policy(PUSH) - # CMake policy 0007 NEW states that empty list elements are not - # ignored. I'm just setting it to avoid the warning that's printed. - cmake_policy(SET CMP0007 NEW) # Note that this will remove all occurances of -G. list(REMOVE_ITEM depends_CUDA_NVCC_FLAGS "-G") - cmake_policy(POP) endif() # nvcc doesn't define __CUDACC__ for some reason when generating dependency files. This @@ -304,3 +301,5 @@ if( build_cubin ) ) endif() + +cmake_policy(POP) diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index d287688..7d4ed6a 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -225,6 +225,7 @@ if(NOT MATLAB_ADDITIONAL_VERSIONS) endif() set(MATLAB_VERSIONS_MAPPING + "R2017b=9.3" "R2017a=9.2" "R2016b=9.1" "R2016a=9.0" @@ -236,7 +237,6 @@ set(MATLAB_VERSIONS_MAPPING "R2013a=8.1" "R2012b=8.0" "R2012a=7.14" - "R2011b=7.13" "R2011a=7.12" "R2010b=7.11" diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake index 595b0b3..272f4dc 100644 --- a/Modules/FindOpenMP.cmake +++ b/Modules/FindOpenMP.cmake @@ -310,7 +310,11 @@ macro(_OPENMP_SET_VERSION_BY_SPEC_DATE LANG) "199710=1.0" ) - string(REGEX MATCHALL "${OpenMP_${LANG}_SPEC_DATE}=([0-9]+)\\.([0-9]+)" _version_match "${OpenMP_SPEC_DATE_MAP}") + if(OpenMP_${LANG}_SPEC_DATE) + string(REGEX MATCHALL "${OpenMP_${LANG}_SPEC_DATE}=([0-9]+)\\.([0-9]+)" _version_match "${OpenMP_SPEC_DATE_MAP}") + else() + set(_version_match "") + endif() if(NOT _version_match STREQUAL "") set(OpenMP_${LANG}_VERSION_MAJOR ${CMAKE_MATCH_1}) set(OpenMP_${LANG}_VERSION_MINOR ${CMAKE_MATCH_2}) @@ -389,7 +393,7 @@ unset(_OpenMP_MIN_VERSION) foreach(LANG IN LISTS OpenMP_FINDLIST) if(CMAKE_${LANG}_COMPILER_LOADED) - if (NOT OpenMP_${LANG}_SPEC_DATE) + if (NOT OpenMP_${LANG}_SPEC_DATE AND OpenMP_${LANG}_FLAGS) _OPENMP_GET_SPEC_DATE("${LANG}" OpenMP_${LANG}_SPEC_DATE_INTERNAL) set(OpenMP_${LANG}_SPEC_DATE "${OpenMP_${LANG}_SPEC_DATE_INTERNAL}" CACHE INTERNAL "${LANG} compiler's OpenMP specification date") diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake index 90f7a2e..7292aec 100644 --- a/Modules/FindProtobuf.cmake +++ b/Modules/FindProtobuf.cmake @@ -79,6 +79,7 @@ # include_directories(${CMAKE_CURRENT_BINARY_DIR}) # protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS foo.proto) # protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS EXPORT_MACRO DLL_EXPORT foo.proto) +# protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS DESCRIPTORS PROTO_DESCS foo.proto) # protobuf_generate_python(PROTO_PY foo.proto) # add_executable(bar bar.cc ${PROTO_SRCS} ${PROTO_HDRS}) # target_link_libraries(bar ${Protobuf_LIBRARIES}) @@ -92,12 +93,15 @@ # # Add custom commands to process ``.proto`` files to C++:: # -# protobuf_generate_cpp (<SRCS> <HDRS> [EXPORT_MACRO <MACRO>] [<ARGN>...]) +# protobuf_generate_cpp (<SRCS> <HDRS> +# [DESCRIPTORS <DESC>] [EXPORT_MACRO <MACRO>] [<ARGN>...]) # # ``SRCS`` # Variable to define with autogenerated source files # ``HDRS`` # Variable to define with autogenerated header files +# ``DESCRIPTORS`` +# Variable to define with auotgenerated descriptor files, if requested. # ``EXPORT_MACRO`` # is a macro which should expand to ``__declspec(dllexport)`` or # ``__declspec(dllimport)`` depending on what is being compiled. @@ -116,7 +120,7 @@ # ``.proto`` filess function(PROTOBUF_GENERATE_CPP SRCS HDRS) - cmake_parse_arguments(protobuf "" "EXPORT_MACRO" "" ${ARGN}) + cmake_parse_arguments(protobuf "" "EXPORT_MACRO;DESCRIPTORS" "" ${ARGN}) set(PROTO_FILES "${protobuf_UNPARSED_ARGUMENTS}") if(NOT PROTO_FILES) @@ -158,6 +162,10 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS) set(${SRCS}) set(${HDRS}) + if (protobuf_DESCRIPTORS) + set(${protobuf_DESCRIPTORS}) + endif() + foreach(FIL ${PROTO_FILES}) get_filename_component(ABS_FIL ${FIL} ABSOLUTE) get_filename_component(FIL_WE ${FIL} NAME_WE) @@ -168,22 +176,38 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS) endif() endif() - list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc") - list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h") + set(_protobuf_protoc_src "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc") + set(_protobuf_protoc_hdr "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h") + list(APPEND ${SRCS} "${_protobuf_protoc_src}") + list(APPEND ${HDRS} "${_protobuf_protoc_hdr}") + + if(protobuf_DESCRIPTORS) + set(_protobuf_protoc_desc "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.desc") + set(_protobuf_protoc_flags "--descriptor_set_out=${_protobuf_protoc_desc}") + list(APPEND ${protobuf_DESCRIPTORS} "${_protobuf_protoc_desc}") + else() + set(_protobuf_protoc_desc "") + set(_protobuf_protoc_flags "") + endif() add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc" - "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h" + OUTPUT "${_protobuf_protoc_src}" + "${_protobuf_protoc_hdr}" + ${_protobuf_protoc_desc} COMMAND protobuf::protoc - ARGS "--cpp_out=${DLL_EXPORT_DECL}${CMAKE_CURRENT_BINARY_DIR}" ${_protobuf_include_path} ${ABS_FIL} + "--cpp_out=${DLL_EXPORT_DECL}${CMAKE_CURRENT_BINARY_DIR}" + ${_protobuf_protoc_flags} + ${_protobuf_include_path} ${ABS_FIL} DEPENDS ${ABS_FIL} protobuf::protoc COMMENT "Running C++ protocol buffer compiler on ${FIL}" VERBATIM ) endforeach() - set_source_files_properties(${${SRCS}} ${${HDRS}} PROPERTIES GENERATED TRUE) - set(${SRCS} ${${SRCS}} PARENT_SCOPE) - set(${HDRS} ${${HDRS}} PARENT_SCOPE) + set(${SRCS} "${${SRCS}}" PARENT_SCOPE) + set(${HDRS} "${${HDRS}}" PARENT_SCOPE) + if(protobuf_DESCRIPTORS) + set(${protobuf_DESCRIPTORS} "${${protobuf_DESCRIPTORS}}" PARENT_SCOPE) + endif() endfunction() function(PROTOBUF_GENERATE_PYTHON SRCS) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index fa39e15..4ce6575 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) -set(CMake_VERSION_MINOR 9) -set(CMake_VERSION_PATCH 20171002) -#set(CMake_VERSION_RC 1) +set(CMake_VERSION_MINOR 10) +set(CMake_VERSION_PATCH 0) +set(CMake_VERSION_RC 1) diff --git a/Source/cmFilePathChecksum.cxx b/Source/cmFilePathChecksum.cxx index 62f52e5..f9afeef 100644 --- a/Source/cmFilePathChecksum.cxx +++ b/Source/cmFilePathChecksum.cxx @@ -13,10 +13,10 @@ cmFilePathChecksum::cmFilePathChecksum() { } -cmFilePathChecksum::cmFilePathChecksum(const std::string& currentSrcDir, - const std::string& currentBinDir, - const std::string& projectSrcDir, - const std::string& projectBinDir) +cmFilePathChecksum::cmFilePathChecksum(std::string const& currentSrcDir, + std::string const& currentBinDir, + std::string const& projectSrcDir, + std::string const& projectBinDir) { setupParentDirs(currentSrcDir, currentBinDir, projectSrcDir, projectBinDir); } @@ -29,36 +29,35 @@ cmFilePathChecksum::cmFilePathChecksum(cmMakefile* makefile) makefile->GetHomeOutputDirectory()); } -void cmFilePathChecksum::setupParentDirs(const std::string& currentSrcDir, - const std::string& currentBinDir, - const std::string& projectSrcDir, - const std::string& projectBinDir) +void cmFilePathChecksum::setupParentDirs(std::string const& currentSrcDir, + std::string const& currentBinDir, + std::string const& projectSrcDir, + std::string const& projectBinDir) { - parentDirs[0].first = cmsys::SystemTools::GetRealPath(currentSrcDir); - parentDirs[1].first = cmsys::SystemTools::GetRealPath(currentBinDir); - parentDirs[2].first = cmsys::SystemTools::GetRealPath(projectSrcDir); - parentDirs[3].first = cmsys::SystemTools::GetRealPath(projectBinDir); + this->parentDirs[0].first = cmsys::SystemTools::GetRealPath(currentSrcDir); + this->parentDirs[1].first = cmsys::SystemTools::GetRealPath(currentBinDir); + this->parentDirs[2].first = cmsys::SystemTools::GetRealPath(projectSrcDir); + this->parentDirs[3].first = cmsys::SystemTools::GetRealPath(projectBinDir); - parentDirs[0].second = "CurrentSource"; - parentDirs[1].second = "CurrentBinary"; - parentDirs[2].second = "ProjectSource"; - parentDirs[3].second = "ProjectBinary"; + this->parentDirs[0].second = "CurrentSource"; + this->parentDirs[1].second = "CurrentBinary"; + this->parentDirs[2].second = "ProjectSource"; + this->parentDirs[3].second = "ProjectBinary"; } -std::string cmFilePathChecksum::get(const std::string& filePath) const +std::string cmFilePathChecksum::get(std::string const& filePath) const { std::string relPath; std::string relSeed; { - const std::string fileReal = cmsys::SystemTools::GetRealPath(filePath); + std::string const fileReal = cmsys::SystemTools::GetRealPath(filePath); std::string parentDir; // Find closest project parent directory - for (size_t ii = 0; ii != numParentDirs; ++ii) { - const std::string& pDir = parentDirs[ii].first; - if (!pDir.empty() && - cmsys::SystemTools::IsSubDirectory(fileReal, pDir)) { - relSeed = parentDirs[ii].second; - parentDir = pDir; + for (auto const& pDir : this->parentDirs) { + if (!pDir.first.empty() && + cmsys::SystemTools::IsSubDirectory(fileReal, pDir.first)) { + parentDir = pDir.first; + relSeed = pDir.second; break; } } @@ -77,11 +76,11 @@ std::string cmFilePathChecksum::get(const std::string& filePath) const cmCryptoHash(cmCryptoHash::AlgoSHA256).ByteHashString(relSeed + relPath); // Convert binary checksum to string - return cmBase32Encoder().encodeString(&hashBytes[0], hashBytes.size(), + return cmBase32Encoder().encodeString(&hashBytes.front(), hashBytes.size(), false); } -std::string cmFilePathChecksum::getPart(const std::string& filePath, +std::string cmFilePathChecksum::getPart(std::string const& filePath, size_t length) const { return get(filePath).substr(0, length); diff --git a/Source/cmFilePathChecksum.h b/Source/cmFilePathChecksum.h index 9d570eb..48b5da0 100644 --- a/Source/cmFilePathChecksum.h +++ b/Source/cmFilePathChecksum.h @@ -5,6 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include <array> #include <stddef.h> #include <string> #include <utility> @@ -29,37 +30,35 @@ public: cmFilePathChecksum(); /// @brief Initilizes the parent directories manually - cmFilePathChecksum(const std::string& currentSrcDir, - const std::string& currentBinDir, - const std::string& projectSrcDir, - const std::string& projectBinDir); + cmFilePathChecksum(std::string const& currentSrcDir, + std::string const& currentBinDir, + std::string const& projectSrcDir, + std::string const& projectBinDir); /// @brief Initilizes the parent directories from a makefile cmFilePathChecksum(cmMakefile* makefile); /// @brief Allows parent directories setup after construction /// - void setupParentDirs(const std::string& currentSrcDir, - const std::string& currentBinDir, - const std::string& projectSrcDir, - const std::string& projectBinDir); + void setupParentDirs(std::string const& currentSrcDir, + std::string const& currentBinDir, + std::string const& projectSrcDir, + std::string const& projectBinDir); /* @brief Calculates the path checksum for the parent directory of a file * */ - std::string get(const std::string& filePath) const; + std::string get(std::string const& filePath) const; /* @brief Same as get() but returns only the first length characters * */ - std::string getPart(const std::string& filePath, + std::string getPart(std::string const& filePath, size_t length = partLengthDefault) const; private: - /// Size of the parent directory list - static const size_t numParentDirs = 4; /// List of (directory name, seed name) pairs - std::pair<std::string, std::string> parentDirs[numParentDirs]; + std::array<std::pair<std::string, std::string>, 4> parentDirs; }; #endif diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 304a188..c79ee47 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -668,7 +668,8 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile( std::string configName = "NO-PER-CONFIG-SUPPORT-IN-XCODE"; std::unique_ptr<cmCompiledGeneratorExpression> compiledExpr = ge.Parse(cflags); - const char* processed = compiledExpr->Evaluate(lg, configName); + const char* processed = + compiledExpr->Evaluate(lg, configName, false, gtgt); if (compiledExpr->GetHadContextSensitiveCondition()) { std::ostringstream e; /* clang-format off */ diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 8027191..d8030b7 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1454,7 +1454,7 @@ cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo( if (const char* cflags = sf.GetProperty("COMPILE_FLAGS")) { cmGeneratorExpression ge; std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(cflags); - fc.CompileFlags = cge->Evaluate(lg, *i); + fc.CompileFlags = cge->Evaluate(lg, *i, false, gt); needfc = true; } if (lg->FortranProject) { diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 6535008..0087957 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2125,8 +2125,8 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( if (configDependentFlags) { cmGeneratorExpression ge; std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(flags); - std::string evaluatedFlags = - cge->Evaluate(this->LocalGenerator, *config); + std::string evaluatedFlags = cge->Evaluate( + this->LocalGenerator, *config, false, this->GeneratorTarget); clOptions.Parse(evaluatedFlags.c_str()); } else { clOptions.Parse(flags.c_str()); @@ -3225,8 +3225,6 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions( } if (this->MSTools) { - linkOptions.AddFlag("Version", ""); - if (this->GeneratorTarget->GetPropertyAsBool("WIN32_EXECUTABLE")) { if (this->GlobalGenerator->TargetsWindowsCE()) { linkOptions.AddFlag("SubSystem", "WindowsCE"); diff --git a/Tests/FindProtobuf/Test/CMakeLists.txt b/Tests/FindProtobuf/Test/CMakeLists.txt index 10ce976..bc89190 100644 --- a/Tests/FindProtobuf/Test/CMakeLists.txt +++ b/Tests/FindProtobuf/Test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.4) +cmake_minimum_required(VERSION 3.8) project(TestFindProtobuf CXX) include(CTest) @@ -32,3 +32,19 @@ target_link_libraries(test_var_protoc PRIVATE ${Protobuf_PROTOC_LIBRARIES}) add_test(NAME test_var_protoc COMMAND test_var_protoc) add_test(NAME test_tgt_protoc_version COMMAND protobuf::protoc --version) + +set(Protobuf_IMPORT_DIRS ${Protobuf_INCLUDE_DIRS}) +PROTOBUF_GENERATE_CPP(PROTO_SRC PROTO_HEADER msgs/example.proto) +PROTOBUF_GENERATE_CPP(DESC_PROTO_SRC DESC_PROTO_HEADER DESCRIPTORS DESC_PROTO_DESC msgs/example_desc.proto) +add_library(msgs ${PROTO_SRC} ${PROTO_HEADER}) + +add_executable(test_generate main-generate.cxx ${PROTO_SRC}) +target_include_directories(test_generate PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +target_link_libraries(test_generate msgs ${Protobuf_LIBRARIES}) +add_test(NAME test_generate COMMAND test_generate) + +add_executable(test_desc main-desc.cxx ${DESC_PROTO_SRC}) +target_compile_features(test_desc PRIVATE cxx_std_11) +target_include_directories(test_desc PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +target_link_libraries(test_desc msgs ${Protobuf_LIBRARIES}) +add_test(NAME test_desc COMMAND test_desc ${DESC_PROTO_DESC}) diff --git a/Tests/FindProtobuf/Test/main-desc.cxx b/Tests/FindProtobuf/Test/main-desc.cxx new file mode 100644 index 0000000..a26e562 --- /dev/null +++ b/Tests/FindProtobuf/Test/main-desc.cxx @@ -0,0 +1,57 @@ +#include <fstream> +#include <google/protobuf/descriptor.h> +#include <google/protobuf/descriptor.pb.h> +#include <google/protobuf/dynamic_message.h> +#include <google/protobuf/text_format.h> +#include <iostream> +#include <string> + +int main(int argc, char* argv[]) +{ + std::ifstream fs; + fs.open(argv[1], std::ifstream::in); + google::protobuf::FileDescriptorSet file_descriptor_set; + file_descriptor_set.ParseFromIstream(&fs); + + const google::protobuf::DescriptorPool* compiled_pool = + google::protobuf::DescriptorPool::generated_pool(); + + if (compiled_pool == NULL) { + std::cerr << "compiled pool is NULL." << std::endl; + return 1; + } + + google::protobuf::DescriptorPool pool(compiled_pool); + google::protobuf::DynamicMessageFactory dynamic_message_factory(&pool); + + for (const google::protobuf::FileDescriptorProto& file_descriptor_proto : + file_descriptor_set.file()) { + const google::protobuf::FileDescriptor* file_descriptor = + pool.BuildFile(file_descriptor_proto); + if (file_descriptor == NULL) { + continue; + } + + const google::protobuf::Descriptor* descriptor = + pool.FindMessageTypeByName("example.msgs.ExampleDesc"); + + if (descriptor == NULL) { + continue; + } + + google::protobuf::Message* msg = + dynamic_message_factory.GetPrototype(descriptor)->New(); + std::string data = "data: 1"; + bool success = google::protobuf::TextFormat::ParseFromString(data, msg); + + if (success) { + return 0; + } else { + std::cerr << "Failed to parse message." << std::endl; + return 2; + } + } + + std::cerr << "No matching message found." << std::endl; + return 3; +} diff --git a/Tests/FindProtobuf/Test/main-generate.cxx b/Tests/FindProtobuf/Test/main-generate.cxx new file mode 100644 index 0000000..ca33a68 --- /dev/null +++ b/Tests/FindProtobuf/Test/main-generate.cxx @@ -0,0 +1,8 @@ +#include <example.pb.h> + +int main() +{ + example::msgs::Example msg; + + return 0; +} diff --git a/Tests/FindProtobuf/Test/msgs/example.proto b/Tests/FindProtobuf/Test/msgs/example.proto new file mode 100644 index 0000000..d27262e --- /dev/null +++ b/Tests/FindProtobuf/Test/msgs/example.proto @@ -0,0 +1,6 @@ +syntax = "proto2"; +package example.msgs; + +message Example { + required int32 data = 1; +} diff --git a/Tests/FindProtobuf/Test/msgs/example_desc.proto b/Tests/FindProtobuf/Test/msgs/example_desc.proto new file mode 100644 index 0000000..4454473 --- /dev/null +++ b/Tests/FindProtobuf/Test/msgs/example_desc.proto @@ -0,0 +1,10 @@ +syntax = "proto2"; +package example.msgs; + +import "google/protobuf/descriptor.proto"; + +message ExampleDesc { + required int32 data = 1; + + optional google.protobuf.FileDescriptorSet desc = 2; +} diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt index 8ac3419..83fd11d 100644 --- a/Tests/GeneratorExpression/CMakeLists.txt +++ b/Tests/GeneratorExpression/CMakeLists.txt @@ -258,11 +258,13 @@ add_custom_target(check-part4 ALL VERBATIM ) +add_executable(srcgenex srcgenex.c) +set_property(SOURCE srcgenex.c PROPERTY COMPILE_FLAGS "-DNAME=$<TARGET_PROPERTY:NAME>") + #----------------------------------------------------------------------------- # Cover test properties with generator expressions. add_executable(echo echo.c) add_executable(pwd pwd.c) -set_property(SOURCE echo.c PROPERTY COMPILE_FLAGS $<1:-DSRC_GENEX_WORKS>) add_test(NAME echo-configuration COMMAND echo $<CONFIGURATION>) set_property(TEST echo-configuration PROPERTY diff --git a/Tests/GeneratorExpression/echo.c b/Tests/GeneratorExpression/echo.c index 41596a2..06b0844 100644 --- a/Tests/GeneratorExpression/echo.c +++ b/Tests/GeneratorExpression/echo.c @@ -3,9 +3,6 @@ int main(int argc, char* argv[]) { -#ifndef SRC_GENEX_WORKS -#error SRC_GENEX_WORKS not defined -#endif printf("%s\n", argv[1]); return EXIT_SUCCESS; } diff --git a/Tests/GeneratorExpression/srcgenex.c b/Tests/GeneratorExpression/srcgenex.c new file mode 100644 index 0000000..56d3c3f --- /dev/null +++ b/Tests/GeneratorExpression/srcgenex.c @@ -0,0 +1,12 @@ +int srcgenex(void) +{ + return 0; +} + +int main(int argc, char* argv[]) +{ +#ifndef NAME +#error NAME not defined +#endif + return NAME(); +} diff --git a/Tests/LoadCommand/CMakeLists.txt b/Tests/LoadCommand/CMakeLists.txt index 03a3b49..cfaebad 100644 --- a/Tests/LoadCommand/CMakeLists.txt +++ b/Tests/LoadCommand/CMakeLists.txt @@ -22,13 +22,6 @@ else() ${LoadCommand_SOURCE_DIR}/CMakeCommands CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO OUTPUT_VARIABLE OUTPUT ) -# do another TRY_COMPILE to get around make -# problem on hp - try_compile(COMPILE_OK - ${LoadCommand_BINARY_DIR}/CMakeCommands - ${LoadCommand_SOURCE_DIR}/CMakeCommands - CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO - OUTPUT_VARIABLE OUTPUT ) endif() message("Output from try compile: ${OUTPUT}") diff --git a/Tests/LoadCommandOneConfig/CMakeLists.txt b/Tests/LoadCommandOneConfig/CMakeLists.txt index 6affd34..65de042 100644 --- a/Tests/LoadCommandOneConfig/CMakeLists.txt +++ b/Tests/LoadCommandOneConfig/CMakeLists.txt @@ -28,13 +28,6 @@ else() ${LoadCommand_SOURCE_DIR}/CMakeCommands CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO OUTPUT_VARIABLE OUTPUT ) -# do another TRY_COMPILE to get around make -# problem on hp - try_compile(COMPILE_OK - ${LoadCommand_BINARY_DIR}/CMakeCommands - ${LoadCommand_SOURCE_DIR}/CMakeCommands - CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO - OUTPUT_VARIABLE OUTPUT ) endif() message("Output from try compile: ${OUTPUT}") diff --git a/Tests/RunCMake/Framework/FrameworkTypeSTATIC-build-stdout.txt b/Tests/RunCMake/Framework/FrameworkTypeSTATIC-build-stdout.txt index 532cfed..4b5f761 100644 --- a/Tests/RunCMake/Framework/FrameworkTypeSTATIC-build-stdout.txt +++ b/Tests/RunCMake/Framework/FrameworkTypeSTATIC-build-stdout.txt @@ -1,2 +1,2 @@ -.*/Framework:( Mach-O universal binary with [^ -]*)? current ar archive random library.* +/Framework: (Mach-O universal binary with [^ +]*)?current ar archive random library diff --git a/Tests/RunCMake/Framework/ios.cmake b/Tests/RunCMake/Framework/ios.cmake index 209a50d..446e914 100644 --- a/Tests/RunCMake/Framework/ios.cmake +++ b/Tests/RunCMake/Framework/ios.cmake @@ -20,6 +20,16 @@ execute_process( OUTPUT_VARIABLE IOS_SDK_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) +execute_process( + COMMAND ${XCRUN_EXECUTABLE} --sdk iphoneos --show-sdk-version + OUTPUT_VARIABLE IOS_SDK_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) +if(IOS_SDK_VERSION VERSION_GREATER_EQUAL 11.0) + set(IOS_ARCH arm64) +else() + set(IOS_ARCH armv7) +endif() + set(CMAKE_OSX_SYSROOT ${IOS_SDK_PATH} CACHE PATH "Sysroot used for iOS support") -set(CMAKE_OSX_ARCHITECTURES "armv7" CACHE STRING "Architectures to build for") +set(CMAKE_OSX_ARCHITECTURES "${IOS_ARCH}" CACHE STRING "Architectures to build for") set(CMAKE_FIND_ROOT_PATH ${IOS_SDK_PATH} CACHE PATH "Find search path root") diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake index 5f4bdc3..554aa2f 100644 --- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake @@ -129,7 +129,9 @@ if(NOT XCODE_VERSION VERSION_LESS 6) unset(RunCMake_TEST_BINARY_DIR) unset(RunCMake_TEST_NO_CLEAN) unset(RunCMake_TEST_OPTIONS) +endif() +if(XCODE_VERSION VERSION_GREATER_EQUAL 6 AND XCODE_VERSION VERSION_LESS 9) # XcodeIOSInstallCombinedPrune set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeIOSInstallCombinedPrune-build) set(RunCMake_TEST_NO_CLEAN 1) diff --git a/Tests/RunCMake/XcodeProject/XcodeBundles.cmake b/Tests/RunCMake/XcodeProject/XcodeBundles.cmake index 0b854d8..cee71fa 100644 --- a/Tests/RunCMake/XcodeProject/XcodeBundles.cmake +++ b/Tests/RunCMake/XcodeProject/XcodeBundles.cmake @@ -5,7 +5,11 @@ enable_language(C) if(TEST_IOS) set(CMAKE_OSX_SYSROOT iphoneos) - set(CMAKE_OSX_ARCHITECTURES "armv7") + if(XCODE_VERSION VERSION_GREATER_EQUAL 9) + set(CMAKE_OSX_ARCHITECTURES "arm64") + else() + set(CMAKE_OSX_ARCHITECTURES "armv7") + endif() set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO") endif(TEST_IOS) diff --git a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined-install-check.cmake b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined-install-check.cmake index a1c0671..cd71205 100644 --- a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined-install-check.cmake +++ b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined-install-check.cmake @@ -13,7 +13,11 @@ function(verify_architectures file) string(REPLACE "architecture " "" actual "${architectures}") list(SORT actual) - set(expected arm64 armv7 i386 x86_64) + if(XCODE_VERSION VERSION_GREATER_EQUAL 9) + set(expected arm64 x86_64) + else() + set(expected arm64 armv7 i386 x86_64) + endif() if(NOT actual STREQUAL expected) message(SEND_ERROR diff --git a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined.cmake b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined.cmake index fc830b1..6abba49 100644 --- a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined.cmake +++ b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined.cmake @@ -7,7 +7,11 @@ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf") set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO") -set(CMAKE_OSX_ARCHITECTURES "armv7;arm64;i386;x86_64") +if(XCODE_VERSION VERSION_GREATER_EQUAL 9) + set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") +else() + set(CMAKE_OSX_ARCHITECTURES "armv7;arm64;i386;x86_64") +endif() add_executable(foo_app MACOSX_BUNDLE main.cpp) install(TARGETS foo_app BUNDLE DESTINATION bin) diff --git a/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake b/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake index a797410..f629f2e 100644 --- a/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake +++ b/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake @@ -6,7 +6,11 @@ set(CMAKE_OSX_SYSROOT iphoneos) set(XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO") -set(CMAKE_OSX_ARCHITECTURES "armv7;i386") +if(XCODE_VERSION VERSION_GREATER_EQUAL 9) + set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") +else() + set(CMAKE_OSX_ARCHITECTURES "armv7;i386") +endif() add_library(foo STATIC foo.cpp) install(TARGETS foo ARCHIVE DESTINATION lib) diff --git a/Utilities/Release/upload_release.cmake b/Utilities/Release/upload_release.cmake index 5b2cc57..3c83957 100644 --- a/Utilities/Release/upload_release.cmake +++ b/Utilities/Release/upload_release.cmake @@ -1,6 +1,6 @@ set(CTEST_RUN_CURRENT_SCRIPT 0) if(NOT VERSION) - set(VERSION 3.9) + set(VERSION 3.10) endif() if(NOT DEFINED PROJECT_PREFIX) set(PROJECT_PREFIX cmake-${VERSION}) diff --git a/Utilities/Scripts/clang-format.bash b/Utilities/Scripts/clang-format.bash index 428a9e4..3b331a1 100755 --- a/Utilities/Scripts/clang-format.bash +++ b/Utilities/Scripts/clang-format.bash @@ -111,7 +111,9 @@ $git_ls | # Select sources with our attribute. git check-attr --stdin format.clang-format | - sed -n '/: format\.clang-format: set$/ {s/:[^:]*:[^:]*$//p}' | + grep -e ': format\.clang-format: set$' | + sed -n 's/:[^:]*:[^:]*$//p' | # Update sources in-place. - xargs -d '\n' "$clang_format" -i + tr '\n' '\0' | + xargs -0 "$clang_format" -i |