diff --git a/.github/workflows/build-clifp-linux.yml b/.github/workflows/build-clifp-linux.yml index 81a1de6..4d4411a 100644 --- a/.github/workflows/build-clifp-linux.yml +++ b/.github/workflows/build-clifp-linux.yml @@ -15,33 +15,40 @@ jobs: build-clifp: name: Build CLIFp - Linux (Release) strategy: + fail-fast: false matrix: - qt_linkage: [static] os: [ubuntu-20.04, ubuntu-22.04] + compiler: [gcc, clang] + lib_linkage: [shared, static] + include: + - os: ubuntu-20.04 + compiler: gcc + c_comp: gcc-10 + cxx_comp: g++-10 + qt_comp: clang12 + - os: ubuntu-20.04 + compiler: clang + c_comp: clang-12 + cxx_comp: clang++-12 + qt_comp: clang12 + - os: ubuntu-22.04 + compiler: gcc + c_comp: gcc-12 + cxx_comp: g++-12 + qt_comp: clang14 + - os: ubuntu-22.04 + compiler: clang + c_comp: clang-14 + cxx_comp: clang++-14 + qt_comp: clang14 + - lib_linkage: shared + cmake_bsl: ON + - lib_linkage: static + cmake_bsl: OFF runs-on: ${{ matrix.os }} env: cmake_gen: Ninja Multi-Config steps: - - name: Set matrix derived variables - uses: kanga333/variable-mapper@v0.3.0 - with: - key: ${{ matrix.os }} - map: | - { - "ubuntu-20.04": { - "c_comp": "clang-12", - "cxx_comp": "clang++-12", - "qt_version": "6.4.2", - "qt_compiler": "clang12" - }, - "ubuntu-22.04": { - "c_comp": "clang-14", - "cxx_comp": "clang++-14", - "qt_version": "6.4.2", - "qt_compiler": "clang14" - } - } - export_to: env,log - name: Set derived variables with shell because GitHub Actions env context sucks run: | echo "clifp_package_path=${{ env.clifp_build_dir }}/out/dist" >> $GITHUB_ENV @@ -51,10 +58,10 @@ jobs: - name: Install Qt (custom build) uses: oblivioncth/actions/general/install-and-cache-qt-from-ffynnon@dev with: - version: ${{ env.qt_version }} + version: 6.4.2 os: linux - compiler: ${{ env.qt_compiler }} - linkage: ${{ matrix.qt_linkage }} + compiler: ${{ matrix.qt_comp }} + linkage: ${{ matrix.lib_linkage }} path: ${{ env.qt_install_dir }} credentials: ${{ secrets.qt_ffynnon_cred }} - name: Update package index @@ -81,20 +88,20 @@ jobs: working-directory: ${{ env.clifp_src_dir }} run: | echo Configuring CMake... - "$qt_cmake" -G "$cmake_gen" -S "$clifp_src_dir" -B "$clifp_build_dir" -D CMAKE_CXX_COMPILER="$cxx_comp" -D CMAKE_C_COMPILER="$c_comp" + "$qt_cmake" -G "$cmake_gen" -S "$clifp_src_dir" -B "$clifp_build_dir" -D BUILD_SHARED_LIBS="${{ matrix.cmake_bsl }}" -D CMAKE_CXX_COMPILER="${{ matrix.cxx_comp }}" -D CMAKE_C_COMPILER="${{ matrix.c_comp }}" echo Changing to build directory... cd "$clifp_build_dir" echo Building CLIFp Release... cmake --build . --target all --config Release echo Installing CLIFp Release - cmake --build . --target install --config Release + cmake --install . --config Release echo Packaging CLIFp... - cpack -C "Debug;Release" + cpack -C "Release" echo Build complete. - name: Get CLIFp artifact name run: | cpack_name=$(find "${{ env.clifp_package_path }}" -type f -name "*.zip") - artifact_name="$(basename "$cpack_name" .zip) [${{ matrix.os }}]" + artifact_name="$(basename "$cpack_name" .zip) [${{ matrix.cxx_comp }}]" echo "current_artifact_name=$artifact_name" >> $GITHUB_ENV - name: Upload CLIFp build artifact uses: actions/upload-artifact@v3 diff --git a/.github/workflows/build-clifp-windows.yml b/.github/workflows/build-clifp-windows.yml index 4fe2f77..1ceb146 100644 --- a/.github/workflows/build-clifp-windows.yml +++ b/.github/workflows/build-clifp-windows.yml @@ -7,7 +7,6 @@ on: required: true env: qt_install_dir: ${{ github.workspace }}/Qt/Install - qt_download_dir: ${{ github.workspace }}/Qt/Download clifp_src_suffix: CLIFp/Source clifp_src_dir: ${{ github.workspace }}/CLIFp/Source clifp_build_dir: ${{ github.workspace }}/CLIFp/Build @@ -16,8 +15,14 @@ jobs: build-clifp: name: Build CLIFp - Windows (Release) strategy: + fail-fast: false matrix: - qt_linkage: [static] + lib_linkage: [shared, static] + include: + - lib_linkage: shared + cmake_bsl: ON + - lib_linkage: static + cmake_bsl: OFF runs-on: windows-latest env: vs_dir: C:/Program Files/Microsoft Visual Studio/2022/Enterprise @@ -32,10 +37,10 @@ jobs: - name: Install Qt (custom build) uses: oblivioncth/actions/general/install-and-cache-qt-from-ffynnon@dev with: - version: 6.4.0 + version: 6.4.2 os: windows compiler: msvc2022 - linkage: ${{ matrix.qt_linkage }} + linkage: ${{ matrix.lib_linkage }} path: ${{ env.qt_install_dir }} credentials: ${{ secrets.qt_ffynnon_cred }} - name: Checkout CLIFp @@ -50,16 +55,19 @@ jobs: echo "Setup C++ Build Environment..." CALL "${{ env.vs_dir }}\Common7\Tools\VsDevCmd.bat" -arch=amd64 echo "Configure CMake using Qt wrapper..." - CALL "${{ env.qt_cmake }}" -G "${{ env.cmake_gen }}" -S "${{ env.clifp_src_dir}}" -B "${{ env.clifp_build_dir }}" + CALL "${{ env.qt_cmake }}" -G "${{ env.cmake_gen }}" -S "${{ env.clifp_src_dir}}" -B "${{ env.clifp_build_dir }}" -D BUILD_SHARED_LIBS=${{ matrix.cmake_bsl }} echo "Changing to build directory..." cd "%clifp_build_dir%" echo "Building CLIFp release..." cmake --build . --target all --config Release echo "Installing CLIFp Release..." - cmake --build . --target install --config Release + cmake --install . --config Release echo "Packaging CLIFp..." cpack -C "Release" echo "Build complete." + - name: Remove VC Runtime Redistributable Added by Qt # Required until an option to disable this is added to Qt + run: | + Remove-Item "${{ env.clifp_install_path }}/bin/vc_redist*" - name: Get CLIFp artifact name run: | $artifact_name=$((Get-ChildItem -Path "${{ env.clifp_package_path }}" -Filter *.zip)[0].BaseName) diff --git a/CMakeLists.txt b/CMakeLists.txt index 113873a..48b975f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,21 +1,32 @@ #================= Project Setup ========================== # CMake -cmake_minimum_required(VERSION 3.21.1) +cmake_minimum_required(VERSION 3.24.0...3.25.0) # Project # NOTE: DON'T USE TRAILING ZEROS IN VERSIONS project(CLIFp - VERSION 0.9.3.1 + VERSION 0.9.4 LANGUAGES CXX DESCRIPTION "Command-line Interface for Flashpoint" ) -set(FORMAL_NAME "CLI Flashpoint") -string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LC) -string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) +# Get helper scripts +include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FetchOBCMake.cmake) +fetch_ob_cmake("v0.3") + +# Initialize project according to standard rules +include(OB/Project) +ob_standard_project_setup() + +# Additional Project Variables +set(PROJECT_FORMAL_NAME "CLI Flashpoint") set(TARGET_FP_VERSION_PREFIX 11.1) +# Configuration options +# Handled by fetched libs, but set this here formally since they aren't part of the main project +option(BUILD_SHARED_LIBS "Build CLIFp with shared libraries" OFF) + # C++ set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -28,60 +39,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL Windows) enable_language("RC") endif() -# Add local modules -set(PROJ_SCRIPTS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -list(APPEND CMAKE_MODULE_PATH "${PROJ_SCRIPTS_PATH}/module") - -# Get helper scripts -include(CLIFp/FetchOBCMake) -fetch_ob_cmake("v0.2") - -# General Variables -if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(TARGET_ARCH x64) -else() - set(TARGET_ARCH x86) -endif() - -#--------------Top Level Project Setup------------- - -if(${PROJECT_IS_TOP_LEVEL}) - message(STATUS "NOTE: ${PROJECT_NAME} is being configured as a top-level project") - - # Install (override the CMake default, but not a user set value) - if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/out/install" - CACHE PATH "Project install path" FORCE - ) - endif() - - # Clean install when clean target is ran - set_directory_properties(PROPERTIES ADDITIONAL_CLEAN_FILES "${CMAKE_INSTALL_PREFIX}") -else() - message(STATUS "NOTE: ${PROJECT_NAME} is being configured as a sub-project") - - # Keep install components out of 'all' target - set(SUB_PROJ_EXCLUDE_FROM_ALL "EXCLUDE_FROM_ALL") -endif() - -#--------------------Setup Paths------------------- - -# Cmake scripts -set(FILE_TEMPLATES_PATH "${PROJ_SCRIPTS_PATH}/file_templates") - -# Package -set(PACKAGE_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/out/dist") - -#------------Set Global Build Rules---------------- - -# Versioning -include(OB/VerboseVersioning) -setup_verbose_versioning(PROJECT_VERSION_VERBOSE) - #================= Build ========================= # Import Qt -find_package(Qt6 REQUIRED COMPONENTS +set(CLIFP_QT_COMPONENTS Core Gui Widgets @@ -89,11 +50,12 @@ find_package(Qt6 REQUIRED COMPONENTS Network ) -# Disable deprecated code +# Find Qt package add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x060000) +find_package(Qt6 REQUIRED COMPONENTS ${CLIFP_QT_COMPONENTS}) # Fetch Qx (build and import from source) -set(QX_FETCH_COMPONENTS +set(CLIFP_QX_COMPONENTS Core Io Network @@ -101,107 +63,59 @@ set(QX_FETCH_COMPONENTS ) if(CMAKE_SYSTEM_NAME STREQUAL Windows) - list(APPEND QX_FETCH_COMPONENTS Windows) + list(APPEND CLIFP_QX_COMPONENTS Windows) endif() if(CMAKE_SYSTEM_NAME STREQUAL Linux) - list(APPEND QX_FETCH_COMPONENTS Linux) + list(APPEND CLIFP_QX_COMPONENTS Linux) endif() include(OB/FetchQx) -fetch_qx( - REF "ae110210c06ae23f7ffb42891d45206db7fdad54" +ob_fetch_qx( + REF "v0.5" COMPONENTS - ${QX_FETCH_COMPONENTS} + ${CLIFP_QX_COMPONENTS} ) # Fetch libfp (build and import from source) include(OB/Fetchlibfp) -fetch_libfp("v0.2") +ob_fetch_libfp("v0.3") # Fetch QI-QMP (build and import from source) include(OB/FetchQI-QMP) -fetch_qi_qmp("v0.2") +ob_fetch_qi_qmp("v0.2.1") # Fetch QuaZip (build and import from source) -include (OB/FetchQuaZip) -fetch_quazip("v1.3") +include(OB/FetchQuaZip) +ob_fetch_quazip( + REF "v1.3" + QT_MAJOR_VER "6" +) # Fetch Neargye's Magic Enum include(OB/FetchMagicEnum) -fetch_magicenum("v0.8.0") +ob_fetch_magicenum("v0.8.0") -# Set main target name -# Name here needs to be as unique as possible for when this project is inlcuded -# in another via FetchContent or add_subdirectory (prevent target clashes) -set(MAIN_TARGET_NAME ${PROJECT_NAME_LC}_${PROJECT_NAME_LC}) - -# Process source files and create target -add_subdirectory(src) +# Process Targets +set(APP_TARGET_NAME ${PROJECT_NAMESPACE_LC}_${PROJECT_NAMESPACE_LC}) +set(APP_ALIAS_NAME ${PROJECT_NAMESPACE}) +add_subdirectory(app) #--------------------Package Config----------------------- -# Create config file -configure_file("${FILE_TEMPLATES_PATH}/${PROJECT_NAME}Config.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake" - @ONLY -) - -# Create version config file -include(CMakePackageConfigHelpers) -write_basic_package_version_file( - "${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake" - VERSION ${PROJECT_VERSION} - COMPATIBILITY SameMinorVersion +ob_standard_project_package_config( + COMPATIBILITY "SameMinorVersion" + CONFIG STANDARD + TARGET_CONFIGS + TARGET "${PROJECT_NAMESPACE}::${APP_ALIAS_NAME}" COMPONENT "${APP_ALIAS_NAME}" DEFAULT ) #================= Install ========================== -set(TOP_LEVEL_INSTALL_COMPONENT ${PROJECT_NAME_LC}) - -# Install package target export -install(EXPORT ${PROJECT_NAME}Targets - CONFIGURATIONS Release - COMPONENT ${MAIN_TARGET_NAME} - FILE "${PROJECT_NAME}Targets.cmake" - NAMESPACE ${PROJECT_NAME}:: - DESTINATION cmake - ${SUB_PROJ_EXCLUDE_FROM_ALL} # "EXCLUDE_FROM_ALL" if project is not top-level -) - -# Install package config -install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake" - CONFIGURATIONS Release - COMPONENT ${MAIN_TARGET_NAME} - DESTINATION cmake - ${SUB_PROJ_EXCLUDE_FROM_ALL} # "EXCLUDE_FROM_ALL" if project is not top-level -) - -# Install README and LICENSE -install(FILES - "${CMAKE_CURRENT_SOURCE_DIR}/README.md" - "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" - COMPONENT ${TOP_LEVEL_INSTALL_COMPONENT} - DESTINATION . - ${SUB_PROJ_EXCLUDE_FROM_ALL} # "EXCLUDE_FROM_ALL" if project is not top-level -) - -#========Export For In-tree Builds ================= -# For in source builds -export(EXPORT ${PROJECT_NAME}Targets - FILE "${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}Targets.cmake" - NAMESPACE ${PROJECT_NAME}:: -) +ob_standard_project_misc_install() #====================== CPack ============================== -set(CPACK_PACKAGE_VENDOR "oblivioncth") -set(CPACK_PACKAGE_DIRECTORY "${PACKAGE_PREFIX}") -set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}_${PROJECT_VERSION_VERBOSE}_${CMAKE_SYSTEM_NAME}_${TARGET_ARCH}") -set(CPACK_GENERATOR "ZIP") -set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") -set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md") -include(CPack) +include(OB/Packaging) +ob_standard_project_package(VENDOR "oblivioncth") diff --git a/README.md b/README.md index 7dd710e..191cc4c 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,9 @@ That being said, it is perfectly possible to use CLIFp in any manner one sees fi It is recommended to place CLIFp in the root directory of Flashpoint (next to its shortcut), but CLIFp will search all parent directories in order for the root Flashpoint structure and therefore will work correctly in any Flashpoint sub-folder. However, this obviously won't work if CLIFp is behind a symlink/junction. +### Builds +**In most cases you should use the 'static' builds of CLIFp on Windows or Linux.** + ### General **NOTE: Do not run CLIFp as an administrator/root as some titles may not work correctly or run at all** @@ -263,10 +266,10 @@ Once CLIFp has finished executing an exit code is reported that indicates the "e ### Summary - C++20 - - CMake 3.21.1 + - CMake 3.24.0 - Targets: - Windows 10+ - - Linux (Tested on Ubuntu 20.04) + - Linux ### Dependencies - Qt6 @@ -275,11 +278,7 @@ Once CLIFp has finished executing an exit code is reported that indicates the "e - [QI-QMP](https://github.com/oblivioncth/QI-QMP/) - [QuaZip](https://github.com/stachenov/quazip) - [Neargye's Magic Enum](https://github.com/Neargye/magic_enum) - -### Builds -Tested with: - - Windows: MSVC2022 - - Linux: Clang 12 +- [OBCMake](https://github.com/oblivioncth/OBCmake) ### Details The source for this project is managed by a sensible CMake configuration that allows for straightforward compilation and consumption of its target(s), either as a sub-project or as an imported package. All required dependencies except for Qt6 are automatically acquired via CMake's FetchContent mechanism. \ No newline at end of file diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt new file mode 100644 index 0000000..af9ab1b --- /dev/null +++ b/app/CMakeLists.txt @@ -0,0 +1,140 @@ +#================= Common Build ========================= + +# Pre-configure target +set(CLIFP_SOURCE + kernel/core.h + kernel/core.cpp + kernel/driver.h + kernel/driver.cpp + kernel/errorcode.h + command/command.h + command/command.cpp + command/c-link.h + command/c-link.cpp + command/c-play.h + command/c-play.cpp + command/c-prepare.h + command/c-prepare.cpp + command/c-run.h + command/c-run.cpp + command/c-show.cpp + command/c-show.h + task/task.h + task/task.cpp + task/t-download.h + task/t-download.cpp + task/t-exec.h + task/t-exec.cpp + task/t-extra.h + task/t-extra.cpp + task/t-extract.h + task/t-extract.cpp + task/t-message.h + task/t-message.cpp + task/t-mount.h + task/t-mount.cpp + task/t-sleep.h + task/t-sleep.cpp + tools/blockingprocessmanager.h + tools/blockingprocessmanager.cpp + tools/deferredprocessmanager.h + tools/deferredprocessmanager.cpp + tools/mounter.h + tools/mounter.cpp + frontend/statusrelay.h + frontend/statusrelay.cpp + controller.h + controller.cpp + utility.h + utility.cpp + main.cpp +) + +set(CLIFP_LINKS + PRIVATE + Qt6::Core + Qt6::Gui + Qt6::Widgets + Qt6::Sql + Qt6::Network + Qx::Core + Qx::Io + Qx::Network + Qx::Widgets + Fp::Fp + QI-QMP::Qmpi + QuaZip::QuaZip + magic_enum::magic_enum +) + +if(CMAKE_SYSTEM_NAME STREQUAL Windows) + list(APPEND CLIFP_SOURCE + command/c-link_win.cpp + task/t-exec_win.cpp + task/t-bideprocess.h + task/t-bideprocess.cpp + tools/processbider.h + tools/processbider.cpp + ) + + list(APPEND CLIFP_LINKS + PRIVATE + Qx::Windows + ) +endif() + +if(CMAKE_SYSTEM_NAME STREQUAL Linux) + list(APPEND CLIFP_SOURCE + command/c-link_linux.cpp + task/t-awaitdocker.h + task/t-awaitdocker.cpp + task/t-exec_linux.cpp + ) + list(APPEND CLIFP_LINKS + PRIVATE + Qx::Linux + ) +endif() + +# Add via ob standard executable +include(OB/Executable) +ob_add_standard_executable(${APP_TARGET_NAME} + NAMESPACE "${PROJECT_NAMESPACE}" + ALIAS "${APP_ALIAS_NAME}" + SOURCE ${CLIFP_SOURCE} + RESOURCE "resources.qrc" + LINKS ${CLIFP_LINKS} + CONFIG STANDARD + WIN32 +) + +## Forward select project variables to C++ code +include(OB/CppVars) +ob_add_cpp_vars(${APP_TARGET_NAME} + NAME "project_vars" + PREFIX "PROJECT_" + VARS + VERSION_STR "\"${PROJECT_VERSION}\"" + SHORT_NAME "\"${APP_ALIAS_NAME}\"" + TARGET_FP_VER_PFX_STR "\"${TARGET_FP_VERSION_PREFIX}\"" + APP_NAME "\"${PROJECT_FORMAL_NAME}\"" +) + +## Add exe details on Windows +if(CMAKE_SYSTEM_NAME STREQUAL Windows) + # Set target exe details + include(OB/WinExecutableDetails) + ob_set_win_executable_details(${APP_TARGET_NAME} + ICON "${CMAKE_CURRENT_SOURCE_DIR}/res/app/CLIFp.ico" + FILE_VER ${PROJECT_VERSION} + PRODUCT_VER ${TARGET_FP_VERSION_PREFIX} + COMPANY_NAME "oblivioncth" + FILE_DESC "CLI for BlueMaxima's Flashpoint" + INTERNAL_NAME "CLIFp" + COPYRIGHT "Open Source @ 2022 oblivioncth" + TRADEMARKS_ONE "All Rights Reserved" + TRADEMARKS_TWO "GNU AGPL V3" + ORIG_FILENAME "CLIFp.exe" + PRODUCT_NAME "${PROJECT_FORMAL_NAME}" + ) +endif() diff --git a/res/app/128x128/CLIFp.png b/app/res/app/128x128/CLIFp.png old mode 100755 new mode 100644 similarity index 100% rename from res/app/128x128/CLIFp.png rename to app/res/app/128x128/CLIFp.png diff --git a/res/app/16x16/CLIFp.png b/app/res/app/16x16/CLIFp.png similarity index 100% rename from res/app/16x16/CLIFp.png rename to app/res/app/16x16/CLIFp.png diff --git a/res/app/256x256/CLIFp.png b/app/res/app/256x256/CLIFp.png similarity index 100% rename from res/app/256x256/CLIFp.png rename to app/res/app/256x256/CLIFp.png diff --git a/res/app/32x32/CLIFp.png b/app/res/app/32x32/CLIFp.png similarity index 100% rename from res/app/32x32/CLIFp.png rename to app/res/app/32x32/CLIFp.png diff --git a/res/app/48x48/CLIFp.png b/app/res/app/48x48/CLIFp.png similarity index 100% rename from res/app/48x48/CLIFp.png rename to app/res/app/48x48/CLIFp.png diff --git a/res/app/64x64/CLIFp.png b/app/res/app/64x64/CLIFp.png old mode 100755 new mode 100644 similarity index 100% rename from res/app/64x64/CLIFp.png rename to app/res/app/64x64/CLIFp.png diff --git a/res/app/CLIFp.ico b/app/res/app/CLIFp.ico similarity index 100% rename from res/app/CLIFp.ico rename to app/res/app/CLIFp.ico diff --git a/res/resources.qrc b/app/res/resources.qrc similarity index 100% rename from res/resources.qrc rename to app/res/resources.qrc diff --git a/res/tray/Exit.png b/app/res/tray/Exit.png similarity index 100% rename from res/tray/Exit.png rename to app/res/tray/Exit.png diff --git a/src/command/c-link.cpp b/app/src/command/c-link.cpp similarity index 100% rename from src/command/c-link.cpp rename to app/src/command/c-link.cpp diff --git a/src/command/c-link.h b/app/src/command/c-link.h similarity index 100% rename from src/command/c-link.h rename to app/src/command/c-link.h diff --git a/src/command/c-link_linux.cpp b/app/src/command/c-link_linux.cpp similarity index 100% rename from src/command/c-link_linux.cpp rename to app/src/command/c-link_linux.cpp diff --git a/src/command/c-link_win.cpp b/app/src/command/c-link_win.cpp similarity index 100% rename from src/command/c-link_win.cpp rename to app/src/command/c-link_win.cpp diff --git a/src/command/c-play.cpp b/app/src/command/c-play.cpp similarity index 100% rename from src/command/c-play.cpp rename to app/src/command/c-play.cpp diff --git a/src/command/c-play.h b/app/src/command/c-play.h similarity index 100% rename from src/command/c-play.h rename to app/src/command/c-play.h diff --git a/src/command/c-prepare.cpp b/app/src/command/c-prepare.cpp similarity index 100% rename from src/command/c-prepare.cpp rename to app/src/command/c-prepare.cpp diff --git a/src/command/c-prepare.h b/app/src/command/c-prepare.h similarity index 100% rename from src/command/c-prepare.h rename to app/src/command/c-prepare.h diff --git a/src/command/c-run.cpp b/app/src/command/c-run.cpp similarity index 100% rename from src/command/c-run.cpp rename to app/src/command/c-run.cpp diff --git a/src/command/c-run.h b/app/src/command/c-run.h similarity index 100% rename from src/command/c-run.h rename to app/src/command/c-run.h diff --git a/src/command/c-show.cpp b/app/src/command/c-show.cpp similarity index 100% rename from src/command/c-show.cpp rename to app/src/command/c-show.cpp diff --git a/src/command/c-show.h b/app/src/command/c-show.h similarity index 100% rename from src/command/c-show.h rename to app/src/command/c-show.h diff --git a/src/command/command.cpp b/app/src/command/command.cpp similarity index 100% rename from src/command/command.cpp rename to app/src/command/command.cpp diff --git a/src/command/command.h b/app/src/command/command.h similarity index 100% rename from src/command/command.h rename to app/src/command/command.h diff --git a/src/controller.cpp b/app/src/controller.cpp similarity index 100% rename from src/controller.cpp rename to app/src/controller.cpp diff --git a/src/controller.h b/app/src/controller.h similarity index 100% rename from src/controller.h rename to app/src/controller.h diff --git a/src/frontend/statusrelay.cpp b/app/src/frontend/statusrelay.cpp similarity index 100% rename from src/frontend/statusrelay.cpp rename to app/src/frontend/statusrelay.cpp diff --git a/src/frontend/statusrelay.h b/app/src/frontend/statusrelay.h similarity index 100% rename from src/frontend/statusrelay.h rename to app/src/frontend/statusrelay.h diff --git a/src/kernel/core.cpp b/app/src/kernel/core.cpp similarity index 100% rename from src/kernel/core.cpp rename to app/src/kernel/core.cpp diff --git a/src/kernel/core.h b/app/src/kernel/core.h similarity index 99% rename from src/kernel/core.h rename to app/src/kernel/core.h index 4d0d460..7dce378 100644 --- a/src/kernel/core.h +++ b/app/src/kernel/core.h @@ -18,7 +18,7 @@ #include // libfp Includes -#include +#include // Project Includes #include "task/task.h" diff --git a/src/kernel/driver.cpp b/app/src/kernel/driver.cpp similarity index 100% rename from src/kernel/driver.cpp rename to app/src/kernel/driver.cpp diff --git a/src/kernel/driver.h b/app/src/kernel/driver.h similarity index 100% rename from src/kernel/driver.h rename to app/src/kernel/driver.h diff --git a/src/kernel/errorcode.h b/app/src/kernel/errorcode.h similarity index 100% rename from src/kernel/errorcode.h rename to app/src/kernel/errorcode.h diff --git a/src/main.cpp b/app/src/main.cpp similarity index 100% rename from src/main.cpp rename to app/src/main.cpp diff --git a/src/task/t-awaitdocker.cpp b/app/src/task/t-awaitdocker.cpp similarity index 100% rename from src/task/t-awaitdocker.cpp rename to app/src/task/t-awaitdocker.cpp diff --git a/src/task/t-awaitdocker.h b/app/src/task/t-awaitdocker.h similarity index 100% rename from src/task/t-awaitdocker.h rename to app/src/task/t-awaitdocker.h diff --git a/src/task/t-bideprocess.cpp b/app/src/task/t-bideprocess.cpp similarity index 100% rename from src/task/t-bideprocess.cpp rename to app/src/task/t-bideprocess.cpp diff --git a/src/task/t-bideprocess.h b/app/src/task/t-bideprocess.h similarity index 100% rename from src/task/t-bideprocess.h rename to app/src/task/t-bideprocess.h diff --git a/src/task/t-download.cpp b/app/src/task/t-download.cpp similarity index 100% rename from src/task/t-download.cpp rename to app/src/task/t-download.cpp diff --git a/src/task/t-download.h b/app/src/task/t-download.h similarity index 100% rename from src/task/t-download.h rename to app/src/task/t-download.h diff --git a/src/task/t-exec.cpp b/app/src/task/t-exec.cpp similarity index 100% rename from src/task/t-exec.cpp rename to app/src/task/t-exec.cpp diff --git a/src/task/t-exec.h b/app/src/task/t-exec.h similarity index 100% rename from src/task/t-exec.h rename to app/src/task/t-exec.h diff --git a/src/task/t-exec_linux.cpp b/app/src/task/t-exec_linux.cpp similarity index 100% rename from src/task/t-exec_linux.cpp rename to app/src/task/t-exec_linux.cpp diff --git a/src/task/t-exec_win.cpp b/app/src/task/t-exec_win.cpp similarity index 100% rename from src/task/t-exec_win.cpp rename to app/src/task/t-exec_win.cpp diff --git a/src/task/t-extra.cpp b/app/src/task/t-extra.cpp similarity index 100% rename from src/task/t-extra.cpp rename to app/src/task/t-extra.cpp diff --git a/src/task/t-extra.h b/app/src/task/t-extra.h similarity index 100% rename from src/task/t-extra.h rename to app/src/task/t-extra.h diff --git a/src/task/t-extract.cpp b/app/src/task/t-extract.cpp similarity index 100% rename from src/task/t-extract.cpp rename to app/src/task/t-extract.cpp diff --git a/src/task/t-extract.h b/app/src/task/t-extract.h similarity index 100% rename from src/task/t-extract.h rename to app/src/task/t-extract.h diff --git a/src/task/t-message.cpp b/app/src/task/t-message.cpp similarity index 100% rename from src/task/t-message.cpp rename to app/src/task/t-message.cpp diff --git a/src/task/t-message.h b/app/src/task/t-message.h similarity index 100% rename from src/task/t-message.h rename to app/src/task/t-message.h diff --git a/src/task/t-mount.cpp b/app/src/task/t-mount.cpp similarity index 100% rename from src/task/t-mount.cpp rename to app/src/task/t-mount.cpp diff --git a/src/task/t-mount.h b/app/src/task/t-mount.h similarity index 100% rename from src/task/t-mount.h rename to app/src/task/t-mount.h diff --git a/src/task/t-sleep.cpp b/app/src/task/t-sleep.cpp similarity index 100% rename from src/task/t-sleep.cpp rename to app/src/task/t-sleep.cpp diff --git a/src/task/t-sleep.h b/app/src/task/t-sleep.h similarity index 100% rename from src/task/t-sleep.h rename to app/src/task/t-sleep.h diff --git a/src/task/task.cpp b/app/src/task/task.cpp similarity index 100% rename from src/task/task.cpp rename to app/src/task/task.cpp diff --git a/src/task/task.h b/app/src/task/task.h similarity index 100% rename from src/task/task.h rename to app/src/task/task.h diff --git a/src/tools/blockingprocessmanager.cpp b/app/src/tools/blockingprocessmanager.cpp similarity index 100% rename from src/tools/blockingprocessmanager.cpp rename to app/src/tools/blockingprocessmanager.cpp diff --git a/src/tools/blockingprocessmanager.h b/app/src/tools/blockingprocessmanager.h similarity index 100% rename from src/tools/blockingprocessmanager.h rename to app/src/tools/blockingprocessmanager.h diff --git a/src/tools/deferredprocessmanager.cpp b/app/src/tools/deferredprocessmanager.cpp similarity index 100% rename from src/tools/deferredprocessmanager.cpp rename to app/src/tools/deferredprocessmanager.cpp diff --git a/src/tools/deferredprocessmanager.h b/app/src/tools/deferredprocessmanager.h similarity index 100% rename from src/tools/deferredprocessmanager.h rename to app/src/tools/deferredprocessmanager.h diff --git a/src/tools/mounter.cpp b/app/src/tools/mounter.cpp similarity index 100% rename from src/tools/mounter.cpp rename to app/src/tools/mounter.cpp diff --git a/src/tools/mounter.h b/app/src/tools/mounter.h similarity index 100% rename from src/tools/mounter.h rename to app/src/tools/mounter.h diff --git a/src/tools/processbider.cpp b/app/src/tools/processbider.cpp similarity index 100% rename from src/tools/processbider.cpp rename to app/src/tools/processbider.cpp diff --git a/src/tools/processbider.h b/app/src/tools/processbider.h similarity index 100% rename from src/tools/processbider.h rename to app/src/tools/processbider.h diff --git a/src/utility.cpp b/app/src/utility.cpp similarity index 100% rename from src/utility.cpp rename to app/src/utility.cpp diff --git a/src/utility.h b/app/src/utility.h similarity index 100% rename from src/utility.h rename to app/src/utility.h diff --git a/cmake/module/CLIFp/FetchOBCMake.cmake b/cmake/FetchOBCMake.cmake similarity index 100% rename from cmake/module/CLIFp/FetchOBCMake.cmake rename to cmake/FetchOBCMake.cmake diff --git a/cmake/file_templates/CLIFpConfig.cmake.in b/cmake/file_templates/CLIFpConfig.cmake.in deleted file mode 100644 index 0865ae9..0000000 --- a/cmake/file_templates/CLIFpConfig.cmake.in +++ /dev/null @@ -1 +0,0 @@ -include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index 2f1f756..0000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -1,204 +0,0 @@ -#================= Common Build ========================= - -# Allow includes relative to source root -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -# Get path to resources -set(RESOURCE_PATH "${PROJECT_SOURCE_DIR}/res") - -# Add executable target -qt_add_executable(${MAIN_TARGET_NAME} WIN32) - -# Make alias target so target can be referred to with its friendly -# export name both internally and when part of another build tree -add_executable(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${MAIN_TARGET_NAME}) - -set(QT_RESOURCES - ${RESOURCE_PATH}/resources.qrc -) - -# Create source group for QT resources -source_group(TREE "${RESOURCE_PATH}" - PREFIX "Resource Files" - FILES ${QT_RESOURCES} -) - -# Set app sources -set(CXX_SOURCES - kernel/core.h - kernel/core.cpp - kernel/driver.h - kernel/driver.cpp - kernel/errorcode.h - command/command.h - command/command.cpp - command/c-link.h - command/c-link.cpp - command/c-play.h - command/c-play.cpp - command/c-prepare.h - command/c-prepare.cpp - command/c-run.h - command/c-run.cpp - command/c-show.cpp - command/c-show.h - task/task.h - task/task.cpp - task/t-download.h - task/t-download.cpp - task/t-exec.h - task/t-exec.cpp - task/t-extra.h - task/t-extra.cpp - task/t-extract.h - task/t-extract.cpp - task/t-message.h - task/t-message.cpp - task/t-mount.h - task/t-mount.cpp - task/t-sleep.h - task/t-sleep.cpp - tools/blockingprocessmanager.h - tools/blockingprocessmanager.cpp - tools/deferredprocessmanager.h - tools/deferredprocessmanager.cpp - tools/mounter.h - tools/mounter.cpp - frontend/statusrelay.h - frontend/statusrelay.cpp - controller.h - controller.cpp - utility.h - utility.cpp - main.cpp -) - -# Add sources to target -target_sources(${MAIN_TARGET_NAME} - PRIVATE - ${CXX_SOURCES} - ${QT_RESOURCES} -) - -# Link target to libraries -target_link_libraries(${MAIN_TARGET_NAME} - PRIVATE - Qt6::Core - Qt6::Gui - Qt6::Widgets - Qt6::Sql - Qt6::Network - Qx::Core - Qx::Io - Qx::Network - Qx::Widgets - Fp::Flashpoint - QI-QMP::Qmpi - QuaZip::QuaZip - magic_enum::magic_enum -) - -# Configure target properties -set_target_properties(${MAIN_TARGET_NAME} PROPERTIES - EXPORT_NAME "${PROJECT_NAME}" -) - -## Forward select project variables to C++ code -include(OB/CppVars) -add_cpp_vars(${MAIN_TARGET_NAME} - NAME "project_vars" - PREFIX "PROJECT_" - VARS - VERSION_STR "\"${PROJECT_VERSION}\"" - SHORT_NAME "\"${PROJECT_NAME}\"" - TARGET_FP_VER_PFX_STR "\"${TARGET_FP_VERSION_PREFIX}\"" - APP_NAME "\"${FORMAL_NAME}\"" -) - -################# Windows Build ################# -if(CMAKE_SYSTEM_NAME STREQUAL Windows) - # Sources - target_sources(${MAIN_TARGET_NAME} - PRIVATE - command/c-link_win.cpp - task/t-exec_win.cpp - task/t-bideprocess.h - task/t-bideprocess.cpp - tools/processbider.h - tools/processbider.cpp - ) - - # Links - target_link_libraries(${MAIN_TARGET_NAME} - PRIVATE - Qx::Windows - ) - - # Target properties - # Only set the target version on Windows because on Linux it - # causes the executable to have the version number as a suffix - # (doesn't seem like this can be disabled). The number is set - # on the target primarily for posterity anyway as it only tags - # the binary with the version in a place that doesn't seem to - # be user visible or really used in any significant way - set_target_properties(${MAIN_TARGET_NAME} PROPERTIES - VERSION ${PROJECT_VERSION} - ) - - # Configure target properties - set_target_properties(${MAIN_TARGET_NAME} PROPERTIES - OUTPUT_NAME "${PROJECT_NAME}" - ) - - # Set target exe details - include(OB/WinExecutableDetails) - set_win_executable_details(${MAIN_TARGET_NAME} - ICON "${RESOURCE_PATH}/app/CLIFp.ico" - FILE_VER ${PROJECT_VERSION} - PRODUCT_VER ${TARGET_FP_VERSION_PREFIX} - COMPANY_NAME "oblivioncth" - FILE_DESC "CLI for BlueMaxima's Flashpoint" - INTERNAL_NAME "CLIFp" - COPYRIGHT "Open Source @ 2022 oblivioncth" - TRADEMARKS_ONE "All Rights Reserved" - TRADEMARKS_TWO "GNU AGPL V3" - ORIG_FILENAME "CLIFp.exe" - PRODUCT_NAME "${FORMAL_NAME}" - ) -endif() - - -################# Linux Build ################# -if(CMAKE_SYSTEM_NAME STREQUAL Linux) - # Sources - target_sources(${MAIN_TARGET_NAME} - PRIVATE - command/c-link_linux.cpp - task/t-awaitdocker.h - task/t-awaitdocker.cpp - task/t-exec_linux.cpp - ) - - # Links - target_link_libraries(${MAIN_TARGET_NAME} - PRIVATE - Qx::Linux - ) - - # Configure target properties - set_target_properties(${MAIN_TARGET_NAME} PROPERTIES - OUTPUT_NAME "${PROJECT_NAME_LC}" - ) -endif() - - -#================= Install ========================== - -# Install executable -install(TARGETS ${MAIN_TARGET_NAME} - CONFIGURATIONS Release - COMPONENT ${MAIN_TARGET_NAME} - EXPORT ${PROJECT_NAME}Targets - ${SUB_PROJ_EXCLUDE_FROM_ALL} # "EXCLUDE_FROM_ALL" if project is not top-level - RUNTIME DESTINATION bin -)