Skip to content

Commit

Permalink
cpp: Fix cmake property mapping
Browse files Browse the repository at this point in the history
Fix the mapping between a projects CMAKE_BUILD_TYPE and the build type
of the imported Slint library.

Fixes #1027
  • Loading branch information
hunger authored and ogoffart committed Mar 9, 2022
1 parent 10dc49d commit ebe3a3c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/cpp/cmake/SlintConfig.cmake.in
Expand Up @@ -13,6 +13,12 @@ endif()

add_library(slint-cpp-shared SHARED IMPORTED)
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@)
endif()
endforeach()

add_executable(Slint::slint-compiler IMPORTED GLOBAL)
set_target_properties(Slint::slint-compiler PROPERTIES IMPORTED_LOCATION "${_IMPORT_PREFIX}/@CMAKE_INSTALL_BINDIR@/slint-compiler${CMAKE_EXECUTABLE_SUFFIX}")
Expand Down

0 comments on commit ebe3a3c

Please sign in to comment.