diff options
Diffstat (limited to 'Help')
-rw-r--r-- | Help/command/if.rst | 2 | ||||
-rw-r--r-- | Help/dev/source.rst | 16 | ||||
-rw-r--r-- | Help/manual/cmake-properties.7.rst | 1 | ||||
-rw-r--r-- | Help/manual/cmake-qt.7.rst | 4 | ||||
-rw-r--r-- | Help/manual/cmake-variables.7.rst | 1 | ||||
-rw-r--r-- | Help/prop_tgt/AUTOMOC.rst | 14 | ||||
-rw-r--r-- | Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst | 28 | ||||
-rw-r--r-- | Help/release/3.9.rst | 10 | ||||
-rw-r--r-- | Help/release/dev/autogen-macro-names.rst | 12 | ||||
-rw-r--r-- | Help/release/dev/require-c++11.rst | 5 | ||||
-rw-r--r-- | Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst | 19 |
11 files changed, 94 insertions, 18 deletions
diff --git a/Help/command/if.rst b/Help/command/if.rst index edd343d..f04f233 100644 --- a/Help/command/if.rst +++ b/Help/command/if.rst @@ -30,7 +30,7 @@ else and endif clause is optional. Long expressions can be used and there is a traditional order of precedence. Parenthetical expressions are evaluated first followed by unary tests such as ``EXISTS``, ``COMMAND``, and ``DEFINED``. Then any binary tests such as -``EQUAL``, ``LESS``, ``LESS_EQUAL, ``GREATER``, ``GREATER_EQUAL``, +``EQUAL``, ``LESS``, ``LESS_EQUAL``, ``GREATER``, ``GREATER_EQUAL``, ``STREQUAL``, ``STRLESS``, ``STRLESS_EQUAL``, ``STRGREATER``, ``STRGREATER_EQUAL``, ``VERSION_EQUAL``, ``VERSION_LESS``, ``VERSION_LESS_EQUAL``, ``VERSION_GREATER``, ``VERSION_GREATER_EQUAL``, diff --git a/Help/dev/source.rst b/Help/dev/source.rst index 16a9252..b40a884 100644 --- a/Help/dev/source.rst +++ b/Help/dev/source.rst @@ -23,20 +23,18 @@ format only a subset of files, such as those that are locally modified. C++ Subset Permitted ==================== -CMake supports compiling as C++98 in addition to C++11 and C++14. -In order to support building on older toolchains some constructs -need to be handled with care: +CMake requires compiling as C++11 or above. However, in order to support +building on older toolchains some constructs need to be handled with care: -* Use ``CM_AUTO_PTR`` instead of ``std::auto_ptr``. +* Do not use ``CM_AUTO_PTR`` or ``std::auto_ptr``. - The ``std::auto_ptr`` template is deprecated in C++11. We want to use it - so we can build on C++98 compilers but we do not want to turn off compiler - warnings about deprecated interfaces in general. Use the ``CM_AUTO_PTR`` - macro instead. + The ``std::auto_ptr`` template is deprecated in C++11. The ``CM_AUTO_PTR`` + macro remains leftover from C++98 support until its uses can be ported to + ``std::unique_ptr``. Do not add new uses of the macro. * Use ``CM_EQ_DELETE;`` instead of ``= delete;``. - Defining functions as *deleted* is not supported in C++98. Using + Older C++11 compilers do not support deleting functions. Using ``CM_EQ_DELETE`` will delete the functions if the compiler supports it and give them no implementation otherwise. Calling such a function will lead to compiler errors if the compiler supports *deleted* functions and linker diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index cc8c356..f1378c8 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -123,6 +123,7 @@ Properties on Targets /prop_tgt/AUTOGEN_BUILD_DIR /prop_tgt/AUTOGEN_TARGET_DEPENDS /prop_tgt/AUTOMOC_DEPEND_FILTERS + /prop_tgt/AUTOMOC_MACRO_NAMES /prop_tgt/AUTOMOC_MOC_OPTIONS /prop_tgt/AUTOMOC /prop_tgt/AUTOUIC diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst index e345cd2..55121df 100644 --- a/Help/manual/cmake-qt.7.rst +++ b/Help/manual/cmake-qt.7.rst @@ -95,6 +95,10 @@ following targets by setting the :variable:`CMAKE_AUTOMOC` variable. The options to pass to ``moc``. The :variable:`CMAKE_AUTOMOC_MOC_OPTIONS` variable may be populated to pre-set the options for all following targets. +The appearance of the strings ``Q_OBJECT`` or ``Q_GADGET`` in a source file +determines if it needs to be ``moc`` processed. To search for additional +strings, list them in :prop_tgt:`AUTOMOC_MACRO_NAMES`. + Additional ``moc`` dependency file names can be extracted from source code by using :prop_tgt:`AUTOMOC_DEPEND_FILTERS`. diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 363b90f..bef1171 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -270,6 +270,7 @@ Variables that Control the Build /variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CONFIG /variable/CMAKE_AUTOMOC /variable/CMAKE_AUTOMOC_DEPEND_FILTERS + /variable/CMAKE_AUTOMOC_MACRO_NAMES /variable/CMAKE_AUTOMOC_MOC_OPTIONS /variable/CMAKE_AUTORCC /variable/CMAKE_AUTORCC_OPTIONS diff --git a/Help/prop_tgt/AUTOMOC.rst b/Help/prop_tgt/AUTOMOC.rst index e70fe0d..61813be68 100644 --- a/Help/prop_tgt/AUTOMOC.rst +++ b/Help/prop_tgt/AUTOMOC.rst @@ -5,8 +5,8 @@ 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 -:module:`QT4_WRAP_CPP() <FindQt4>` or QT5_WRAP_CPP() macro. Currently Qt4 and Qt5 are -supported. +:module:`QT4_WRAP_CPP() <FindQt4>` or QT5_WRAP_CPP() macro. +Currently Qt4 and Qt5 are supported. When this property is set ``ON``, CMake will scan the header and source files at build time and invoke moc accordingly. @@ -37,7 +37,7 @@ source files at build time and invoke moc accordingly. which is compiled as part of the target. * The custom directories with checksum - based names help to avoid name collisions for moc files with the same + based names help to avoid name collisions for ``moc`` files with the same ``<basename>``. * See :prop_tgt:`AUTOGEN_BUILD_DIR`. @@ -56,11 +56,11 @@ source files at build time and invoke moc accordingly. This property is initialized by the value of the :variable:`CMAKE_AUTOMOC` variable if it is set when a target is created. -Additional command line options for moc can be set via the +Additional command line options for ``moc`` can be set via the :prop_tgt:`AUTOMOC_MOC_OPTIONS` property. By enabling the :variable:`CMAKE_AUTOMOC_RELAXED_MODE` variable the -rules for searching the files which will be processed by moc can be relaxed. +rules for searching the files which will be processed by ``moc`` can be relaxed. See the documentation for this variable for more details. The global property :prop_gbl:`AUTOGEN_TARGETS_FOLDER` can be used to group the @@ -69,6 +69,10 @@ automoc targets together in an IDE, e.g. in MSVS. The global property :prop_gbl:`AUTOGEN_SOURCE_GROUP` can be used to group files generated by :prop_tgt:`AUTOMOC` together in an IDE, e.g. in MSVS. +The appearance of the strings ``Q_OBJECT`` or ``Q_GADGET`` in a source file +determines if it needs to be ``moc`` processed. To search for additional +strings, list them in :prop_tgt:`AUTOMOC_MACRO_NAMES`. + Additional ``moc`` dependency file names can be extracted from source code by using :prop_tgt:`AUTOMOC_DEPEND_FILTERS`. diff --git a/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst b/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst new file mode 100644 index 0000000..0639bc8 --- /dev/null +++ b/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst @@ -0,0 +1,28 @@ +AUTOMOC_MACRO_NAMES +------------------- + +Additional macro names used by :prop_tgt:`AUTOMOC` +to determine if a C++ file needs to be processed by ``moc``. + +This property is only used if the :prop_tgt:`AUTOMOC` property is ``ON`` +for this target. + +CMake searches for the strings ``Q_OBJECT`` and ``Q_GADGET`` to +determine if a file needs to be processed by ``moc``. +:prop_tgt:`AUTOMOC_MACRO_NAMES` allows to add additional strings to the +search list. This is useful for cases where the ``Q_OBJECT`` or ``Q_GADGET`` +macro is hidden inside another macro. + +By default :prop_tgt:`AUTOMOC_MACRO_NAMES` is initialized from +:variable:`CMAKE_AUTOMOC_MACRO_NAMES`, which is empty by default. + +See the :manual:`cmake-qt(7)` manual for more information on using CMake +with Qt. + +Example +------- +In this case the the ``Q_OBJECT`` macro is hidden inside an other macro +called ``CUSTOM_MACRO``. To let CMake know that source files, that contain +``CUSTOM_MACRO``, need to be ``moc`` processed, we call:: + + set_property(TARGET tgt PROPERTY AUTOMOC_MACRO_NAMES "CUSTOM_MACRO") diff --git a/Help/release/3.9.rst b/Help/release/3.9.rst index ae55105..5087b43 100644 --- a/Help/release/3.9.rst +++ b/Help/release/3.9.rst @@ -310,9 +310,6 @@ Other Changes in dependent targets may now compile without waiting for their targets' dependencies to link. -* On macOS, the default application bundle ``Info.plist`` file now enables - Hi-DPI support. - * On macOS, ``RPATH`` settings such as :prop_tgt:`BUILD_WITH_INSTALL_RPATH` no longer affect the ``install_name`` field. See policy :policy:`CMP0068`. @@ -333,3 +330,10 @@ Changes made since CMake 3.9.0 include the following. CMake 3.9.0 has been removed for the 3.9 series due to regressions caused by new use of ``<PackageName>_ROOT`` variables. The behavior may be re-introduced in the future in a more-compatible way. + +3.9.2 +----- + +* On macOS, the default application bundle ``Info.plist`` file no longer + enables Hi-DPI support as it did in 3.9.0 and 3.9.1. The change had + to be reverted because it broke iOS applications. diff --git a/Help/release/dev/autogen-macro-names.rst b/Help/release/dev/autogen-macro-names.rst new file mode 100644 index 0000000..736dd3a --- /dev/null +++ b/Help/release/dev/autogen-macro-names.rst @@ -0,0 +1,12 @@ +autogen-macro-names +------------------- + +* When using :prop_tgt:`AUTOMOC`, CMake searches for the strings ``Q_OBJECT`` + and ``Q_OBJECT`` 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`` + and ``Q_OBJECT`` 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/require-c++11.rst b/Help/release/dev/require-c++11.rst new file mode 100644 index 0000000..7b849e7 --- /dev/null +++ b/Help/release/dev/require-c++11.rst @@ -0,0 +1,5 @@ +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/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst b/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst new file mode 100644 index 0000000..7ed3445 --- /dev/null +++ b/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst @@ -0,0 +1,19 @@ +CMAKE_AUTOMOC_MACRO_NAMES +---------------------------- + +Additional macro names used by :variable:`CMAKE_AUTOMOC` +to determine if a C++ file needs to be processed by ``moc``. + +This variable is used to initialize the :prop_tgt:`AUTOMOC_MACRO_NAMES` +property on all the targets. See that target property for additional +information. + +By default it is empty. + +Example +------- +Let CMake know that source files that contain ``CUSTOM_MACRO`` must be ``moc`` +processed as well:: + + set(CMAKE_AUTOMOC ON) + set(CMAKE_AUTOMOC_MACRO_NAMES "CUSTOM_MACRO") |