summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-06-20 10:56:19 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-06-21 12:45:37 +0000
commit1c4510cfc4c020d54e3c1c52e187b31b67e3a5fb (patch)
tree3cc4e36089330833ea9dca45b03978876b525870 /cmake
parentb0bd50d33966d93ba5e24ac6be0c849ce501eed6 (diff)
Fix build with multi-config VS code generator
We want our libraries to end up in the same bin directory, not inside the Debug\ or Release\ sub-directories. Their distinct names avoid a clash. For our tools such as moc, uic, etc. we need to place the release build into the bin directory explicitly, as by default multi-config generators place binaries into the Debug\ or Release\ sub-directory. This is also needed as cmake's automoc itself expects moc to be in the bin directory. One effect of this is that with a multi-config build, it is always necessary to perform a release build first, otherwise the debug build won't find moc/uic. Change-Id: I1361823ddf5961a5f1bb517e4bca69e621cbce9e Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBuild.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index 98c9c334cf..4427d2438b 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -1131,6 +1131,8 @@ function(add_qt_module target)
set_target_properties("${target}" PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${QT_BUILD_DIR}/${INSTALL_LIBDIR}"
RUNTIME_OUTPUT_DIRECTORY "${QT_BUILD_DIR}/${INSTALL_BINDIR}"
+ RUNTIME_OUTPUT_DIRECTORY_RELEASE "${QT_BUILD_DIR}/${INSTALL_BINDIR}"
+ RUNTIME_OUTPUT_DIRECTORY_DEBUG "${QT_BUILD_DIR}/${INSTALL_BINDIR}"
ARCHIVE_OUTPUT_DIRECTORY "${QT_BUILD_DIR}/${INSTALL_LIBDIR}"
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
@@ -1815,6 +1817,10 @@ function(add_qt_tool name)
)
qt_internal_add_target_aliases("${name}")
+ set_target_properties("${name}" PROPERTIES
+ RUNTIME_OUTPUT_DIRECTORY_RELEASE "${QT_BUILD_DIR}/${INSTALL_BINDIR}"
+ )
+
if(NOT arg_NO_INSTALL AND arg_TOOLS_TARGET)
# Assign a tool to an export set, and mark the module to which the tool belongs.
qt_internal_append_known_modules_with_tools("${arg_TOOLS_TARGET}")