diff options
author | Eike Ziller <eike.ziller@qt.io> | 2020-02-07 13:03:40 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2020-02-07 12:09:56 +0000 |
commit | 4e357e84c03c629a284c1f5505908f8a7644fba9 (patch) | |
tree | bb7195b3c89c183a8ac3f91075f0545bdeb9eab5 /src/tools | |
parent | 43c17efe5e7619b8d150e7dceceba232d3911890 (diff) |
CMake build: Fix building sdktool against static Qt
On Windows. This is a hack, but enough for the purpose of packaging.
Change-Id: I308b80dcf37e26e5c69f2fd6631b4b38854d68e0
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/sdktool/CMakeLists.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tools/sdktool/CMakeLists.txt b/src/tools/sdktool/CMakeLists.txt index 2c0c60b92a..e25ae3f31a 100644 --- a/src/tools/sdktool/CMakeLists.txt +++ b/src/tools/sdktool/CMakeLists.txt @@ -25,6 +25,15 @@ find_package(Qt5 REQUIRED ) +if (MSVC) + # find out if Qt is static and set /MT if so + get_target_property(_input_type Qt5::Core TYPE) + if (${_input_type} STREQUAL "STATIC_LIBRARY") + string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") + string(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") + endif() +endif() + if (APPLE) find_library(FWFoundation Foundation) endif() |