diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-01-12 11:11:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-01-15 19:36:22 (GMT) |
commit | 4ee872cb99f49ac5a95768da454f3313ba87182f (patch) | |
tree | caa573a00cb61a298e5c8345be5c9a962753291e /Source/cmTarget.cxx | |
parent | 1d47cd94f3748d287f676f3847d42f3674062dcd (diff) | |
download | CMake-4ee872cb99f49ac5a95768da454f3313ba87182f.zip CMake-4ee872cb99f49ac5a95768da454f3313ba87182f.tar.gz CMake-4ee872cb99f49ac5a95768da454f3313ba87182f.tar.bz2 |
Make the BUILD_INTERFACE of export()ed targets work.
The existing BUILD_INTERFACE code is executed at generate time, which
is too late for export().
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 9b50b8e..cf01f9f 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -150,6 +150,7 @@ cmTarget::cmTarget() this->DLLPlatform = false; this->IsApple = false; this->IsImportedTarget = false; + this->BuildInterfaceIncludesAppended = false; } //---------------------------------------------------------------------------- @@ -2655,6 +2656,30 @@ void cmTarget::AppendProperty(const char* prop, const char* value, } //---------------------------------------------------------------------------- +void cmTarget::AppendBuildInterfaceIncludes() +{ + if (this->BuildInterfaceIncludesAppended) + { + return; + } + this->BuildInterfaceIncludesAppended = true; + + if (this->Makefile->IsOn("CMAKE_BUILD_INTERFACE_INCLUDES")) + { + const char *binDir = this->Makefile->GetStartOutputDirectory(); + const char *srcDir = this->Makefile->GetStartDirectory(); + const std::string dirs = std::string(binDir ? binDir : "") + + std::string(binDir ? ";" : "") + + std::string(srcDir ? srcDir : ""); + if (!dirs.empty()) + { + this->AppendProperty("INTERFACE_INCLUDE_DIRECTORIES", + ("$<BUILD_INTERFACE:" + dirs + ">").c_str()); + } + } +} + +//---------------------------------------------------------------------------- void cmTarget::InsertInclude(const cmMakefileIncludeDirectoriesEntry &entry, bool before) { |