diff --git a/src/tools/sdktool/CMakeLists.txt b/src/tools/sdktool/CMakeLists.txt index 2c0c60b92ac..e25ae3f31a4 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()