diff options
90 files changed, 705 insertions, 267 deletions
diff --git a/Help/cpack_gen/deb.rst b/Help/cpack_gen/deb.rst index 26021cc..fdde654 100644 --- a/Help/cpack_gen/deb.rst +++ b/Help/cpack_gen/deb.rst @@ -1,20 +1,20 @@ -CPack Deb Generator +CPack DEB Generator ------------------- -The built in (binary) CPack Deb generator (Unix only) +The built in (binary) CPack DEB generator (Unix only) Variables specific to CPack Debian (DEB) generator ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The CPack Deb generator may be used to create Deb package using :module:`CPack`. -The CPack Deb generator is a :module:`CPack` generator thus it uses the +The CPack DEB generator may be used to create DEB package using :module:`CPack`. +The CPack DEB generator is a :module:`CPack` generator thus it uses the ``CPACK_XXX`` variables used by :module:`CPack`. -The CPack Deb generator should work on any Linux host but it will produce +The CPack DEB generator should work on any Linux host but it will produce better deb package when Debian specific tools ``dpkg-xxx`` are usable on the build system. -The CPack Deb generator has specific features which are controlled by the +The CPack DEB generator has specific features which are controlled by the specifics :code:`CPACK_DEBIAN_XXX` variables. :code:`CPACK_DEBIAN_<COMPONENT>_XXXX` variables may be used in order to have @@ -22,13 +22,13 @@ specifics :code:`CPACK_DEBIAN_XXX` variables. the **grouping name** written in upper case. It may be either a component name or a component GROUP name. -Here are some CPack Deb generator wiki resources that are here for historic +Here are some CPack DEB generator wiki resources that are here for historic reasons and are no longer maintained but may still prove useful: - https://gitlab.kitware.com/cmake/community/wikis/doc/cpack/Configuration - https://gitlab.kitware.com/cmake/community/wikis/doc/cpack/PackageGenerators#deb-unix-only -List of CPack Deb generator specific variables: +List of CPack DEB generator specific variables: .. variable:: CPACK_DEB_COMPONENT_INSTALL @@ -64,7 +64,7 @@ List of CPack Deb generator specific variables: * Mandatory : YES * Default : ``<CPACK_PACKAGE_FILE_NAME>[-<component>].deb`` - This may be set to ``DEB-DEFAULT`` to allow the CPack Deb generator to generate + This may be set to ``DEB-DEFAULT`` to allow the CPack DEB generator to generate package file name by itself in deb format:: <PackageName>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb @@ -75,7 +75,7 @@ List of CPack Deb generator specific variables: .. note:: Preferred setting of this variable is ``DEB-DEFAULT`` but for backward - compatibility with the CPack Deb generator in CMake prior to version 3.6 this + compatibility with the CPack DEB generator in CMake prior to version 3.6 this feature is disabled by default. .. note:: @@ -279,7 +279,7 @@ List of CPack Deb generator specific variables: .. variable:: CPACK_DEBIAN_PACKAGE_DEBUG May be set when invoking cpack in order to trace debug information - during the CPack Deb generator run. + during the CPack DEB generator run. * Mandatory : NO * Default : - @@ -553,5 +553,5 @@ Reproducible packages The environment variable ``SOURCE_DATE_EPOCH`` may be set to a UNIX timestamp, defined as the number of seconds, excluding leap seconds, -since 01 Jan 1970 00:00:00 UTC. If set, the CPack Deb generator will +since 01 Jan 1970 00:00:00 UTC. If set, the CPack DEB generator will use its value for timestamps in the package. diff --git a/Help/cpack_gen/dmg.rst b/Help/cpack_gen/dmg.rst index b7b3a0a..1e37889 100644 --- a/Help/cpack_gen/dmg.rst +++ b/Help/cpack_gen/dmg.rst @@ -1,7 +1,7 @@ -CPack DMG Generator -------------------- +CPack DragNDrop Generator +------------------------- -DragNDrop CPack generator (macOS). +The DragNDrop CPack generator (macOS) creates a DMG image. Variables specific to CPack DragNDrop generator ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/Help/cpack_gen/external.rst b/Help/cpack_gen/external.rst index f98e1c9..e4912a4 100644 --- a/Help/cpack_gen/external.rst +++ b/Help/cpack_gen/external.rst @@ -21,11 +21,11 @@ install and package files as required. Alternatively CPack can invoke an external packaging software through an optional custom CMake script in -:variable:`CPACK_EXT_PACKAGE_SCRIPT` instead. +:variable:`CPACK_EXTERNAL_PACKAGE_SCRIPT` instead. Staging of installation files may also optionally be taken care of by the generator when enabled through the -:variable:`CPACK_EXT_ENABLE_STAGING` variable. +:variable:`CPACK_EXTERNAL_ENABLE_STAGING` variable. JSON Format ^^^^^^^^^^^ @@ -46,10 +46,10 @@ always of the format ``major.minor``. In other words, it always has exactly two parts, separated by a period. You can request one or more specific versions of the output format as described -below with :variable:`CPACK_EXT_REQUESTED_VERSIONS`. The output format will +below with :variable:`CPACK_EXTERNAL_REQUESTED_VERSIONS`. The output format will have a major version that exactly matches the requested major version, and a minor version that is greater than or equal to the requested minor version. If -no version is requested with :variable:`CPACK_EXT_REQUESTED_VERSIONS`, the +no version is requested with :variable:`CPACK_EXTERNAL_REQUESTED_VERSIONS`, the latest known major version is used by default. Currently, the only supported format is 1.0, which is described below. @@ -234,7 +234,7 @@ following fields in the root: Variables specific to CPack External generator ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. variable:: CPACK_EXT_REQUESTED_VERSIONS +.. variable:: CPACK_EXTERNAL_REQUESTED_VERSIONS This variable is used to request a specific version of the CPack External generator. It is a list of ``major.minor`` values, separated by semicolons. @@ -248,7 +248,7 @@ Variables specific to CPack External generator The generator knows how to generate the version if it has a versioned generator whose major version exactly matches the requested major version, and whose minor version is greater than or equal to the requested minor - version. For example, if ``CPACK_EXT_REQUESTED_VERSIONS`` contains 1.0, and + version. For example, if ``CPACK_EXTERNAL_REQUESTED_VERSIONS`` contains 1.0, and the CPack External generator knows how to generate 1.1, it will generate 1.1. If the generator doesn't know how to generate a version in the list, it skips the version and looks at the next one. If it doesn't know how to generate any @@ -257,11 +257,11 @@ Variables specific to CPack External generator If this variable is not set, or is empty, the CPack External generator will generate the highest major and minor version that it knows how to generate. - If an invalid version is encountered in ``CPACK_EXT_REQUESTED_VERSIONS`` (one + If an invalid version is encountered in ``CPACK_EXTERNAL_REQUESTED_VERSIONS`` (one that doesn't match ``major.minor``, where ``major`` and ``minor`` are integers), it is ignored. -.. variable:: CPACK_EXT_ENABLE_STAGING +.. variable:: CPACK_EXTERNAL_ENABLE_STAGING This variable can be set to true to enable optional installation into a temporary staging area which can then be picked up @@ -274,7 +274,7 @@ Variables specific to CPack External generator It also contains the staging area ``CPACK_TEMPORARY_DIRECTORY`` into which CPack performs the installation when staging is enabled. -.. variable:: CPACK_EXT_PACKAGE_SCRIPT +.. variable:: CPACK_EXTERNAL_PACKAGE_SCRIPT This variable can optionally specify the full path to a CMake script file to be run as part of the CPack invocation. diff --git a/Help/cpack_gen/freebsd.rst b/Help/cpack_gen/freebsd.rst index 2419057..b22ea9a 100644 --- a/Help/cpack_gen/freebsd.rst +++ b/Help/cpack_gen/freebsd.rst @@ -13,7 +13,7 @@ depending on the installed package-management tools -- using :module:`CPack`. The CPack FreeBSD generator is a :module:`CPack` generator and uses the ``CPACK_XXX`` variables used by :module:`CPack`. It tries to re-use packaging information that may already be specified for Debian packages for the -:cpack_gen:`CPack Deb Generator`. It also tries to re-use RPM packaging +:cpack_gen:`CPack DEB Generator`. It also tries to re-use RPM packaging information when Debian does not specify. The CPack FreeBSD generator should work on any host with libpkg installed. The diff --git a/Help/cpack_gen/wix.rst b/Help/cpack_gen/wix.rst index fc8a098..dde4943 100644 --- a/Help/cpack_gen/wix.rst +++ b/Help/cpack_gen/wix.rst @@ -1,9 +1,9 @@ -CPack WiX Generator +CPack WIX Generator ------------------- -CPack WiX generator specific options +CPack WIX generator specific options -Variables specific to CPack WiX generator +Variables specific to CPack WIX generator ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The following variables are specific to the installers built on @@ -50,11 +50,11 @@ Windows using WiX. If CPACK_RESOURCE_FILE_LICENSE has an .rtf extension it is used as-is. If CPACK_RESOURCE_FILE_LICENSE has an .txt extension it is implicitly - converted to RTF by the WiX Generator. + converted to RTF by the WIX Generator. The expected encoding of the .txt file is UTF-8. With CPACK_WIX_LICENSE_RTF you can override the license file used by the - WiX Generator in case CPACK_RESOURCE_FILE_LICENSE is in an unsupported + WIX Generator in case CPACK_RESOURCE_FILE_LICENSE is in an unsupported format or the .txt -> .rtf conversion does not work as expected. .. variable:: CPACK_WIX_PRODUCT_ICON @@ -122,10 +122,10 @@ Windows using WiX. generated WiX sources This optional variable can be used to specify an XML file that the - WiX generator will use to inject fragments into its generated + WIX generator will use to inject fragments into its generated source files. - Patch files understood by the CPack WiX generator + Patch files understood by the CPack WIX generator roughly follow this RELAX NG compact schema: .. code-block:: none @@ -155,7 +155,7 @@ Windows using WiX. The following example illustrates how this works. - Given that the WiX generator creates the following XML element: + Given that the WIX generator creates the following XML element: .. code-block:: xml diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst index f05c4b1..c3bbf28 100644 --- a/Help/manual/cmake-developer.7.rst +++ b/Help/manual/cmake-developer.7.rst @@ -13,6 +13,9 @@ Introduction This manual is intended for reference by developers modifying the CMake source tree itself, and by those authoring externally-maintained modules. +See https://cmake.org/get-involved/ to get involved in development of +CMake upstream. + Adding Compile Features ======================= diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 1651114..047859d 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -124,6 +124,7 @@ Properties on Targets /prop_tgt/ARCHIVE_OUTPUT_NAME_CONFIG /prop_tgt/ARCHIVE_OUTPUT_NAME /prop_tgt/AUTOGEN_BUILD_DIR + /prop_tgt/AUTOGEN_ORIGIN_DEPENDS /prop_tgt/AUTOGEN_PARALLEL /prop_tgt/AUTOGEN_TARGET_DEPENDS /prop_tgt/AUTOMOC_COMPILER_PREDEFINES diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst index 724d8ec..0382794 100644 --- a/Help/manual/cmake-qt.7.rst +++ b/Help/manual/cmake-qt.7.rst @@ -44,14 +44,10 @@ Qt Build Tools Qt relies on some bundled tools for code generation, such as ``moc`` for meta-object code generation, ``uic`` for widget layout and population, -and ``rcc`` for virtual filesystem content generation. These tools may be +and ``rcc`` for virtual file system content generation. These tools may be automatically invoked by :manual:`cmake(1)` if the appropriate conditions are met. The automatic tool invocation may be used with both Qt 4 and Qt 5. -The tools are executed as part of a synthesized custom target generated by -CMake. Target dependencies may be added to that custom target by adding them -to the :prop_tgt:`AUTOGEN_TARGET_DEPENDS` target property. - AUTOMOC ^^^^^^^ @@ -214,19 +210,31 @@ overrides options from the :prop_tgt:`AUTORCC_OPTIONS` target property. Source files can be excluded from :prop_tgt:`AUTORCC` processing by enabling :prop_sf:`SKIP_AUTORCC` or the broader :prop_sf:`SKIP_AUTOGEN`. +The ``<ORIGIN>_autogen`` target +=============================== + +The ``moc`` and ``uic`` tools are executed as part of a synthesized +``<ORIGIN>_autogen`` :command:`custom target <add_custom_target>` generated by +CMake. By default that ``<ORIGIN>_autogen`` target inherits the dependencies +of the ``<ORIGIN>`` target (see :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS`). +Target dependencies may be added to the ``<ORIGIN>_autogen`` target by adding +them to the :prop_tgt:`AUTOGEN_TARGET_DEPENDS` target property. + Visual Studio Generators ======================== -When using the :manual:`Visual Studio generators <cmake-generators(7)>`, -CMake uses a ``PRE_BUILD`` :command:`custom command <add_custom_command>` for -:prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`. -If the :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` processing depends on files, -a :command:`custom target <add_custom_target>` is used instead. -This happens when - -- The origin target depends on :prop_sf:`GENERATED` files which aren't excluded - from :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` by :prop_sf:`SKIP_AUTOMOC`, - :prop_sf:`SKIP_AUTOUIC`, :prop_sf:`SKIP_AUTOGEN` or :policy:`CMP0071` +When using the :manual:`Visual Studio generators <cmake-generators(7)>`, CMake +generates a ``PRE_BUILD`` :command:`custom command <add_custom_command>` +instead of the ``<ORIGIN>_autogen`` :command:`custom target <add_custom_target>` +(for :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`). +This isn't always possible though and +an ``<ORIGIN>_autogen`` :command:`custom target <add_custom_target>` is used, +when either + +- the ``<ORIGIN>`` target depends on :prop_sf:`GENERATED` files which aren't + excluded from :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` by + :prop_sf:`SKIP_AUTOMOC`, :prop_sf:`SKIP_AUTOUIC`, :prop_sf:`SKIP_AUTOGEN` + or :policy:`CMP0071` - :prop_tgt:`AUTOGEN_TARGET_DEPENDS` lists a source file qtmain.lib on Windows diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index b88c661..9b12fc5 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -309,6 +309,7 @@ Variables that Control the Build /variable/CMAKE_ANDROID_STL_TYPE /variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY /variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CONFIG + /variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS /variable/CMAKE_AUTOGEN_PARALLEL /variable/CMAKE_AUTOGEN_VERBOSE /variable/CMAKE_AUTOMOC diff --git a/Help/module/CPackDMG.rst b/Help/module/CPackDMG.rst index a597002..e59dcbb 100644 --- a/Help/module/CPackDMG.rst +++ b/Help/module/CPackDMG.rst @@ -1,4 +1,4 @@ CPackDMG -------- -The documentation for the CPack DMG generator has moved here: :cpack_gen:`CPack DMG Generator` +The documentation for the CPack DragNDrop generator has moved here: :cpack_gen:`CPack DragNDrop Generator` diff --git a/Help/module/CPackDeb.rst b/Help/module/CPackDeb.rst index 73e59a2..cd7e5f3 100644 --- a/Help/module/CPackDeb.rst +++ b/Help/module/CPackDeb.rst @@ -1,4 +1,4 @@ CPackDeb -------- -The documentation for the CPack Deb generator has moved here: :cpack_gen:`CPack Deb Generator` +The documentation for the CPack DEB generator has moved here: :cpack_gen:`CPack DEB Generator` diff --git a/Help/module/CPackWIX.rst b/Help/module/CPackWIX.rst index e1d4a03..c88c723 100644 --- a/Help/module/CPackWIX.rst +++ b/Help/module/CPackWIX.rst @@ -1,4 +1,4 @@ CPackWIX -------- -The documentation for the CPack WiX generator has moved here: :cpack_gen:`CPack WiX Generator` +The documentation for the CPack WIX generator has moved here: :cpack_gen:`CPack WIX Generator` diff --git a/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst b/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst new file mode 100644 index 0000000..f61089a --- /dev/null +++ b/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst @@ -0,0 +1,26 @@ +AUTOGEN_ORIGIN_DEPENDS +---------------------- + +Switch for forwarding origin target dependencies to the corresponding +``_autogen`` target. + +Targets which have their :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC` property +``ON`` have a corresponding ``_autogen`` target which is used to auto generate +``moc`` and ``uic`` files. As this ``_autogen`` target is created at +generate-time, it is not possible to define dependencies of it, +such as to create inputs for the ``moc`` or ``uic`` executable. + +The dependencies of the ``_autogen`` target are composed from + +- the origin target dependencies + (by default enabled via :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS`) +- user defined dependencies from :prop_tgt:`AUTOGEN_TARGET_DEPENDS` + +:prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` decides whether the origin target +dependencies should be forwarded to the ``_autogen`` target or not. + +By default :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` is initialized from +:variable:`CMAKE_AUTOGEN_ORIGIN_DEPENDS` which is ``ON`` by default. + +See the :manual:`cmake-qt(7)` manual for more information on using CMake +with Qt. diff --git a/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst b/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst index 7d3dfd1..84c2bfe 100644 --- a/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst +++ b/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst @@ -9,9 +9,15 @@ Targets which have their :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC` property generate-time, it is not possible to define dependencies of it, such as to create inputs for the ``moc`` or ``uic`` executable. -The :prop_tgt:`AUTOGEN_TARGET_DEPENDS` target property can be set instead to a -list of dependencies of the ``_autogen`` target. Dependencies can be target -names or file names. +The dependencies of the ``_autogen`` target are composed from + +- the origin target dependencies + (by default enabled via :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS`) +- user defined dependencies from :prop_tgt:`AUTOGEN_TARGET_DEPENDS` + +The :prop_tgt:`AUTOGEN_TARGET_DEPENDS` target property can be set to a +list of additional dependencies for the ``_autogen`` target. Dependencies +can be target names or file names. See the :manual:`cmake-qt(7)` manual for more information on using CMake with Qt. diff --git a/Help/prop_tgt/AUTOMOC.rst b/Help/prop_tgt/AUTOMOC.rst index 3bd693a..70d89f2 100644 --- a/Help/prop_tgt/AUTOMOC.rst +++ b/Help/prop_tgt/AUTOMOC.rst @@ -3,8 +3,8 @@ AUTOMOC Should the target be processed with automoc (for Qt projects). -AUTOMOC is a boolean specifying whether CMake will handle the Qt ``moc`` -preprocessor automatically, i.e. without having to use the +:prop_tgt:`AUTOMOC` is a boolean specifying whether CMake will handle the Qt +``moc`` preprocessor automatically, i.e. without having to use the :module:`QT4_WRAP_CPP() <FindQt4>` or QT5_WRAP_CPP() macro. Currently Qt4 and Qt5 are supported. diff --git a/Help/prop_tgt/AUTORCC.rst b/Help/prop_tgt/AUTORCC.rst index 3cc5990..99c2b0e 100644 --- a/Help/prop_tgt/AUTORCC.rst +++ b/Help/prop_tgt/AUTORCC.rst @@ -3,7 +3,7 @@ AUTORCC Should the target be processed with autorcc (for Qt projects). -``AUTORCC`` is a boolean specifying whether CMake will handle +:prop_tgt:`AUTORCC` is a boolean specifying whether CMake will handle the Qt ``rcc`` code generator automatically, i.e. without having to use the :module:`QT4_ADD_RESOURCES() <FindQt4>` or ``QT5_ADD_RESOURCES()`` macro. Currently Qt4 and Qt5 are supported. diff --git a/Help/prop_tgt/AUTOUIC.rst b/Help/prop_tgt/AUTOUIC.rst index 4fc603f..8cae0a7 100644 --- a/Help/prop_tgt/AUTOUIC.rst +++ b/Help/prop_tgt/AUTOUIC.rst @@ -3,7 +3,7 @@ AUTOUIC Should the target be processed with autouic (for Qt projects). -``AUTOUIC`` is a boolean specifying whether CMake will handle +:prop_tgt:`AUTOUIC` is a boolean specifying whether CMake will handle the Qt ``uic`` code generator automatically, i.e. without having to use the :module:`QT4_WRAP_UI() <FindQt4>` or ``QT5_WRAP_UI()`` macro. Currently Qt4 and Qt5 are supported. diff --git a/Help/release/3.1.rst b/Help/release/3.1.rst index 8278353..8bea28f 100644 --- a/Help/release/3.1.rst +++ b/Help/release/3.1.rst @@ -294,11 +294,11 @@ CPack * :manual:`cpack(1)` gained ``7Z`` and ``TXZ`` generators supporting lzma-compressed archives. -* The :cpack_gen:`CPack Deb Generator` learned a new +* The :cpack_gen:`CPack DEB Generator` learned a new :variable:`CPACK_DEBIAN_COMPRESSION_TYPE` variable to set the tarball compression type. -* The :manual:`cpack(1)` ``WiX`` generator learned to support +* The :cpack_gen:`CPack WIX Generator` learned to support a :prop_inst:`CPACK_WIX_ACL` installed file property to specify an Access Control List. diff --git a/Help/release/3.10.rst b/Help/release/3.10.rst index 66a1d09..03eda36 100644 --- a/Help/release/3.10.rst +++ b/Help/release/3.10.rst @@ -186,15 +186,15 @@ CPack * A :cpack_gen:`CPack FreeBSD Generator` was added for FreeBSD ``pkg(8)``. -* The :cpack_gen:`CPack Deb Generator` was enabled on Windows. While not +* The :cpack_gen:`CPack DEB Generator` 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 :cpack_gen:`CPack Deb Generator` learned to set package release +* The :cpack_gen:`CPack DEB Generator` learned to set package release version in ``Version`` info property. See the :variable:`CPACK_DEBIAN_PACKAGE_RELEASE` variable. -* The :cpack_gen:`CPack Deb Generator` learned more strict package +* The :cpack_gen:`CPack DEB Generator` learned more strict package version checking that complies with Debian rules. * The :module:`CPackIFW` module :command:`cpack_ifw_configure_component` and @@ -211,7 +211,7 @@ CPack repack dependent components. This feature is only available when using QtIFW 3.1 or later. -* The :cpack_gen:`CPack RPM Generator` and :cpack_gen:`CPack Deb Generator` +* The :cpack_gen:`CPack RPM Generator` and :cpack_gen:`CPack DEB Generator` learned to set the package epoch version. See :variable:`CPACK_RPM_PACKAGE_EPOCH` and :variable:`CPACK_DEBIAN_PACKAGE_EPOCH` variables. diff --git a/Help/release/3.13.rst b/Help/release/3.13.rst index f547556..9f7e61f 100644 --- a/Help/release/3.13.rst +++ b/Help/release/3.13.rst @@ -138,6 +138,9 @@ Properties Modules ------- +* The :module:`FindBoost` module gained a ``Boost_ARCHITECTURE`` option + to specify a Boost architecture-specific library filename fragment. + * The :module:`FindCURL` module learned to find debug and release variants separately. @@ -178,11 +181,11 @@ CTest CPack ----- -* The :cpack_gen:`CPack Deb Generator` learned to split debug symbols into +* The :cpack_gen:`CPack DEB Generator` learned to split debug symbols into a corresponding .ddeb package when ``CPACK_DEBIAN_DEBUGINFO_PACKAGE`` is set. -* The :cpack_gen:`CPack Deb Generator` learned to honor the ``SOURCE_DATE_EPOCH`` +* The :cpack_gen:`CPack DEB Generator` learned to honor the ``SOURCE_DATE_EPOCH`` environment variable when packaging files. This is useful for generating reproducible packages. diff --git a/Help/release/3.3.rst b/Help/release/3.3.rst index 11f0c60..6657e8d 100644 --- a/Help/release/3.3.rst +++ b/Help/release/3.3.rst @@ -172,11 +172,11 @@ CPack * The :cpack_gen:`CPack IFW Generator` learned to support Qt Framework Installer 2.0 tools. -* The :cpack_gen:`CPack Deb Generator` learned a new +* The :cpack_gen:`CPack DEB Generator` learned a new :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_SHLIBDEPS` variable to specify per-component use of ``dpkg-shlibdeps``. -* The :cpack_gen:`CPack Deb Generator` learned a new +* The :cpack_gen:`CPack DEB Generator` learned a new :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS` option to specify per-component dependencies. diff --git a/Help/release/3.4.rst b/Help/release/3.4.rst index 0a0e6df..943d267 100644 --- a/Help/release/3.4.rst +++ b/Help/release/3.4.rst @@ -197,7 +197,7 @@ CTest CPack ----- -* The :cpack_gen:`CPack Deb Generator` learned to set package dependencies +* The :cpack_gen:`CPack DEB Generator` learned to set package dependencies per component. See variables: * :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_BREAKS` @@ -249,10 +249,10 @@ Other Changes :module:`CheckSymbolExists`, and :module:`FindThreads` modules learned to work in environments where only CXX is enabled. -* The :cpack_gen:`CPack Deb Generator` now correctly excludes symlinks +* The :cpack_gen:`CPack DEB Generator` now correctly excludes symlinks during package checksum calculation. -* The :cpack_gen:`CPack Deb Generator` no longer uses fakeroot and +* The :cpack_gen:`CPack DEB Generator` no longer uses fakeroot and system tar program for packaging. * The :module:`CPack` module no longer mangles settings with CMake-special diff --git a/Help/release/3.5.rst b/Help/release/3.5.rst index f988908..58a5d4e 100644 --- a/Help/release/3.5.rst +++ b/Help/release/3.5.rst @@ -120,23 +120,23 @@ Platforms CPack ----- -* The :cpack_gen:`CPack DMG Generator` learned new variable to +* The :cpack_gen:`CPack DragNDrop Generator` learned new variable to specify AppleScript file run to customize appearance of ``DragNDrop`` installer folder, including background image setting using supplied PNG or multi-resolution TIFF file. See the :variable:`CPACK_DMG_DS_STORE_SETUP_SCRIPT` and :variable:`CPACK_DMG_BACKGROUND_IMAGE` variables. -* The :cpack_gen:`CPack Deb Generator` learned to set the optional config +* The :cpack_gen:`CPack DEB Generator` learned to set the optional config file ``Source`` field using a monolithic or per-component variable. See :variable:`CPACK_DEBIAN_PACKAGE_SOURCE`. -* The :cpack_gen:`CPack Deb Generator` learned to set Package, Section +* The :cpack_gen:`CPack DEB Generator` learned to set Package, Section and Priority control fields per-component. See variables :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_SECTION` and :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_PRIORITY`. -* The :cpack_gen:`CPack DMG Generator` learned to add +* The :cpack_gen:`CPack DragNDrop Generator` learned to add multi-lingual SLAs to a DMG which is presented to the user when they try to mount the DMG. See the :variable:`CPACK_DMG_SLA_LANGUAGES` and :variable:`CPACK_DMG_SLA_DIR` variables for details. diff --git a/Help/release/3.6.rst b/Help/release/3.6.rst index b2403cf..f0add07 100644 --- a/Help/release/3.6.rst +++ b/Help/release/3.6.rst @@ -165,24 +165,24 @@ CTest CPack ----- -* The :cpack_gen:`CPack Deb Generator` learned how to handle ``$ORIGIN`` +* The :cpack_gen:`CPack DEB Generator` learned how to handle ``$ORIGIN`` in ``CMAKE_INSTALL_RPATH`` when :variable:`CPACK_DEBIAN_PACKAGE_SHLIBDEPS` is used for dependency auto detection. -* The :cpack_gen:`CPack Deb Generator` learned how to generate +* The :cpack_gen:`CPack DEB Generator` learned how to generate ``DEBIAN/shlibs`` contorl file when package contains shared libraries. -* The :cpack_gen:`CPack Deb Generator` learned how to generate +* The :cpack_gen:`CPack DEB Generator` learned how to generate ``DEBIAN/postinst`` and ``DEBIAN/postrm`` files if the package installs libraries in ldconfig-controlled locations (e.g. ``/lib/``, ``/usr/lib/``). -* The :cpack_gen:`CPack Deb Generator` learned how to generate dependencies +* The :cpack_gen:`CPack DEB Generator` learned how to generate dependencies between Debian packages if multi-component setup is used and :variable:`CPACK_COMPONENT_<compName>_DEPENDS` variables are set. For backward compatibility this feature is disabled by default. See :variable:`CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS`. -* The :cpack_gen:`CPack Deb Generator` learned how to set custom package +* The :cpack_gen:`CPack DEB Generator` learned how to set custom package file names including how to generate properly-named Debian packages:: <PackageName>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb @@ -191,17 +191,17 @@ CPack :variable:`CPACK_DEBIAN_FILE_NAME` and :variable:`CPACK_DEBIAN_<COMPONENT>_FILE_NAME`. -* The :cpack_gen:`CPack Deb Generator` learned how to set the package +* The :cpack_gen:`CPack DEB Generator` learned how to set the package release number (``DebianRevisionNumber`` in package file name when used in combination with ``DEB-DEFAULT`` value set by :variable:`CPACK_DEBIAN_FILE_NAME`). See :variable:`CPACK_DEBIAN_PACKAGE_RELEASE`. -* The :cpack_gen:`CPack Deb Generator` learned how to set the package +* The :cpack_gen:`CPack DEB Generator` learned how to set the package architecture per-component. See :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_ARCHITECTURE`. -* The :cpack_gen:`CPack DMG Generator` learned a new option to skip the +* The :cpack_gen:`CPack DragNDrop Generator` learned a new option to skip the ``/Applications`` symlink. See the :variable:`CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK` variable. diff --git a/Help/release/3.7.rst b/Help/release/3.7.rst index fae10f5..345c056 100644 --- a/Help/release/3.7.rst +++ b/Help/release/3.7.rst @@ -226,7 +226,7 @@ CPack * CPack gained a new :variable:`CPACK_PACKAGE_CHECKSUM` variable to enable generation of a checksum file for each package file. -* The :cpack_gen:`CPack Deb Generator` learned to support long file names +* The :cpack_gen:`CPack DEB Generator` learned to support long file names when archive format is set to GNU tar. See :variable:`CPACK_DEBIAN_ARCHIVE_TYPE` @@ -252,19 +252,19 @@ CPack :variable:`CPACK_NSIS_<compName>_INSTALL_DIRECTORY`. This can be used to set component specific installation directories. -* The :cpack_gen:`CPack WiX Generator` now supports +* The :cpack_gen:`CPack WIX Generator` now supports :variable:`CPACK_WIX_SKIP_PROGRAM_FOLDER` to allow specification of a custom absolute installation prefix outside of the ProgramFiles folders. -* The :cpack_gen:`CPack WiX Generator` now supports +* The :cpack_gen:`CPack WIX Generator` now supports :variable:`CPACK_COMPONENT_<compName>_DISABLED`. This can be used to deselect a component from being installed by default. -* The :cpack_gen:`CPack WiX Generator` now supports +* The :cpack_gen:`CPack WIX Generator` now supports :variable:`CPACK_WIX_PATCH_FILE` fragments for Feature elements. -* The :cpack_gen:`CPack WiX Generator` now supports +* The :cpack_gen:`CPack WIX Generator` now supports :variable:`CPACK_WIX_ROOT_FEATURE_TITLE` and :variable:`CPACK_WIX_ROOT_FEATURE_DESCRIPTION` to allow the specification of a custom title and description for the root feature element. diff --git a/Help/release/3.9.rst b/Help/release/3.9.rst index 5001e90..ffa95aa 100644 --- a/Help/release/3.9.rst +++ b/Help/release/3.9.rst @@ -232,12 +232,12 @@ CPack * The :cpack_gen:`CPack RPM Generator` learned to modify the ``debuginfo`` package name. See the :variable:`CPACK_RPM_DEBUGINFO_FILE_NAME` variable. -* The :cpack_gen:`CPack WiX Generator` patching system now has the +* The :cpack_gen:`CPack WIX Generator` patching system now has the ability to set additional attributes. This can be done by specifying attributes with the ``CPackWiXFragment`` XML tag after the ``Id`` attribute. See the :variable:`CPACK_WIX_PATCH_FILE` variable. -* The :cpack_gen:`CPack WiX Generator` implemented a new +* The :cpack_gen:`CPack WIX Generator` implemented a new :variable:`CPACK_WIX_ROOT_FOLDER_ID` variable which allows using a custom root folder ID instead of the default ``ProgramFilesFolder`` / ``ProgramFiles64Folder``. diff --git a/Help/release/dev/FindPostgreSQL-target.rst b/Help/release/dev/FindPostgreSQL-target.rst new file mode 100644 index 0000000..84f8d1a --- /dev/null +++ b/Help/release/dev/FindPostgreSQL-target.rst @@ -0,0 +1,4 @@ +FindPostgreSQL-target +--------------------- + +* The :module:`FindPostgreSQL` module now provides an imported target. diff --git a/Help/release/dev/autogen-origin-depends.rst b/Help/release/dev/autogen-origin-depends.rst new file mode 100644 index 0000000..7310487 --- /dev/null +++ b/Help/release/dev/autogen-origin-depends.rst @@ -0,0 +1,7 @@ +autogen-origin-depends +---------------------- + +* A new :variable:`CMAKE_AUTOGEN_ORIGIN_DEPENDS` variable and + :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` target property may be set to enable or + disable forwarding of the origin target dependencies to the corresponding + ``_autogen`` target. diff --git a/Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst b/Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst new file mode 100644 index 0000000..1398e78 --- /dev/null +++ b/Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst @@ -0,0 +1,11 @@ +CMAKE_AUTOGEN_ORIGIN_DEPENDS +---------------------------- + +Switch for forwarding origin target dependencies to the corresponding +``_autogen`` targets. + +This variable is used to initialize the :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` +property on all the targets. See that target property for additional +information. + +By default :variable:`CMAKE_AUTOGEN_ORIGIN_DEPENDS` is ``ON``. diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake index 02cb464..ddfc7bd 100644 --- a/Modules/CMakeGenericSystem.cmake +++ b/Modules/CMakeGenericSystem.cmake @@ -23,6 +23,8 @@ set(CMAKE_DL_LIBS "dl") set(CMAKE_FIND_LIBRARY_PREFIXES "lib") set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a") + +set(CMAKE_AUTOGEN_ORIGIN_DEPENDS ON) set(CMAKE_AUTOMOC_COMPILER_PREDEFINES ON) set(CMAKE_AUTOMOC_MACRO_NAMES "Q_OBJECT" "Q_GADGET" "Q_NAMESPACE") diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake index 48cd207..d150826 100644 --- a/Modules/FindBLAS.cmake +++ b/Modules/FindBLAS.cmake @@ -223,7 +223,7 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") set(BLAS_SEARCH_LIBS "") if(BLA_F95) - set(BLAS_mkl_SEARCH_SYMBOL SGEMM) + set(BLAS_mkl_SEARCH_SYMBOL sgemm_f95) set(_LIBRARIES BLAS95_LIBRARIES) if (WIN32) if (BLA_STATIC) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 23f636e..889dbf1 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -147,6 +147,9 @@ setting variables:: used if multiple compatible suffixes should be tested for, in decreasing order of preference. + Boost_ARCHITECTURE - Set to the architecture-specific library suffix + (e.g. "-x64"). Default is auto-computed for the + C++ compiler in use. Boost_THREADAPI - Suffix for "thread" component library name, such as "pthread" or "win32". Names with and without this suffix will both be tried. @@ -1507,27 +1510,35 @@ endif() # -x86 Architecture and address model tag # First character is the architecture, then word-size, either 32 or 64 # Only used in 'versioned' layout, added in Boost 1.66.0 -set(_boost_ARCHITECTURE_TAG "") -# {CMAKE_CXX_COMPILER_ARCHITECTURE_ID} is not currently set for all compilers -if(NOT "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x" AND NOT Boost_VERSION VERSION_LESS 106600) - string(APPEND _boost_ARCHITECTURE_TAG "-") - # This needs to be kept in-sync with the section of CMakePlatformId.h.in - # inside 'defined(_WIN32) && defined(_MSC_VER)' - if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "IA64") - string(APPEND _boost_ARCHITECTURE_TAG "i") - elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "X86" - OR CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "x64") - string(APPEND _boost_ARCHITECTURE_TAG "x") - elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "^ARM") - string(APPEND _boost_ARCHITECTURE_TAG "a") - elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "MIPS") - string(APPEND _boost_ARCHITECTURE_TAG "m") - endif() - - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - string(APPEND _boost_ARCHITECTURE_TAG "64") - else() - string(APPEND _boost_ARCHITECTURE_TAG "32") +if(DEFINED Boost_ARCHITECTURE) + set(_boost_ARCHITECTURE_TAG "${Boost_ARCHITECTURE}") + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "using user-specified Boost_ARCHITECTURE = ${_boost_ARCHITECTURE_TAG}") + endif() +else() + set(_boost_ARCHITECTURE_TAG "") + # {CMAKE_CXX_COMPILER_ARCHITECTURE_ID} is not currently set for all compilers + if(NOT "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x" AND NOT Boost_VERSION VERSION_LESS 106600) + string(APPEND _boost_ARCHITECTURE_TAG "-") + # This needs to be kept in-sync with the section of CMakePlatformId.h.in + # inside 'defined(_WIN32) && defined(_MSC_VER)' + if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "IA64") + string(APPEND _boost_ARCHITECTURE_TAG "i") + elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "X86" + OR CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "x64") + string(APPEND _boost_ARCHITECTURE_TAG "x") + elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "^ARM") + string(APPEND _boost_ARCHITECTURE_TAG "a") + elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "MIPS") + string(APPEND _boost_ARCHITECTURE_TAG "m") + endif() + + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + string(APPEND _boost_ARCHITECTURE_TAG "64") + else() + string(APPEND _boost_ARCHITECTURE_TAG "32") + endif() endif() endif() diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake index 31e5620b..62ff94c 100644 --- a/Modules/FindLAPACK.cmake +++ b/Modules/FindLAPACK.cmake @@ -288,7 +288,7 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") set(LAPACK_SEARCH_LIBS "") if (BLA_F95) - set(LAPACK_mkl_SEARCH_SYMBOL "CHEEV") + set(LAPACK_mkl_SEARCH_SYMBOL "cheev_f95") set(_LIBRARIES LAPACK95_LIBRARIES) set(_BLAS_LIBRARIES ${BLAS95_LIBRARIES}) @@ -299,7 +299,7 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") list(APPEND LAPACK_SEARCH_LIBS "mkl_intel_c") list(APPEND LAPACK_SEARCH_LIBS - "mkl_intel_${BLAS_mkl_ILP_MODE}") + "mkl_lapack95_${BLAS_mkl_ILP_MODE}") else() set(LAPACK_mkl_SEARCH_SYMBOL "cheev") set(_LIBRARIES LAPACK_LIBRARIES) diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake index 77fa4ed..4b5e60e 100644 --- a/Modules/FindPostgreSQL.cmake +++ b/Modules/FindPostgreSQL.cmake @@ -7,14 +7,27 @@ FindPostgreSQL Find the PostgreSQL installation. -This module defines - -:: - - PostgreSQL_LIBRARIES - the PostgreSQL libraries needed for linking - PostgreSQL_INCLUDE_DIRS - the directories of the PostgreSQL headers - PostgreSQL_LIBRARY_DIRS - the link directories for PostgreSQL libraries - PostgreSQL_VERSION_STRING - the version of PostgreSQL found (since CMake 2.8.8) +IMPORTED Targets +^^^^^^^^^^^^^^^^ + +This module defines :prop_tgt:`IMPORTED` target ``PostgreSQL::PostgreSQL`` +if PostgreSQL has been found. + +Result Variables +^^^^^^^^^^^^^^^^ + +This module will set the following variables in your project: + +``PostgreSQL_FOUND`` + True if PostgreSQL is found. +``PostgreSQL_LIBRARIES`` + the PostgreSQL libraries needed for linking +``PostgreSQL_INCLUDE_DIRS`` + the directories of the PostgreSQL headers +``PostgreSQL_LIBRARY_DIRS`` + the link directories for PostgreSQL libraries +``PostgreSQL_VERSION_STRING`` + the version of PostgreSQL found #]=======================================================================] # ---------------------------------------------------------------------------- @@ -49,6 +62,8 @@ This module defines # PostgreSQL_LIBRARY_DIRS - Link directories for PostgreSQL libraries # PostgreSQL_LIBRARIES - The PostgreSQL libraries. # +# The ``PostgreSQL::PostgreSQL`` imported target is also created. +# # ---------------------------------------------------------------------------- # If you have installed PostgreSQL in a non-standard location. # (Please note that in the following comments, it is assumed that <Your Path> @@ -160,14 +175,34 @@ if (PostgreSQL_INCLUDE_DIR) foreach(_PG_CONFIG_HEADER ${_PG_CONFIG_HEADERS}) if(EXISTS "${_PG_CONFIG_HEADER}") file(STRINGS "${_PG_CONFIG_HEADER}" pgsql_version_str - REGEX "^#define[\t ]+PG_VERSION[\t ]+\".*\"") + REGEX "^#define[\t ]+PG_VERSION_NUM[\t ]+.*") if(pgsql_version_str) - string(REGEX REPLACE "^#define[\t ]+PG_VERSION[\t ]+\"([^\"]*)\".*" - "\\1" PostgreSQL_VERSION_STRING "${pgsql_version_str}") + string(REGEX REPLACE "^#define[\t ]+PG_VERSION_NUM[\t ]+([0-9]*).*" + "\\1" _PostgreSQL_VERSION_NUM "${pgsql_version_str}") break() endif() endif() endforeach() + if (_PostgreSQL_VERSION_NUM) + math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 10000") + math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 10000") + set(PostgreSQL_VERSION_STRING "${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}") + unset(_PostgreSQL_major_version) + unset(_PostgreSQL_minor_version) + else () + foreach(_PG_CONFIG_HEADER ${_PG_CONFIG_HEADERS}) + if(EXISTS "${_PG_CONFIG_HEADER}") + file(STRINGS "${_PG_CONFIG_HEADER}" pgsql_version_str + REGEX "^#define[\t ]+PG_VERSION[\t ]+\".*\"") + if(pgsql_version_str) + string(REGEX REPLACE "^#define[\t ]+PG_VERSION[\t ]+\"([^\"]*)\".*" + "\\1" PostgreSQL_VERSION_STRING "${pgsql_version_str}") + break() + endif() + endif() + endforeach() + endif () + unset(_PostgreSQL_VERSION_NUM) unset(pgsql_version_str) endif() @@ -180,6 +215,12 @@ set(PostgreSQL_FOUND ${POSTGRESQL_FOUND}) # Now try to get the include and library path. if(PostgreSQL_FOUND) + if (NOT TARGET PostgreSQL::PostgreSQL) + add_library(PostgreSQL::PostgreSQL UNKNOWN IMPORTED) + set_target_properties(PostgreSQL::PostgreSQL PROPERTIES + IMPORTED_LOCATION "${PostgreSQL_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${PostgreSQL_INCLUDE_DIR};${PostgreSQL_TYPE_INCLUDE_DIR}") + endif () set(PostgreSQL_INCLUDE_DIRS ${PostgreSQL_INCLUDE_DIR} ${PostgreSQL_TYPE_INCLUDE_DIR} ) set(PostgreSQL_LIBRARY_DIRS ${PostgreSQL_LIBRARY_DIR} ) set(PostgreSQL_LIBRARIES ${PostgreSQL_LIBRARY}) diff --git a/Modules/Internal/CPack/CPackExt.cmake b/Modules/Internal/CPack/CPackExternal.cmake index e52d978..e4d055a 100644 --- a/Modules/Internal/CPack/CPackExt.cmake +++ b/Modules/Internal/CPack/CPackExternal.cmake @@ -1,15 +1,15 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -if(NOT "${CPACK_EXT_REQUESTED_VERSIONS}" STREQUAL "") +if(NOT "${CPACK_EXTERNAL_REQUESTED_VERSIONS}" STREQUAL "") unset(_found_major) - foreach(_req_version IN LISTS CPACK_EXT_REQUESTED_VERSIONS) + foreach(_req_version IN LISTS CPACK_EXTERNAL_REQUESTED_VERSIONS) if(_req_version MATCHES "^([0-9]+)\\.([0-9]+)$") set(_req_major "${CMAKE_MATCH_1}") set(_req_minor "${CMAKE_MATCH_2}") - foreach(_known_version IN LISTS CPACK_EXT_KNOWN_VERSIONS) + foreach(_known_version IN LISTS CPACK_EXTERNAL_KNOWN_VERSIONS) string(REGEX MATCH "^([0-9]+)\\.([0-9]+)$" _known_version_dummy @@ -33,21 +33,21 @@ if(NOT "${CPACK_EXT_REQUESTED_VERSIONS}" STREQUAL "") endforeach() if(DEFINED _found_major) - set(CPACK_EXT_SELECTED_MAJOR "${_found_major}") - set(CPACK_EXT_SELECTED_MINOR "${_found_minor}") - set(CPACK_EXT_SELECTED_VERSION "${_found_major}.${_found_minor}") + set(CPACK_EXTERNAL_SELECTED_MAJOR "${_found_major}") + set(CPACK_EXTERNAL_SELECTED_MINOR "${_found_minor}") + set(CPACK_EXTERNAL_SELECTED_VERSION "${_found_major}.${_found_minor}") else() message(FATAL_ERROR - "Could not find a suitable version in CPACK_EXT_REQUESTED_VERSIONS" + "Could not find a suitable version in CPACK_EXTERNAL_REQUESTED_VERSIONS" ) endif() else() - list(GET CPACK_EXT_KNOWN_VERSIONS 0 CPACK_EXT_SELECTED_VERSION) + list(GET CPACK_EXTERNAL_KNOWN_VERSIONS 0 CPACK_EXTERNAL_SELECTED_VERSION) string(REGEX MATCH "^([0-9]+)\\.([0-9]+)$" _dummy - "${CPACK_EXT_SELECTED_VERSION}" + "${CPACK_EXTERNAL_SELECTED_VERSION}" ) - set(CPACK_EXT_SELECTED_MAJOR "${CMAKE_MATCH_1}") - set(CPACK_EXT_SELECTED_MINOR "${CMAKE_MATCH_2}") + set(CPACK_EXTERNAL_SELECTED_MAJOR "${CMAKE_MATCH_1}") + set(CPACK_EXTERNAL_SELECTED_MINOR "${CMAKE_MATCH_2}") endif() diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 5e2758a..ded21bc 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -892,7 +892,7 @@ set(CPACK_SRCS CPack/cmCPackArchiveGenerator.cxx CPack/cmCPackComponentGroup.cxx CPack/cmCPackDebGenerator.cxx - CPack/cmCPackExtGenerator.cxx + CPack/cmCPackExternalGenerator.cxx CPack/cmCPackGeneratorFactory.cxx CPack/cmCPackGenerator.cxx CPack/cmCPackLog.cxx diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index cfce90d..ad29c57 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 13) -set(CMake_VERSION_PATCH 20181105) +set(CMake_VERSION_PATCH 20181107) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/cmCPackExtGenerator.cxx b/Source/CPack/cmCPackExternalGenerator.cxx index 4c560b9..9f7b236 100644 --- a/Source/CPack/cmCPackExtGenerator.cxx +++ b/Source/CPack/cmCPackExternalGenerator.cxx @@ -1,6 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmCPackExtGenerator.h" +#include "cmCPackExternalGenerator.h" #include "cmAlgorithms.h" #include "cmCPackComponentGroup.h" @@ -16,25 +16,25 @@ #include <utility> #include <vector> -int cmCPackExtGenerator::InitializeInternal() +int cmCPackExternalGenerator::InitializeInternal() { - this->SetOption("CPACK_EXT_KNOWN_VERSIONS", "1.0"); + this->SetOption("CPACK_EXTERNAL_KNOWN_VERSIONS", "1.0"); - if (!this->ReadListFile("Internal/CPack/CPackExt.cmake")) { + if (!this->ReadListFile("Internal/CPack/CPackExternal.cmake")) { cmCPackLogger(cmCPackLog::LOG_ERROR, - "Error while executing CPackExt.cmake" << std::endl); + "Error while executing CPackExternal.cmake" << std::endl); return 0; } - std::string major = this->GetOption("CPACK_EXT_SELECTED_MAJOR"); + std::string major = this->GetOption("CPACK_EXTERNAL_SELECTED_MAJOR"); if (major == "1") { - this->Generator = cm::make_unique<cmCPackExtVersion1Generator>(this); + this->Generator = cm::make_unique<cmCPackExternalVersion1Generator>(this); } return this->Superclass::InitializeInternal(); } -int cmCPackExtGenerator::PackageFiles() +int cmCPackExternalGenerator::PackageFiles() { Json::StreamWriterBuilder builder; builder["indentation"] = " "; @@ -57,12 +57,12 @@ int cmCPackExtGenerator::PackageFiles() return 0; } - const char* packageScript = this->GetOption("CPACK_EXT_PACKAGE_SCRIPT"); + const char* packageScript = this->GetOption("CPACK_EXTERNAL_PACKAGE_SCRIPT"); if (packageScript && *packageScript) { if (!cmSystemTools::FileIsFullPath(packageScript)) { cmCPackLogger( cmCPackLog::LOG_ERROR, - "CPACK_EXT_PACKAGE_SCRIPT does not contain a full file path" + "CPACK_EXTERNAL_PACKAGE_SCRIPT does not contain a full file path" << std::endl); return 0; } @@ -77,12 +77,12 @@ int cmCPackExtGenerator::PackageFiles() return 1; } -bool cmCPackExtGenerator::SupportsComponentInstallation() const +bool cmCPackExternalGenerator::SupportsComponentInstallation() const { return true; } -int cmCPackExtGenerator::InstallProjectViaInstallCommands( +int cmCPackExternalGenerator::InstallProjectViaInstallCommands( bool setDestDir, const std::string& tempInstallDirectory) { if (this->StagingEnabled()) { @@ -93,7 +93,7 @@ int cmCPackExtGenerator::InstallProjectViaInstallCommands( return 1; } -int cmCPackExtGenerator::InstallProjectViaInstallScript( +int cmCPackExternalGenerator::InstallProjectViaInstallScript( bool setDestDir, const std::string& tempInstallDirectory) { if (this->StagingEnabled()) { @@ -104,7 +104,7 @@ int cmCPackExtGenerator::InstallProjectViaInstallScript( return 1; } -int cmCPackExtGenerator::InstallProjectViaInstalledDirectories( +int cmCPackExternalGenerator::InstallProjectViaInstalledDirectories( bool setDestDir, const std::string& tempInstallDirectory, const mode_t* default_dir_mode) { @@ -116,7 +116,7 @@ int cmCPackExtGenerator::InstallProjectViaInstalledDirectories( return 1; } -int cmCPackExtGenerator::RunPreinstallTarget( +int cmCPackExternalGenerator::RunPreinstallTarget( const std::string& installProjectName, const std::string& installDirectory, cmGlobalGenerator* globalGenerator, const std::string& buildConfig) { @@ -128,7 +128,7 @@ int cmCPackExtGenerator::RunPreinstallTarget( return 1; } -int cmCPackExtGenerator::InstallCMakeProject( +int cmCPackExternalGenerator::InstallCMakeProject( bool setDestDir, const std::string& installDirectory, const std::string& baseTempInstallDirectory, const mode_t* default_dir_mode, const std::string& component, bool componentInstall, @@ -145,18 +145,19 @@ int cmCPackExtGenerator::InstallCMakeProject( return 1; } -bool cmCPackExtGenerator::StagingEnabled() const +bool cmCPackExternalGenerator::StagingEnabled() const { - return !cmSystemTools::IsOff(this->GetOption("CPACK_EXT_ENABLE_STAGING")); + return !cmSystemTools::IsOff( + this->GetOption("CPACK_EXTERNAL_ENABLE_STAGING")); } -cmCPackExtGenerator::cmCPackExtVersionGenerator::cmCPackExtVersionGenerator( - cmCPackExtGenerator* parent) +cmCPackExternalGenerator::cmCPackExternalVersionGenerator:: + cmCPackExternalVersionGenerator(cmCPackExternalGenerator* parent) : Parent(parent) { } -int cmCPackExtGenerator::cmCPackExtVersionGenerator::WriteVersion( +int cmCPackExternalGenerator::cmCPackExternalVersionGenerator::WriteVersion( Json::Value& root) { root["formatVersionMajor"] = this->GetVersionMajor(); @@ -165,7 +166,7 @@ int cmCPackExtGenerator::cmCPackExtVersionGenerator::WriteVersion( return 1; } -int cmCPackExtGenerator::cmCPackExtVersionGenerator::WriteToJSON( +int cmCPackExternalGenerator::cmCPackExternalVersionGenerator::WriteToJSON( Json::Value& root) { if (!this->WriteVersion(root)) { diff --git a/Source/CPack/cmCPackExtGenerator.h b/Source/CPack/cmCPackExternalGenerator.h index 103e56d..176d6a9 100644 --- a/Source/CPack/cmCPackExtGenerator.h +++ b/Source/CPack/cmCPackExternalGenerator.h @@ -1,7 +1,7 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmCPackExtGenerator_h -#define cmCPackExtGenerator_h +#ifndef cmCPackExternalGenerator_h +#define cmCPackExternalGenerator_h #include "cmCPackGenerator.h" #include "cm_sys_stat.h" @@ -14,13 +14,13 @@ namespace Json { class Value; } -/** \class cmCPackExtGenerator +/** \class cmCPackExternalGenerator * \brief A generator for CPack External packaging tools */ -class cmCPackExtGenerator : public cmCPackGenerator +class cmCPackExternalGenerator : public cmCPackGenerator { public: - cmCPackTypeMacro(cmCPackExtGenerator, cmCPackGenerator); + cmCPackTypeMacro(cmCPackExternalGenerator, cmCPackGenerator); const char* GetOutputExtension() override { return ".json"; } @@ -54,12 +54,12 @@ protected: private: bool StagingEnabled() const; - class cmCPackExtVersionGenerator + class cmCPackExternalVersionGenerator { public: - cmCPackExtVersionGenerator(cmCPackExtGenerator* parent); + cmCPackExternalVersionGenerator(cmCPackExternalGenerator* parent); - virtual ~cmCPackExtVersionGenerator() = default; + virtual ~cmCPackExternalVersionGenerator() = default; virtual int WriteToJSON(Json::Value& root); @@ -69,20 +69,21 @@ private: int WriteVersion(Json::Value& root); - cmCPackExtGenerator* Parent; + cmCPackExternalGenerator* Parent; }; - class cmCPackExtVersion1Generator : public cmCPackExtVersionGenerator + class cmCPackExternalVersion1Generator + : public cmCPackExternalVersionGenerator { public: - using cmCPackExtVersionGenerator::cmCPackExtVersionGenerator; + using cmCPackExternalVersionGenerator::cmCPackExternalVersionGenerator; protected: int GetVersionMajor() override { return 1; } int GetVersionMinor() override { return 0; } }; - std::unique_ptr<cmCPackExtVersionGenerator> Generator; + std::unique_ptr<cmCPackExternalVersionGenerator> Generator; }; #endif diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx index 8ef24f7..2c5ab4d 100644 --- a/Source/CPack/cmCPackGeneratorFactory.cxx +++ b/Source/CPack/cmCPackGeneratorFactory.cxx @@ -12,7 +12,7 @@ # include "cmCPackFreeBSDGenerator.h" #endif #include "cmCPackDebGenerator.h" -#include "cmCPackExtGenerator.h" +#include "cmCPackExternalGenerator.h" #include "cmCPackGenerator.h" #include "cmCPackLog.h" #include "cmCPackNSISGenerator.h" @@ -111,9 +111,9 @@ cmCPackGeneratorFactory::cmCPackGeneratorFactory() this->RegisterGenerator("NuGet", "NuGet packages", cmCPackNuGetGenerator::CreateGenerator); } - if (cmCPackExtGenerator::CanGenerate()) { - this->RegisterGenerator("Ext", "CPack External packages", - cmCPackExtGenerator::CreateGenerator); + if (cmCPackExternalGenerator::CanGenerate()) { + this->RegisterGenerator("External", "CPack External packages", + cmCPackExternalGenerator::CreateGenerator); } #ifdef __APPLE__ if (cmCPackDragNDropGenerator::CanGenerate()) { diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 7700767..a213c84 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -322,6 +322,9 @@ bool cmQtAutoGenInitializer::InitCustomTargets() // Autogen target: Compute user defined dependencies { + this->AutogenTarget.DependOrigin = + this->Target->GetPropertyAsBool("AUTOGEN_ORIGIN_DEPENDS"); + std::string const deps = this->Target->GetSafeProperty("AUTOGEN_TARGET_DEPENDS"); if (!deps.empty()) { @@ -904,7 +907,7 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() // Add link library target dependencies to the autogen target // dependencies - { + if (this->AutogenTarget.DependOrigin) { // add_dependencies/addUtility do not support generator expressions. // We depend only on the libraries found in all configs therefore. std::map<cmGeneratorTarget const*, std::size_t> commonTargets; @@ -941,8 +944,10 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() new cmGeneratorTarget(autogenTarget, localGen)); // Forward origin utilities to autogen target - for (BT<std::string> const& depName : this->Target->GetUtilities()) { - autogenTarget->AddUtility(depName.Value, makefile); + if (this->AutogenTarget.DependOrigin) { + for (BT<std::string> const& depName : this->Target->GetUtilities()) { + autogenTarget->AddUtility(depName.Value, makefile); + } } // Add additional autogen target dependencies to autogen target for (cmTarget* depTarget : this->AutogenTarget.DependTargets) { diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h index ce00e00..1d3947b 100644 --- a/Source/cmQtAutoGenInitializer.h +++ b/Source/cmQtAutoGenInitializer.h @@ -107,6 +107,7 @@ private: std::string SettingsFile; std::map<std::string, std::string> ConfigSettingsFile; // Dependencies + bool DependOrigin = false; std::set<std::string> DependFiles; std::set<cmTarget*> DependTargets; // Sources to process diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 987bdb3..5d76a02 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -239,6 +239,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, this->SetPropertyDefault("AUTOMOC", nullptr); this->SetPropertyDefault("AUTOUIC", nullptr); this->SetPropertyDefault("AUTORCC", nullptr); + this->SetPropertyDefault("AUTOGEN_ORIGIN_DEPENDS", nullptr); this->SetPropertyDefault("AUTOGEN_PARALLEL", nullptr); this->SetPropertyDefault("AUTOMOC_COMPILER_PREDEFINES", nullptr); this->SetPropertyDefault("AUTOMOC_DEPEND_FILTERS", nullptr); diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 02e56eb..132855b 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1465,6 +1465,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_subdirectory(FindPatch) endif() + if(CMake_TEST_FindPostgreSQL) + add_subdirectory(FindPostgreSQL) + endif() + if(CMake_TEST_FindProtobuf) add_subdirectory(FindProtobuf) endif() diff --git a/Tests/FindPostgreSQL/CMakeLists.txt b/Tests/FindPostgreSQL/CMakeLists.txt new file mode 100644 index 0000000..50151ee --- /dev/null +++ b/Tests/FindPostgreSQL/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindPostgreSQL.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPostgreSQL/Test" + "${CMake_BINARY_DIR}/Tests/FindPostgreSQL/Test" + ${build_generator_args} + --build-project TestFindPostgreSQL + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindPostgreSQL/Test/CMakeLists.txt b/Tests/FindPostgreSQL/Test/CMakeLists.txt new file mode 100644 index 0000000..374e147 --- /dev/null +++ b/Tests/FindPostgreSQL/Test/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.10) +project(TestFindPostgreSQL C) +include(CTest) + +find_package(PostgreSQL REQUIRED) + +add_definitions(-DCMAKE_EXPECTED_POSTGRESQL_VERSION="${PostgreSQL_VERSION_STRING}") + +add_executable(test_tgt main.c) +target_link_libraries(test_tgt PostgreSQL::PostgreSQL) +add_test(NAME test_tgt COMMAND test_tgt) + +add_executable(test_var main.c) +target_include_directories(test_var PRIVATE ${PostgreSQL_INCLUDE_DIRS}) +target_link_libraries(test_var PRIVATE ${PostgreSQL_LIBRARIES}) +add_test(NAME test_var COMMAND test_var) diff --git a/Tests/FindPostgreSQL/Test/main.c b/Tests/FindPostgreSQL/Test/main.c new file mode 100644 index 0000000..2cfeed0 --- /dev/null +++ b/Tests/FindPostgreSQL/Test/main.c @@ -0,0 +1,15 @@ +#include <libpq-fe.h> +#include <stdio.h> +#include <string.h> + +int main() +{ + int version = PQlibVersion(); + int major = version / 10000; + int minor = version % 10000; + char version_string[100]; + snprintf(version_string, sizeof(version_string), "%d.%d", major, minor); + printf("Found PostgreSQL version %s, expected version %s\n", version_string, + CMAKE_EXPECTED_POSTGRESQL_VERSION); + return strcmp(version_string, CMAKE_EXPECTED_POSTGRESQL_VERSION); +} diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt b/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt new file mode 100644 index 0000000..1c2271a --- /dev/null +++ b/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt @@ -0,0 +1,71 @@ +cmake_minimum_required(VERSION 3.11) +project(AutogenOriginDependsOff) +include("../AutogenTest.cmake") + +set(CSD ${CMAKE_CURRENT_SOURCE_DIR}) +set(CBD ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(${CSD}) +include_directories(${CBD}) + +# A GENERATED file ensures there will be an _autogen target in VS +add_custom_command ( + OUTPUT "${CBD}/config.hpp" + COMMAND ${CMAKE_COMMAND} -E copy "${CSD}/config.hpp.in" "${CBD}/config.hpp" + ) + + +# Library "a_mc" provides a header that holds a string with the content of +# mocs_compilation.cpp from a_qt. It therefore must depend on a_qt_autogen. +add_custom_target ( a_mc + COMMAND ${CMAKE_COMMAND} -E sleep 2 + COMMAND ${CMAKE_COMMAND} + "-DMCF=${CBD}/a_qt_autogen/mocs_compilation.cpp" + "-DCF_IN=${CSD}/a_mc.hpp.in" + "-DCF_OUT=${CBD}/a_mc.hpp" + -P ${CSD}/configure_content.cmake + ) +add_dependencies ( a_mc a_qt_autogen ) + +# Library "a_qt" +# - depends on a GENERATED file +# - AUTOMOC enabled +# - depends on a target (a_mc) that depends on a_qt_qutogen +add_library ( a_qt a_qt.cpp "${CBD}/config.hpp" ) +add_dependencies ( a_qt a_mc ) +target_link_libraries ( a_qt ${QT_QTCORE_TARGET}) +set_target_properties ( a_qt PROPERTIES AUTOMOC TRUE) +# Disable AUTOGEN_ORIGIN_DEPENDS to avoid loop dependencies +set_target_properties ( a_qt PROPERTIES AUTOGEN_ORIGIN_DEPENDS OFF) + + +# Library "b_mc" provides a header that holds a string function that returns +# the content of mocs_compilation.cpp from b_qt. +# It therefore must depend on b_qt_autogen. +add_custom_command ( + OUTPUT ${CBD}/b_mc.cpp + DEPENDS b_qt_autogen + COMMAND ${CMAKE_COMMAND} -E sleep 2 + COMMAND ${CMAKE_COMMAND} + "-DMCF=${CBD}/b_qt_autogen/mocs_compilation.cpp" + "-DCF_IN=${CSD}/b_mc.cpp.in" + "-DCF_OUT=${CBD}/b_mc.cpp" + -P ${CSD}/configure_content.cmake + ) +add_library ( b_mc ${CSD}/b_mc.hpp ${CBD}/b_mc.cpp ) + +# Library "b_qt" +# - depends on a GENERATED file +# - AUTOMOC enabled +# - depends on a library (b_mc) that depends on b_qt_qutogen +add_library ( b_qt b_qt.cpp "${CBD}/config.hpp" ) +target_link_libraries ( b_qt b_mc ) +target_link_libraries ( b_qt ${QT_QTCORE_TARGET}) +set_target_properties ( b_qt PROPERTIES AUTOMOC TRUE) +# Disable AUTOGEN_ORIGIN_DEPENDS to avoid loop dependencies +set_target_properties ( b_qt PROPERTIES AUTOGEN_ORIGIN_DEPENDS OFF) + + +# The main target depends on both libraries which depend on the _autogen +# target of the main target. +add_executable ( autogenOriginDependsOff main.cpp ) +target_link_libraries ( autogenOriginDependsOff a_qt b_qt ) diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/a_mc.hpp.in b/Tests/QtAutogen/AutogenOriginDependsOff/a_mc.hpp.in new file mode 100644 index 0000000..fe71f67 --- /dev/null +++ b/Tests/QtAutogen/AutogenOriginDependsOff/a_mc.hpp.in @@ -0,0 +1,9 @@ +#ifndef A_MC_HPP +#define A_MC_HPP + +namespace a_mc { + +char const* mocs_compilation = "@MOCS_COMPILATION@"; +} + +#endif diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.cpp b/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.cpp new file mode 100644 index 0000000..e498969 --- /dev/null +++ b/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.cpp @@ -0,0 +1,28 @@ + +#include "a_qt.hpp" +#include <a_mc.hpp> + +namespace a_qt { + +/// @brief A source local QObject based class +class Source_QObject : public QObject +{ + Q_OBJECT +public: + Source_QObject() {} + ~Source_QObject() {} + + std::string str; +}; + +std::string mocs_compilation() +{ + // Create and destroy QObject based classes + Header_QObject header_obj; + Source_QObject source_obj; + + return std::string(a_mc::mocs_compilation); +} +} + +#include "a_qt.moc" diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.hpp b/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.hpp new file mode 100644 index 0000000..e2387ee --- /dev/null +++ b/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.hpp @@ -0,0 +1,25 @@ +#ifndef A_QT_HPP +#define A_QT_HPP + +#include <QObject> +#include <config.hpp> +#include <string> + +namespace a_qt { + +/// @brief A header local QObject based class +class Header_QObject : public QObject +{ + Q_OBJECT +public: + Header_QObject() {} + ~Header_QObject() {} + + std::string str; +}; + +/// @brief Function that returns the content of mocs_compilation.cpp +extern std::string mocs_compilation(); +} + +#endif diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/b_mc.cpp.in b/Tests/QtAutogen/AutogenOriginDependsOff/b_mc.cpp.in new file mode 100644 index 0000000..0f5ec30 --- /dev/null +++ b/Tests/QtAutogen/AutogenOriginDependsOff/b_mc.cpp.in @@ -0,0 +1,9 @@ +#include <b_mc.hpp> + +namespace b_mc { + +char const* mocs_compilation() +{ + return "@MOCS_COMPILATION@"; +} +} diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/b_mc.hpp b/Tests/QtAutogen/AutogenOriginDependsOff/b_mc.hpp new file mode 100644 index 0000000..0437273 --- /dev/null +++ b/Tests/QtAutogen/AutogenOriginDependsOff/b_mc.hpp @@ -0,0 +1,9 @@ +#ifndef B_MC_HPP +#define B_MC_HPP + +namespace b_mc { + +extern char const* mocs_compilation(); +} + +#endif diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.cpp b/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.cpp new file mode 100644 index 0000000..f72f6ca --- /dev/null +++ b/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.cpp @@ -0,0 +1,28 @@ + +#include "b_qt.hpp" +#include <b_mc.hpp> + +namespace b_qt { + +/// @brief A source local QObject based class +class Source_QObject : public QObject +{ + Q_OBJECT +public: + Source_QObject() {} + ~Source_QObject() {} + + std::string str; +}; + +std::string mocs_compilation() +{ + // Create and destroy QObject based classes + Header_QObject header_obj; + Source_QObject source_obj; + + return std::string(b_mc::mocs_compilation()); +} +} + +#include "b_qt.moc" diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.hpp b/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.hpp new file mode 100644 index 0000000..d7f0311 --- /dev/null +++ b/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.hpp @@ -0,0 +1,25 @@ +#ifndef B_QT_HPP +#define B_QT_HPP + +#include <QObject> +#include <config.hpp> +#include <string> + +namespace b_qt { + +/// @brief A header local QObject based class +class Header_QObject : public QObject +{ + Q_OBJECT +public: + Header_QObject() {} + ~Header_QObject() {} + + std::string str; +}; + +/// @brief Function that returns the content of mocs_compilation.cpp +extern std::string mocs_compilation(); +} + +#endif diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/config.hpp.in b/Tests/QtAutogen/AutogenOriginDependsOff/config.hpp.in new file mode 100644 index 0000000..e415d08 --- /dev/null +++ b/Tests/QtAutogen/AutogenOriginDependsOff/config.hpp.in @@ -0,0 +1,8 @@ +#ifndef CONFIG_HPP +#define CONFIG_HPP + +// Application configuration + +enum dummy { NO_OP }; + +#endif diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/configure_content.cmake b/Tests/QtAutogen/AutogenOriginDependsOff/configure_content.cmake new file mode 100644 index 0000000..0fc6e63 --- /dev/null +++ b/Tests/QtAutogen/AutogenOriginDependsOff/configure_content.cmake @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.10) + +# Read mocs_compilation.cpp file into variable +file(READ "${MCF}" MOCS_COMPILATION) +string(REPLACE "\\" "\\\\" MOCS_COMPILATION "${MOCS_COMPILATION}" ) +string(REPLACE "\"" "\\\"" MOCS_COMPILATION "${MOCS_COMPILATION}" ) +string(REPLACE "\n" "\"\n\"" MOCS_COMPILATION "${MOCS_COMPILATION}" ) + +# Configure file +configure_file ( "${CF_IN}" "${CF_OUT}" @ONLY ) diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/main.cpp b/Tests/QtAutogen/AutogenOriginDependsOff/main.cpp new file mode 100644 index 0000000..a3425f1 --- /dev/null +++ b/Tests/QtAutogen/AutogenOriginDependsOff/main.cpp @@ -0,0 +1,15 @@ + +#include <a_qt.hpp> +#include <b_qt.hpp> +#include <string> + +int main() +{ + if (a_qt::mocs_compilation().empty()) { + return -1; + } + if (b_qt::mocs_compilation().empty()) { + return -1; + } + return 0; +} diff --git a/Tests/QtAutogen/MocDepends/CMakeLists.txt b/Tests/QtAutogen/AutogenOriginDependsOn/CMakeLists.txt index 6ea72be..60869eb 100644 --- a/Tests/QtAutogen/MocDepends/CMakeLists.txt +++ b/Tests/QtAutogen/AutogenOriginDependsOn/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.10) -project(MocDepends) +project(AutogenOriginDependsOn) include("../AutogenTest.cmake") include_directories(${CMAKE_CURRENT_BINARY_DIR}) @@ -89,51 +89,3 @@ target_link_libraries(SimpleLib ${QT_QTCORE_TARGET}) add_executable(mocDepGenLib testGenLib.cpp) target_link_libraries(mocDepGenLib SimpleLib ${QT_QTCORE_TARGET}) set_target_properties(mocDepGenLib PROPERTIES AUTOMOC TRUE) - - -# -- Test AUTOGEN_TARGET_DEPENDS with GENERATED file dependency -# -# This tests the dependency of the mocDepATDFile_autogen target of -# mocDepATDTarget to the utility target mocDepATDFileUtil. -# If mocDepATDFile_autogen gets built *before* or in *parallel* to -# mocDepATDFileUtil, the build will fail. That's -# because ATDFile.hpp, which is required by mocDepATDFile_autogen, -# is only valid after the mocDepATDFileUtil build has been completed. -# -# The sleep seconds artificially increase the build time of -# mocDepATDFileUtil to simulate a slow utility target build that takes -# longer to run than the build of the mocDepATDFile_autogen target. -add_custom_command( - OUTPUT ${CBD}/ATDFile.hpp - COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_invalid.hpp.in ${CBD}/ATDFile.hpp - COMMAND ${CMAKE_COMMAND} -E sleep 3 - COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_valid.hpp.in ${CBD}/ATDFile.hpp) - -add_executable(mocDepATDFile testATDFile.cpp) -target_link_libraries(mocDepATDFile ${QT_QTCORE_TARGET}) -set_target_properties(mocDepATDFile PROPERTIES AUTOMOC TRUE) -set_target_properties(mocDepATDFile PROPERTIES AUTOGEN_TARGET_DEPENDS ${CBD}/ATDFile.hpp) - - -# -- Test AUTOGEN_TARGET_DEPENDS with target dependency -# -# This tests the dependency of the mocDepATDTarget_autogen target of -# mocDepATDTarget to the utility target mocDepATDTargetUtil. -# If mocDepATDTarget_autogen gets built *before* or in *parallel* to -# mocDepATDTargetUtil, the build will fail. That's -# because ATDTarget.hpp, which is required by mocDepATDTarget_autogen, -# is only valid after the mocDepATDTargetUtil build has been completed. -# -# The sleep seconds artificially increase the build time of -# mocDepATDTargetUtil to simulate a slow utility target build that takes -# longer to run than the build of the mocDepATDTarget_autogen target. -add_custom_target(mocDepATDTargetUtil - BYPRODUCTS ${CBD}/ATDTarget.hpp - COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_invalid.hpp.in ${CBD}/ATDTarget.hpp - COMMAND ${CMAKE_COMMAND} -E sleep 3 - COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_valid.hpp.in ${CBD}/ATDTarget.hpp) - -add_executable(mocDepATDTarget testATDTarget.cpp) -target_link_libraries(mocDepATDTarget ${QT_QTCORE_TARGET}) -set_target_properties(mocDepATDTarget PROPERTIES AUTOMOC TRUE) -set_target_properties(mocDepATDTarget PROPERTIES AUTOGEN_TARGET_DEPENDS mocDepATDTargetUtil) diff --git a/Tests/QtAutogen/MocDepends/object_invalid.hpp.in b/Tests/QtAutogen/AutogenOriginDependsOn/object_invalid.hpp.in index 854d9a1..854d9a1 100644 --- a/Tests/QtAutogen/MocDepends/object_invalid.hpp.in +++ b/Tests/QtAutogen/AutogenOriginDependsOn/object_invalid.hpp.in diff --git a/Tests/QtAutogen/MocDepends/object_valid.hpp.in b/Tests/QtAutogen/AutogenOriginDependsOn/object_valid.hpp.in index f364f7c..f364f7c 100644 --- a/Tests/QtAutogen/MocDepends/object_valid.hpp.in +++ b/Tests/QtAutogen/AutogenOriginDependsOn/object_valid.hpp.in diff --git a/Tests/QtAutogen/MocDepends/simpleLib.cpp.in b/Tests/QtAutogen/AutogenOriginDependsOn/simpleLib.cpp.in index fa33bd3..fa33bd3 100644 --- a/Tests/QtAutogen/MocDepends/simpleLib.cpp.in +++ b/Tests/QtAutogen/AutogenOriginDependsOn/simpleLib.cpp.in diff --git a/Tests/QtAutogen/MocDepends/simpleLib.hpp.in b/Tests/QtAutogen/AutogenOriginDependsOn/simpleLib.hpp.in index b65b0cb..b65b0cb 100644 --- a/Tests/QtAutogen/MocDepends/simpleLib.hpp.in +++ b/Tests/QtAutogen/AutogenOriginDependsOn/simpleLib.hpp.in diff --git a/Tests/QtAutogen/MocDepends/testGenFile.cpp b/Tests/QtAutogen/AutogenOriginDependsOn/testGenFile.cpp index 7df6e13..7df6e13 100644 --- a/Tests/QtAutogen/MocDepends/testGenFile.cpp +++ b/Tests/QtAutogen/AutogenOriginDependsOn/testGenFile.cpp diff --git a/Tests/QtAutogen/MocDepends/testGenLib.cpp b/Tests/QtAutogen/AutogenOriginDependsOn/testGenLib.cpp index c14e159..c14e159 100644 --- a/Tests/QtAutogen/MocDepends/testGenLib.cpp +++ b/Tests/QtAutogen/AutogenOriginDependsOn/testGenLib.cpp diff --git a/Tests/QtAutogen/MocDepends/testGenLib.hpp b/Tests/QtAutogen/AutogenOriginDependsOn/testGenLib.hpp index 408335b..408335b 100644 --- a/Tests/QtAutogen/MocDepends/testGenLib.hpp +++ b/Tests/QtAutogen/AutogenOriginDependsOn/testGenLib.hpp diff --git a/Tests/QtAutogen/MocDepends/testGenTarget.cpp b/Tests/QtAutogen/AutogenOriginDependsOn/testGenTarget.cpp index 911076e..911076e 100644 --- a/Tests/QtAutogen/MocDepends/testGenTarget.cpp +++ b/Tests/QtAutogen/AutogenOriginDependsOn/testGenTarget.cpp diff --git a/Tests/QtAutogen/AutogenTargetDepends/CMakeLists.txt b/Tests/QtAutogen/AutogenTargetDepends/CMakeLists.txt new file mode 100644 index 0000000..63b7c98 --- /dev/null +++ b/Tests/QtAutogen/AutogenTargetDepends/CMakeLists.txt @@ -0,0 +1,54 @@ +cmake_minimum_required(VERSION 3.10) +project(AutogenTargetDepends) +include("../AutogenTest.cmake") + +include_directories(${CMAKE_CURRENT_BINARY_DIR}) +set(CSD ${CMAKE_CURRENT_SOURCE_DIR}) +set(CBD ${CMAKE_CURRENT_BINARY_DIR}) + +# -- Test AUTOGEN_TARGET_DEPENDS with GENERATED file dependency +# +# This tests the dependency of the mocDepATDFile_autogen target of +# mocDepATDTarget to the utility target mocDepATDFileUtil. +# If mocDepATDFile_autogen gets built *before* or in *parallel* to +# mocDepATDFileUtil, the build will fail. That's +# because ATDFile.hpp, which is required by mocDepATDFile_autogen, +# is only valid after the mocDepATDFileUtil build has been completed. +# +# The sleep seconds artificially increase the build time of +# mocDepATDFileUtil to simulate a slow utility target build that takes +# longer to run than the build of the mocDepATDFile_autogen target. +add_custom_command( + OUTPUT ${CBD}/ATDFile.hpp + COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_invalid.hpp.in ${CBD}/ATDFile.hpp + COMMAND ${CMAKE_COMMAND} -E sleep 3 + COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_valid.hpp.in ${CBD}/ATDFile.hpp) + +add_executable(mocDepATDFile testATDFile.cpp) +target_link_libraries(mocDepATDFile ${QT_QTCORE_TARGET}) +set_target_properties(mocDepATDFile PROPERTIES AUTOMOC TRUE) +set_target_properties(mocDepATDFile PROPERTIES AUTOGEN_TARGET_DEPENDS ${CBD}/ATDFile.hpp) + + +# -- Test AUTOGEN_TARGET_DEPENDS with target dependency +# +# This tests the dependency of the mocDepATDTarget_autogen target of +# mocDepATDTarget to the utility target mocDepATDTargetUtil. +# If mocDepATDTarget_autogen gets built *before* or in *parallel* to +# mocDepATDTargetUtil, the build will fail. That's +# because ATDTarget.hpp, which is required by mocDepATDTarget_autogen, +# is only valid after the mocDepATDTargetUtil build has been completed. +# +# The sleep seconds artificially increase the build time of +# mocDepATDTargetUtil to simulate a slow utility target build that takes +# longer to run than the build of the mocDepATDTarget_autogen target. +add_custom_target(mocDepATDTargetUtil + BYPRODUCTS ${CBD}/ATDTarget.hpp + COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_invalid.hpp.in ${CBD}/ATDTarget.hpp + COMMAND ${CMAKE_COMMAND} -E sleep 3 + COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_valid.hpp.in ${CBD}/ATDTarget.hpp) + +add_executable(mocDepATDTarget testATDTarget.cpp) +target_link_libraries(mocDepATDTarget ${QT_QTCORE_TARGET}) +set_target_properties(mocDepATDTarget PROPERTIES AUTOMOC TRUE) +set_target_properties(mocDepATDTarget PROPERTIES AUTOGEN_TARGET_DEPENDS mocDepATDTargetUtil) diff --git a/Tests/QtAutogen/AutogenTargetDepends/object_invalid.hpp.in b/Tests/QtAutogen/AutogenTargetDepends/object_invalid.hpp.in new file mode 100644 index 0000000..854d9a1 --- /dev/null +++ b/Tests/QtAutogen/AutogenTargetDepends/object_invalid.hpp.in @@ -0,0 +1 @@ +#ifndef diff --git a/Tests/QtAutogen/AutogenTargetDepends/object_valid.hpp.in b/Tests/QtAutogen/AutogenTargetDepends/object_valid.hpp.in new file mode 100644 index 0000000..f364f7c --- /dev/null +++ b/Tests/QtAutogen/AutogenTargetDepends/object_valid.hpp.in @@ -0,0 +1,14 @@ +#ifndef OBJECT_HPP +#define OBJECT_HPP + +#include <QObject> + +class Object : public QObject +{ + Q_OBJECT +public: + Q_SLOT + void aSlot(){}; +}; + +#endif diff --git a/Tests/QtAutogen/MocDepends/testATDFile.cpp b/Tests/QtAutogen/AutogenTargetDepends/testATDFile.cpp index 6bddfcd..6bddfcd 100644 --- a/Tests/QtAutogen/MocDepends/testATDFile.cpp +++ b/Tests/QtAutogen/AutogenTargetDepends/testATDFile.cpp diff --git a/Tests/QtAutogen/MocDepends/testATDTarget.cpp b/Tests/QtAutogen/AutogenTargetDepends/testATDTarget.cpp index 831fc26..831fc26 100644 --- a/Tests/QtAutogen/MocDepends/testATDTarget.cpp +++ b/Tests/QtAutogen/AutogenTargetDepends/testATDTarget.cpp diff --git a/Tests/QtAutogen/CommonTests.cmake b/Tests/QtAutogen/CommonTests.cmake index 01ed7e9..58d9f0b 100644 --- a/Tests/QtAutogen/CommonTests.cmake +++ b/Tests/QtAutogen/CommonTests.cmake @@ -15,7 +15,9 @@ ADD_AUTOGEN_TEST(RccSkipSource) if(QT_TEST_VERSION GREATER 4) ADD_AUTOGEN_TEST(MocMacroName mocMacroName) endif() -ADD_AUTOGEN_TEST(MocDepends) +ADD_AUTOGEN_TEST(AutogenOriginDependsOff autogenOriginDependsOff) +ADD_AUTOGEN_TEST(AutogenOriginDependsOn) +ADD_AUTOGEN_TEST(AutogenTargetDepends) if(QT_TEST_ALLOW_QT_MACROS) ADD_AUTOGEN_TEST(MocIncludeStrict mocIncludeStrict) ADD_AUTOGEN_TEST(MocIncludeRelaxed mocIncludeRelaxed) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index c5f3087..e23926f 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -439,7 +439,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja") add_RunCMake_test(ctest_labels_for_subprojects) endif() -add_RunCMake_test_group(CPack "DEB;RPM;7Z;TBZ2;TGZ;TXZ;TZ;ZIP;STGZ;Ext") +add_RunCMake_test_group(CPack "DEB;RPM;7Z;TBZ2;TGZ;TXZ;TZ;ZIP;STGZ;External") # add a test to make sure symbols are exported from a shared library # for MSVC compilers CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS property is used add_RunCMake_test(AutoExportDll) diff --git a/Tests/RunCMake/CPack/Ext/Helpers.cmake b/Tests/RunCMake/CPack/External/Helpers.cmake index 2c67e06..2c67e06 100644 --- a/Tests/RunCMake/CPack/Ext/Helpers.cmake +++ b/Tests/RunCMake/CPack/External/Helpers.cmake diff --git a/Tests/RunCMake/CPack/Ext/Prerequirements.cmake b/Tests/RunCMake/CPack/External/Prerequirements.cmake index e69de29..e69de29 100644 --- a/Tests/RunCMake/CPack/Ext/Prerequirements.cmake +++ b/Tests/RunCMake/CPack/External/Prerequirements.cmake diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index 91d3cb7..33ddb72 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -18,8 +18,8 @@ run_cpack_test(GENERATE_SHLIBS_LDCONFIG "DEB" true "COMPONENT") run_cpack_test(INSTALL_SCRIPTS "RPM" false "COMPONENT") run_cpack_test(LONG_FILENAMES "DEB" false "MONOLITHIC") run_cpack_test_subtests(MAIN_COMPONENT "invalid;found" "RPM" false "COMPONENT") -run_cpack_test(MINIMAL "RPM;DEB;7Z;TBZ2;TGZ;TXZ;TZ;ZIP;STGZ;Ext" false "MONOLITHIC;COMPONENT") -run_cpack_test_package_target(MINIMAL "RPM;DEB;7Z;TBZ2;TGZ;TXZ;TZ;ZIP;STGZ;Ext" false "MONOLITHIC;COMPONENT") +run_cpack_test(MINIMAL "RPM;DEB;7Z;TBZ2;TGZ;TXZ;TZ;ZIP;STGZ;External" false "MONOLITHIC;COMPONENT") +run_cpack_test_package_target(MINIMAL "RPM;DEB;7Z;TBZ2;TGZ;TXZ;TZ;ZIP;STGZ;External" false "MONOLITHIC;COMPONENT") run_cpack_test_subtests(PACKAGE_CHECKSUM "invalid;MD5;SHA1;SHA224;SHA256;SHA384;SHA512" "TGZ" false "MONOLITHIC") run_cpack_test(PARTIALLY_RELOCATABLE_WARNING "RPM" false "COMPONENT") run_cpack_test(PER_COMPONENT_FIELDS "RPM;DEB" false "COMPONENT") @@ -35,4 +35,4 @@ run_cpack_test(USER_FILELIST "RPM" false "MONOLITHIC") run_cpack_test(MD5SUMS "DEB" false "MONOLITHIC;COMPONENT") run_cpack_test(CPACK_INSTALL_SCRIPT "ZIP" false "MONOLITHIC") run_cpack_test(DEB_PACKAGE_VERSION_BACK_COMPATIBILITY "DEB" false "MONOLITHIC;COMPONENT") -run_cpack_test_subtests(EXT "none;good;good_multi;bad_major;bad_minor;invalid_good;invalid_bad;stage_and_package" "Ext" false "MONOLITHIC;COMPONENT") +run_cpack_test_subtests(EXTERNAL "none;good;good_multi;bad_major;bad_minor;invalid_good;invalid_bad;stage_and_package" "External" false "MONOLITHIC;COMPONENT") diff --git a/Tests/RunCMake/CPack/tests/EXT/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/EXT/VerifyResult.cmake deleted file mode 100644 index 97b74f7..0000000 --- a/Tests/RunCMake/CPack/tests/EXT/VerifyResult.cmake +++ /dev/null @@ -1,3 +0,0 @@ -if(RunCMake_SUBTEST_SUFFIX MATCHES "^(none|good(_multi)?|invalid_good)") - check_ext_json("${src_dir}/tests/EXT/expected-json-1.0.txt" "${FOUND_FILE_1}") -endif() diff --git a/Tests/RunCMake/CPack/tests/EXT/bad_major-stderr.txt b/Tests/RunCMake/CPack/tests/EXT/bad_major-stderr.txt deleted file mode 100644 index 372c5e4..0000000 --- a/Tests/RunCMake/CPack/tests/EXT/bad_major-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Error at .*/Modules/Internal/CPack/CPackExt\.cmake:[0-9]+ \(message\): - Could not find a suitable version in CPACK_EXT_REQUESTED_VERSIONS - - -CPack Error: Error while executing CPackExt\.cmake -CPack Error: Cannot initialize the generator Ext diff --git a/Tests/RunCMake/CPack/tests/EXT/bad_minor-stderr.txt b/Tests/RunCMake/CPack/tests/EXT/bad_minor-stderr.txt deleted file mode 100644 index 372c5e4..0000000 --- a/Tests/RunCMake/CPack/tests/EXT/bad_minor-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Error at .*/Modules/Internal/CPack/CPackExt\.cmake:[0-9]+ \(message\): - Could not find a suitable version in CPACK_EXT_REQUESTED_VERSIONS - - -CPack Error: Error while executing CPackExt\.cmake -CPack Error: Cannot initialize the generator Ext diff --git a/Tests/RunCMake/CPack/tests/EXT/invalid_bad-stderr.txt b/Tests/RunCMake/CPack/tests/EXT/invalid_bad-stderr.txt deleted file mode 100644 index 372c5e4..0000000 --- a/Tests/RunCMake/CPack/tests/EXT/invalid_bad-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Error at .*/Modules/Internal/CPack/CPackExt\.cmake:[0-9]+ \(message\): - Could not find a suitable version in CPACK_EXT_REQUESTED_VERSIONS - - -CPack Error: Error while executing CPackExt\.cmake -CPack Error: Cannot initialize the generator Ext diff --git a/Tests/RunCMake/CPack/tests/EXT/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/EXTERNAL/ExpectedFiles.cmake index 91608c9..91608c9 100644 --- a/Tests/RunCMake/CPack/tests/EXT/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/EXTERNAL/ExpectedFiles.cmake diff --git a/Tests/RunCMake/CPack/tests/EXTERNAL/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/EXTERNAL/VerifyResult.cmake new file mode 100644 index 0000000..bc19d7e --- /dev/null +++ b/Tests/RunCMake/CPack/tests/EXTERNAL/VerifyResult.cmake @@ -0,0 +1,3 @@ +if(RunCMake_SUBTEST_SUFFIX MATCHES "^(none|good(_multi)?|invalid_good)") + check_ext_json("${src_dir}/tests/EXTERNAL/expected-json-1.0.txt" "${FOUND_FILE_1}") +endif() diff --git a/Tests/RunCMake/CPack/tests/EXTERNAL/bad_major-stderr.txt b/Tests/RunCMake/CPack/tests/EXTERNAL/bad_major-stderr.txt new file mode 100644 index 0000000..f2e160e --- /dev/null +++ b/Tests/RunCMake/CPack/tests/EXTERNAL/bad_major-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at .*/Modules/Internal/CPack/CPackExternal\.cmake:[0-9]+ \(message\): + Could not find a suitable version in CPACK_EXTERNAL_REQUESTED_VERSIONS + + +CPack Error: Error while executing CPackExternal\.cmake +CPack Error: Cannot initialize the generator External diff --git a/Tests/RunCMake/CPack/tests/EXTERNAL/bad_minor-stderr.txt b/Tests/RunCMake/CPack/tests/EXTERNAL/bad_minor-stderr.txt new file mode 100644 index 0000000..f2e160e --- /dev/null +++ b/Tests/RunCMake/CPack/tests/EXTERNAL/bad_minor-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at .*/Modules/Internal/CPack/CPackExternal\.cmake:[0-9]+ \(message\): + Could not find a suitable version in CPACK_EXTERNAL_REQUESTED_VERSIONS + + +CPack Error: Error while executing CPackExternal\.cmake +CPack Error: Cannot initialize the generator External diff --git a/Tests/RunCMake/CPack/tests/EXT/create_package.cmake b/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake index e308ccb..e308ccb 100644 --- a/Tests/RunCMake/CPack/tests/EXT/create_package.cmake +++ b/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake diff --git a/Tests/RunCMake/CPack/tests/EXT/expected-json-1.0.txt b/Tests/RunCMake/CPack/tests/EXTERNAL/expected-json-1.0.txt index b96cf0b..18bf617 100644 --- a/Tests/RunCMake/CPack/tests/EXT/expected-json-1.0.txt +++ b/Tests/RunCMake/CPack/tests/EXTERNAL/expected-json-1.0.txt @@ -150,8 +150,8 @@ \} \}, "packageDescriptionFile" : ".*/Templates/CPack\.GenericDescription\.txt", - "packageDescriptionSummary" : "EXT-(none|good(_multi)?|invalid_good)-subtest-(MONOLITHIC|COMPONENT)-type built using CMake", - "packageName" : "ext", + "packageDescriptionSummary" : "EXTERNAL-(none|good(_multi)?|invalid_good)-subtest-(MONOLITHIC|COMPONENT)-type built using CMake", + "packageName" : "external", "packageVersion" : "0\.1\.1", "projects" :[ ] \[ @@ -164,9 +164,9 @@ "f3", "f4" \], - "directory" : ".*/Tests/RunCMake/Ext/CPack/EXT-build-(none|good(_multi)?|invalid_good)-subtest", + "directory" : ".*/Tests/RunCMake/External/CPack/EXTERNAL-build-(none|good(_multi)?|invalid_good)-subtest", "installationTypes" : \[\], - "projectName" : "EXT-(none|good(_multi)?|invalid_good)-subtest-(MONOLITHIC|COMPONENT)-type", + "projectName" : "EXTERNAL-(none|good(_multi)?|invalid_good)-subtest-(MONOLITHIC|COMPONENT)-type", "subDirectory" : "/" \} \], diff --git a/Tests/RunCMake/CPack/tests/EXTERNAL/invalid_bad-stderr.txt b/Tests/RunCMake/CPack/tests/EXTERNAL/invalid_bad-stderr.txt new file mode 100644 index 0000000..f2e160e --- /dev/null +++ b/Tests/RunCMake/CPack/tests/EXTERNAL/invalid_bad-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at .*/Modules/Internal/CPack/CPackExternal\.cmake:[0-9]+ \(message\): + Could not find a suitable version in CPACK_EXTERNAL_REQUESTED_VERSIONS + + +CPack Error: Error while executing CPackExternal\.cmake +CPack Error: Cannot initialize the generator External diff --git a/Tests/RunCMake/CPack/tests/EXT/stage_and_package-stderr.txt b/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stderr.txt index 40f2743..40f2743 100644 --- a/Tests/RunCMake/CPack/tests/EXT/stage_and_package-stderr.txt +++ b/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stderr.txt diff --git a/Tests/RunCMake/CPack/tests/EXT/test.cmake b/Tests/RunCMake/CPack/tests/EXTERNAL/test.cmake index 976cb6a..bc9766b 100644 --- a/Tests/RunCMake/CPack/tests/EXT/test.cmake +++ b/Tests/RunCMake/CPack/tests/EXTERNAL/test.cmake @@ -1,22 +1,22 @@ include(CPackComponent) if(RunCMake_SUBTEST_SUFFIX STREQUAL "none") - unset(CPACK_EXT_REQUESTED_VERSIONS) + unset(CPACK_EXTERNAL_REQUESTED_VERSIONS) elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "good") - set(CPACK_EXT_REQUESTED_VERSIONS "1.0") + set(CPACK_EXTERNAL_REQUESTED_VERSIONS "1.0") elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "good_multi") - set(CPACK_EXT_REQUESTED_VERSIONS "1.0;2.0") + set(CPACK_EXTERNAL_REQUESTED_VERSIONS "1.0;2.0") elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "bad_major") - set(CPACK_EXT_REQUESTED_VERSIONS "2.0") + set(CPACK_EXTERNAL_REQUESTED_VERSIONS "2.0") elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "bad_minor") - set(CPACK_EXT_REQUESTED_VERSIONS "1.1") + set(CPACK_EXTERNAL_REQUESTED_VERSIONS "1.1") elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "invalid_good") - set(CPACK_EXT_REQUESTED_VERSIONS "1;1.0") + set(CPACK_EXTERNAL_REQUESTED_VERSIONS "1;1.0") elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "invalid_bad") - set(CPACK_EXT_REQUESTED_VERSIONS "1") + set(CPACK_EXTERNAL_REQUESTED_VERSIONS "1") elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "stage_and_package") - set(CPACK_EXT_ENABLE_STAGING 1) - set(CPACK_EXT_PACKAGE_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/create_package.cmake") + set(CPACK_EXTERNAL_ENABLE_STAGING 1) + set(CPACK_EXTERNAL_PACKAGE_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/create_package.cmake") endif() file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/f1.txt" test1) |