diff options
author | Brad King <brad.king@kitware.com> | 2005-02-07 21:11:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2005-02-07 21:11:01 (GMT) |
commit | 337ad802c64d10904700457939a8b5e0a48439be (patch) | |
tree | 5bee5711c158e1ae87afdacb0061d880d8a6ff43 /Source/cmLocalUnixMakefileGenerator2.cxx | |
parent | c44e6d30e5127457060f8e027fbff17ac89e98a5 (diff) | |
download | CMake-337ad802c64d10904700457939a8b5e0a48439be.zip CMake-337ad802c64d10904700457939a8b5e0a48439be.tar.gz CMake-337ad802c64d10904700457939a8b5e0a48439be.tar.bz2 |
ENH: Implemented support for include/complain regular expressions for dependency scanning. This now includes the possibility that scanning will return failure and the build will stop.
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator2.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator2.cxx | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator2.cxx b/Source/cmLocalUnixMakefileGenerator2.cxx index cd229e9..13a2f38 100644 --- a/Source/cmLocalUnixMakefileGenerator2.cxx +++ b/Source/cmLocalUnixMakefileGenerator2.cxx @@ -234,6 +234,7 @@ void cmLocalUnixMakefileGenerator2::GenerateCMakefile() << "SET(CMAKE_MAKEFILE_OUTPUTS\n" << " \"" << this->ConvertToRelativePath(makefileName.c_str()).c_str() << "\"\n" << " \"" << this->ConvertToRelativePath(check.c_str()).c_str() << "\"\n" + << " \"CMakeDirectoryInformation.cmake\"\n" << " )\n\n"; // Set the set of files to check for dependency integrity. @@ -525,8 +526,7 @@ cmLocalUnixMakefileGenerator2 // touch the corresponding depends file after scanning dependencies. cmOStringStream depCmd; // TODO: Account for source file properties and directory-level - // definitions when scanning for dependencies. Also account for - // include/ignore regular expressions. + // definitions when scanning for dependencies. depCmd << "$(CMAKE_COMMAND) -E cmake_depends " << lang << " " << this->ConvertToRelativeOutputPath(obj.c_str()) << " " << this->ConvertToRelativeOutputPath(source.GetFullPath().c_str()); @@ -2854,20 +2854,41 @@ cmLocalUnixMakefileGenerator2 } } + // Get the include file regular expression. + std::string includeRegexScan = "^.*$"; + std::string includeRegexComplain = "^$"; + if(haveDirectoryInfo) + { + std::string scanRegexVar = "CMAKE_"; + scanRegexVar += lang; + scanRegexVar += "_INCLUDE_REGEX_SCAN"; + if(const char* scanRegex = mf->GetDefinition(scanRegexVar.c_str())) + { + includeRegexScan = scanRegex; + } + std::string complainRegexVar = "CMAKE_"; + complainRegexVar += lang; + complainRegexVar += "_INCLUDE_REGEX_COMPLAIN"; + if(const char* complainRegex = mf->GetDefinition(complainRegexVar.c_str())) + { + includeRegexComplain = complainRegex; + } + } + // Dispatch the scan for each language. if(lang == "C" || lang == "CXX" || lang == "RC") { // TODO: Handle RC (resource files) dependencies correctly. - cmDependsC scanner(".", objFile, srcFile, includes); - scanner.Write(); - return true; + cmDependsC scanner(".", objFile, srcFile, includes, + includeRegexScan.c_str(), includeRegexComplain.c_str()); + return scanner.Write(); + true; } #ifdef CMAKE_BUILD_WITH_CMAKE else if(lang == "Fortran") { cmDependsFortran scanner(".", objFile, srcFile, includes); - scanner.Write(); - return true; + return scanner.Write(); } #endif return false; |