Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

let's not automoc them all #4

Open
portaloffreedom opened this issue Jun 4, 2020 · 0 comments
Open

let's not automoc them all #4

portaloffreedom opened this issue Jun 4, 2020 · 0 comments

Comments

@portaloffreedom
Copy link
Member

Right now it seems that all header files are parsed through the automoc. We can probably flag many of them to not be parsed at all.

> cmake --help-policy CMP0100

CMP0100
-------

Let ``AUTOMOC`` and ``AUTOUIC`` process
header files that end with a ``.hh`` extension.

Since version 3.17, CMake processes header files that end with a
``.hh`` extension in ``AUTOMOC`` and ``AUTOUIC``.
In earlier CMake versions, these header files were ignored by
``AUTOMOC`` and ``AUTOUIC``.

This policy affects how header files that end with a ``.hh`` extension
get treated in ``AUTOMOC`` and ``AUTOUIC``.

The ``OLD`` behavior for this policy is to ignore ``.hh`` header files
in ``AUTOMOC`` and ``AUTOUIC``.

The ``NEW`` behavior for this policy is to process ``.hh`` header files
in ``AUTOMOC`` and ``AUTOUIC`` just like other header files.

.. note::

  To silence the ``CMP0100`` warning source files can be excluded from
  ``AUTOMOC`` and ``AUTOUIC`` processing by setting the
  source file properties ``SKIP_AUTOMOC``, ``SKIP_AUTOUIC`` or
  ``SKIP_AUTOGEN``.

  .. code-block:: cmake

    # Source skip example:
    set_property(SOURCE /path/to/file1.hh PROPERTY SKIP_AUTOMOC ON)
    set_property(SOURCE /path/to/file2.hh PROPERTY SKIP_AUTOUIC ON)
    set_property(SOURCE /path/to/file3.hh PROPERTY SKIP_AUTOGEN ON)

This policy was introduced in CMake version 3.17.0.  CMake version
3.17.3 warns when the policy is not set and uses ``OLD`` behavior.
Use the ``cmake_policy()`` command to set it to ``OLD`` or ``NEW``
explicitly.

.. note::
  The ``OLD`` behavior of a policy is
  ``deprecated by definition``
  and may be removed in a future version of CMake.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant