CMake: Treat OUTPUT_DIRECTORY as relative to top level build directory

Treat a relative path in OUTPUT_DIRECTORY as relative to the top level
build directory, not to the current build directory.

Change-Id: I4d409d1362a8f73d13b93cf5ab98e82e60dd62cb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
bb10
Tobias Hunger 2019-03-18 18:49:04 +01:00
parent a9af99c926
commit b173f0b905
1 changed files with 3 additions and 0 deletions

View File

@ -752,6 +752,9 @@ function(add_qt_executable name)
set(arg_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}")
endif()
get_filename_component(arg_OUTPUT_DIRECTORY "${arg_OUTPUT_DIRECTORY}"
ABSOLUTE BASE_DIR "${CMAKE_BINARY_DIR}")
add_executable("${name}" ${arg_EXE_FLAGS})
qt_autogen_tools("${name}"