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  ae4b7dbfab672dcf7be8c4439b340637789873a3 (commit)
       via  900dd0f8eb0a1ff8b7f774468ad3b77ecc595892 (commit)
       via  c96688bad9acb6d026a7da18e69772d25750172a (commit)
       via  2047575b9fd78a3b12641dd52eff72d9438c5a16 (commit)
      from  28838aa8afc49a17ccfecd6d6c9ba1704ce47ac4 (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=ae4b7dbfab672dcf7be8c4439b340637789873a3
commit ae4b7dbfab672dcf7be8c4439b340637789873a3
Merge: 28838aa 900dd0f
Author:     Stephen Kelly <steve...@gmail.com>
AuthorDate: Sat Jan 12 06:38:07 2013 -0500
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Sat Jan 12 06:38:07 2013 -0500

    Merge topic 'test-export-iface-genex' into next
    
    900dd0f Test evaluation target via export for generator expressions
    c96688b Export the INTERFACE_PIC property.
    2047575 Make the BUILD_INTERFACE of export()ed targets work.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=900dd0f8eb0a1ff8b7f774468ad3b77ecc595892
commit 900dd0f8eb0a1ff8b7f774468ad3b77ecc595892
Author:     Stephen Kelly <steve...@gmail.com>
AuthorDate: Sat Jan 12 12:13:44 2013 +0100
Commit:     Stephen Kelly <steve...@gmail.com>
CommitDate: Sat Jan 12 12:36:20 2013 +0100

    Test evaluation target via export for generator expressions

diff --git a/Tests/ExportImport/Export/CMakeLists.txt 
b/Tests/ExportImport/Export/CMakeLists.txt
index fd7a1a6..dd615d1 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -186,7 +186,7 @@ set_property(TARGET testSharedLibDepends APPEND PROPERTY
 )
 set_property(TARGET testSharedLibDepends APPEND PROPERTY
   LINK_INTERFACE_LIBRARIES
-    $<1:$<TARGET_NAME:testSharedLibRequired>>
+    
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:$<TARGET_NAME:testSharedLibRequired>>
 )
 
 # LINK_PRIVATE because the LINK_INTERFACE_LIBRARIES is specified above.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c96688bad9acb6d026a7da18e69772d25750172a
commit c96688bad9acb6d026a7da18e69772d25750172a
Author:     Stephen Kelly <steve...@gmail.com>
AuthorDate: Sat Jan 12 12:13:19 2013 +0100
Commit:     Stephen Kelly <steve...@gmail.com>
CommitDate: Sat Jan 12 12:36:20 2013 +0100

    Export the INTERFACE_PIC property.

diff --git a/Source/cmExportBuildFileGenerator.cxx 
b/Source/cmExportBuildFileGenerator.cxx
index cfd2c0b..cacdca6 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -72,6 +72,8 @@ bool 
cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
     this->PopulateInterfaceProperty("INTERFACE_COMPILE_DEFINITIONS", te,
                                     cmGeneratorExpression::BuildInterface,
                                     properties, missingTargets);
+    this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
+                                  te, properties);
 
     this->GenerateInterfaceProperties(te, os, properties);
     }
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 94e24c7..6b2934a 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -126,6 +126,18 @@ void 
cmExportFileGenerator::GenerateImportConfig(std::ostream& os,
 
 //----------------------------------------------------------------------------
 void cmExportFileGenerator::PopulateInterfaceProperty(const char *propName,
+                                              cmTarget *target,
+                                              ImportPropertyMap &properties)
+{
+  const char *input = target->GetProperty(propName);
+  if (input)
+    {
+    properties[propName] = input;
+    }
+}
+
+//----------------------------------------------------------------------------
+void cmExportFileGenerator::PopulateInterfaceProperty(const char *propName,
                       const char *outputName,
                       cmTarget *target,
                       cmGeneratorExpression::PreprocessContext preprocessRule,
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index 4d97a63..476462d 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -99,6 +99,8 @@ protected:
                                  cmGeneratorExpression::PreprocessContext,
                                  ImportPropertyMap &properties,
                                  std::vector<std::string> &missingTargets);
+  void PopulateInterfaceProperty(const char *propName, cmTarget *target,
+                                 ImportPropertyMap &properties);
   void GenerateInterfaceProperties(cmTarget *target, std::ostream& os,
                                    const ImportPropertyMap &properties);
 
diff --git a/Source/cmExportInstallFileGenerator.cxx 
b/Source/cmExportInstallFileGenerator.cxx
index 68881a1..2992d79 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -89,6 +89,8 @@ bool 
cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
                                   te,
                                   cmGeneratorExpression::InstallInterface,
                                   properties, missingTargets);
+    this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
+                                  te, properties);
 
     this->GenerateInterfaceProperties(te, os, properties);
     }
diff --git a/Tests/ExportImport/Export/CMakeLists.txt 
b/Tests/ExportImport/Export/CMakeLists.txt
index e92dcd8..fd7a1a6 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -162,6 +162,10 @@ include(GenerateExportHeader)
 
 add_library(testSharedLibRequired SHARED testSharedLibRequired.cpp)
 generate_export_header(testSharedLibRequired)
+set_property(TARGET testSharedLibRequired
+  PROPERTY
+    INTERFACE_POSITION_INDEPENDENT_CODE ON
+)
 set_property(TARGET testSharedLibRequired APPEND PROPERTY
   INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}"
 )
diff --git a/Tests/ExportImport/Import/A/deps_shared_iface.cpp 
b/Tests/ExportImport/Import/A/deps_shared_iface.cpp
index 14aac0a..d3521b7 100644
--- a/Tests/ExportImport/Import/A/deps_shared_iface.cpp
+++ b/Tests/ExportImport/Import/A/deps_shared_iface.cpp
@@ -2,6 +2,10 @@
 
 #include "testSharedLibDepends.h"
 
+#if defined(__ELF__) && !defined(__PIC__) && !defined(__PIE__)
+#error Expected by INTERFACE_POSITION_INDEPENDENT_CODE property of dependency
+#endif
+
 #ifdef TEST_SUBDIR_LIB
 #include "subdir.h"
 #endif

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2047575b9fd78a3b12641dd52eff72d9438c5a16
commit 2047575b9fd78a3b12641dd52eff72d9438c5a16
Author:     Stephen Kelly <steve...@gmail.com>
AuthorDate: Sat Jan 12 12:11:29 2013 +0100
Commit:     Stephen Kelly <steve...@gmail.com>
CommitDate: Sat Jan 12 12:36:13 2013 +0100

    Make the BUILD_INTERFACE of export()ed targets work.
    
    The existing BUILD_INTERFACE code is executed at generate time, which
    is too late for export().

diff --git a/Source/cmExportBuildFileGenerator.cxx 
b/Source/cmExportBuildFileGenerator.cxx
index 29f6743..cfd2c0b 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -62,6 +62,8 @@ bool 
cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
     cmTarget* te = *tei;
     this->GenerateImportTargetCode(os, te);
 
+    te->AppendBuildInterfaceIncludes();
+
     ImportPropertyMap properties;
 
     this->PopulateInterfaceProperty("INTERFACE_INCLUDE_DIRECTORIES", te,
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index d030aa7..d2baf53 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -941,19 +941,7 @@ void cmGlobalGenerator::Generate()
 
     for ( tit = targets->begin(); tit != targets->end(); ++ tit )
       {
-      if (mf->IsOn("CMAKE_BUILD_INTERFACE_INCLUDES"))
-        {
-        const char *binDir = mf->GetStartOutputDirectory();
-        const char *srcDir = mf->GetStartDirectory();
-        const std::string dirs = std::string(binDir ? binDir : "")
-                                + std::string(binDir ? ";" : "")
-                                + std::string(srcDir ? srcDir : "");
-        if (!dirs.empty())
-          {
-          tit->second.AppendProperty("INTERFACE_INCLUDE_DIRECTORIES",
-                                ("$<BUILD_INTERFACE:" + dirs + ">").c_str());
-          }
-        }
+        tit->second.AppendBuildInterfaceIncludes();
       }
     }
 
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 9b50b8e..cf01f9f 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -150,6 +150,7 @@ cmTarget::cmTarget()
   this->DLLPlatform = false;
   this->IsApple = false;
   this->IsImportedTarget = false;
+  this->BuildInterfaceIncludesAppended = false;
 }
 
 //----------------------------------------------------------------------------
@@ -2655,6 +2656,30 @@ void cmTarget::AppendProperty(const char* prop, const 
char* value,
 }
 
 //----------------------------------------------------------------------------
+void cmTarget::AppendBuildInterfaceIncludes()
+{
+  if (this->BuildInterfaceIncludesAppended)
+    {
+    return;
+    }
+  this->BuildInterfaceIncludesAppended = true;
+
+  if (this->Makefile->IsOn("CMAKE_BUILD_INTERFACE_INCLUDES"))
+    {
+    const char *binDir = this->Makefile->GetStartOutputDirectory();
+    const char *srcDir = this->Makefile->GetStartDirectory();
+    const std::string dirs = std::string(binDir ? binDir : "")
+                            + std::string(binDir ? ";" : "")
+                            + std::string(srcDir ? srcDir : "");
+    if (!dirs.empty())
+      {
+      this->AppendProperty("INTERFACE_INCLUDE_DIRECTORIES",
+                            ("$<BUILD_INTERFACE:" + dirs + ">").c_str());
+      }
+    }
+}
+
+//----------------------------------------------------------------------------
 void cmTarget::InsertInclude(const cmMakefileIncludeDirectoriesEntry &entry,
                      bool before)
 {
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index b4d053d..48dde0a 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -490,6 +490,8 @@ public:
   void InsertInclude(const cmMakefileIncludeDirectoriesEntry &entry,
                      bool before = false);
 
+  void AppendBuildInterfaceIncludes();
+
   void GetLinkDependentTargetsForProperty(const std::string &p,
                                        std::set<std::string> &targets);
   bool IsNullImpliedByLinkLibraries(const std::string &p);
@@ -611,6 +613,7 @@ private:
   mutable std::map<cmStdString, std::set<std::string> >
                                                       LinkDependentProperties;
   mutable std::set<std::string> LinkImplicitNullProperties;
+  bool BuildInterfaceIncludesAppended;
 
   // Cache target output paths for each configuration.
   struct OutputInfo;
diff --git a/Tests/ExportImport/Export/CMakeLists.txt 
b/Tests/ExportImport/Export/CMakeLists.txt
index 4f6ccd6..e92dcd8 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -247,9 +247,11 @@ if(WIN32)
   install(TARGETS testLib5 RUNTIME DESTINATION bin)
 endif()
 
+add_subdirectory(sublib) # For CMAKE_BUILD_INTERFACE_INCLUDES test.
+
 # Export from build tree.
 export(TARGETS testExe1 testLib1 testLib2 testLib3
-  testExe2libImp testLib3Imp testLib3ImpDep
+  testExe2libImp testLib3Imp testLib3ImpDep subdirlib
   testSharedLibRequired testSharedLibDepends
   NAMESPACE bld_
   FILE ExportBuildTree.cmake
diff --git a/Tests/ExportImport/Export/sublib/CMakeLists.txt 
b/Tests/ExportImport/Export/sublib/CMakeLists.txt
new file mode 100644
index 0000000..2d11040
--- /dev/null
+++ b/Tests/ExportImport/Export/sublib/CMakeLists.txt
@@ -0,0 +1,6 @@
+
+set(CMAKE_BUILD_INTERFACE_INCLUDES ON)
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+add_library(subdirlib SHARED subdir.cpp)
+generate_export_header(subdirlib)
diff --git a/Tests/ExportImport/Export/sublib/subdir.cpp 
b/Tests/ExportImport/Export/sublib/subdir.cpp
new file mode 100644
index 0000000..35b0743
--- /dev/null
+++ b/Tests/ExportImport/Export/sublib/subdir.cpp
@@ -0,0 +1,7 @@
+
+#include "subdir.h"
+
+int SubDirObject::foo()
+{
+  return 0;
+}
diff --git a/Tests/ExportImport/Export/sublib/subdir.h 
b/Tests/ExportImport/Export/sublib/subdir.h
new file mode 100644
index 0000000..3a4b73d
--- /dev/null
+++ b/Tests/ExportImport/Export/sublib/subdir.h
@@ -0,0 +1,12 @@
+
+#ifndef SUBDIR_H
+#define SUBDIR_H
+
+#include "subdirlib_export.h"
+
+struct SUBDIRLIB_EXPORT SubDirObject
+{
+  int foo();
+};
+
+#endif
diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt 
b/Tests/ExportImport/Import/A/CMakeLists.txt
index 6a2e54c..72d11b6 100644
--- a/Tests/ExportImport/Import/A/CMakeLists.txt
+++ b/Tests/ExportImport/Import/A/CMakeLists.txt
@@ -172,6 +172,8 @@ target_compile_definitions(deps_shared_iface PRIVATE 
testSharedLibDepends)
 # evaluated correctly. The above already tests the same for the install tree.
 
 add_executable(deps_shared_iface2 deps_shared_iface.cpp)
-target_link_libraries(deps_shared_iface2 bld_testSharedLibDepends)
-target_include_directories(deps_shared_iface2 PRIVATE bld_testSharedLibDepends)
-target_compile_definitions(deps_shared_iface2 PRIVATE bld_testSharedLibDepends)
+target_link_libraries(deps_shared_iface2 bld_testSharedLibDepends 
bld_subdirlib)
+target_include_directories(deps_shared_iface2 PRIVATE bld_testSharedLibDepends 
bld_subdirlib)
+target_compile_definitions(deps_shared_iface2
+  PRIVATE bld_testSharedLibDepends TEST_SUBDIR_LIB
+)
diff --git a/Tests/ExportImport/Import/A/deps_shared_iface.cpp 
b/Tests/ExportImport/Import/A/deps_shared_iface.cpp
index 4f7eb23..14aac0a 100644
--- a/Tests/ExportImport/Import/A/deps_shared_iface.cpp
+++ b/Tests/ExportImport/Import/A/deps_shared_iface.cpp
@@ -2,10 +2,22 @@
 
 #include "testSharedLibDepends.h"
 
+#ifdef TEST_SUBDIR_LIB
+#include "subdir.h"
+#endif
+
 int main(int,char **)
 {
   TestSharedLibDepends dep;
   TestSharedLibRequired req;
 
-  return dep.foo() + req.foo();
+#ifdef TEST_SUBDIR_LIB
+  SubDirObject sdo;
+#endif
+
+  return dep.foo() + req.foo()
+#ifdef TEST_SUBDIR_LIB
+                   + sdo.foo()
+#endif
+                              ;
 }

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

Summary of changes:
 Source/cmExportBuildFileGenerator.cxx              |    4 +++
 Source/cmExportFileGenerator.cxx                   |   12 +++++++++
 Source/cmExportFileGenerator.h                     |    2 +
 Source/cmExportInstallFileGenerator.cxx            |    2 +
 Source/cmGlobalGenerator.cxx                       |   14 +----------
 Source/cmTarget.cxx                                |   25 ++++++++++++++++++++
 Source/cmTarget.h                                  |    3 ++
 Tests/ExportImport/Export/CMakeLists.txt           |   10 ++++++-
 .../Export/sublib}/CMakeLists.txt                  |    3 +-
 Tests/ExportImport/Export/sublib/subdir.cpp        |    7 +++++
 Tests/ExportImport/Export/sublib/subdir.h          |   12 +++++++++
 Tests/ExportImport/Import/A/CMakeLists.txt         |    8 ++++--
 Tests/ExportImport/Import/A/deps_shared_iface.cpp  |   18 +++++++++++++-
 13 files changed, 100 insertions(+), 20 deletions(-)
 copy Tests/{CMakeCommands/target_link_libraries/subdir => 
ExportImport/Export/sublib}/CMakeLists.txt (50%)
 create mode 100644 Tests/ExportImport/Export/sublib/subdir.cpp
 create mode 100644 Tests/ExportImport/Export/sublib/subdir.h


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits

Reply via email to