Просмотр исходного кода

CMP0052: Make the warning message more informative.

Print the reason for the offending entry in the
INTERFACE_INCLUDE_DIRECTORIES.
Stephen Kelly 11 лет назад
Родитель
Сommit
3b673586f5

+ 4 - 1
Source/cmExportFileGenerator.cxx

@@ -301,7 +301,10 @@ static bool checkInterfaceDirs(const std::string &prepro,
             s << "Directory:\n    \"" << *li << "\"\nin "
               "INTERFACE_INCLUDE_DIRECTORIES of target \""
               << target->GetName() << "\" is a subdirectory of the install "
-              "directory:\n    \"" << installDir << "\"";
+              "directory:\n    \"" << installDir << "\"\nhowever it is also "
+              "a subdirectory of the " << (inBinary ? "build" : "source")
+              << " tree:\n    \"" << (inBinary ? topBinaryDir : topSourceDir)
+              << "\"" << std::endl;
             target->GetMakefile()->IssueMessage(cmake::AUTHOR_WARNING,
                                                 s.str());
             }

+ 5 - 0
Tests/RunCMake/include_directories/BinInInstallPrefix-CMP0052-WARN-stderr.txt

@@ -12,4 +12,9 @@ CMake Warning \(dev\) in CMakeLists.txt:
   of the install directory:
 
       ".*Tests/RunCMake/include_directories/prefix"
+
+  however it is also a subdirectory of the build tree:
+
+      ".*Tests/RunCMake/include_directories/prefix/BinInInstallPrefix-CMP0052-WARN-build"
+
 This warning is for project developers.  Use -Wno-dev to suppress it.

+ 5 - 0
Tests/RunCMake/include_directories/SrcInInstallPrefix-CMP0052-WARN-stderr.txt

@@ -12,4 +12,9 @@ CMake Warning \(dev\) in CMakeLists.txt:
   of the install directory:
 
       ".*Tests/RunCMake/include_directories/prefix"
+
+  however it is also a subdirectory of the source tree:
+
+      ".*Tests/RunCMake/include_directories/prefix/src"
+
 This warning is for project developers.  Use -Wno-dev to suppress it.