mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-28 21:04:47 +00:00

Fix the mapping between a projects CMAKE_BUILD_TYPE and the build type of the imported Slint library. Fixes #1027
31 lines
1.3 KiB
CMake
31 lines
1.3 KiB
CMake
# Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
|
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
|
|
|
@PACKAGE_INIT@
|
|
|
|
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
|
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
|
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
|
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
|
if(_IMPORT_PREFIX STREQUAL "/")
|
|
set(_IMPORT_PREFIX "")
|
|
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}")
|
|
|
|
set(_IMPORT_PREFIX)
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/SlintTargets.cmake")
|
|
include("${CMAKE_CURRENT_LIST_DIR}/SlintMacro.cmake")
|
|
|
|
set(SLINT_STYLE @SLINT_STYLE_DEFAULT@ CACHE STRING "The Slint widget style")
|