mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 06:41:14 +00:00
Fix Qt detection in C++ build when qmake is not in PATH but CMAKE_PREFIX_PATH is set
find_package(Qt5) may do a better job at finding qmake, especially if the build is invoked through Qt Creator, which may make sure that CMAKE_PREFIX_PATH is set. Forward the qmake path therefore the the rust build.
This commit is contained in:
parent
9ff3b01b54
commit
b30aaf2c06
1 changed files with 15 additions and 1 deletions
|
@ -14,12 +14,26 @@ include(FetchContent)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
Corrosion
|
Corrosion
|
||||||
GIT_REPOSITORY https://github.com/AndrewGaspar/corrosion.git
|
GIT_REPOSITORY https://github.com/AndrewGaspar/corrosion.git
|
||||||
GIT_TAG 946c5dd80a6ebdb84c5986e52af460e23e74394d
|
GIT_TAG 343546419f56f56780bd92f3fcd51fc02a598de6
|
||||||
)
|
)
|
||||||
FetchContent_MakeAvailable(Corrosion)
|
FetchContent_MakeAvailable(Corrosion)
|
||||||
corrosion_import_crate(MANIFEST_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../Cargo.toml"
|
corrosion_import_crate(MANIFEST_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../Cargo.toml"
|
||||||
CRATES sixtyfps-compiler sixtyfps-cpp xtask)
|
CRATES sixtyfps-compiler sixtyfps-cpp xtask)
|
||||||
|
|
||||||
|
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.19.0)
|
||||||
|
# For the CMake build don't rely on qmake being in PATH but use CMake to locate Qt. This
|
||||||
|
# means usually CMAKE_PREFIX_PATH is set.
|
||||||
|
find_package(Qt5 QUIET COMPONENTS Core Widgets)
|
||||||
|
if (TARGET Qt5::qmake)
|
||||||
|
set_property(
|
||||||
|
TARGET sixtyfps-cpp
|
||||||
|
APPEND
|
||||||
|
PROPERTY CORROSION_ENVIRONMENT_VARIABLES
|
||||||
|
QMAKE=$<TARGET_PROPERTY:Qt5::qmake,LOCATION>
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
add_library(SixtyFPS INTERFACE)
|
add_library(SixtyFPS INTERFACE)
|
||||||
add_library(SixtyFPS::SixtyFPS ALIAS SixtyFPS)
|
add_library(SixtyFPS::SixtyFPS ALIAS SixtyFPS)
|
||||||
target_link_libraries(SixtyFPS INTERFACE sixtyfps-cpp)
|
target_link_libraries(SixtyFPS INTERFACE sixtyfps-cpp)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue