initial port to cxx_qt 6.0
This commit is contained in:
parent
62daf316a3
commit
744481587f
31 changed files with 1992 additions and 1860 deletions
|
@ -60,7 +60,6 @@ endif()
|
|||
|
||||
add_subdirectory(src)
|
||||
set(CRATE liblumina)
|
||||
|
||||
# Corrosion creates a CMake target with the same name as the crate.
|
||||
corrosion_import_crate(MANIFEST_PATH Cargo.toml CRATES ${CRATE})
|
||||
|
||||
|
@ -75,33 +74,35 @@ corrosion_set_env_vars(${CRATE}
|
|||
"QMAKE=${QMAKE}"
|
||||
)
|
||||
|
||||
add_library(${APP_NAME}_lib INTERFACE)
|
||||
# Include the headers generated by the Rust library's build script. Each
|
||||
# crate gets its own subdirectory under CXXQT_EXPORT_DIR. This allows you
|
||||
# to include headers generated by multiple crates without risk of one crate
|
||||
# overwriting another's files.
|
||||
target_include_directories(${CRATE} INTERFACE "${CXXQT_EXPORT_DIR}/${CRATE}")
|
||||
target_include_directories(${APP_NAME}_lib INTERFACE "${CXXQT_EXPORT_DIR}/${CRATE}")
|
||||
|
||||
# Link the Rust INTERFACE library target to Qt. Do this on the library target
|
||||
# rather than the main executable. This way, CMake targets besides the main
|
||||
# executable which link the Rust library, for example tests, will also link Qt.
|
||||
target_link_libraries(${CRATE} INTERFACE
|
||||
Qt5::Quick
|
||||
Qt5::Qml
|
||||
Qt5::Gui
|
||||
Qt5::QuickControls2
|
||||
Qt5::Widgets
|
||||
Qt5::Sql
|
||||
Qt5::X11Extras
|
||||
Qt5::WebEngine
|
||||
KF5::Kirigami2
|
||||
KF5::I18n
|
||||
KF5::Archive
|
||||
KF5::CoreAddons
|
||||
mpv
|
||||
target_link_libraries(${APP_NAME}_lib INTERFACE
|
||||
"$<LINK_LIBRARY:WHOLE_ARCHIVE,${CRATE}-static>"
|
||||
Qt5::Quick
|
||||
Qt5::Qml
|
||||
Qt5::Gui
|
||||
Qt5::QuickControls2
|
||||
Qt5::Widgets
|
||||
Qt5::Sql
|
||||
Qt5::X11Extras
|
||||
Qt5::WebEngine
|
||||
KF5::Kirigami2
|
||||
KF5::I18n
|
||||
KF5::Archive
|
||||
KF5::CoreAddons
|
||||
mpv
|
||||
)
|
||||
|
||||
# Link to the Rust library
|
||||
target_link_libraries(${APP_NAME} PRIVATE ${CRATE})
|
||||
target_link_libraries(${APP_NAME} PRIVATE ${APP_NAME}_lib)
|
||||
|
||||
# If we are using a statically linked Qt then we need to import any qml plugins
|
||||
qt_import_qml_plugins(${APP_NAME})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue