summaryrefslogtreecommitdiffstats
path: root/Source/cmIncludeDirectoryCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-04-04 13:35:22 (GMT)
committerBrad King <brad.king@kitware.com>2006-04-04 13:35:22 (GMT)
commitcddedaa7d85c1a4ccc3502a6ec56f6e6cdea6f90 (patch)
tree36bc7768d9b66e5d59f956739bb59d0996584bac /Source/cmIncludeDirectoryCommand.cxx
parent66faeeeab4fb77800afdab5c9ea73ad71873fb71 (diff)
downloadCMake-cddedaa7d85c1a4ccc3502a6ec56f6e6cdea6f90.zip
CMake-cddedaa7d85c1a4ccc3502a6ec56f6e6cdea6f90.tar.gz
CMake-cddedaa7d85c1a4ccc3502a6ec56f6e6cdea6f90.tar.bz2
ENH: INCLUDE_DIRECTORIES should have been written to prepend to the include path so that the most local directories are included first. This is a patch from Alex to resolve the problem by allowing users to switch the default using a variable CMAKE_INCLUDE_DIRECTORIES_BEFORE and then still explicitly appending or prepending by using AFTER or BEFORE arguments explicitly.
Diffstat (limited to 'Source/cmIncludeDirectoryCommand.cxx')
-rw-r--r--Source/cmIncludeDirectoryCommand.cxx8
1 files changed, 7 insertions, 1 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)
{