[Cmake-commits] CMake branch, next, updated. v3.6.1-1647-g698e662

Brad King brad.king at kitware.com
Wed Aug 31 09:17:41 EDT 2016


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  698e66225604dfd7b2419d2459bddcbc08c609b9 (commit)
       via  df32e564aed43470e304cf21d8c9ac1d5a01d055 (commit)
      from  da28ae1b3d79b91d94fa39aa7228b0717374f972 (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=698e66225604dfd7b2419d2459bddcbc08c609b9
commit 698e66225604dfd7b2419d2459bddcbc08c609b9
Merge: da28ae1 df32e56
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Aug 31 09:17:40 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Aug 31 09:17:40 2016 -0400

    Merge topic '16101-xcode-fix-directory-exclude-from-all' into next
    
    df32e564 Xcode: Add targets marked as EXCLUDE_FROM_ALL to project (#16101)


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=df32e564aed43470e304cf21d8c9ac1d5a01d055
commit df32e564aed43470e304cf21d8c9ac1d5a01d055
Author:     Gregor Jasny <gjasny at googlemail.com>
AuthorDate: Fri Aug 19 21:50:48 2016 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Aug 31 09:16:44 2016 -0400

    Xcode: Add targets marked as EXCLUDE_FROM_ALL to project (#16101)

diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 780ca90..b4bc084 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2635,13 +2635,10 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
 }
 
 bool cmGlobalXCodeGenerator::CreateGroups(
-  cmLocalGenerator* root, std::vector<cmLocalGenerator*>& generators)
+  std::vector<cmLocalGenerator*>& generators)
 {
   for (std::vector<cmLocalGenerator*>::iterator i = generators.begin();
        i != generators.end(); ++i) {
-    if (this->IsExcluded(root, *i)) {
-      continue;
-    }
     cmMakefile* mf = (*i)->GetMakefile();
     std::vector<cmSourceGroup> sourceGroups = mf->GetSourceGroups();
     std::vector<cmGeneratorTarget*> tgts = (*i)->GetGeneratorTargets();
@@ -2873,7 +2870,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
   this->MainGroupChildren->AddObject(resourcesGroup);
 
   // now create the cmake groups
-  if (!this->CreateGroups(root, generators)) {
+  if (!this->CreateGroups(generators)) {
     return false;
   }
 
@@ -3041,10 +3038,8 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
   std::vector<cmXCodeObject*> targets;
   for (std::vector<cmLocalGenerator*>::iterator i = generators.begin();
        i != generators.end(); ++i) {
-    if (!this->IsExcluded(root, *i)) {
-      if (!this->CreateXCodeTargets(*i, targets)) {
-        return false;
-      }
+    if (!this->CreateXCodeTargets(*i, targets)) {
+      return false;
     }
   }
   // loop over all targets and add link and depend info
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index 0485d4f..303dfa0 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -92,8 +92,7 @@ private:
   cmXCodeObject* CreateOrGetPBXGroup(cmGeneratorTarget* gtgt,
                                      cmSourceGroup* sg);
   cmXCodeObject* CreatePBXGroup(cmXCodeObject* parent, std::string name);
-  bool CreateGroups(cmLocalGenerator* root,
-                    std::vector<cmLocalGenerator*>& generators);
+  bool CreateGroups(std::vector<cmLocalGenerator*>& generators);
   std::string XCodeEscapePath(const std::string& p);
   std::string RelativeToSource(const char* p);
   std::string RelativeToBinary(const char* p);
diff --git a/Tests/RunCMake/add_subdirectory/ExcludeFromAll.cmake b/Tests/RunCMake/add_subdirectory/ExcludeFromAll.cmake
new file mode 100644
index 0000000..f686005
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/ExcludeFromAll.cmake
@@ -0,0 +1,6 @@
+enable_language(CXX)
+
+add_subdirectory(ExcludeFromAll EXCLUDE_FROM_ALL)
+
+add_executable(main main.cpp)
+target_link_libraries(main PRIVATE foo)
diff --git a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt
new file mode 100644
index 0000000..b1df6b0
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt
@@ -0,0 +1,4 @@
+add_library(bar STATIC bar.cpp)
+
+add_library(foo STATIC foo.cpp)
+target_include_directories(foo PUBLIC .)
diff --git a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/bar.cpp b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/bar.cpp
new file mode 100644
index 0000000..7a828bd
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/bar.cpp
@@ -0,0 +1 @@
+#error This should be excluded from all target
diff --git a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/foo.cpp b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/foo.cpp
new file mode 100644
index 0000000..c9ad322
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/foo.cpp
@@ -0,0 +1,6 @@
+#include "foo.h"
+
+int foo()
+{
+  return 42;
+}
diff --git a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/foo.h b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/foo.h
new file mode 100644
index 0000000..5d5f8f0
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/foo.h
@@ -0,0 +1 @@
+int foo();
diff --git a/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake b/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake
index 9d514e1..88b9283 100644
--- a/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake
+++ b/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake
@@ -3,3 +3,15 @@ include(RunCMake)
 run_cmake(DoesNotExist)
 run_cmake(Missing)
 run_cmake(Function)
+
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/ExcludeFromAll-build)
+set(RunCMake_TEST_NO_CLEAN 1)
+
+file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+run_cmake(ExcludeFromAll)
+run_cmake_command(ExcludeFromAll-build ${CMAKE_COMMAND} --build .)
+
+unset(RunCMake_TEST_BINARY_DIR)
+unset(RunCMake_TEST_NO_CLEAN)
diff --git a/Tests/RunCMake/add_subdirectory/main.cpp b/Tests/RunCMake/add_subdirectory/main.cpp
new file mode 100644
index 0000000..1dc3906
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/main.cpp
@@ -0,0 +1,6 @@
+#include "foo.h"
+
+int main(int, char**)
+{
+  return foo();
+}

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list