Skip to content

Commit

Permalink
Simplify slint-compiler import location logic in SlintConfig.cmake.in
Browse files Browse the repository at this point in the history
Instead of detecting the suffix, just copy across the corrosion-determined file name.

Amends 13975d9
  • Loading branch information
tronical committed Aug 25, 2024
1 parent 4ca3760 commit 5d03d6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 3 additions & 0 deletions api/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,9 @@ if(SLINT_BUILD_RUNTIME)
endforeach()

get_property(_SLINT_STYLE GLOBAL PROPERTY SLINT_STYLE)
get_target_property(_slint_compiler_location slint-compiler IMPORTED_LOCATION)
cmake_path(GET _slint_compiler_location FILENAME SLINT_COMPILER_FILE_NAME)

configure_package_config_file("cmake/SlintConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/Slint/SlintConfig.cmake" INSTALL_DESTINATION lib/cmake/Slint)
endfunction()

Expand Down
6 changes: 1 addition & 5 deletions api/cpp/cmake/SlintConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ if (SLINT_COMPILER)
include("${CMAKE_CURRENT_LIST_DIR}/SlintMacro.cmake")
elseif (@SLINT_FEATURE_COMPILER@)
add_executable(Slint::slint-compiler IMPORTED GLOBAL)
if(CMAKE_HOST_WIN32)
set_target_properties(Slint::slint-compiler PROPERTIES IMPORTED_LOCATION "${_IMPORT_PREFIX}/@CMAKE_INSTALL_BINDIR@/slint-compiler.exe")
else()
set_target_properties(Slint::slint-compiler PROPERTIES IMPORTED_LOCATION "${_IMPORT_PREFIX}/@CMAKE_INSTALL_BINDIR@/slint-compiler")
endif()
set_target_properties(Slint::slint-compiler PROPERTIES IMPORTED_LOCATION "${_IMPORT_PREFIX}/@CMAKE_INSTALL_BINDIR@/@SLINT_COMPILER_FILE_NAME@")
include("${CMAKE_CURRENT_LIST_DIR}/SlintMacro.cmake")
endif()

Expand Down

0 comments on commit 5d03d6e

Please sign in to comment.