[Cmake-commits] CMake branch, master, updated. v3.9.1-534-gb14fdea

Kitware Robot kwrobot at kitware.com
Mon Aug 21 09:05:10 EDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  b14fdea3a63c7c8d91b0b02c57d1254a106376de (commit)
       via  ab5667b516f3a67349437b4ca662a70d1edf5913 (commit)
       via  fabb217502b027ccab3e44cae4ed7a718a6eea81 (commit)
       via  d46300be899334e95aa196159337d4f78f33a488 (commit)
       via  037beeddd1d434e22040310bc6b88310496d3814 (commit)
       via  e37cdb385ad766d7e798036f5d4142b22c090b7b (commit)
       via  80047bd611e2734cfddc11e4f383589cc7acff84 (commit)
       via  ef978c1dea9fa3f2decadd5145c643d90af40f61 (commit)
       via  7814d75023cc7a9b656ad6a763bd92f376caa9e6 (commit)
       via  b3d98c6ec2c966b316ffeec257a249e8355ce005 (commit)
       via  7529d84facc8c5b3ddfc916c20c5998d6aa9acaf (commit)
       via  05891d8f774cc2ac3fea44f6f320dcdc2e1d95e2 (commit)
       via  93f0ba2823b694340e6cfdb4e6befbf7fcf520bd (commit)
       via  79064819a6adfd8c86134db2309f261425f3b4c7 (commit)
       via  d12837afe65daf6f907364e48f907e6ce35fef7d (commit)
       via  dc0befb6a1b6480d5c2a8237ac052452c710e39a (commit)
       via  6fdcf02aafe1d3c64a4cce0b852685a6dde88a10 (commit)
       via  c1f4f13dbfa7caf6bbf4d8b70a7f09f786c7eed6 (commit)
      from  774d649126d32f1acbf4c9d10771e337c63cef7d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b14fdea3a63c7c8d91b0b02c57d1254a106376de
commit b14fdea3a63c7c8d91b0b02c57d1254a106376de
Merge: ab5667b 80047bd
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Aug 21 13:02:56 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Aug 21 09:03:00 2017 -0400

    Merge topic 'cpack-extend-test-capabilities'
    
    80047bd6 CPack: extend testing framework
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1162


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ab5667b516f3a67349437b4ca662a70d1edf5913
commit ab5667b516f3a67349437b4ca662a70d1edf5913
Merge: fabb217 b3d98c6
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Aug 21 13:02:06 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Aug 21 09:02:09 2017 -0400

    Merge topic 'autogen-macro-names'
    
    b3d98c6e Autogen: Add release notes for AUTOMOC_MACRO_NAMES
    7529d84f Autogen: Add documentation for AUTOMOC_MACRO_NAMES
    05891d8f Autogen: Add test for AUTOMOC_MACRO_NAMES
    93f0ba28 Autogen: Add AUTOMOC_MACRO_NAMES support
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1156


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fabb217502b027ccab3e44cae4ed7a718a6eea81
commit fabb217502b027ccab3e44cae4ed7a718a6eea81
Merge: d46300b ef978c1
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Aug 21 13:00:07 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Aug 21 09:00:09 2017 -0400

    Merge topic 'bootstrap-target-commands'
    
    ef978c1d CursesDialog: use target_include_directories for cmForm
    7814d750 bootstrap: make target_* commands available
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1158


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d46300be899334e95aa196159337d4f78f33a488
commit d46300be899334e95aa196159337d4f78f33a488
Merge: 037beed 7906481
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Aug 21 12:58:36 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Aug 21 08:58:39 2017 -0400

    Merge topic 'vs-less-c_str'
    
    79064819 VS: remove unnecessary c_str()
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1151


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=037beeddd1d434e22040310bc6b88310496d3814
commit 037beeddd1d434e22040310bc6b88310496d3814
Merge: e37cdb3 c1f4f13
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Aug 21 12:56:44 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Aug 21 08:56:56 2017 -0400

    Merge topic 'findcuda_dont_quote_COMPILE_DEFINITIONS'
    
    c1f4f13d FindCUDA: Use long brackets to handle spaces in CUDA_NVCC_COMPILE_DEFINITIONS
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1139


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e37cdb385ad766d7e798036f5d4142b22c090b7b
commit e37cdb385ad766d7e798036f5d4142b22c090b7b
Merge: 774d649 d12837a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Aug 21 12:54:52 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Aug 21 08:55:11 2017 -0400

    Merge topic 'bootstrap'
    
    d12837af bootstrap: Require a standard C compiler
    dc0befb6 bootstrap: Remove check that identifies GNU compiler
    6fdcf02a bootstrap: remove dead branches
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1142


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=80047bd611e2734cfddc11e4f383589cc7acff84
commit 80047bd611e2734cfddc11e4f383589cc7acff84
Author:     Domen Vrankar <domen.vrankar at gmail.com>
AuthorDate: Sat Aug 19 22:41:14 2017 +0200
Commit:     Domen Vrankar <domen.vrankar at gmail.com>
CommitDate: Sat Aug 19 22:41:14 2017 +0200

    CPack: extend testing framework
    
    Some CPack tests require running
    commands after the inclusion of
    CPack.cmake and this patch enables
    such tests to declare run_after_include_cpack
    function which is run after the
    inclusion.

diff --git a/Tests/RunCMake/CPack/CMakeLists.txt b/Tests/RunCMake/CPack/CMakeLists.txt
index c361af0..1b3dbb2 100644
--- a/Tests/RunCMake/CPack/CMakeLists.txt
+++ b/Tests/RunCMake/CPack/CMakeLists.txt
@@ -15,3 +15,7 @@ include(tests/${RunCMake_TEST_FILE_PREFIX}/test.cmake)
 
 set(CPACK_GENERATOR "${GENERATOR_TYPE}")
 include(CPack)
+
+if(COMMAND run_after_include_cpack)
+  run_after_include_cpack()
+endif()
diff --git a/Tests/RunCMake/CPack/README.txt b/Tests/RunCMake/CPack/README.txt
index 7c98f69..cf7c02c 100644
--- a/Tests/RunCMake/CPack/README.txt
+++ b/Tests/RunCMake/CPack/README.txt
@@ -91,6 +91,11 @@ If test will be used for multiple generators but some of them require some
 generator specific commands then those commands should be added to 'test.cmake'
 script wrapped with 'if(GENERATOR_TYPE STREQUAL <name_of_the_generator>)'.
 
+NOTE: In some cases (for example when testing CPackComponent.cmake functions)
+the test has to run some functions after CPack.cmake is included. In such cases
+a function run_after_include_cpack can be declared in test.cmake file and that
+function will run after the inclusion of CPack.cmake.
+
 build phase (optional and not available for source package tests)
 -----------------------------------------------------------------
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ef978c1dea9fa3f2decadd5145c643d90af40f61
commit ef978c1dea9fa3f2decadd5145c643d90af40f61
Author:     Daniel Pfeifer <daniel at pfeifer-mail.de>
AuthorDate: Fri Aug 18 22:25:20 2017 +0200
Commit:     Daniel Pfeifer <daniel at pfeifer-mail.de>
CommitDate: Fri Aug 18 22:25:20 2017 +0200

    CursesDialog: use target_include_directories for cmForm

diff --git a/Source/CursesDialog/CMakeLists.txt b/Source/CursesDialog/CMakeLists.txt
index c5ac1f1..6023c83 100644
--- a/Source/CursesDialog/CMakeLists.txt
+++ b/Source/CursesDialog/CMakeLists.txt
@@ -17,10 +17,6 @@ set( CURSES_SRCS
               CursesDialog/ccmake
    )
 
-if( NOT CMAKE_USE_SYSTEM_FORM )
-  include_directories(${CMake_SOURCE_DIR}/Source/CursesDialog/form
-                      ${CMake_BINARY_DIR}/Source/CursesDialog/form)
-endif()
 include_directories(${CURSES_INCLUDE_PATH})
 
 
diff --git a/Source/CursesDialog/form/CMakeLists.txt b/Source/CursesDialog/form/CMakeLists.txt
index 0677043..b468f5b 100644
--- a/Source/CursesDialog/form/CMakeLists.txt
+++ b/Source/CursesDialog/form/CMakeLists.txt
@@ -3,12 +3,9 @@
 
 project(CMAKE_FORM)
 
-include_regular_expression("^.*$")
-include_directories(${CURSES_INCLUDE_PATH} "${CMAKE_CURRENT_BINARY_DIR}")
-
 configure_file(cmFormConfigure.h.in "${CMAKE_CURRENT_BINARY_DIR}/cmFormConfigure.h")
 
-set(  FORM_SRCS
+add_library(cmForm
              fld_arg.c
              fld_attr.c
              fld_current.c
@@ -49,10 +46,16 @@ set(  FORM_SRCS
              fty_num.c
              fty_regex.c
    )
-             
-include_directories(${CMAKE_FORM_SOURCE_DIR})
-add_library(cmForm ${FORM_SRCS} )
+
+target_include_directories(cmForm
+  PUBLIC
+    ${CURSES_INCLUDE_PATH}
+    ${CMAKE_FORM_BINARY_DIR}
+    ${CMAKE_FORM_SOURCE_DIR}
+  )
+
 target_link_libraries(cmForm ${CURSES_LIBRARY})
+
 if(CURSES_EXTRA_LIBRARY)
   target_link_libraries(cmForm ${CURSES_EXTRA_LIBRARY})
 endif()

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7814d75023cc7a9b656ad6a763bd92f376caa9e6
commit 7814d75023cc7a9b656ad6a763bd92f376caa9e6
Author:     Daniel Pfeifer <daniel at pfeifer-mail.de>
AuthorDate: Fri Aug 18 21:48:14 2017 +0200
Commit:     Daniel Pfeifer <daniel at pfeifer-mail.de>
CommitDate: Fri Aug 18 21:48:14 2017 +0200

    bootstrap: make target_* commands available

diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx
index 61239a9..8a7d9bd 100644
--- a/Source/cmCommands.cxx
+++ b/Source/cmCommands.cxx
@@ -68,7 +68,12 @@
 #include "cmSiteNameCommand.h"
 #include "cmStringCommand.h"
 #include "cmSubdirCommand.h"
+#include "cmTargetCompileDefinitionsCommand.h"
+#include "cmTargetCompileFeaturesCommand.h"
+#include "cmTargetCompileOptionsCommand.h"
+#include "cmTargetIncludeDirectoriesCommand.h"
 #include "cmTargetLinkLibrariesCommand.h"
+#include "cmTargetSourcesCommand.h"
 #include "cmTryCompileCommand.h"
 #include "cmTryRunCommand.h"
 #include "cmUnsetCommand.h"
@@ -94,11 +99,6 @@
 #include "cmRemoveDefinitionsCommand.h"
 #include "cmSourceGroupCommand.h"
 #include "cmSubdirDependsCommand.h"
-#include "cmTargetCompileDefinitionsCommand.h"
-#include "cmTargetCompileFeaturesCommand.h"
-#include "cmTargetCompileOptionsCommand.h"
-#include "cmTargetIncludeDirectoriesCommand.h"
-#include "cmTargetSourcesCommand.h"
 #include "cmUseMangledMesaCommand.h"
 #include "cmUtilitySourceCommand.h"
 #include "cmVariableRequiresCommand.h"
@@ -238,8 +238,17 @@ void GetProjectCommands(cmState* state)
   state->AddBuiltinCommand("set_tests_properties",
                            new cmSetTestsPropertiesCommand);
   state->AddBuiltinCommand("subdirs", new cmSubdirCommand);
+  state->AddBuiltinCommand("target_compile_definitions",
+                           new cmTargetCompileDefinitionsCommand);
+  state->AddBuiltinCommand("target_compile_features",
+                           new cmTargetCompileFeaturesCommand);
+  state->AddBuiltinCommand("target_compile_options",
+                           new cmTargetCompileOptionsCommand);
+  state->AddBuiltinCommand("target_include_directories",
+                           new cmTargetIncludeDirectoriesCommand);
   state->AddBuiltinCommand("target_link_libraries",
                            new cmTargetLinkLibrariesCommand);
+  state->AddBuiltinCommand("target_sources", new cmTargetSourcesCommand);
   state->AddBuiltinCommand("try_compile", new cmTryCompileCommand);
   state->AddBuiltinCommand("try_run", new cmTryRunCommand);
 
@@ -260,15 +269,6 @@ void GetProjectCommands(cmState* state)
   state->AddBuiltinCommand("remove_definitions",
                            new cmRemoveDefinitionsCommand);
   state->AddBuiltinCommand("source_group", new cmSourceGroupCommand);
-  state->AddBuiltinCommand("target_compile_definitions",
-                           new cmTargetCompileDefinitionsCommand);
-  state->AddBuiltinCommand("target_compile_features",
-                           new cmTargetCompileFeaturesCommand);
-  state->AddBuiltinCommand("target_compile_options",
-                           new cmTargetCompileOptionsCommand);
-  state->AddBuiltinCommand("target_include_directories",
-                           new cmTargetIncludeDirectoriesCommand);
-  state->AddBuiltinCommand("target_sources", new cmTargetSourcesCommand);
 
   state->AddDisallowedCommand(
     "export_library_dependencies", new cmExportLibraryDependenciesCommand,
diff --git a/bootstrap b/bootstrap
index 9d73233..be1c49b 100755
--- a/bootstrap
+++ b/bootstrap
@@ -403,8 +403,14 @@ CMAKE_CXX_SOURCES="\
   cmSubdirCommand \
   cmSystemTools \
   cmTarget \
+  cmTargetCompileDefinitionsCommand \
+  cmTargetCompileFeaturesCommand \
+  cmTargetCompileOptionsCommand \
+  cmTargetIncludeDirectoriesCommand \
   cmTargetLinkLibrariesCommand \
+  cmTargetPropCommandBase \
   cmTargetPropertyComputer \
+  cmTargetSourcesCommand \
   cmTest \
   cmTestGenerator \
   cmTimestamp \

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b3d98c6ec2c966b316ffeec257a249e8355ce005
commit b3d98c6ec2c966b316ffeec257a249e8355ce005
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Fri Aug 18 14:07:57 2017 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Fri Aug 18 14:07:57 2017 +0200

    Autogen: Add release notes for AUTOMOC_MACRO_NAMES

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.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7529d84facc8c5b3ddfc916c20c5998d6aa9acaf
commit 7529d84facc8c5b3ddfc916c20c5998d6aa9acaf
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Fri Aug 18 13:58:14 2017 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Fri Aug 18 13:58:14 2017 +0200

    Autogen: Add documentation for AUTOMOC_MACRO_NAMES

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/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")

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=05891d8f774cc2ac3fea44f6f320dcdc2e1d95e2
commit 05891d8f774cc2ac3fea44f6f320dcdc2e1d95e2
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Fri Aug 18 12:29:50 2017 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Fri Aug 18 12:32:34 2017 +0200

    Autogen: Add test for AUTOMOC_MACRO_NAMES

diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index 198bf63..be864c3 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -66,6 +66,15 @@ set_property(TARGET mocOnly PROPERTY AUTOMOC ON)
 target_link_libraries(mocOnly ${QT_LIBRARIES})
 
 # -- Test
+# MOC AUTOMOC_MACRO_NAMES
+if (NOT QT_TEST_VERSION STREQUAL 4)
+  add_executable(mocMacroName mocMacroName/main.cpp mocMacroName/MacroName.cpp)
+  set_property(TARGET mocMacroName PROPERTY AUTOMOC ON)
+  set_property(TARGET mocMacroName PROPERTY AUTOMOC_MACRO_NAMES "QO_ALIAS")
+  target_link_libraries(mocMacroName ${QT_LIBRARIES})
+endif()
+
+# -- Test
 # UIC only
 if(ALLOW_WRAP_CPP)
   qtx_wrap_cpp(uicOnlyMoc uicOnlySource/uiconly.h)
diff --git a/Tests/QtAutogen/mocMacroName/MacroAlias.hpp b/Tests/QtAutogen/mocMacroName/MacroAlias.hpp
new file mode 100644
index 0000000..cf06f2a
--- /dev/null
+++ b/Tests/QtAutogen/mocMacroName/MacroAlias.hpp
@@ -0,0 +1,7 @@
+#ifndef MACROALIAS_HPP
+#define MACROALIAS_HPP
+
+#include <QObject>
+#define QO_ALIAS Q_OBJECT
+
+#endif
diff --git a/Tests/QtAutogen/mocMacroName/MacroName.cpp b/Tests/QtAutogen/mocMacroName/MacroName.cpp
new file mode 100644
index 0000000..78d04a8
--- /dev/null
+++ b/Tests/QtAutogen/mocMacroName/MacroName.cpp
@@ -0,0 +1,9 @@
+#include "MacroName.hpp"
+
+MacroName::MacroName()
+{
+}
+
+void MacroName::aSlot()
+{
+}
diff --git a/Tests/QtAutogen/mocMacroName/MacroName.hpp b/Tests/QtAutogen/mocMacroName/MacroName.hpp
new file mode 100644
index 0000000..b6c7306
--- /dev/null
+++ b/Tests/QtAutogen/mocMacroName/MacroName.hpp
@@ -0,0 +1,20 @@
+#ifndef MACRONAME_HPP
+#define MACRONAME_HPP
+
+#include "MacroAlias.hpp"
+
+// Test Qt object macro hidden in a macro (AUTOMOC_MACRO_NAMES)
+class MacroName : public QObject
+{
+  QO_ALIAS
+public:
+  MacroName();
+
+signals:
+  void aSignal();
+
+public slots:
+  void aSlot();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocMacroName/main.cpp b/Tests/QtAutogen/mocMacroName/main.cpp
new file mode 100644
index 0000000..67ee81f
--- /dev/null
+++ b/Tests/QtAutogen/mocMacroName/main.cpp
@@ -0,0 +1,7 @@
+#include "MacroName.hpp"
+
+int main(int argv, char** args)
+{
+  MacroName macroName;
+  return 0;
+}

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=93f0ba2823b694340e6cfdb4e6befbf7fcf520bd
commit 93f0ba2823b694340e6cfdb4e6befbf7fcf520bd
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Fri Aug 18 11:11:21 2017 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Fri Aug 18 12:32:04 2017 +0200

    Autogen: Add AUTOMOC_MACRO_NAMES support
    
    Closes #17176

diff --git a/Modules/AutogenInfo.cmake.in b/Modules/AutogenInfo.cmake.in
index 4e85474..e1a9c39 100644
--- a/Modules/AutogenInfo.cmake.in
+++ b/Modules/AutogenInfo.cmake.in
@@ -18,6 +18,7 @@ set(AM_MOC_DEFINITIONS @_moc_compile_defs@)
 set(AM_MOC_INCLUDES @_moc_incs@)
 set(AM_MOC_OPTIONS @_moc_options@)
 set(AM_MOC_RELAXED_MODE @_moc_relaxed_mode@)
+set(AM_MOC_MACRO_NAMES @_moc_macro_names@)
 set(AM_MOC_DEPEND_FILTERS @_moc_depend_filters@)
 set(AM_MOC_PREDEFS_CMD @_moc_predefs_cmd@)
 # UIC settings
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index 7974977..6ae101f 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -380,6 +380,8 @@ static void MocSetupAutoTarget(
   AddDefinitionEscaped(makefile, "_moc_relaxed_mode",
                        makefile->IsOn("CMAKE_AUTOMOC_RELAXED_MODE") ? "TRUE"
                                                                     : "FALSE");
+  AddDefinitionEscaped(makefile, "_moc_macro_names",
+                       GetSafeProperty(target, "AUTOMOC_MACRO_NAMES"));
   AddDefinitionEscaped(makefile, "_moc_depend_filters",
                        GetSafeProperty(target, "AUTOMOC_DEPEND_FILTERS"));
 
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 1fe07ce..65ea048 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -280,12 +280,10 @@ cmQtAutoGenerators::cmQtAutoGenerators()
   }
 
   // Moc macro filters
-  this->MocMacroFilters[0].first = "Q_OBJECT";
-  this->MocMacroFilters[0].second.compile(
-    "[\n][ \t]*{?[ \t]*Q_OBJECT[^a-zA-Z0-9_]");
-  this->MocMacroFilters[1].first = "Q_GADGET";
-  this->MocMacroFilters[1].second.compile(
-    "[\n][ \t]*{?[ \t]*Q_GADGET[^a-zA-Z0-9_]");
+  this->MocMacroFilters.push_back(
+    MocMacroFilter("Q_OBJECT", "[\n][ \t]*{?[ \t]*Q_OBJECT[^a-zA-Z0-9_]"));
+  this->MocMacroFilters.push_back(
+    MocMacroFilter("Q_GADGET", "[\n][ \t]*{?[ \t]*Q_GADGET[^a-zA-Z0-9_]"));
 
   // Precompile regular expressions
   this->MocRegExpInclude.compile(
@@ -402,7 +400,6 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(
   InfoGet(makefile, "AM_QT_UIC_EXECUTABLE", this->UicExecutable);
   InfoGet(makefile, "AM_QT_RCC_EXECUTABLE", this->RccExecutable);
 
-  InfoGet(makefile, "AM_MOC_PREDEFS_CMD", this->MocPredefsCmd);
   // Check Qt version
   if ((this->QtMajorVersion != "4") && (this->QtMajorVersion != "5")) {
     this->LogError("AutoGen: Error: Unsupported Qt version: " +
@@ -427,6 +424,16 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(
     InfoGet(makefile, "AM_MOC_OPTIONS", this->MocOptions);
     InfoGet(makefile, "AM_MOC_RELAXED_MODE", this->MocRelaxedMode);
     {
+      std::vector<std::string> MocMacroNames;
+      InfoGet(makefile, "AM_MOC_MACRO_NAMES", MocMacroNames);
+      for (std::vector<std::string>::const_iterator dit =
+             MocMacroNames.begin();
+           dit != MocMacroNames.end(); ++dit) {
+        this->MocMacroFilters.push_back(
+          MocMacroFilter(*dit, "[^a-zA-Z0-9_]" + *dit + "[^a-zA-Z0-9_]"));
+      }
+    }
+    {
       std::vector<std::string> mocDependFilters;
       InfoGet(makefile, "AM_MOC_DEPEND_FILTERS", mocDependFilters);
       // Insert Q_PLUGIN_METADATA dependency filter
@@ -452,6 +459,7 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(
         return false;
       }
     }
+    InfoGet(makefile, "AM_MOC_PREDEFS_CMD", this->MocPredefsCmd);
   }
 
   // - Uic
@@ -800,8 +808,10 @@ bool cmQtAutoGenerators::RunAutogen()
 bool cmQtAutoGenerators::MocRequired(const std::string& contentText,
                                      std::string* macroName)
 {
-  for (unsigned int ii = 0; ii != cmArraySize(this->MocMacroFilters); ++ii) {
-    MocMacroFilter& filter = this->MocMacroFilters[ii];
+  for (std::vector<MocMacroFilter>::iterator fit =
+         this->MocMacroFilters.begin();
+       fit != this->MocMacroFilters.end(); ++fit) {
+    MocMacroFilter& filter = *fit;
     // Run a simple find string operation before the expensive
     // regular expression check
     if (contentText.find(filter.first) != std::string::npos) {
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index 337aa17..ce5db4a 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -201,7 +201,7 @@ private:
   std::vector<std::string> MocOptions;
   std::vector<std::string> MocPredefsCmd;
   std::vector<MocDependFilter> MocDependFilters;
-  MocMacroFilter MocMacroFilters[2];
+  std::vector<MocMacroFilter> MocMacroFilters;
   cmsys::RegularExpression MocRegExpInclude;
   // -- Uic
   bool UicSettingsChanged;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index c1b6f97..501aebf 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -248,6 +248,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
     this->SetPropertyDefault("AUTOUIC", CM_NULLPTR);
     this->SetPropertyDefault("AUTORCC", CM_NULLPTR);
     this->SetPropertyDefault("AUTOMOC_DEPEND_FILTERS", CM_NULLPTR);
+    this->SetPropertyDefault("AUTOMOC_MACRO_NAMES", CM_NULLPTR);
     this->SetPropertyDefault("AUTOMOC_MOC_OPTIONS", CM_NULLPTR);
     this->SetPropertyDefault("AUTOUIC_OPTIONS", CM_NULLPTR);
     this->SetPropertyDefault("AUTOUIC_SEARCH_PATHS", CM_NULLPTR);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=79064819a6adfd8c86134db2309f261425f3b4c7
commit 79064819a6adfd8c86134db2309f261425f3b4c7
Author:     Vitaly Stakhovsky <vvs31415 at gitlab.org>
AuthorDate: Thu Aug 17 14:41:01 2017 -0400
Commit:     Vitaly Stakhovsky <vvs31415 at gitlab.org>
CommitDate: Thu Aug 17 14:41:01 2017 -0400

    VS: remove unnecessary c_str()

diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 5570593..e1a0c83 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -85,7 +85,7 @@ cmVisualStudio10TargetGenerator::cmVisualStudio10TargetGenerator(
   this->LocalGenerator =
     (cmLocalVisualStudio7Generator*)this->GeneratorTarget->GetLocalGenerator();
   this->Name = this->GeneratorTarget->GetName();
-  this->GUID = this->GlobalGenerator->GetGUID(this->Name.c_str());
+  this->GUID = this->GlobalGenerator->GetGUID(this->Name);
   this->Platform = gg->GetPlatformName();
   this->NsightTegra = gg->IsNsightTegra();
   for (int i = 0; i < 4; ++i) {
@@ -411,7 +411,7 @@ void cmVisualStudio10TargetGenerator::Generate()
         globalKey == "ROOTNAMESPACE" || globalKey == "KEYWORD") {
       continue;
     }
-    const char* value = this->GeneratorTarget->GetProperty(keyIt->c_str());
+    const char* value = this->GeneratorTarget->GetProperty(*keyIt);
     if (!value)
       continue;
     this->WriteString("<", 2);
@@ -744,7 +744,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup()
         for (std::vector<std::string>::const_iterator i =
                this->Configurations.begin();
              i != this->Configurations.end(); ++i) {
-          this->WritePlatformConfigTag("LogicalName", i->c_str(), 3);
+          this->WritePlatformConfigTag("LogicalName", *i, 3);
           if (this->GeneratorTarget->GetProperty("VS_GLOBAL_ROOTNAMESPACE") ||
               // Handle variant of VS_GLOBAL_<variable> for RootNamespace.
               this->GeneratorTarget->GetProperty("VS_GLOBAL_RootNamespace")) {
@@ -806,7 +806,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup()
         for (cmPropertyMap::const_iterator p = props.begin(); p != props.end();
              ++p) {
           static const std::string propNamePrefix = "VS_CSHARP_";
-          if (p->first.find(propNamePrefix.c_str()) == 0) {
+          if (p->first.find(propNamePrefix) == 0) {
             std::string tagName = p->first.substr(propNamePrefix.length());
             if (!tagName.empty()) {
               std::string value = props.GetPropertyValue(p->first);
@@ -962,7 +962,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
   for (std::vector<std::string>::const_iterator i =
          this->Configurations.begin();
        i != this->Configurations.end(); ++i) {
-    this->WritePlatformConfigTag("PropertyGroup", i->c_str(), 1,
+    this->WritePlatformConfigTag("PropertyGroup", *i, 1,
                                  " Label=\"Configuration\"", "\n");
 
     if (this->ProjectType != csproj) {
@@ -1086,8 +1086,7 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValuesManaged(
     this->WriteString("<DefineDebug>true</DefineDebug>\n", 2);
   }
 
-  std::string outDir =
-    this->GeneratorTarget->GetDirectory(config.c_str()) + "/";
+  std::string outDir = this->GeneratorTarget->GetDirectory(config) + "/";
   this->ConvertToWindowsSlash(outDir);
   this->WriteString("<OutputPath>", 2);
   (*this->BuildFileStream) << cmVS10EscapeXML(outDir) << "</OutputPath>\n";
@@ -1258,8 +1257,7 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule(
     for (std::vector<std::string>::const_iterator d = ccg.GetDepends().begin();
          d != ccg.GetDepends().end(); ++d) {
       std::string dep;
-      if (this->LocalGenerator->GetRealDependency(d->c_str(), i->c_str(),
-                                                  dep)) {
+      if (this->LocalGenerator->GetRealDependency(*d, *i, dep)) {
         this->ConvertToWindowsSlash(dep);
         inputs << ";" << cmVS10EscapeXML(dep);
       }
@@ -1471,7 +1469,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
       std::string guidName = "SG_Filter_";
       guidName += name;
       this->WriteString("<UniqueIdentifier>", 3);
-      std::string guid = this->GlobalGenerator->GetGUID(guidName.c_str());
+      std::string guid = this->GlobalGenerator->GetGUID(guidName);
       (*this->BuildFileStream) << "{" << guid << "}"
                                << "</UniqueIdentifier>\n";
       this->WriteString("</Filter>\n", 2);
@@ -1482,7 +1480,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
     this->WriteString("<Filter Include=\"Resource Files\">\n", 2);
     std::string guidName = "SG_Filter_Resource Files";
     this->WriteString("<UniqueIdentifier>", 3);
-    std::string guid = this->GlobalGenerator->GetGUID(guidName.c_str());
+    std::string guid = this->GlobalGenerator->GetGUID(guidName);
     (*this->BuildFileStream) << "{" << guid << "}"
                              << "</UniqueIdentifier>\n";
     this->WriteString("<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;", 3);
@@ -2050,7 +2048,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
     std::string configDefines = defines;
     std::string defPropName = "COMPILE_DEFINITIONS_";
     defPropName += configUpper;
-    if (const char* ccdefs = sf.GetProperty(defPropName.c_str())) {
+    if (const char* ccdefs = sf.GetProperty(defPropName)) {
       if (!configDefines.empty()) {
         configDefines += ";";
       }
@@ -2177,7 +2175,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
          this->Configurations.begin();
        config != this->Configurations.end(); ++config) {
     if (ttype >= cmStateEnums::UTILITY) {
-      this->WritePlatformConfigTag("IntDir", config->c_str(), 2);
+      this->WritePlatformConfigTag("IntDir", *config, 2);
       *this->BuildFileStream
         << "$(Platform)\\$(Configuration)\\$(ProjectName)\\"
         << "</IntDir>\n";
@@ -2194,30 +2192,30 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
         targetNameFull = this->GeneratorTarget->GetName();
         targetNameFull += ".lib";
       } else {
-        outDir = this->GeneratorTarget->GetDirectory(config->c_str()) + "/";
-        targetNameFull = this->GeneratorTarget->GetFullName(config->c_str());
+        outDir = this->GeneratorTarget->GetDirectory(*config) + "/";
+        targetNameFull = this->GeneratorTarget->GetFullName(*config);
       }
       this->ConvertToWindowsSlash(intermediateDir);
       this->ConvertToWindowsSlash(outDir);
 
-      this->WritePlatformConfigTag("OutDir", config->c_str(), 2);
+      this->WritePlatformConfigTag("OutDir", *config, 2);
       *this->BuildFileStream << cmVS10EscapeXML(outDir) << "</OutDir>\n";
 
-      this->WritePlatformConfigTag("IntDir", config->c_str(), 2);
+      this->WritePlatformConfigTag("IntDir", *config, 2);
       *this->BuildFileStream << cmVS10EscapeXML(intermediateDir)
                              << "</IntDir>\n";
 
       if (const char* workingDir = this->GeneratorTarget->GetProperty(
             "VS_DEBUGGER_WORKING_DIRECTORY")) {
-        this->WritePlatformConfigTag("LocalDebuggerWorkingDirectory",
-                                     config->c_str(), 2);
+        this->WritePlatformConfigTag("LocalDebuggerWorkingDirectory", *config,
+                                     2);
         *this->BuildFileStream << cmVS10EscapeXML(workingDir)
                                << "</LocalDebuggerWorkingDirectory>\n";
       }
 
       std::string name =
         cmSystemTools::GetFilenameWithoutLastExtension(targetNameFull);
-      this->WritePlatformConfigTag("TargetName", config->c_str(), 2);
+      this->WritePlatformConfigTag("TargetName", *config, 2);
       *this->BuildFileStream << cmVS10EscapeXML(name) << "</TargetName>\n";
 
       std::string ext =
@@ -2227,7 +2225,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
         // A single "." appears to be treated as an empty extension.
         ext = ".";
       }
-      this->WritePlatformConfigTag("TargetExt", config->c_str(), 2);
+      this->WritePlatformConfigTag("TargetExt", *config, 2);
       *this->BuildFileStream << cmVS10EscapeXML(ext) << "</TargetExt>\n";
 
       this->OutputLinkIncremental(*config);
@@ -2254,13 +2252,13 @@ void cmVisualStudio10TargetGenerator::OutputLinkIncremental(
   Options& linkOptions = *(this->LinkOptions[configName]);
 
   const char* incremental = linkOptions.GetFlag("LinkIncremental");
-  this->WritePlatformConfigTag("LinkIncremental", configName.c_str(), 2);
+  this->WritePlatformConfigTag("LinkIncremental", configName, 2);
   *this->BuildFileStream << (incremental ? incremental : "true")
                          << "</LinkIncremental>\n";
   linkOptions.RemoveFlag("LinkIncremental");
 
   const char* manifest = linkOptions.GetFlag("GenerateManifest");
-  this->WritePlatformConfigTag("GenerateManifest", configName.c_str(), 2);
+  this->WritePlatformConfigTag("GenerateManifest", configName, 2);
   *this->BuildFileStream << (manifest ? manifest : "true")
                          << "</GenerateManifest>\n";
   linkOptions.RemoveFlag("GenerateManifest");
@@ -2271,7 +2269,7 @@ void cmVisualStudio10TargetGenerator::OutputLinkIncremental(
   for (const char** f = flags; *f; ++f) {
     const char* flag = *f;
     if (const char* value = linkOptions.GetFlag(flag)) {
-      this->WritePlatformConfigTag(flag, configName.c_str(), 2);
+      this->WritePlatformConfigTag(flag, configName, 2);
       *this->BuildFileStream << value << "</" << flag << ">\n";
       linkOptions.RemoveFlag(flag);
     }
@@ -2315,7 +2313,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
 
   std::string flags;
   const std::string& linkLanguage =
-    this->GeneratorTarget->GetLinkerLanguage(configName.c_str());
+    this->GeneratorTarget->GetLinkerLanguage(configName);
   if (linkLanguage.empty()) {
     cmSystemTools::Error(
       "CMake can not determine linker language for target: ",
@@ -2346,13 +2344,13 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
     baseFlagVar += "_FLAGS";
     flags =
       this->GeneratorTarget->Target->GetMakefile()->GetRequiredDefinition(
-        baseFlagVar.c_str());
+        baseFlagVar);
     std::string flagVar =
       baseFlagVar + std::string("_") + cmSystemTools::UpperCase(configName);
     flags += " ";
     flags +=
       this->GeneratorTarget->Target->GetMakefile()->GetRequiredDefinition(
-        flagVar.c_str());
+        flagVar);
     this->LocalGenerator->AddCompileOptions(flags, this->GeneratorTarget,
                                             langForClCompile, configName);
   }
@@ -2383,12 +2381,12 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
   std::vector<std::string> targetDefines;
   switch (this->ProjectType) {
     case vcxproj:
-      this->GeneratorTarget->GetCompileDefinitions(targetDefines,
-                                                   configName.c_str(), "CXX");
+      this->GeneratorTarget->GetCompileDefinitions(targetDefines, configName,
+                                                   "CXX");
       break;
     case csproj:
-      this->GeneratorTarget->GetCompileDefinitions(
-        targetDefines, configName.c_str(), "CSharp");
+      this->GeneratorTarget->GetCompileDefinitions(targetDefines, configName,
+                                                   "CSharp");
       break;
   }
   clOptions.AddDefines(targetDefines);
@@ -2494,8 +2492,7 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
     }
 
     // Specify the compiler program database file if configured.
-    std::string pdb =
-      this->GeneratorTarget->GetCompilePDBPath(configName.c_str());
+    std::string pdb = this->GeneratorTarget->GetCompilePDBPath(configName);
     if (!pdb.empty()) {
       this->ConvertToWindowsSlash(pdb);
       this->WriteString("<ProgramDataBaseFileName>", 3);
@@ -2637,8 +2634,8 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions(
   cudaOptions.FixCudaCodeGeneration();
 
   std::vector<std::string> targetDefines;
-  this->GeneratorTarget->GetCompileDefinitions(targetDefines,
-                                               configName.c_str(), "CUDA");
+  this->GeneratorTarget->GetCompileDefinitions(targetDefines, configName,
+                                               "CUDA");
   cudaOptions.AddDefines(targetDefines);
 
   // Add a definition for the configuration name.
@@ -3108,11 +3105,11 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
   linkFlagVarBase += "_LINKER_FLAGS";
   flags += " ";
   flags += this->GeneratorTarget->Target->GetMakefile()->GetRequiredDefinition(
-    linkFlagVarBase.c_str());
+    linkFlagVarBase);
   std::string linkFlagVar = linkFlagVarBase + "_" + CONFIG;
   flags += " ";
   flags += this->GeneratorTarget->Target->GetMakefile()->GetRequiredDefinition(
-    linkFlagVar.c_str());
+    linkFlagVar);
   const char* targetLinkFlags =
     this->GeneratorTarget->GetProperty("LINK_FLAGS");
   if (targetLinkFlags) {
@@ -3122,13 +3119,13 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
   std::string flagsProp = "LINK_FLAGS_";
   flagsProp += CONFIG;
   if (const char* flagsConfig =
-        this->GeneratorTarget->GetProperty(flagsProp.c_str())) {
+        this->GeneratorTarget->GetProperty(flagsProp)) {
     flags += " ";
     flags += flagsConfig;
   }
 
   cmComputeLinkInformation* pcli =
-    this->GeneratorTarget->GetLinkInformation(config.c_str());
+    this->GeneratorTarget->GetLinkInformation(config);
   if (!pcli) {
     cmSystemTools::Error(
       "CMake can not compute cmComputeLinkInformation for target: ",
@@ -3156,8 +3153,7 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
   std::string standardLibsVar = "CMAKE_";
   standardLibsVar += linkLanguage;
   standardLibsVar += "_STANDARD_LIBRARIES";
-  std::string const libs =
-    this->Makefile->GetSafeDefinition(standardLibsVar.c_str());
+  std::string const libs = this->Makefile->GetSafeDefinition(standardLibsVar);
   cmSystemTools::ParseWindowsCommandLine(libs.c_str(), libVec);
   linkOptions.AddFlag("AdditionalDependencies", libVec);
 
@@ -3185,13 +3181,12 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
   std::string targetNameImport;
   std::string targetNamePDB;
   if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE) {
-    this->GeneratorTarget->GetExecutableNames(targetName, targetNameFull,
-                                              targetNameImport, targetNamePDB,
-                                              config.c_str());
+    this->GeneratorTarget->GetExecutableNames(
+      targetName, targetNameFull, targetNameImport, targetNamePDB, config);
   } else {
     this->GeneratorTarget->GetLibraryNames(targetName, targetNameSO,
                                            targetNameFull, targetNameImport,
-                                           targetNamePDB, config.c_str());
+                                           targetNamePDB, config);
   }
 
   if (this->MSTools) {
@@ -3232,11 +3227,11 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
 
     linkOptions.AddFlag("GenerateDebugInformation", "false");
 
-    std::string pdb = this->GeneratorTarget->GetPDBDirectory(config.c_str());
+    std::string pdb = this->GeneratorTarget->GetPDBDirectory(config);
     pdb += "/";
     pdb += targetNamePDB;
     std::string imLib = this->GeneratorTarget->GetDirectory(
-      config.c_str(), cmStateEnums::ImportLibraryArtifact);
+      config, cmStateEnums::ImportLibraryArtifact);
     imLib += "/";
     imLib += targetNameImport;
 
@@ -3311,7 +3306,7 @@ bool cmVisualStudio10TargetGenerator::ComputeLibOptions(
   std::string const& config)
 {
   cmComputeLinkInformation* pcli =
-    this->GeneratorTarget->GetLinkInformation(config.c_str());
+    this->GeneratorTarget->GetLinkInformation(config);
   if (!pcli) {
     cmSystemTools::Error(
       "CMake can not compute cmComputeLinkInformation for target: ",
@@ -3326,8 +3321,8 @@ bool cmVisualStudio10TargetGenerator::ComputeLibOptions(
     this->LocalGenerator->GetCurrentBinaryDirectory();
   for (ItemVector::const_iterator l = libs.begin(); l != libs.end(); ++l) {
     if (l->IsPath && cmVS10IsTargetsFile(l->Value)) {
-      std::string path = this->LocalGenerator->ConvertToRelativePath(
-        currentBinDir, l->Value.c_str());
+      std::string path =
+        this->LocalGenerator->ConvertToRelativePath(currentBinDir, l->Value);
       this->ConvertToWindowsSlash(path);
       this->AddTargetsFileAndConfigPair(path, config);
     }
@@ -3372,8 +3367,8 @@ void cmVisualStudio10TargetGenerator::AddLibraries(
     this->LocalGenerator->GetCurrentBinaryDirectory();
   for (ItemVector::const_iterator l = libs.begin(); l != libs.end(); ++l) {
     if (l->IsPath) {
-      std::string path = this->LocalGenerator->ConvertToRelativePath(
-        currentBinDir, l->Value.c_str());
+      std::string path =
+        this->LocalGenerator->ConvertToRelativePath(currentBinDir, l->Value);
       this->ConvertToWindowsSlash(path);
       if (cmVS10IsTargetsFile(l->Value)) {
         vsTargetVec.push_back(path);
@@ -3463,12 +3458,12 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups()
        i != this->Configurations.end(); ++i) {
     std::vector<std::string> includes;
     this->LocalGenerator->GetIncludeDirectories(
-      includes, this->GeneratorTarget, "C", i->c_str());
+      includes, this->GeneratorTarget, "C", *i);
     for (std::vector<std::string>::iterator ii = includes.begin();
          ii != includes.end(); ++ii) {
       this->ConvertToWindowsSlash(*ii);
     }
-    this->WritePlatformConfigTag("ItemDefinitionGroup", i->c_str(), 1);
+    this->WritePlatformConfigTag("ItemDefinitionGroup", *i, 1);
     *this->BuildFileStream << "\n";
     //    output cl compile flags <ClCompile></ClCompile>
     if (this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY) {
@@ -3606,8 +3601,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences()
     this->ConvertToWindowsSlash(path);
     (*this->BuildFileStream) << cmVS10EscapeXML(path) << "\">\n";
     this->WriteString("<Project>", 3);
-    (*this->BuildFileStream)
-      << "{" << this->GlobalGenerator->GetGUID(name.c_str()) << "}";
+    (*this->BuildFileStream) << "{" << this->GlobalGenerator->GetGUID(name)
+                             << "}";
     (*this->BuildFileStream) << "</Project>\n";
     this->WriteString("<Name>", 3);
     (*this->BuildFileStream) << name << "</Name>\n";
@@ -3880,7 +3875,7 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
         this->WriteString("<XapOutputs>true</XapOutputs>\n", 2);
         this->WriteString("<XapFilename>", 2);
         (*this->BuildFileStream)
-          << cmVS10EscapeXML(this->Name.c_str())
+          << cmVS10EscapeXML(this->Name)
           << "_$(Configuration)_$(Platform).xap</XapFilename>\n";
       }
     }
@@ -4407,7 +4402,7 @@ void cmVisualStudio10TargetGenerator::GetCSharpSourceProperties(
     for (cmPropertyMap::const_iterator p = props.begin(); p != props.end();
          ++p) {
       static const std::string propNamePrefix = "VS_CSHARP_";
-      if (p->first.find(propNamePrefix.c_str()) == 0) {
+      if (p->first.find(propNamePrefix) == 0) {
         std::string tagName = p->first.substr(propNamePrefix.length());
         if (!tagName.empty()) {
           const std::string val = props.GetPropertyValue(p->first);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d12837afe65daf6f907364e48f907e6ce35fef7d
commit d12837afe65daf6f907364e48f907e6ce35fef7d
Author:     Daniel Pfeifer <daniel at pfeifer-mail.de>
AuthorDate: Tue Aug 15 21:59:06 2017 +0200
Commit:     Daniel Pfeifer <daniel at pfeifer-mail.de>
CommitDate: Wed Aug 16 16:38:06 2017 +0200

    bootstrap: Require a standard C compiler

diff --git a/bootstrap b/bootstrap
index 00c3ba5..eb54228 100755
--- a/bootstrap
+++ b/bootstrap
@@ -935,35 +935,26 @@ echo '
 # error "The CMAKE_C_COMPILER is set to a C++ compiler"
 #endif
 
-#include<stdio.h>
+#include <stdio.h>
 
-#if defined(__CLASSIC_C__)
-int main(argc, argv)
-  int argc;
-  char* argv[];
-#else
 int main(int argc, char* argv[])
-#endif
 {
   printf("%d%c", (argv != 0), (char)0x0a);
-  return argc-1;
+  return argc - 1;
 }
 ' > "${TMPFILE}.c"
-for a in ${cmake_c_compilers}; do
-  if [ -z "${cmake_c_compiler}" ] && \
-    cmake_try_run "${a}" "${cmake_c_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
-    cmake_c_compiler="${a}"
-  fi
-done
 for std in 11 99 90; do
   try_flags="`cmake_extract_standard_flags \"${cmake_toolchain}\" C \"${std}\"`"
-  for flag in $try_flags; do
-    echo "Checking whether ${cmake_c_compiler} supports ${flag}" >> cmake_bootstrap.log 2>&1
-    if cmake_try_run "${cmake_c_compiler}" "${cmake_c_flags} ${flag}" \
-      "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
-      cmake_c_flags="${cmake_c_flags} ${flag}"
-      break 2
-    fi
+  for compiler in ${cmake_c_compilers}; do
+    for flag in '' $try_flags; do
+      echo "Checking whether '${compiler} ${cmake_c_flags} ${flag}' works." >> cmake_bootstrap.log 2>&1
+      if cmake_try_run "${compiler}" "${cmake_c_flags} ${flag}" \
+        "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
+        cmake_c_compiler="${compiler}"
+        cmake_c_flags="${cmake_c_flags} ${flag}"
+        break 3
+      fi
+    done
   done
 done
 rm -f "${TMPFILE}.c"

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dc0befb6a1b6480d5c2a8237ac052452c710e39a
commit dc0befb6a1b6480d5c2a8237ac052452c710e39a
Author:     Daniel Pfeifer <daniel at pfeifer-mail.de>
AuthorDate: Tue Aug 15 21:55:53 2017 +0200
Commit:     Daniel Pfeifer <daniel at pfeifer-mail.de>
CommitDate: Tue Aug 15 21:55:53 2017 +0200

    bootstrap: Remove check that identifies GNU compiler
    
    Bootstrapping no longer depends on this information.

diff --git a/bootstrap b/bootstrap
index 7304908..00c3ba5 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1110,31 +1110,6 @@ if [ "x${cmake_full_make_flags}" != "x${cmake_make_flags}" ]; then
   echo "---------------------------------------------"
 fi
 
-# Ok, we have CC, CXX, and MAKE.
-
-# Test C++ compiler features
-
-# Are we GCC?
-
-TMPFILE=`cmake_tmp_file`
-echo '
-#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
-#include <iostream>
-int main() { std::cout << "This is GNU" << std::endl; return 0;}
-#endif
-' > ${TMPFILE}.cxx
-cmake_cxx_compiler_is_gnu=0
-if cmake_try_run "${cmake_cxx_compiler}" \
-  "${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
-  cmake_cxx_compiler_is_gnu=1
-fi
-if [ "x${cmake_cxx_compiler_is_gnu}" = "x1" ]; then
-  echo "${cmake_cxx_compiler} is GNU compiler"
-else
-  echo "${cmake_cxx_compiler} is not GNU compiler"
-fi
-rm -f "${TMPFILE}.cxx"
-
 # Test for kwsys features
 KWSYS_NAME_IS_KWSYS=0
 KWSYS_BUILD_SHARED=0

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6fdcf02aafe1d3c64a4cce0b852685a6dde88a10
commit 6fdcf02aafe1d3c64a4cce0b852685a6dde88a10
Author:     Daniel Pfeifer <daniel at pfeifer-mail.de>
AuthorDate: Tue Aug 15 21:48:45 2017 +0200
Commit:     Daniel Pfeifer <daniel at pfeifer-mail.de>
CommitDate: Tue Aug 15 21:48:45 2017 +0200

    bootstrap: remove dead branches
    
    Remove code that uses cmake_cxx_compiler_is_gnu before it is set.

diff --git a/bootstrap b/bootstrap
index 9d73233..7304908 100755
--- a/bootstrap
+++ b/bootstrap
@@ -855,16 +855,6 @@ if ${cmake_system_haiku}; then
   cmake_ld_flags="${LDFLAGS} -lroot -lbe"
 fi
 
-# Workaround for short jump tables on PA-RISC
-if ${cmake_machine_parisc}; then
-  if ${cmake_c_compiler_is_gnu}; then
-    cmake_c_flags="${CFLAGS} -mlong-calls"
-  fi
-  if ${cmake_cxx_compiler_is_gnu}; then
-    cmake_cxx_flags="${CXXFLAGS} -mlong-calls"
-  fi
-fi
-
 #-----------------------------------------------------------------------------
 # Detect known toolchains on some platforms.
 cmake_toolchains=''

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c1f4f13dbfa7caf6bbf4d8b70a7f09f786c7eed6
commit c1f4f13dbfa7caf6bbf4d8b70a7f09f786c7eed6
Author:     Robert Maynard <robert.maynard at kitware.com>
AuthorDate: Mon Aug 14 11:43:32 2017 -0400
Commit:     Robert Maynard <robert.maynard at kitware.com>
CommitDate: Tue Aug 15 12:58:52 2017 -0400

    FindCUDA: Use long brackets to handle spaces in CUDA_NVCC_COMPILE_DEFINITIONS
    
    Fixes #16510. Quoting of compile definitions breaks string value definitions

diff --git a/Modules/FindCUDA/run_nvcc.cmake b/Modules/FindCUDA/run_nvcc.cmake
index 28cc1e9..ec5a099 100644
--- a/Modules/FindCUDA/run_nvcc.cmake
+++ b/Modules/FindCUDA/run_nvcc.cmake
@@ -74,7 +74,7 @@ set(CUDA_NVCC_FLAGS @CUDA_NVCC_FLAGS@ ;; @CUDA_WRAP_OPTION_NVCC_FLAGS@) # list
 @CUDA_NVCC_FLAGS_CONFIG@
 set(nvcc_flags @nvcc_flags@) # list
 set(CUDA_NVCC_INCLUDE_DIRS "@CUDA_NVCC_INCLUDE_DIRS@") # list (needs to be in quotes to handle spaces properly).
-set(CUDA_NVCC_COMPILE_DEFINITIONS "@CUDA_NVCC_COMPILE_DEFINITIONS@") # list (needs to be in quotes to handle spaces properly).
+set(CUDA_NVCC_COMPILE_DEFINITIONS [==[@CUDA_NVCC_COMPILE_DEFINITIONS@]==]) # list (needs to be in lua quotes see #16510 ).
 set(format_flag "@format_flag@") # string
 set(cuda_language_flag @cuda_language_flag@) # list
 

-----------------------------------------------------------------------

Summary of changes:
 Help/manual/cmake-properties.7.rst                 |    1 +
 Help/manual/cmake-qt.7.rst                         |    4 +
 Help/manual/cmake-variables.7.rst                  |    1 +
 Help/prop_tgt/AUTOMOC.rst                          |   14 ++-
 Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst              |   28 +++++
 Help/release/dev/autogen-macro-names.rst           |   12 +++
 Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst        |   19 ++++
 Modules/AutogenInfo.cmake.in                       |    1 +
 Modules/FindCUDA/run_nvcc.cmake                    |    2 +-
 Source/CursesDialog/CMakeLists.txt                 |    4 -
 Source/CursesDialog/form/CMakeLists.txt            |   17 +--
 Source/cmCommands.cxx                              |   28 ++---
 Source/cmQtAutoGeneratorInitializer.cxx            |    2 +
 Source/cmQtAutoGenerators.cxx                      |   28 +++--
 Source/cmQtAutoGenerators.h                        |    2 +-
 Source/cmTarget.cxx                                |    1 +
 Source/cmVisualStudio10TargetGenerator.cxx         |  111 ++++++++++----------
 Tests/QtAutogen/CMakeLists.txt                     |    9 ++
 Tests/QtAutogen/mocMacroName/MacroAlias.hpp        |    7 ++
 Tests/QtAutogen/mocMacroName/MacroName.cpp         |    9 ++
 Tests/QtAutogen/mocMacroName/MacroName.hpp         |   20 ++++
 .../mocPlugin => QtAutogen/mocMacroName}/main.cpp  |    3 +-
 Tests/RunCMake/CPack/CMakeLists.txt                |    4 +
 Tests/RunCMake/CPack/README.txt                    |    5 +
 bootstrap                                          |   74 ++++---------
 25 files changed, 250 insertions(+), 156 deletions(-)
 create mode 100644 Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst
 create mode 100644 Help/release/dev/autogen-macro-names.rst
 create mode 100644 Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst
 create mode 100644 Tests/QtAutogen/mocMacroName/MacroAlias.hpp
 create mode 100644 Tests/QtAutogen/mocMacroName/MacroName.cpp
 create mode 100644 Tests/QtAutogen/mocMacroName/MacroName.hpp
 copy Tests/{QtAutogenRerun/mocPlugin => QtAutogen/mocMacroName}/main.cpp (50%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list