[Cmake-commits] CMake branch, next, updated. v3.4.0-1475-g7e33309

Brad King brad.king at kitware.com
Mon Nov 23 13:28:55 EST 2015


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  7e33309c1755f61326f8d11403d4b72c0648ff7b (commit)
       via  010c5959864a10f4b83907fb058006e118dd740d (commit)
      from  328b26f818b568d42d5fb1bc1e7e6cdf2eeca178 (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=7e33309c1755f61326f8d11403d4b72c0648ff7b
commit 7e33309c1755f61326f8d11403d4b72c0648ff7b
Merge: 328b26f 010c595
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Nov 23 13:28:54 2015 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Nov 23 13:28:54 2015 -0500

    Merge topic 'test-add_subdirectory-in-function' into next
    
    010c5959 Tests: Add case for add_subdirectory inside a function


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=010c5959864a10f4b83907fb058006e118dd740d
commit 010c5959864a10f4b83907fb058006e118dd740d
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Nov 23 10:51:37 2015 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Nov 23 10:52:51 2015 -0500

    Tests: Add case for add_subdirectory inside a function

diff --git a/Tests/RunCMake/add_subdirectory/Function-stdout.txt b/Tests/RunCMake/add_subdirectory/Function-stdout.txt
new file mode 100644
index 0000000..16fa857
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/Function-stdout.txt
@@ -0,0 +1,10 @@
+-- var='1' before my_add_subdirectory
+-- var='2' in my_add_subdirectory before add_subdirectory
+-- var='2' in subdirectory before set
+-- var='3' in subdirectory after set
+-- var_sub='' in subdirectory after set PARENT_SCOPE
+-- var='2' in my_add_subdirectory after add_subdirectory
+-- var_sub='sub' in my_add_subdirectory after add_subdirectory
+-- var='1' after my_add_subdirectory
+-- var_sub='' after my_add_subdirectory
+-- var='3' taken from subdirectory
diff --git a/Tests/RunCMake/add_subdirectory/Function.cmake b/Tests/RunCMake/add_subdirectory/Function.cmake
new file mode 100644
index 0000000..e804da9
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/Function.cmake
@@ -0,0 +1,17 @@
+function(my_add_subdirectory dir)
+  set(var 2)
+  message(STATUS "var='${var}' in my_add_subdirectory before add_subdirectory")
+  add_subdirectory(${dir})
+  message(STATUS "var='${var}' in my_add_subdirectory after add_subdirectory")
+  message(STATUS "var_sub='${var_sub}' in my_add_subdirectory after add_subdirectory")
+endfunction()
+
+set(var 1)
+
+message(STATUS "var='${var}' before my_add_subdirectory")
+my_add_subdirectory(Function)
+message(STATUS "var='${var}' after my_add_subdirectory")
+message(STATUS "var_sub='${var_sub}' after my_add_subdirectory")
+
+get_directory_property(sub_var DIRECTORY Function DEFINITION var)
+message(STATUS "var='${sub_var}' taken from subdirectory")
diff --git a/Tests/RunCMake/add_subdirectory/Function/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/Function/CMakeLists.txt
new file mode 100644
index 0000000..7b9e801
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/Function/CMakeLists.txt
@@ -0,0 +1,5 @@
+message(STATUS "var='${var}' in subdirectory before set")
+set(var 3)
+message(STATUS "var='${var}' in subdirectory after set")
+set(var_sub sub PARENT_SCOPE)
+message(STATUS "var_sub='${var_sub}' in subdirectory after set PARENT_SCOPE")
diff --git a/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake b/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake
index a3ddec8..9d514e1 100644
--- a/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake
+++ b/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake
@@ -2,3 +2,4 @@ include(RunCMake)
 
 run_cmake(DoesNotExist)
 run_cmake(Missing)
+run_cmake(Function)

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

Summary of changes:
 Tests/RunCMake/add_subdirectory/Function-stdout.txt   |   10 ++++++++++
 Tests/RunCMake/add_subdirectory/Function.cmake        |   17 +++++++++++++++++
 .../RunCMake/add_subdirectory/Function/CMakeLists.txt |    5 +++++
 Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake    |    1 +
 4 files changed, 33 insertions(+)
 create mode 100644 Tests/RunCMake/add_subdirectory/Function-stdout.txt
 create mode 100644 Tests/RunCMake/add_subdirectory/Function.cmake
 create mode 100644 Tests/RunCMake/add_subdirectory/Function/CMakeLists.txt


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list