lumina/build.rs

123 lines
4.9 KiB
Rust

use std::{env, path::PathBuf};
use cxx_qt_build::{CxxQtBuilder, QmlModule};
fn main() {
CxxQtBuilder::new()
.file("src/rust/settings.rs")
.file("src/rust/file_helper.rs")
.file("src/rust/slide_object.rs")
.file("src/rust/slide_model.rs")
.file("src/rust/service_item_model.rs")
.file("src/rust/image_model.rs")
.file("src/rust/video_model.rs")
.file("src/rust/presentation_model.rs")
.file("src/rust/songs/song_model.rs")
.file("src/rust/songs/song_editor.rs")
.file("src/rust/ytdl.rs")
.file("src/rust/utils.rs")
.file("src/rust/obs.rs")
.build();
// let mut kde_include_dir = String::from("/usr/include/");
// let mut kde_lib_dir = String::from("/usr/lib/x86_64-linux-gnu/");
// if let Ok(mut include_dir) = env::var("CMAKE_INCLUDE_PATH") {
// println!("{}", include_dir);
// if let Some(include_dir) =
// include_dir.split(":").find(|s| s.contains("ki18n"))
// {
// kde_include_dir = include_dir.to_owned();
// }
// } else {
// println!(
// "cargo:warning=KDE_INCLUDEDIR is not defined, used default value: {}",
// kde_include_dir
// );
// }
// if let Ok(lib_dir) = env::var("KDE_LIBDIR") {
// kde_lib_dir = lib_dir;
// } else {
// println!(
// "cargo:warning=KDE_LIBDIR is not defined, used default value: {}",
// kde_lib_dir
// );
// }
// let ki18n_include_path = PathBuf::from(kde_include_dir)
// .canonicalize()
// .expect("Cannot get canonical path of KDE_INCLUDEDIR")
// .join("KF6")
// .join("KI18n");
// CxxQtBuilder::new()
// // Link Qt's Network library
// // - Qt Core is always linked
// // - Qt Gui is linked by enabling the qt_gui Cargo feature (default).
// // - Qt Qml is linked by enabling the qt_qml Cargo feature (default).
// // - Qt Qml requires linking Qt Network on macOS
// // .qt_module("Core5Compat")
// // .qt_module("Kirigami")
// // .qt_module("WebEngineQuick")
// .qt_module("Network")
// // .qt_module("Quick")
// // .qt_module("Test")
// // .qt_module("WebEngineQuick")
// // .qt_module("I18n")
// // .qt_module("CoreAddons")
// .qml_module(QmlModule {
// uri: "com.cochrun.xyz",
// rust_files: &[
// "src/rust/settings.rs",
// "src/rust/service_item_model.rs",
// "src/rust/file_helper.rs",
// "src/rust/slide_model.rs",
// "src/rust/slide_object.rs",
// "src/rust/ytdl.rs",
// "src/rust/utils.rs",
// "src/rust/obs.rs",
// "src/rust/video_model.rs",
// "src/rust/image_model.rs",
// "src/rust/presentation_model.rs",
// // "src/rust/songs/song_model.rs",
// // "src/rust/songs/song_editor.rs",
// ],
// qrc_files: &["src/resources.qrc"],
// qml_files: &[
// "src/qml/main.qml",
// "src/qml/presenter/LeftDock.qml",
// "src/qml/presenter/ServiceList.qml",
// "src/qml/presenter/MainWindow.qml",
// "src/qml/presenter/Library.qml",
// "src/qml/presenter/LibraryItem.qml",
// "src/qml/presenter/Header.qml",
// "src/qml/presenter/Actions.qml",
// "src/qml/presenter/PanelItem.qml",
// "src/qml/presenter/SongEditor.qml",
// "src/qml/presenter/VideoEditor.qml",
// "src/qml/presenter/ImageEditor.qml",
// "src/qml/presenter/PresentationEditor.qml",
// "src/qml/presenter/SlideEditor.qml",
// "src/qml/presenter/Slide.qml",
// "src/qml/presenter/SlidesListView.qml",
// "src/qml/presenter/SongEditorSlideList.qml",
// "src/qml/presenter/DragHandle.qml",
// "src/qml/presenter/Presentation.qml",
// "src/qml/presenter/PresentationWindow.qml",
// "src/qml/presenter/PreviewSlideListDelegate.qml",
// "src/qml/presenter/PreviewSlide.qml",
// "src/qml/presenter/Settings.qml",
// "src/qml/presenter/RangedSlider.qml",
// "src/qml/presenter/NewVideo.qml",
// "src/qml/presenter/TextBackground.qml",
// "src/qml/presenter/TextBox.qml",
// "src/qml/presenter/LoadingSpinner.qml",
// ],
// ..Default::default()
// })
// .cc_builder(|cc| {
// cc.include("cpp");
// cc.include(format!("{}", ki18n_include_path.display()));
// })
// .build();
}