CMP0052: Make the warning message more informative.

Print the reason for the offending entry in the
INTERFACE_INCLUDE_DIRECTORIES.
This commit is contained in:
Stephen Kelly 2014-04-16 23:46:13 +02:00 committed by Brad King
parent 5baa81592b
commit 3b673586f5
3 changed files with 14 additions and 1 deletions

View File

@ -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());
}

View File

@ -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.

View File

@ -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.