summaryrefslogtreecommitdiffstats
path: root/Source/cmExtraEclipseCDT4Generator.cxx
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2011-11-01 09:41:23 (GMT)
committerAlex Neundorf <neundorf@kde.org>2011-11-01 20:13:35 (GMT)
commit4b930220be0c0b2391a33336a37525154f6b402d (patch)
tree3d2d126f489c35c4fc5bf2cb694efd0793f286f7 /Source/cmExtraEclipseCDT4Generator.cxx
parent07e88ae4499b632222367eb5b4308cac2a89718f (diff)
downloadCMake-4b930220be0c0b2391a33336a37525154f6b402d.zip
CMake-4b930220be0c0b2391a33336a37525154f6b402d.tar.gz
CMake-4b930220be0c0b2391a33336a37525154f6b402d.tar.bz2
Eclipse: warn if CMAKE_BINARY_DIR is subdir of CMAKE_SOURCE_DIR
Eclipse doesn't handle this case well. When doing out-of-source builds we create a linked resource which points to CMAKE_SOURCE_DIR, so the user can browse the source dir in Eclipse. This is not possible when the build dir is a subdir of the source dir. Alex
Diffstat (limited to 'Source/cmExtraEclipseCDT4Generator.cxx')
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 785e85a..0667da7 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -87,6 +87,16 @@ void cmExtraEclipseCDT4Generator::Generate()
this->GenerateSourceProject = (this->IsOutOfSourceBuild &&
mf->IsOn("ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT"));
+ if (cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(),
+ this->HomeDirectory.c_str()))
+ {
+ mf->IssueMessage(cmake::WARNING, "The build directory is a subdirectory "
+ "of the source directory.\n"
+ "This is not supported well by Eclipse. It is strongly "
+ "recommended to use a build directory which is a "
+ "sibling of the source directory.");
+ }
+
// NOTE: This is not good, since it pollutes the source tree. However,
// Eclipse doesn't allow CVS/SVN to work when the .project is not in
// the cvs/svn root directory. Hence, this is provided as an option.