From 15f5a347fe0010f640b5451804ecb96c23bcf4a3 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 26 Mar 2019 19:37:01 +0100 Subject: Add a debug suffix to libraries and plugins on macOS and Windows This is especially important on macOS when doing a debug build, because QPluginLoader is looking for the cocoa QPA plugin suffixed with "_debug" when executing a test or example. Change-Id: Ief23b3a82c567c16ab9dd30d04d1729031262d7d Reviewed-by: Tobias Hunger --- cmake/QtSetup.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cmake') diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake index caf908b4c9..c7d6f50b73 100644 --- a/cmake/QtSetup.cmake +++ b/cmake/QtSetup.cmake @@ -10,6 +10,14 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") # Set the possible values of build type for cmake-gui endif() +# Appends a 'debug postfix' to library targets (not executables) +# e.g. lib/libQt5DBus_debug.5.12.0.dylib +if(WIN32) + set(CMAKE_DEBUG_POSTFIX "d") +elseif(APPLE) + set(CMAKE_DEBUG_POSTFIX "_debug") +endif() + ## Force C++ standard, do not fall back, do not use compiler extensions set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) -- cgit v1.2.3