diff options
author | Brad King <brad.king@kitware.com> | 2001-12-10 16:03:44 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2001-12-10 16:03:44 (GMT) |
commit | ee31c3e0a433c8ed31eac4d8ae898c67c7a51b17 (patch) | |
tree | 38243b41866b811c6ec18c7f444d097881da60df /Source/cmMakefile.cxx | |
parent | a946931f91bfffe8ce06a9924beb424cb0233907 (diff) | |
download | CMake-ee31c3e0a433c8ed31eac4d8ae898c67c7a51b17.zip CMake-ee31c3e0a433c8ed31eac4d8ae898c67c7a51b17.tar.gz CMake-ee31c3e0a433c8ed31eac4d8ae898c67c7a51b17.tar.bz2 |
ENH: SUBDIR_DEPENDS command now does nothing. The parallel build functionality is now automatic. Dependencies are setup to force the same build order as a single threaded build, but multiple files in the same directory can be built simultaneously. Also fixed bug with inheriting CMakeLists.txt files when a directory level is skipped.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 696b89b..81b4b33 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -560,12 +560,6 @@ void cmMakefile::AddSubDirectory(const char* sub) m_SubDirectories.push_back(sub); } -void cmMakefile::AddSubdirDependency(const char* subdir, - const char* dependency) -{ - m_SubdirDepends[subdir].insert(dependency); -} - void cmMakefile::AddIncludeDirectory(const char* inc, bool before) { // Don't add an include directory that is already present. Yes, @@ -812,12 +806,26 @@ std::string cmMakefile::GetParentListFileName(const char *currentFileName) // is there a CMakeLists.txt file in the parent directory ? parentFile = listsDir; parentFile += "/CMakeLists.txt"; - if(!cmSystemTools::FileExists(parentFile.c_str())) + while(!cmSystemTools::FileExists(parentFile.c_str())) { - parentFile = ""; - return parentFile; + // There is no CMakeLists.txt file in the parent directory. This + // can occur when coming out of a subdirectory resulting from a + // SUBDIRS(Foo/Bar) command (coming out of Bar into Foo). Try + // walking up until a CMakeLists.txt is found or the home + // directory is hit. + + // if we are in the home directory then stop, return 0 + if(m_cmHomeDirectory == listsDir) { return ""; } + + // is there a parent directory we can check + pos = listsDir.rfind('/'); + // if we could not find the directory return 0 + if(pos == std::string::npos) { return ""; } + listsDir = listsDir.substr(0, pos); + parentFile = listsDir; + parentFile += "/CMakeLists.txt"; } - + return parentFile; } |