[Cmake-commits] CMake branch, next, updated. v2.8.12.2-1801-gb8ebeea

Brad King brad.king at kitware.com
Thu Feb 27 08:55:10 EST 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  b8ebeeaa7d8adeaaf7e207595fc882b207545966 (commit)
       via  ac42bca8330e0501d2fbf80dbe6d4d93234ba0c0 (commit)
       via  c50325b8e55e55306fbf8bca38128303b82a51a9 (commit)
      from  18210400c7c76a2f4f0b7cefa8ead43938144109 (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=b8ebeeaa7d8adeaaf7e207595fc882b207545966
commit b8ebeeaa7d8adeaaf7e207595fc882b207545966
Merge: 1821040 ac42bca
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Feb 27 08:55:09 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Feb 27 08:55:09 2014 -0500

    Merge topic 'FindGTest-AUTO-SOURCES' into next
    
    ac42bca8 Help: Add FindGTest-AUTO-SOURCES topic release notes
    c50325b8 FindGTest: Optionally detect sources automatically (#14775)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ac42bca8330e0501d2fbf80dbe6d4d93234ba0c0
commit ac42bca8330e0501d2fbf80dbe6d4d93234ba0c0
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Feb 27 08:54:13 2014 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Feb 27 08:54:13 2014 -0500

    Help: Add FindGTest-AUTO-SOURCES topic release notes

diff --git a/Help/release/dev/FindGTest-AUTO-SOURCES.rst b/Help/release/dev/FindGTest-AUTO-SOURCES.rst
new file mode 100644
index 0000000..17b2a1b
--- /dev/null
+++ b/Help/release/dev/FindGTest-AUTO-SOURCES.rst
@@ -0,0 +1,7 @@
+FindGTest-AUTO-SOURCES
+----------------------
+
+* The :module:`FindGTest` module ``gtest_add_tests`` macro learned
+  a new ``AUTO`` option to automatically read the :prop_tgt:`SOURCES`
+  target property of the test executable and scan the source files
+  for tests to be added.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c50325b8e55e55306fbf8bca38128303b82a51a9
commit c50325b8e55e55306fbf8bca38128303b82a51a9
Author:     Nikolay Orliuk <virkony at gmail.com>
AuthorDate: Wed Feb 26 14:47:38 2014 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Feb 27 08:52:18 2014 -0500

    FindGTest: Optionally detect sources automatically (#14775)
    
    Teach GTEST_ADD_TESTS an "AUTO" option to read the source files from the
    SOURCES target property of an executable.

diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake
index c00a750..aa3c235 100644
--- a/Modules/FindGTest.cmake
+++ b/Modules/FindGTest.cmake
@@ -79,7 +79,7 @@
 #     extra_args = Pass a list of extra arguments to be passed to
 #                  executable enclosed in quotes (or "" for none)
 #     ARGN =       A list of source files to search for tests & test
-#                  fixtures.
+#                  fixtures. Or AUTO to find them from executable target.
 #
 #
 #
@@ -88,7 +88,7 @@
 #   Example:
 #      set(FooTestArgs --foo 1 --bar 2)
 #      add_executable(FooTest FooUnitTest.cc)
-#      GTEST_ADD_TESTS(FooTest "${FooTestArgs}" FooUnitTest.cc)
+#      GTEST_ADD_TESTS(FooTest "${FooTestArgs}" AUTO)
 
 #=============================================================================
 # Copyright 2009 Kitware, Inc.
@@ -111,6 +111,10 @@ function(GTEST_ADD_TESTS executable extra_args)
     if(NOT ARGN)
         message(FATAL_ERROR "Missing ARGN: Read the documentation for GTEST_ADD_TESTS")
     endif()
+    if(ARGN STREQUAL "AUTO")
+        # obtain sources used for building that executable
+        get_property(ARGN TARGET ${executable} PROPERTY SOURCES)
+    endif()
     foreach(source ${ARGN})
         file(READ "${source}" contents)
         string(REGEX MATCHALL "TEST_?F?\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents})

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

Summary of changes:
 Help/release/dev/FindGTest-AUTO-SOURCES.rst |    7 +++++++
 Modules/FindGTest.cmake                     |    8 ++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)
 create mode 100644 Help/release/dev/FindGTest-AUTO-SOURCES.rst


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list