diff options
-rw-r--r-- | Source/cmIncludeDirectoryCommand.cxx | 8 | ||||
-rw-r--r-- | Source/cmIncludeDirectoryCommand.h | 9 |
2 files changed, 13 insertions, 4 deletions
diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx index eb21288..eb07eb7 100644 --- a/Source/cmIncludeDirectoryCommand.cxx +++ b/Source/cmIncludeDirectoryCommand.cxx @@ -26,12 +26,18 @@ bool cmIncludeDirectoryCommand::InitialPass(std::vector<std::string> const& args std::vector<std::string>::const_iterator i = args.begin(); - bool before = false; + bool before = this->Makefile->IsOn("CMAKE_INCLUDE_DIRECTORIES_BEFORE"); + if ((*i) == "BEFORE") { before = true; ++i; } + else if ((*i) == "AFTER") + { + before = false; + ++i; + } for(; i != args.end(); ++i) { diff --git a/Source/cmIncludeDirectoryCommand.h b/Source/cmIncludeDirectoryCommand.h index 0249f9f..a22bc0e 100644 --- a/Source/cmIncludeDirectoryCommand.h +++ b/Source/cmIncludeDirectoryCommand.h @@ -61,10 +61,13 @@ public: virtual const char* GetFullDocumentation() { return - " INCLUDE_DIRECTORIES([BEFORE] dir1 dir2 ...)\n" + " INCLUDE_DIRECTORIES([AFTER|BEFORE] dir1 dir2 ...)\n" "Add the given directories to those searched by the compiler for " - "include files. If BEFORE is specified, the directories are prepended " - "onto the current list of directories instead of appended."; + "include files. By default the directories are appended onto " + "the current list of directories. This default behavior can be " + "changed by setting CMAKE_INCLUDE_DIRECTORIES_BEFORE to ON. " + "By using BEFORE or AFTER you can select between appending and " + "prepending, independent from the default. "; } cmTypeMacro(cmIncludeDirectoryCommand, cmCommand); |