diff options
Diffstat (limited to 'Source/cmSourceFile.cxx')
-rw-r--r-- | Source/cmSourceFile.cxx | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 3704d6a..ed1da7b 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -16,6 +16,7 @@ #include "cmMakefile.h" #include "cmSystemTools.h" #include "cmake.h" +#include "cmDocumentCompileDefinitions.h" //---------------------------------------------------------------------------- cmSourceFile::cmSourceFile(cmMakefile* mf, const char* name): @@ -101,11 +102,11 @@ cmSourceFileLocation const& cmSourceFile::GetLocation() const } //---------------------------------------------------------------------------- -std::string const& cmSourceFile::GetFullPath() +std::string const& cmSourceFile::GetFullPath(std::string* error) { if(this->FullPath.empty()) { - if(this->FindFullPath()) + if(this->FindFullPath(error)) { this->CheckExtension(); } @@ -120,7 +121,7 @@ std::string const& cmSourceFile::GetFullPath() const } //---------------------------------------------------------------------------- -bool cmSourceFile::FindFullPath() +bool cmSourceFile::FindFullPath(std::string* error) { // If thie method has already failed once do not try again. if(this->FindFullPathFailed) @@ -187,8 +188,13 @@ bool cmSourceFile::FindFullPath() } cmOStringStream e; - e << "Cannot find source file \"" << this->Location.GetName() << "\""; - e << ". Tried extensions"; + std::string missing = this->Location.GetDirectory(); + if(!missing.empty()) + { + missing += "/"; + } + missing += this->Location.GetName(); + e << "Cannot find source file:\n " << missing << "\nTried extensions"; for(std::vector<std::string>::const_iterator ext = srcExts.begin(); ext != srcExts.end(); ++ext) { @@ -199,7 +205,14 @@ bool cmSourceFile::FindFullPath() { e << " ." << *ext; } - this->Location.GetMakefile()->IssueMessage(cmake::FATAL_ERROR, e.str()); + if(error) + { + *error = e.str(); + } + else + { + this->Location.GetMakefile()->IssueMessage(cmake::FATAL_ERROR, e.str()); + } this->FindFullPathFailed = true; return false; } @@ -404,15 +417,7 @@ void cmSourceFile::DefineProperties(cmake *cm) "The VS6 IDE does not support definition values with spaces " "(but NMake does). Xcode does not support per-configuration " "definitions on source files.\n" - "Dislaimer: Most native build tools have poor support for escaping " - "certain values. CMake has work-arounds for many cases but some " - "values may just not be possible to pass correctly. If a value " - "does not seem to be escaped correctly, do not attempt to " - "work-around the problem by adding escape sequences to the value. " - "Your work-around may break in a future version of CMake that " - "has improved escape support. Instead consider defining the macro " - "in a (configured) header file. Then report the limitation."); - + CM_DOCUMENT_COMPILE_DEFINITIONS_DISCLAIMER); cm->DefineProperty ("COMPILE_DEFINITIONS_<CONFIG>", cmProperty::SOURCE_FILE, @@ -433,7 +438,7 @@ void cmSourceFile::DefineProperties(cmake *cm) ("GENERATED", cmProperty::SOURCE_FILE, "Is this source file generated as part of the build process.", "If a source file is generated by the build process CMake will " - "handle it differently in temrs of dependency checking etc. " + "handle it differently in terms of dependency checking etc. " "Otherwise having a non-existent source file could create problems."); cm->DefineProperty @@ -465,7 +470,9 @@ void cmSourceFile::DefineProperties(cmake *cm) "What programming language is the file.", "A property that can be set to indicate what programming language " "the source file is. If it is not set the language is determined " - "based on the file extension. Typical values are CXX C etc."); + "based on the file extension. Typical values are CXX C etc. Setting " + "this property for a file means this file will be compiled. " + "Do not set this for header or files that should not be compiled."); cm->DefineProperty ("LOCATION", cmProperty::SOURCE_FILE, @@ -487,7 +494,7 @@ void cmSourceFile::DefineProperties(cmake *cm) "For frameworks the content folder is " "\"<name>.framework/Versions/<version>\". " "See the PUBLIC_HEADER, PRIVATE_HEADER, and RESOURCE target " - "properties for specifying files meant for Headers, PrivateHeadres, " + "properties for specifying files meant for Headers, PrivateHeaders, " "or Resources directories."); cm->DefineProperty |