[Cmake-commits] CMake branch, next, updated. v3.0.0-rc4-2603-g29ede8a

Stephen Kelly steveire at gmail.com
Wed Apr 30 02:36:53 EDT 2014


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, next has been updated
       via  29ede8a5f2c73a0afb55487ed38bedadcb8a1951 (commit)
       via  5c6cee659eb3a6e00adc0825d3973d12d9f4f5d6 (commit)
      from  5b004e8432404ad6b93176be520f9222a7a5de5e (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 -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=29ede8a5f2c73a0afb55487ed38bedadcb8a1951
commit 29ede8a5f2c73a0afb55487ed38bedadcb8a1951
Merge: 5b004e8 5c6cee6
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Apr 30 02:36:52 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Apr 30 02:36:52 2014 -0400

    Merge topic 'dont-rewrite-moc-parameter-file' into next
    
    5c6cee65 Qt4: Extend the Qt4Targets test to cover dir and target moc parameters.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5c6cee659eb3a6e00adc0825d3973d12d9f4f5d6
commit 5c6cee659eb3a6e00adc0825d3973d12d9f4f5d6
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Apr 30 08:35:51 2014 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Apr 30 08:35:51 2014 +0200

    Qt4: Extend the Qt4Targets test to cover dir and target moc parameters.

diff --git a/Tests/Qt4Targets/CMakeLists.txt b/Tests/Qt4Targets/CMakeLists.txt
index 7430084..3670746 100644
--- a/Tests/Qt4Targets/CMakeLists.txt
+++ b/Tests/Qt4Targets/CMakeLists.txt
@@ -37,29 +37,34 @@ set_property(TARGET Qt4WrapMacroTest PROPERTY AUTOMOC OFF)
 target_include_directories(Qt4WrapMacroTest PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/interface")
 target_link_libraries(Qt4WrapMacroTest Qt4::QtGui)
 
-set(timeformat "%Y%j%H%M%S")
-try_compile(RESULT
-  "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild"
-  "${CMAKE_CURRENT_SOURCE_DIR}/IncrementalMoc"
-  IncrementalMoc
-  CMAKE_FLAGS -DADD_DEF=0 "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}")
-file(TIMESTAMP "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild/moc_foo.cpp" tsvar_before "${timeformat}")
-if (NOT tsvar_before)
-  message(SEND_ERROR "Unable to read timestamp from moc file from first build!")
-endif()
+macro(test_incremental def)
+  set(timeformat "%Y%j%H%M%S")
+  try_compile(RESULT
+    "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild_${def}"
+    "${CMAKE_CURRENT_SOURCE_DIR}/IncrementalMoc"
+    IncrementalMoc_${def}
+    CMAKE_FLAGS -D${def}=0 "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}")
+  file(TIMESTAMP "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild_${def}/moc_foo.cpp" tsvar_before "${timeformat}")
+  if (NOT tsvar_before)
+    message(SEND_ERROR "Unable to read timestamp from moc file from first build with -D${def}!")
+  endif()
 
-execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 2) # Ensure that the timestamp will change.
+  execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 2) # Ensure that the timestamp will change.
 
-try_compile(RESULT
-  "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild"
-  "${CMAKE_CURRENT_SOURCE_DIR}/IncrementalMoc"
-  IncrementalMoc
-  CMAKE_FLAGS -DADD_DEF=1 "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}")
-file(TIMESTAMP "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild/moc_foo.cpp" tsvar_after "${timeformat}")
-if (NOT tsvar_after)
-  message(SEND_ERROR "Unable to read timestamp from moc file from second build!")
-endif()
+  try_compile(RESULT
+    "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild_${def}"
+    "${CMAKE_CURRENT_SOURCE_DIR}/IncrementalMoc"
+    IncrementalMoc_${def}
+    CMAKE_FLAGS -D${def}=1 "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}")
+  file(TIMESTAMP "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild_${def}/moc_foo.cpp" tsvar_after "${timeformat}")
+  if (NOT tsvar_after)
+    message(SEND_ERROR "Unable to read timestamp from moc file from second build!")
+  endif()
 
-if (NOT tsvar_after GREATER tsvar_before)
-  message(SEND_ERROR "Rebuild did not re-create moc file. Before: ${tsvar_before}. After: ${tsvar_after}")
-endif()
+  if (NOT tsvar_after GREATER tsvar_before)
+    message(SEND_ERROR "Rebuild did not re-create moc file with -D${def}. Before: ${tsvar_before}. After: ${tsvar_after}")
+  endif()
+endmacro()
+
+test_incremental(ADD_TARGET_DEF)
+test_incremental(ADD_DIR_DEF)
diff --git a/Tests/Qt4Targets/IncrementalMoc/CMakeLists.txt b/Tests/Qt4Targets/IncrementalMoc/CMakeLists.txt
index 4ba0ced..65e2b64 100644
--- a/Tests/Qt4Targets/IncrementalMoc/CMakeLists.txt
+++ b/Tests/Qt4Targets/IncrementalMoc/CMakeLists.txt
@@ -4,10 +4,18 @@ project(IncrementalMoc)
 
 find_package(Qt4 REQUIRED)
 
-qt4_generate_moc(foo.h moc_foo.cpp)
+if (ADD_TARGET_DEF)
+  set(target_args TARGET testlib)
+endif()
+
+if (ADD_DIR_DEF)
+  add_definitions(-DNEW_DEF)
+endif()
+
+qt4_generate_moc(foo.h moc_foo.cpp ${target_args})
 
 add_library(testlib foo.cpp moc_foo.cpp)
 target_link_libraries(testlib Qt4::QtCore)
-if (ADD_DEF)
+if (ADD_TARGET_DEF)
   target_compile_definitions(testlib PRIVATE NEW_DEF)
 endif()

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

Summary of changes:
 Tests/Qt4Targets/CMakeLists.txt                |   51 +++++++++++++-----------
 Tests/Qt4Targets/IncrementalMoc/CMakeLists.txt |   12 +++++-
 2 files changed, 38 insertions(+), 25 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list