[Cmake-commits] CMake branch, next, updated. v2.8.10.2-2647-gc34b9f0

Stephen Kelly steveire at gmail.com
Mon Mar 25 15:25:15 EDT 2013


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  c34b9f01eee582d32ee12d75d81d3a477c5bffac (commit)
       via  13278bca1146370ae4c4538457fa6a130595e523 (commit)
      from  d9546441018650c76e6bfdd19e704dac7057ad6c (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=c34b9f01eee582d32ee12d75d81d3a477c5bffac
commit c34b9f01eee582d32ee12d75d81d3a477c5bffac
Merge: d954644 13278bc
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Mar 25 15:25:12 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Mar 25 15:25:12 2013 -0400

    Merge topic 'error-on-exported-missing-include-dir' into next
    
    13278bc Make targets report an error on faulty INTERFACE on IMPORTED targets.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=13278bca1146370ae4c4538457fa6a130595e523
commit 13278bca1146370ae4c4538457fa6a130595e523
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Mar 24 21:18:21 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Mar 25 20:23:42 2013 +0100

    Make targets report an error on faulty INTERFACE on IMPORTED targets.
    
    It is considered an error if the INTERFACE_INCLUDE_DIRECTORIES contains
    a directory which does not exist, which indicates a programmer error
    by the upstream, or a packaging error.
    
    One of the RunCMake.CompatibleInterface tests also needs to be updated
    due to this change. Non-existant includes were used in the test, but
    are not needed.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 61d4ce2..b4fdcd5 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -131,11 +131,13 @@ public:
   SourceEntriesType SourceEntries;
 
   struct IncludeDirectoriesEntry {
-    IncludeDirectoriesEntry(cmsys::auto_ptr<cmCompiledGeneratorExpression> cge)
-      : ge(cge)
+    IncludeDirectoriesEntry(cmsys::auto_ptr<cmCompiledGeneratorExpression> cge,
+      const std::string &targetName = std::string())
+      : ge(cge), TargetName(targetName)
     {}
     const cmsys::auto_ptr<cmCompiledGeneratorExpression> ge;
     std::vector<std::string> CachedIncludes;
+    const std::string TargetName;
   };
   std::vector<IncludeDirectoriesEntry*> IncludeDirectoriesEntries;
   std::vector<cmValueWithOrigin> LinkInterfaceIncludeDirectoriesEntries;
@@ -2818,6 +2820,28 @@ static void processIncludeDirectories(cmTarget *tgt,
     for(std::vector<std::string>::iterator
           li = entryIncludes.begin(); li != entryIncludes.end(); ++li)
       {
+      cmTarget *dependentTarget =
+                              mf->FindTargetToUse((*it)->TargetName.c_str());
+
+      const bool fromImported = dependentTarget
+                             && dependentTarget->IsImported();
+
+      if (fromImported && !cmSystemTools::FileExists(li->c_str()))
+        {
+        cmOStringStream e;
+        e << "Imported target \"" << (*it)->TargetName << "\" includes "
+             "non-existent path\n  \"" << *li << "\"\nin its "
+             "INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:\n"
+             "* The path was deleted, renamed, or moved to another "
+             "location.\n"
+             "* An install or uninstall procedure did not complete "
+             "successfully.\n"
+             "* The installation package was faulty and references files it "
+             "does not provide.\n";
+        tgt->GetMakefile()->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
+        return;
+        }
+
       if (testIsOff && !cmSystemTools::IsOff(li->c_str()))
         {
         cmSystemTools::ConvertToUnixSlashes(*li);
@@ -2913,7 +2937,8 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
                               it->Value + ",INTERFACE_INCLUDE_DIRECTORIES>");
 
       this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries.push_back(
-                        new cmTargetInternals::IncludeDirectoriesEntry(cge));
+                        new cmTargetInternals::IncludeDirectoriesEntry(cge,
+                                                              it->Value));
       }
     }
 
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-builtin-prop.cmake b/Tests/RunCMake/CompatibleInterface/InterfaceString-builtin-prop.cmake
index 5221a12..5772856 100644
--- a/Tests/RunCMake/CompatibleInterface/InterfaceString-builtin-prop.cmake
+++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-builtin-prop.cmake
@@ -3,8 +3,6 @@ add_library(foo UNKNOWN IMPORTED)
 add_library(bar UNKNOWN IMPORTED)
 
 set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_STRING INCLUDE_DIRECTORIES)
-set_property(TARGET foo PROPERTY INTERFACE_INCLUDE_DIRECTORIES foo_inc)
-set_property(TARGET bar PROPERTY INTERFACE_INCLUDE_DIRECTORIES bar_inc)
 
 add_executable(user main.cpp)
 set_property(TARGET user PROPERTY INCLUDE_DIRECTORIES bar_inc)
diff --git a/Tests/RunCMake/include_directories/ImportedTarget-result.txt b/Tests/RunCMake/include_directories/ImportedTarget-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/include_directories/ImportedTarget-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/include_directories/ImportedTarget-stderr.txt b/Tests/RunCMake/include_directories/ImportedTarget-stderr.txt
new file mode 100644
index 0000000..da26052
--- /dev/null
+++ b/Tests/RunCMake/include_directories/ImportedTarget-stderr.txt
@@ -0,0 +1,13 @@
+CMake Error in CMakeLists.txt:
+  Imported target "imported" includes non-existent path
+
+    "/does/not/exist"
+
+  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:
+
+  \* The path was deleted, renamed, or moved to another location.
+
+  \* An install or uninstall procedure did not complete successfully.
+
+  \* The installation package was faulty and references files it does not
+  provide.
diff --git a/Tests/RunCMake/include_directories/ImportedTarget.cmake b/Tests/RunCMake/include_directories/ImportedTarget.cmake
new file mode 100644
index 0000000..e1a20b1
--- /dev/null
+++ b/Tests/RunCMake/include_directories/ImportedTarget.cmake
@@ -0,0 +1,9 @@
+
+project(ImportedTarget)
+
+add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp")
+
+add_library(imported UNKNOWN IMPORTED)
+set_property(TARGET imported PROPERTY INTERFACE_INCLUDE_DIRECTORIES "/does/not/exist")
+
+target_link_libraries(testTarget imported)
diff --git a/Tests/RunCMake/include_directories/RunCMakeTest.cmake b/Tests/RunCMake/include_directories/RunCMakeTest.cmake
index bd299fc..1caae5c 100644
--- a/Tests/RunCMake/include_directories/RunCMakeTest.cmake
+++ b/Tests/RunCMake/include_directories/RunCMakeTest.cmake
@@ -6,3 +6,4 @@ run_cmake(TID-bad-target)
 run_cmake(SourceDirectoryInInterface)
 run_cmake(BinaryDirectoryInInterface)
 run_cmake(RelativePathInInterface)
+run_cmake(ImportedTarget)

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list