CMake: Improve handling of CMAKE_RUNTIME_OUTPUT_DIRECTORY

Set the working directory of binaries which got moved from the
build directory using CMAKE_RUNTIME_OUTPUT_DIRECTORY to the directory
the binay is actualy in.

Task-number: QTCREATORBUG-18158
Change-Id: I059d55a6c408799f3220bd90c271a6d743e6cd82
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Tobias Hunger
2017-05-05 14:02:05 +02:00
parent e788333510
commit 4e6fd0a2c0

View File

@@ -204,7 +204,11 @@ QList<CMakeBuildTarget> ServerModeReader::buildTargets() const
else
type = UtilityType;
ct.targetType = type;
if (t->artifacts.isEmpty()) {
ct.workingDirectory = t->buildDirectory;
} else {
ct.workingDirectory = Utils::FileName::fromString(t->artifacts.at(0).toFileInfo().absolutePath());
}
ct.sourceDirectory = t->sourceDirectory;
return ct;
});