diff --git a/CMakeLists.txt b/CMakeLists.txt index fe47e28..91790b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 4.2) include("${CMAKE_CURRENT_LIST_DIR}/_cmake/version.cmake") @@ -12,11 +12,24 @@ set(NUI_JSON_DIAGNOSTICS ON CACHE BOOL "Enable json diagnostics for nlohmann_jso set(WEBKIT_PATH "" CACHE PATH "Path to custom built WebKit, if empty, will use system WebKit") set(WEBKIT_PACKAGE_NAME "webkitgtk-6.0" CACHE STRING "Pkg-config package name for WebKit, used if WEBKIT_PATH is set") +option(FETCH_YAML_CPP "Fetch yaml-cpp" ON) option(BUILD_SHARED_LIBS "Do not build shared libraries" OFF) option(BUILD_STATIC_LIBS "Build static libraries" ON) option(NUI_SFTP_ENABLE_TESTING "Enable testing for nui-sftp" OFF) -option(FLATPAK_BUILD "Inform CMake that we are building for flatpak, this will set some additional flags and dependencies" OFF) +option(OFFLINE_BUILD "Inform CMake that we are building for offline environments (flatpak, yocto), this will set some additional flags and dependencies" OFF) option(OMIT_FRONTEND_BUILD "Dont build the frontend, used primarily for flatpak, because using emscripten there is hell" OFF) +option(FETCH_RAPIDFUZZ "Fetch rapidfuzz" ON) +option(FETCH_SPDLOG "Fetch spdlog" ON) +option(FETCH_EFSW "Fetch efsw" ON) +option(FETCH_ICONS "Fetch icons" ON) + +if (OFFLINE_BUILD) + include("${CMAKE_CURRENT_LIST_DIR}/_cmake/offline_build.cmake") +endif() + +if (OMIT_FRONTEND_BUILD) + set(NUI_OMIT_FRONTEND ON CACHE BOOL "Do not build the frontend, sometimes useful for environments where emscripten is hard to use" FORCE) +endif() include (${CMAKE_CURRENT_LIST_DIR}/_cmake/common_options.cmake) @@ -40,10 +53,6 @@ if (NOT EMSCRIPTEN) endif() endif() -if (FLATPAK_BUILD) - include("${CMAKE_CURRENT_LIST_DIR}/_cmake/flatpak.cmake") -endif() - # Nui Dependency add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/Nui" EXCLUDE_FROM_ALL) diff --git a/_cmake/common_options.cmake b/_cmake/common_options.cmake index 2219838..ecb85b6 100644 --- a/_cmake/common_options.cmake +++ b/_cmake/common_options.cmake @@ -6,19 +6,18 @@ else() target_compile_options(core-target INTERFACE -Wall -Wextra -Wpedantic) endif() -set(MEM64 "") -set(EXCEPTIONS "") if (EMSCRIPTEN) if (WIN32) - set(MEM64 "-sMEMORY64=1") + target_compile_options(core-target INTERFACE -sMEMORY64=1) + target_link_options(core-target INTERFACE -sMEMORY64=1) else() # No support for WASM64 in webkit - set(MEM64 "-sWASM_BIGINT=1") + target_compile_options(core-target INTERFACE -sWASM_BIGINT=1) endif() - set(EXCEPTIONS "-fexceptions") + target_link_options(core-target INTERFACE "-fexceptions") endif() -target_compile_options(core-target INTERFACE -Wbad-function-cast -Wcast-function-type -fexceptions -pedantic $<$:-g;-Werror=return-type> $<$:-O3> ${MEM64} ${EXCEPTIONS}) -target_link_options(core-target INTERFACE $<$:-s;-static-libgcc;-static-libstdc++> ${MEM64} ${EXCEPTIONS}) +target_compile_options(core-target INTERFACE -Wbad-function-cast -Wcast-function-type -fexceptions -pedantic $<$:-g;-Werror=return-type> $<$:-O3>) +target_link_options(core-target INTERFACE $<$:-s;-static-libgcc;-static-libstdc++>) target_compile_features(core-target INTERFACE cxx_std_23) target_compile_definitions(core-target INTERFACE JSON_DIAGNOSTICS=1) \ No newline at end of file diff --git a/_cmake/copy_styles_to_build_dir.cmake b/_cmake/copy_styles_to_build_dir.cmake index 9028c9c..e9d1afb 100644 --- a/_cmake/copy_styles_to_build_dir.cmake +++ b/_cmake/copy_styles_to_build_dir.cmake @@ -1,43 +1,45 @@ -add_custom_command( - OUTPUT - "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/dropdown_menu.css" - "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/file_grid.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/button.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/color_picker.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/resizeable_table.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/select.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/switch.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/text_input.css" - COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/styles/nui-file-explorer" - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/nui-file-explorer/styles/dropdown_menu.css" "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/dropdown_menu.css" - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/nui-file-explorer/styles/file_grid.css" "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/file_grid.css" - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/button.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/button.css" - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/color_picker.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/color_picker.css" - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/resizeable_table.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/resizeable_table.css" - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/select.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/select.css" - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/switch.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/switch.css" - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/text_input.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/text_input.css" - DEPENDS - "${CMAKE_SOURCE_DIR}/nui-file-explorer/styles/dropdown_menu.css" - "${CMAKE_SOURCE_DIR}/nui-file-explorer/styles/file_grid.css" - "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/button.css" - "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/color_picker.css" - "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/resizeable_table.css" - "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/select.css" - "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/switch.css" - "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/text_input.css" -) +if (NOT OMIT_FRONTEND_BUILD) + add_custom_command( + OUTPUT + "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/dropdown_menu.css" + "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/file_grid.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/button.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/color_picker.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/resizeable_table.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/select.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/switch.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/text_input.css" + COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/styles/nui-file-explorer" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/nui-file-explorer/styles/dropdown_menu.css" "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/dropdown_menu.css" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/nui-file-explorer/styles/file_grid.css" "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/file_grid.css" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/button.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/button.css" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/color_picker.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/color_picker.css" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/resizeable_table.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/resizeable_table.css" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/select.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/select.css" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/switch.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/switch.css" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/text_input.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/text_input.css" + DEPENDS + "${CMAKE_SOURCE_DIR}/nui-file-explorer/styles/dropdown_menu.css" + "${CMAKE_SOURCE_DIR}/nui-file-explorer/styles/file_grid.css" + "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/button.css" + "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/color_picker.css" + "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/resizeable_table.css" + "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/select.css" + "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/switch.css" + "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/text_input.css" + ) -add_custom_target( - nui-sftp-style-copy - ALL - DEPENDS - "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/dropdown_menu.css" - "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/file_grid.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/button.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/color_picker.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/resizeable_table.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/select.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/switch.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/text_input.css" -) \ No newline at end of file + add_custom_target( + nui-sftp-style-copy + ALL + DEPENDS + "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/dropdown_menu.css" + "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/file_grid.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/button.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/color_picker.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/resizeable_table.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/select.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/switch.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/text_input.css" + ) +endif() \ No newline at end of file diff --git a/_cmake/dependencies/efsw.cmake b/_cmake/dependencies/efsw.cmake index 6586a4d..df1d42f 100755 --- a/_cmake/dependencies/efsw.cmake +++ b/_cmake/dependencies/efsw.cmake @@ -1,8 +1,11 @@ -include(FetchContent) -FetchContent_Declare( - efsw - GIT_REPOSITORY https://github.com/SpartanJ/efsw.git - GIT_TAG 87abe599995d5646f5d83cf2e3a225bd73148b3a -) +if (FETCH_EFSW) + include(FetchContent) + # If you edit here, update work_dependencies.json + FetchContent_Declare( + efsw + GIT_REPOSITORY https://github.com/SpartanJ/efsw.git + GIT_TAG 87abe599995d5646f5d83cf2e3a225bd73148b3a + ) -FetchContent_MakeAvailable(efsw) \ No newline at end of file + FetchContent_MakeAvailable(efsw) +endif() \ No newline at end of file diff --git a/_cmake/dependencies/expected.cmake b/_cmake/dependencies/expected.cmake deleted file mode 100755 index 17f9c93..0000000 --- a/_cmake/dependencies/expected.cmake +++ /dev/null @@ -1,8 +0,0 @@ -include(FetchContent) -FetchContent_Declare( - expected - GIT_REPOSITORY https://github.com/TartanLlama/expected.git - GIT_TAG 3f0ca7b19253129700a073abfa6d8638d9f7c80c -) - -FetchContent_MakeAvailable(expected) \ No newline at end of file diff --git a/_cmake/dependencies/rapidfuzz.cmake b/_cmake/dependencies/rapidfuzz.cmake index b481394..99bb8ff 100644 --- a/_cmake/dependencies/rapidfuzz.cmake +++ b/_cmake/dependencies/rapidfuzz.cmake @@ -1,6 +1,10 @@ -FetchContent_Declare( - rapidfuzz - GIT_REPOSITORY https://github.com/rapidfuzz/rapidfuzz-cpp.git - GIT_TAG main -) -FetchContent_MakeAvailable(rapidfuzz) \ No newline at end of file +if (FETCH_RAPIDFUZZ) + include(FetchContent) + # If you edit here, update work_dependencies.json + FetchContent_Declare( + rapidfuzz + GIT_REPOSITORY https://github.com/rapidfuzz/rapidfuzz-cpp.git + GIT_TAG b8ce411e91e01599d0697ad307933e05ddf3a723 + ) + FetchContent_MakeAvailable(rapidfuzz) +endif() \ No newline at end of file diff --git a/_cmake/dependencies/spdlog.cmake b/_cmake/dependencies/spdlog.cmake index 1df55da..910c43d 100755 --- a/_cmake/dependencies/spdlog.cmake +++ b/_cmake/dependencies/spdlog.cmake @@ -1,10 +1,13 @@ set(SPDLOG_FMT_EXTERNAL ON CACHE BOOL "Use an external fmt library (provide it manually)" FORCE) -include(FetchContent) -FetchContent_Declare( - spdlog - GIT_REPOSITORY https://github.com/gabime/spdlog.git - GIT_TAG v1.17.0 -) +if (FETCH_SPDLOG) + include(FetchContent) + # If you edit here, update work_dependencies.json + FetchContent_Declare( + spdlog + GIT_REPOSITORY https://github.com/gabime/spdlog.git + GIT_TAG v1.17.0 + ) -FetchContent_MakeAvailable(spdlog) + FetchContent_MakeAvailable(spdlog) +endif() \ No newline at end of file diff --git a/_cmake/dependencies/yaml-cpp.cmake b/_cmake/dependencies/yaml-cpp.cmake index 2117fd7..fc9dc8b 100644 --- a/_cmake/dependencies/yaml-cpp.cmake +++ b/_cmake/dependencies/yaml-cpp.cmake @@ -1,8 +1,11 @@ -include(FetchContent) +if (FETCH_YAML_CPP) + include(FetchContent) -FetchContent_Declare( - yaml-cpp - GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git - GIT_TAG 89ff142b991af432b5d7a7cee55282f082a7e629 -) -FetchContent_MakeAvailable(yaml-cpp) \ No newline at end of file + # If you edit here, update work_dependencies.json + FetchContent_Declare( + yaml-cpp + GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git + GIT_TAG 89ff142b991af432b5d7a7cee55282f082a7e629 + ) + FetchContent_MakeAvailable(yaml-cpp) +endif() \ No newline at end of file diff --git a/_cmake/flatpak.cmake b/_cmake/flatpak.cmake deleted file mode 100644 index 68edfaf..0000000 --- a/_cmake/flatpak.cmake +++ /dev/null @@ -1,14 +0,0 @@ -# When this file is included its a flatpak build - -if(EMSCRIPTEN) - # add_subdirectory("${CMAKE_CURRENT_BINARY_DIR}/flatpakdeps/nlohmann_json" EXCLUDE_FROM_ALL) - # add_subdirectory("${CMAKE_CURRENT_BINARY_DIR}/flatpakdeps/fmt" EXCLUDE_FROM_ALL) -else() - find_package(nlohmann_json REQUIRED) - find_package(fmt REQUIRED) - - add_library(boost_preprocessor INTERFACE IMPORTED GLOBAL) - add_library(interval-tree INTERFACE IMPORTED GLOBAL) - add_library(boost_describe INTERFACE IMPORTED GLOBAL) - add_library(boost_mp11 INTERFACE IMPORTED GLOBAL) -endif() \ No newline at end of file diff --git a/_cmake/offline_build.cmake b/_cmake/offline_build.cmake new file mode 100644 index 0000000..6b1c70e --- /dev/null +++ b/_cmake/offline_build.cmake @@ -0,0 +1,43 @@ +# When this file is included its a build requiring to be offline (flatpak, yocto). +if(NOT EMSCRIPTEN) + # Installed into sytem: + set(NUI_FETCH_BOOST_PREPROCESSOR OFF CACHE BOOL "Do not fetch boost preprocessor, assume it is provided by the system" FORCE) + set(NUI_FETCH_INTERVAL_TREE OFF CACHE BOOL "Do not fetch interval tree, assume it is provided by the system" FORCE) + set(NUI_FETCH_BOOST_DESCRIBE OFF CACHE BOOL "Do not fetch boost describe, assume it is provided by the system" FORCE) + set(NUI_FETCH_BOOST_MP11 OFF CACHE BOOL "Do not fetch boost mp11, assume it is provided by the system" FORCE) + set(NUI_FETCH_NLOHMANN_JSON OFF CACHE BOOL "Do not fetch nlohmann_json, assume it is provided by the system" FORCE) + set(NUI_FETCH_BINARYEN OFF CACHE BOOL "Do not fetch binaryen, assume it is provided by the system" FORCE) + set(NUI_FETCH_FMT OFF CACHE BOOL "Do not fetch fmt, assume it is provided by the system" FORCE) + set(NUI_FIND_FMT OFF CACHE BOOL "Do not find fmt, assume it is provided by the system" FORCE) + set(ROAR_EXTERNAL_NLOHMANN_JSON ON CACHE BOOL "Use external nlohmann_json for roar, assume it is provided by the system" FORCE) + + # Checked out in dependencies directory in source dir: + set(NUI_FETCH_TRAITS OFF CACHE BOOL "Do not fetch nui traits, assume it is in dependencies/traits" FORCE) + set(NUI_FETCH_WEBVIEW OFF CACHE BOOL "Do not fetch webview, assume it is in dependencies/webview" FORCE) + set(NUI_FETCH_PORTABLE_FILE_DIALOG OFF CACHE BOOL "Do not fetch portable file dialog, assume it is in dependencies/portable-file-dialogs" FORCE) + set(NUI_FETCH_ROAR OFF CACHE BOOL "Do not fetch roar, assume it is in dependencies/roar" FORCE) + set(ROAR_EXTERNAL_PROMISE ON CACHE BOOL "Use external promise-cpp for roar, assume it is in dependencies/promise-cpp" FORCE) + set(FETCH_YAML_CPP OFF CACHE BOOL "Do not fetch yaml-cpp, assume it is in dependencies/yml-cpp" FORCE) + set(FETCH_RAPIDFUZZ OFF CACHE BOOL "Do not fetch rapidfuzz, assume it is in dependencies/rapidfuzz" FORCE) + set(FETCH_SPDLOG OFF CACHE BOOL "Do not fetch spdlog, assume it is in dependencies/spdlog" FORCE) + set(FETCH_EFSW OFF CACHE BOOL "Do not fetch efsw, assume it is in dependencies/efsw" FORCE) + set(FETCH_ICONS OFF CACHE BOOL "Do not fetch icons, assume it is in dependencies/icons" FORCE) + + set(OMIT_FRONTEND_BUILD ON CACHE BOOL "Do not build the frontend, in offline environments emscripten is hard to use" FORCE) + + find_package(nlohmann_json REQUIRED) + find_package(fmt REQUIRED) + + add_library(boost_preprocessor INTERFACE IMPORTED GLOBAL) + add_library(interval-tree INTERFACE IMPORTED GLOBAL) + add_library(boost_describe INTERFACE IMPORTED GLOBAL) + add_library(boost_mp11 INTERFACE IMPORTED GLOBAL) + + add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/portable-file-dialogs" EXCLUDE_FROM_ALL) + add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/webview" EXCLUDE_FROM_ALL) + add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/yaml-cpp" EXCLUDE_FROM_ALL) + add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/rapidfuzz" EXCLUDE_FROM_ALL) + add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/spdlog" EXCLUDE_FROM_ALL) + add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/efsw" EXCLUDE_FROM_ALL) + add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/promise-cpp" EXCLUDE_FROM_ALL) +endif() \ No newline at end of file diff --git a/_cmake/resource_copy.cmake b/_cmake/resource_copy.cmake index 31b49f3..2e70481 100644 --- a/_cmake/resource_copy.cmake +++ b/_cmake/resource_copy.cmake @@ -1,15 +1,20 @@ # Icons -include(FetchContent) +if (FETCH_ICONS) + include(FetchContent) -FetchContent_Declare( - base-icons - URL "https://s3.g.s4.mega.io/jgemkib4a5fte35rktt5wxrwkw4ejk4ybemkf/nui-scp/icons.tar.gz" - URL_HASH MD5=38d01d8769dda2a006495c7a3caa11b4 - DOWNLOAD_EXTRACT_TIMESTAMP TRUE -) + FetchContent_Declare( + base-icons + URL "https://s3.g.s4.mega.io/jgemkib4a5fte35rktt5wxrwkw4ejk4ybemkf/nui-scp/icons.tar.gz" + URL_HASH MD5=38d01d8769dda2a006495c7a3caa11b4 + DOWNLOAD_EXTRACT_TIMESTAMP TRUE + ) -FetchContent_MakeAvailable(base-icons) + FetchContent_MakeAvailable(base-icons) + set(BASE_ICONS_DIR "${base-icons_SOURCE_DIR}") +else() + set(BASE_ICONS_DIR "${CMAKE_SOURCE_DIR}/dependencies/icons") +endif() add_custom_command( OUTPUT @@ -32,44 +37,44 @@ add_custom_command( "${CMAKE_BINARY_DIR}/assets/icons/rust.png" "${CMAKE_BINARY_DIR}/assets/icons/python.png" "${CMAKE_BINARY_DIR}/themes/dark/css_variables.css" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/os_folders/windows/11/folder_main.png" "${CMAKE_BINARY_DIR}/assets/icons/folder_main.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Others/hard-drive.png" "${CMAKE_BINARY_DIR}/assets/icons/hard_drive.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/os_folders/windows/11/folder_main.png" "${CMAKE_BINARY_DIR}/assets/icons/folder_main.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Others/hard-drive.png" "${CMAKE_BINARY_DIR}/assets/icons/hard_drive.png" COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_LIST_DIR}/../static/assets/file.png" "${CMAKE_BINARY_DIR}/assets/icons/file.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-c-4921409.png" "${CMAKE_BINARY_DIR}/assets/icons/cpp.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/css-3-logo.png" "${CMAKE_BINARY_DIR}/assets/icons/css.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-html-1174764.png" "${CMAKE_BINARY_DIR}/assets/icons/html.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/Go-Logo_Black.png" "${CMAKE_BINARY_DIR}/assets/icons/go.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-c-4921443.png" "${CMAKE_BINARY_DIR}/assets/icons/csharp.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-cad-4921405.png" "${CMAKE_BINARY_DIR}/assets/icons/cad.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-c-file-115671.png" "${CMAKE_BINARY_DIR}/assets/icons/c.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-jar-4921452.png" "${CMAKE_BINARY_DIR}/assets/icons/jar.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-java-1156842.png" "${CMAKE_BINARY_DIR}/assets/icons/java.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-js-4921450.png" "${CMAKE_BINARY_DIR}/assets/icons/js.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-log-4921382.png" "${CMAKE_BINARY_DIR}/assets/icons/log.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-sql-4921378.png" "${CMAKE_BINARY_DIR}/assets/icons/sql.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-swift-file-3001056.png" "${CMAKE_BINARY_DIR}/assets/icons/swift.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/Rust_programming_language.png" "${CMAKE_BINARY_DIR}/assets/icons/rust.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-python-1375869.png" "${CMAKE_BINARY_DIR}/assets/icons/python.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-c-4921409.png" "${CMAKE_BINARY_DIR}/assets/icons/cpp.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/css-3-logo.png" "${CMAKE_BINARY_DIR}/assets/icons/css.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-html-1174764.png" "${CMAKE_BINARY_DIR}/assets/icons/html.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/Go-Logo_Black.png" "${CMAKE_BINARY_DIR}/assets/icons/go.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-c-4921443.png" "${CMAKE_BINARY_DIR}/assets/icons/csharp.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-cad-4921405.png" "${CMAKE_BINARY_DIR}/assets/icons/cad.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-c-file-115671.png" "${CMAKE_BINARY_DIR}/assets/icons/c.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-jar-4921452.png" "${CMAKE_BINARY_DIR}/assets/icons/jar.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-java-1156842.png" "${CMAKE_BINARY_DIR}/assets/icons/java.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-js-4921450.png" "${CMAKE_BINARY_DIR}/assets/icons/js.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-log-4921382.png" "${CMAKE_BINARY_DIR}/assets/icons/log.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-sql-4921378.png" "${CMAKE_BINARY_DIR}/assets/icons/sql.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-swift-file-3001056.png" "${CMAKE_BINARY_DIR}/assets/icons/swift.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/Rust_programming_language.png" "${CMAKE_BINARY_DIR}/assets/icons/rust.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-python-1375869.png" "${CMAKE_BINARY_DIR}/assets/icons/python.png" COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_LIST_DIR}/../themes/dark/css_variables.css" "${CMAKE_BINARY_DIR}/themes/dark/css_variables.css" DEPENDS - "${base-icons_SOURCE_DIR}/os_folders/windows/11/folder_main.png" + "${BASE_ICONS_DIR}/os_folders/windows/11/folder_main.png" "${CMAKE_CURRENT_LIST_DIR}/../static/assets/file.png" - "${base-icons_SOURCE_DIR}/masks/Others/hard-drive.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-c-4921409.png" - "${base-icons_SOURCE_DIR}/masks/Development/css-3-logo.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-html-1174764.png" - "${base-icons_SOURCE_DIR}/masks/Development/Go-Logo_Black.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-c-4921443.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-cad-4921405.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-c-file-115671.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-jar-4921452.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-java-1156842.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-js-4921450.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-log-4921382.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-sql-4921378.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-swift-file-3001056.png" - "${base-icons_SOURCE_DIR}/masks/Development/Rust_programming_language.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-python-1375869.png" + "${BASE_ICONS_DIR}/masks/Others/hard-drive.png" + "${BASE_ICONS_DIR}/masks/Development/noun-c-4921409.png" + "${BASE_ICONS_DIR}/masks/Development/css-3-logo.png" + "${BASE_ICONS_DIR}/masks/Development/noun-html-1174764.png" + "${BASE_ICONS_DIR}/masks/Development/Go-Logo_Black.png" + "${BASE_ICONS_DIR}/masks/Development/noun-c-4921443.png" + "${BASE_ICONS_DIR}/masks/Development/noun-cad-4921405.png" + "${BASE_ICONS_DIR}/masks/Development/noun-c-file-115671.png" + "${BASE_ICONS_DIR}/masks/Development/noun-jar-4921452.png" + "${BASE_ICONS_DIR}/masks/Development/noun-java-1156842.png" + "${BASE_ICONS_DIR}/masks/Development/noun-js-4921450.png" + "${BASE_ICONS_DIR}/masks/Development/noun-log-4921382.png" + "${BASE_ICONS_DIR}/masks/Development/noun-sql-4921378.png" + "${BASE_ICONS_DIR}/masks/Development/noun-swift-file-3001056.png" + "${BASE_ICONS_DIR}/masks/Development/Rust_programming_language.png" + "${BASE_ICONS_DIR}/masks/Development/noun-python-1375869.png" "${CMAKE_CURRENT_LIST_DIR}/../themes/dark/css_variables.css" ) diff --git a/backend/source/backend/CMakeLists.txt b/backend/source/backend/CMakeLists.txt index c24efe7..657afce 100644 --- a/backend/source/backend/CMakeLists.txt +++ b/backend/source/backend/CMakeLists.txt @@ -114,8 +114,7 @@ if (NOT OMIT_FRONTEND_BUILD) -DNUI_FIND_FMT=OFF -DBROWSER_ENGINE=${BROWSER_ENGINE} # -DXML_TO_NUI_TOOL=$ - -DFLATPAK_BUILD=${FLATPAK_BUILD} - -DFLATPAK_INCLUDE_DIR=${FLATPAK_INCLUDE_DIR} + -DOFFLINE_BUILD=${OFFLINE_BUILD} ) # add_dependencies(${PROJECT_NAME}-emscripten xml-to-nui) diff --git a/org.nuicpp.nui_sftp.desktop b/org.nuicpp.nui_sftp.desktop new file mode 100644 index 0000000..90d8faf --- /dev/null +++ b/org.nuicpp.nui_sftp.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Name=nui-sftp +Icon=nui_sftp +Comment=A SSH/SFTP client using the NuiCpp UI Framework +Exec=nui-sftp +Terminal=false +Categories=Utility; \ No newline at end of file diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 2572b1a..528c9f7 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -23,6 +23,8 @@ BUILD_DIRECTORY=$(canonicalPath "${BUILD_DIRECTORY}") SOURCE_DIRECTORY="${SOURCE_DIRECTORY:-${SCRIPT_DIR}/..}" SOURCE_DIRECTORY=$(canonicalPath "${SOURCE_DIRECTORY}") +OMIT_FRONTEND="${OMIT_FRONTEND:-false}" + NOLINK="${NOLINK:-false}" # On Windows executeable is called nui-sftp.exe, look if that exsists and then use that as the source for the executable @@ -51,7 +53,9 @@ mkdir -p "${INSTALL_TARGET}/themes/dark" cp "${EXECUTABLE}" "${INSTALL_TARGET}/bin/${EXECUTABLE_NAME}" cp -r "${BUILD_DIRECTORY}/assets/." "${INSTALL_TARGET}/assets" cp -r "${BUILD_DIRECTORY}/themes/." "${INSTALL_TARGET}/themes" -cp -r "${BUILD_DIRECTORY}/module_nui-sftp/bin/." "${INSTALL_TARGET}/frontend" +if [ "$OMIT_FRONTEND" = false ]; then + cp -r "${BUILD_DIRECTORY}/module_nui-sftp/bin/." "${INSTALL_TARGET}/frontend" +fi # Dont create a symlink on windows or if NOLINK is true if [ "$IS_WINDOWS" = false ] && [ "$NOLINK" = false ]; then diff --git a/work_dependencies.json b/work_dependencies.json index 056122f..bc08746 100644 --- a/work_dependencies.json +++ b/work_dependencies.json @@ -8,7 +8,7 @@ }, { "url": "https://github.com/NuiCpp/Nui.git", - "rev": "d91ad07799eea440a017d146dd36f70e19bd091d", + "rev": "d066aebccc5ef40612e4c072ad14686ca8c16072", "branch": "main", "name": "Nui" }, @@ -41,6 +41,48 @@ "rev": "fb33b5f751eed174b930329fbecf52138e63c0cf", "branch": "main", "name": "5cript-nui-components" + }, + { + "url": "https://github.com/5cript/portable-file-dialogs.git", + "rev": "13ac8d8655514486d0d700ea7063dcb05f8363da", + "branch": "main", + "name": "portable-file-dialogs" + }, + { + "url": "https://github.com/5cript/webview.git", + "rev": "1dc3cbda951de8de0ff2ae5cc286b070d61f972d", + "branch": "main", + "name": "webview" + }, + { + "url": "https://github.com/jbeder/yaml-cpp.git", + "rev": "89ff142b991af432b5d7a7cee55282f082a7e629", + "branch": "main", + "name": "yaml-cpp" + }, + { + "url": "https://github.com/rapidfuzz/rapidfuzz-cpp.git", + "rev": "b8ce411e91e01599d0697ad307933e05ddf3a723", + "branch": "main", + "name": "rapidfuzz" + }, + { + "url": "https://github.com/gabime/spdlog.git", + "rev": "v1.17.0", + "branch": "main", + "name": "spdlog" + }, + { + "url": "https://github.com/SpartanJ/efsw.git", + "rev": "87abe599995d5646f5d83cf2e3a225bd73148b3a", + "branch": "main", + "name": "efsw" + }, + { + "url": "https://github.com/5cript/promise-cpp.git", + "rev": "bfad5bdd58f29465741858d826338e5b4ca65826", + "branch": "main", + "name": "promise-cpp" } ] } \ No newline at end of file