cmake: Do not break when slint is build with empty CMAKE_BUILD_TYPE

Do not break building against slint using CMake from C++ when no
CMAKE_BUILD_TYPE was set when building Slint.

This just makes sure the build type is properly quoted, which makes sure
we keep a (empty) string token where CMake expects one.

Fixes: #1065
This commit is contained in:
Tobias Hunger 2022-03-17 16:41:33 +01:00 committed by Tobias Hunger
parent 66fa1fcfee
commit 526166090e

View file

@ -16,7 +16,7 @@ set_target_properties(slint-cpp-shared PROPERTIES @SLINT_LIB_PROPERTIES@)
foreach(build_type Release RelWithDebInfo MinSizeRel Debug)
string(TOUPPER "${build_type}" config_name)
if(NOT("@CMAKE_BUILD_TYPE@" STREQUAL build_type))
set_target_properties(slint-cpp-shared PROPERTIES MAP_IMPORTED_CONFIG_${config_name} @CMAKE_BUILD_TYPE@)
set_target_properties(slint-cpp-shared PROPERTIES MAP_IMPORTED_CONFIG_${config_name} "@CMAKE_BUILD_TYPE@")
endif()
endforeach()