diff options
author | Brad King <brad.king@kitware.com> | 2018-08-28 17:42:36 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-08-28 17:42:43 (GMT) |
commit | 6f7c96fb178a290934b5b91c919ddff143d8b542 (patch) | |
tree | 4f7b80f56fd419a829d6ccb282b833604efa83f7 /Source/cmTarget.cxx | |
parent | c549deed7fc6dec2c3f5f3ab5f9ded1acb916239 (diff) | |
parent | c8fd23ec6f33eef8cf11d81938c379590080bd19 (diff) | |
download | CMake-6f7c96fb178a290934b5b91c919ddff143d8b542.zip CMake-6f7c96fb178a290934b5b91c919ddff143d8b542.tar.gz CMake-6f7c96fb178a290934b5b91c919ddff143d8b542.tar.bz2 |
Merge topic 'mk-directory'
c8fd23ec6f cmMakefile: return directories as const std::string&
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2311
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index cc5a176..cfcb31a 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1127,10 +1127,11 @@ void cmTarget::AppendBuildInterfaceIncludes() this->BuildInterfaceIncludesAppended = true; if (this->Makefile->IsOn("CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE")) { - const char* binDir = this->Makefile->GetCurrentBinaryDirectory(); - const char* srcDir = this->Makefile->GetCurrentSourceDirectory(); - const std::string dirs = std::string(binDir ? binDir : "") + - std::string(binDir ? ";" : "") + std::string(srcDir ? srcDir : ""); + std::string dirs = this->Makefile->GetCurrentBinaryDirectory(); + if (!dirs.empty()) { + dirs += ';'; + } + dirs += this->Makefile->GetCurrentSourceDirectory(); if (!dirs.empty()) { this->AppendProperty("INTERFACE_INCLUDE_DIRECTORIES", ("$<BUILD_INTERFACE:" + dirs + ">").c_str()); |