diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 45570471e..c638800ad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,17 +103,14 @@ jobs: BITROCK_LICENSE: ${{ secrets.BITROCK_LICENSE }} - name: Install dependencies run: | - sudo apt-get -y install dbus-x11 doxygen graphviz libglu1-mesa-dev libopus-dev libsodium-dev libpulse-dev libdbus-1-dev libevent-dev libpng-dev + sudo apt-get -y install dbus-x11 doxygen graphviz libglu1-mesa-dev libopus-dev libsodium-dev libpulse-dev libdbus-1-dev libevent-dev libpng-dev ninja-build + pip3 install requests sudo cpan Path::Class - name: Checkout repository uses: actions/checkout@v3 with: submodules: true fetch-depth: 0 - - name: Copy dependencies to externals - run: | - dpkg-query -s libsodium23 libevent-core-2.1-7 libpng16-16 - cp $(dpkg-query -L libsodium23 libevent-core-2.1-7 libpng16-16 | grep -E '^/usr/lib/.*\.so\.[0-9]+$') externals/linux-g++/64/lib/ - name: Start DBus session bus run: | dbus-launch --sh-syntax | tee session.sh @@ -132,11 +129,11 @@ jobs: - name: Build swift (without symbols) if: ${{ env.do_symbols != 'true' }} run: | - python3 -u scripts/build.py -w 64 -t gcc -d -j2 -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" 2> >(tee error.log >&2) + python3 -u scripts/build.py -w 64 -t gcc -d -j2 -q "-DVATSIM_KEY_JSON=$vatsim_key_file" 2> >(tee error.log >&2) - name: Build swift (with symbols) if: ${{ env.do_symbols == 'true' }} run: | - python3 -u scripts/build.py -w 64 -t gcc -d -j2 -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" --upload 2> >(tee error.log >&2) + python3 -u scripts/build.py -w 64 -t gcc -d -j2 -q "-DVATSIM_KEY_JSON=$vatsim_key_file" --upload 2> >(tee error.log >&2) - name: Check warnings id: warnings run: | @@ -164,7 +161,7 @@ jobs: env: BACKTRACE_SYMBOL_TOKEN: ${{ secrets.BACKTRACE_SYMBOL_TOKEN }} BACKTRACE_MINIDUMP_TOKEN: ${{ secrets.BACKTRACE_MINIDUMP_TOKEN }} - BITROCK_BUILDER: "$(USERPROFILE)/installbuilder/bin/builder-cli.exe" + BITROCK_BUILDER: "~/installbuilder/bin/builder-cli.exe" outputs: warnings: ${{ steps.warnings.outputs.warnings }} @@ -197,8 +194,7 @@ jobs: BITROCK_LICENSE: ${{ secrets.BITROCK_LICENSE }} - name: Install dependencies run: | - choco install jom --yes - pip install PyInstaller + pip install requests PyInstaller - name: Checkout repository uses: actions/checkout@v3 with: @@ -218,12 +214,12 @@ jobs: if: ${{ env.do_symbols != 'true' }} shell: bash run: | - python -u scripts/build.py -w 64 -t msvc -d -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" 2>&1 | tee error.log + python -u scripts/build.py -w 64 -t msvc -d -q "-DVATSIM_KEY_JSON=$vatsim_key_file" 2>&1 | tee error.log - name: Build swift (with symbols) if: ${{ env.do_symbols == 'true' }} shell: bash run: | - python -u scripts/build.py -w 64 -t msvc -d -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" --upload 2>&1 | tee error.log + python -u scripts/build.py -w 64 -t msvc -d -q "-DVATSIM_KEY_JSON=$vatsim_key_file" --upload 2>&1 | tee error.log - name: Check warnings id: warnings run: | @@ -251,7 +247,7 @@ jobs: env: BACKTRACE_SYMBOL_TOKEN: ${{ secrets.BACKTRACE_SYMBOL_TOKEN }} BACKTRACE_MINIDUMP_TOKEN: ${{ secrets.BACKTRACE_MINIDUMP_TOKEN }} - BITROCK_BUILDER: "$(USERPROFILE)/installbuilder/bin/builder-cli.exe" + BITROCK_BUILDER: "~/installbuilder/bin/builder-cli.exe" outputs: warnings: ${{ steps.warnings.outputs.warnings }} @@ -284,7 +280,7 @@ jobs: BITROCK_LICENSE: ${{ secrets.BITROCK_LICENSE }} - name: Install dependencies run: | - choco install jom --yes + pip install requests PyInstaller - name: Checkout repository uses: actions/checkout@v3 with: @@ -304,12 +300,12 @@ jobs: if: ${{ env.do_symbols != 'true' }} shell: bash run: | - python -u scripts/build.py -w 32 -t msvc -d -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" 2>&1 | tee error.log + python -u scripts/build.py -w 32 -t msvc -d -q "-DVATSIM_KEY_JSON=$vatsim_key_file" 2>&1 | tee error.log - name: Build swift (with symbols) if: ${{ env.do_symbols == 'true' }} shell: bash run: | - python -u scripts/build.py -w 32 -t msvc -d -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" --upload 2>&1 | tee error.log + python -u scripts/build.py -w 32 -t msvc -d -q "-DVATSIM_KEY_JSON=$vatsim_key_file" --upload 2>&1 | tee error.log - name: Check warnings id: warnings run: | @@ -379,7 +375,7 @@ jobs: - name: Build swift (without symbols) if: ${{ env.do_symbols != 'true' }} run: | - python3 -u scripts/build.py -w 64 -t clang -d -j2 -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" 2> >(tee error.log >&2) + python3 -u scripts/build.py -w 64 -t clang -d -j2 -q "-DVATSIM_KEY_JSON=$vatsim_key_file" 2> >(tee error.log >&2) - name: Build swift (with symbols) if: ${{ env.do_symbols == 'true' }} run: | diff --git a/.gitignore b/.gitignore index 385440687..1c3dbd18d 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ # Visual Studio stuff /.vs/ /.vscode/ +/CMakeSettings.json # MS tools /config.log @@ -45,3 +46,7 @@ desktop.ini # Jetbrains stuff .idea/** cmake-build-*/ + +# Install folders +/out/ +/dist/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..6210f22d1 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,185 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +cmake_policy(VERSION 3.21) + +cmake_minimum_required(VERSION 3.26) + +if(APPLE) + set(CMAKE_OSX_ARCHITECTURES "x86_64") +endif() + +set(SWIFT_LANGUAGES C CXX) +if(APPLE) + list(APPEND SWIFT_LANGUAGES OBJC OBJCXX) +endif() + +project(swift LANGUAGES ${SWIFT_LANGUAGES}) + +include(cmake/tools.cmake) +include(cmake/pch_config.cmake) +include(CMakeDependentOption) +get_version_number() +configure_target_platform() + +# CMake config +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/lib) + +# Build related options +option(SWIFT_BUILD_SAMPLES "Build samples" ON) +option(SWIFT_BUILD_UNIT_TESTS "Build unit tests" ON) +option(SWIFT_BUILD_DOCUMENTATION "Build documentation" ON) + +cmake_dependent_option(SWIFT_BUILD_FS9_PLUGIN "Build FS9 plugin" ON SWIFT_WIN32 OFF) +cmake_dependent_option(SWIFT_BUILD_FSX_PLUGIN "Build FSX plugin" ON SWIFT_WIN32 OFF) +cmake_dependent_option(SWIFT_BUILD_P3D_PLUGIN "Build P3D plugin" ON WIN32 OFF) +option(SWIFT_BUILD_XPLANE_PLUGIN "Build X-Plane plugin" ON) +cmake_dependent_option(SWIFT_BUILD_XSWIFTBUS "Build xswiftbus" ON "NOT SWIFT_WIN32" OFF) +option(SWIFT_BUILD_FLIGHTGEAR_PLUGIN "Build Flightgear plugin" ON) +option(SWIFT_BUILD_EMULATED_PLUGIN "Build Emulated plugin" ON) +cmake_dependent_option(SWIFT_BUILD_MSFS_PLUGIN "Build MSFS plugin" ON WIN32 OFF) + +option(SWIFT_BUILD_BLACKCORE "Build Blackcore" ON) +option(SWIFT_BUILD_BLACKSOUND "Build Blacksound" ON) +option(SWIFT_BUILD_BLACKINPUT "Build Blackinput" ON) +option(SWIFT_BUILD_BLACKGUI "Build Blackgui" ON) + +option(SWIFT_USE_CRASHPAD "Use crashpad" OFF) + +# VATSIM related options +option(SWIFT_VATSIM_SUPPORT "Build with VATSIM support" ON) +set(VATSIM_KEY_JSON "" CACHE STRING "Path to JSON containing VATSIM key") +load_vatsim_key() + + +if(MSVC) + # This also installs some dlls which we do not need + # but our script to create the installer does not pack them. + # Further they are removed with cleanup.cmake + # see https://gitlab.kitware.com/cmake/cmake/-/issues/17725 + set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION vcredist) + include(InstallRequiredSystemLibraries) + if (SWIFT_WIN32) + install(FILES ${MSVC_REDIST_DIR}/vc_redist.x86.exe DESTINATION vcredist) + else() + install(FILES ${MSVC_REDIST_DIR}/vc_redist.x64.exe DESTINATION vcredist) + endif() +endif() + +# Find dependencies +find_package(Qt5 REQUIRED COMPONENTS Core DBus Gui Multimedia Network OpenGL Concurrent Xml Qml Widgets Svg Test) + +# Global compiler options +if(MSVC) + add_compile_options(/wd4351 /wd4661) + + # https://doc.qt.io/qt-6/qt-disable-unicode-defines.html + add_compile_definitions(UNICODE) + add_compile_definitions(_UNICODE) + + add_compile_options(/utf-8) + add_compile_options(/permissive-) + add_compile_options(/Zc:lambda) + add_compile_options(/FI${PROJECT_SOURCE_DIR}/src/permissiveworkarounds.h) + + # Workaround C1128 error + add_compile_options(/bigobj) +endif() + +if(UNIX AND NOT APPLE) + add_compile_options("-Wno-deprecated") +endif() + +if(UNIX) + add_compile_options("-Wno-deprecated-declarations") +endif() + +if(SWIFT_USE_CRASHPAD) + add_compile_definitions(BLACK_USE_CRASHPAD) +endif() + +if(APPLE) + set(CMAKE_INSTALL_RPATH @loader_path/../lib) +elseif(UNIX) + set(CMAKE_INSTALL_RPATH \$ORIGIN/../lib) +endif() + +if(MSVC) + set(CMAKE_DEBUG_POSTFIX d) +endif() + +# Add external folders +add_subdirectory(cmake/vatsimauth) +add_subdirectory(cmake/qwt_plot) +add_subdirectory(cmake/dbus) +add_subdirectory(cmake/sodium) +add_subdirectory(cmake/msgpack) +add_subdirectory(cmake/rapidjson) +add_subdirectory(cmake/opus) +add_subdirectory(cmake/crashpad) +add_subdirectory(cmake/tls) +add_subdirectory(cmake/simconnect) +add_subdirectory(cmake/dplay) + + +if(SWIFT_BUILD_XSWIFTBUS) + add_subdirectory(cmake/xp) + add_subdirectory(cmake/event) +endif() + +# Add source folders +add_subdirectory(src) +add_subdirectory(resources) + +if(SWIFT_BUILD_UNIT_TESTS) + enable_testing() + add_subdirectory(tests) +endif() + +if(SWIFT_BUILD_SAMPLES) + add_subdirectory(samples) +endif() + +if(SWIFT_BUILD_DOCUMENTATION) + add_custom_target(documentation env DOXY_SRC_ROOT=${swift_SOURCE_DIR} doxygen Doxyfile.qmake WORKING_DIRECTORY ${swift_SOURCE_DIR}/docs) +endif() + +include(cmake/install.cmake) + +if(MSVC) + install(SCRIPT ${PROJECT_SOURCE_DIR}/cmake/cleanup.cmake) +endif() + +# Copy externals to build directory to allow running swift and tests +# TODO This should be put into the corresponding targets responsible for these files and may use TARGET_RUNTIME_DLLS +if(WIN32) + add_custom_target(copy_externals_to_build_dir) + if(SWIFT_WIN32) + set(ARCH_DIR 32) + elseif(SWIFT_WIN64) + set(ARCH_DIR 64) + endif() + add_custom_command(TARGET copy_externals_to_build_dir + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different externals/win32-msvc/${ARCH_DIR}/bin ${PROJECT_BINARY_DIR}/out/bin + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + add_custom_command(TARGET copy_externals_to_build_dir + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different externals/win32-msvc/${ARCH_DIR}/lib ${PROJECT_BINARY_DIR}/out/bin + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +endif() + +message(STATUS "Simulators:") +message(STATUS "\t FS9: ${SWIFT_BUILD_FS9_PLUGIN}") +message(STATUS "\t FSX: ${SWIFT_BUILD_FSX_PLUGIN}") +message(STATUS "\t P3D: ${SWIFT_BUILD_P3D_PLUGIN}") +message(STATUS "\t MSFS: ${SWIFT_BUILD_MSFS_PLUGIN}") +message(STATUS "\t XPLANE: ${SWIFT_BUILD_XPLANE_PLUGIN}") +message(STATUS "\t XSWIFTBUS: ${SWIFT_BUILD_XPLANE_PLUGIN}") +message(STATUS "\t FLIGHTGEAR: ${SWIFT_BUILD_FLIGHTGEAR_PLUGIN}") +message(STATUS "\t EMULATED: ${SWIFT_BUILD_EMULATED_PLUGIN}") diff --git a/cmake/cleanup.cmake b/cmake/cleanup.cmake new file mode 100644 index 000000000..be8d85df6 --- /dev/null +++ b/cmake/cleanup.cmake @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +file(GLOB UNUSED_DLLS ${CMAKE_INSTALL_PREFIX}/vcredist/*.dll) +file(REMOVE ${UNUSED_DLLS}) diff --git a/cmake/crashpad/CMakeLists.txt b/cmake/crashpad/CMakeLists.txt new file mode 100644 index 000000000..2245188c6 --- /dev/null +++ b/cmake/crashpad/CMakeLists.txt @@ -0,0 +1,50 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(externals_crashpad INTERFACE) +target_include_directories(externals_crashpad INTERFACE + ${PROJECT_SOURCE_DIR}/externals/common/include/crashpad + ${PROJECT_SOURCE_DIR}/externals/common/include/crashpad/mini_chromium +) + +if(SWIFT_WIN32) + if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") + target_link_libraries(externals_crashpad INTERFACE + ${PROJECT_SOURCE_DIR}/externals/win32-msvc/32/lib/based.lib + ${PROJECT_SOURCE_DIR}/externals/win32-msvc/32/lib/clientd.lib + ${PROJECT_SOURCE_DIR}/externals/win32-msvc/32/lib/utild.lib + ) + else() + target_link_libraries(externals_crashpad INTERFACE + ${PROJECT_SOURCE_DIR}/externals/win32-msvc/32/lib/base.lib + ${PROJECT_SOURCE_DIR}/externals/win32-msvc/32/lib/client.lib + ${PROJECT_SOURCE_DIR}/externals/win32-msvc/32/lib/util.lib + ) + endif() +elseif(SWIFT_WIN64) + if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") + target_link_libraries(externals_crashpad INTERFACE + ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/based.lib + ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/clientd.lib + ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/utild.lib + ) + else() + target_link_libraries(externals_crashpad INTERFACE + ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/base.lib + ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/client.lib + ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/util.lib + ) + endif() +elseif(APPLE) + target_link_libraries(externals_crashpad INTERFACE + ${PROJECT_SOURCE_DIR}/externals/macx-clang/64/lib/libbase.a + ${PROJECT_SOURCE_DIR}/externals/macx-clang/64/lib/libclient.a + ${PROJECT_SOURCE_DIR}/externals/macx-clang/64/lib/libutil.a + ) +else() + target_link_libraries(externals_crashpad INTERFACE + ${PROJECT_SOURCE_DIR}/externals/linux-g++/64/lib/libbase.a + ${PROJECT_SOURCE_DIR}/externals/linux-g++/64/lib/libclient.a + ${PROJECT_SOURCE_DIR}/externals/linux-g++/64/lib/libutil.a + ) +endif() diff --git a/cmake/dbus/CMakeLists.txt b/cmake/dbus/CMakeLists.txt new file mode 100644 index 000000000..d92474e0e --- /dev/null +++ b/cmake/dbus/CMakeLists.txt @@ -0,0 +1,39 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(externals_dbus SHARED IMPORTED GLOBAL) + + +if(UNIX AND NOT APPLE) + find_package(PkgConfig REQUIRED) + pkg_search_module(DBUS REQUIRED dbus-1) + target_include_directories(externals_dbus INTERFACE ${DBUS_INCLUDE_DIRS}) + set_target_properties(externals_dbus PROPERTIES IMPORTED_LOCATION ${DBUS_LINK_LIBRARIES}) +elseif(SWIFT_WIN32) + target_include_directories(externals_dbus INTERFACE ${PROJECT_SOURCE_DIR}/externals/common/include) + target_include_directories(externals_dbus INTERFACE ${PROJECT_SOURCE_DIR}/externals/win32-msvc/32/include) + + set_target_properties(externals_dbus PROPERTIES IMPORTED_IMPLIB ${PROJECT_SOURCE_DIR}/externals/win32-msvc/32/lib/dbus-1.lib) + set_target_properties(externals_dbus PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/win32-msvc/32/lib/dbus-1-3.dll) + install(IMPORTED_RUNTIME_ARTIFACTS externals_dbus DESTINATION xswiftbus/64) + install(IMPORTED_RUNTIME_ARTIFACTS externals_dbus DESTINATION bin) + install(FILES ${PROJECT_SOURCE_DIR}/externals/win32-msvc/32/bin/dbus-daemon.exe DESTINATION bin) +elseif(SWIFT_WIN64) + target_include_directories(externals_dbus INTERFACE ${PROJECT_SOURCE_DIR}/externals/common/include) + target_include_directories(externals_dbus INTERFACE ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/include) + + set_target_properties(externals_dbus PROPERTIES IMPORTED_IMPLIB ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/dbus-1.lib) + set_target_properties(externals_dbus PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/dbus-1-3.dll) + install(IMPORTED_RUNTIME_ARTIFACTS externals_dbus DESTINATION xswiftbus/64) + install(IMPORTED_RUNTIME_ARTIFACTS externals_dbus DESTINATION bin) + install(FILES ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/bin/dbus-daemon.exe DESTINATION bin) +elseif(APPLE) + target_include_directories(externals_dbus INTERFACE ${PROJECT_SOURCE_DIR}/externals/common/include) + target_include_directories(externals_dbus INTERFACE ${PROJECT_SOURCE_DIR}/externals/macx-clang/64/include/) + + set_target_properties(externals_dbus PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/macx-clang/64/lib/libdbus-1.3.dylib) + install(IMPORTED_RUNTIME_ARTIFACTS externals_dbus DESTINATION xswiftbus/64 PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) + install(IMPORTED_RUNTIME_ARTIFACTS externals_dbus DESTINATION lib PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) + install(FILES ${PROJECT_SOURCE_DIR}/externals/macx-clang/64/bin/dbus-daemon DESTINATION bin) + install(FILES ${PROJECT_SOURCE_DIR}/externals/macx-clang/64/bin/dbus-uuidgen DESTINATION bin) +endif() diff --git a/cmake/dplay/CMakeLists.txt b/cmake/dplay/CMakeLists.txt new file mode 100644 index 000000000..8ffd64cdb --- /dev/null +++ b/cmake/dplay/CMakeLists.txt @@ -0,0 +1,16 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +if(SWIFT_BUILD_FS9_PLUGIN) + set(DPLAY_PATH ${PROJECT_SOURCE_DIR}/externals/win32-msvc/32/include) + if(NOT EXISTS "${DPLAY_PATH}/dplay8.h") + message(WARNING "DPLAY_PATH does not point to dplay include directory. FS9 support disabled.") + set(SWIFT_BUILD_FS9_PLUGIN OFF PARENT_SCOPE) + endif() + + if(SWIFT_BUILD_FS9_PLUGIN) + add_library(externals_dplay INTERFACE IMPORTED GLOBAL) + target_include_directories(externals_dplay INTERFACE ${DPLAY_PATH}) + target_link_libraries(externals_dplay INTERFACE dxguid) + endif() +endif() diff --git a/cmake/event/CMakeLists.txt b/cmake/event/CMakeLists.txt new file mode 100644 index 000000000..b3b141c3b --- /dev/null +++ b/cmake/event/CMakeLists.txt @@ -0,0 +1,30 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(externals_event SHARED IMPORTED GLOBAL) + +target_include_directories(externals_event INTERFACE ${PROJECT_SOURCE_DIR}/externals/common/include) + +if(SWIFT_WIN64) + target_include_directories(externals_event INTERFACE ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/include) + + set_target_properties(externals_event PROPERTIES IMPORTED_IMPLIB ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/event_core.lib) + set_target_properties(externals_event PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/event_core.dll) +elseif(APPLE) + target_include_directories(externals_event INTERFACE ${PROJECT_SOURCE_DIR}/externals/macx-clang/64/include) + set_target_properties(externals_event PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/macx-clang/64/lib/libevent_core.2.1.8.dylib) +else() + find_package(PkgConfig REQUIRED) + pkg_search_module(libevent_core REQUIRED libevent_core) + + # Adapted from CMake file() documentation to resolve symbolic link + file(READ_SYMLINK ${libevent_core_LINK_LIBRARIES} LIBEVENT_CORE_ABS) + if(NOT IS_ABSOLUTE "${LIBEVENT_CORE_ABS}") + get_filename_component(dir "${libevent_core_LINK_LIBRARIES}" DIRECTORY) + set(LIBEVENT_CORE_ABS "${dir}/${LIBEVENT_CORE_ABS}") + endif() + + set_target_properties(externals_event PROPERTIES IMPORTED_LOCATION ${LIBEVENT_CORE_ABS}) +endif() + +install(IMPORTED_RUNTIME_ARTIFACTS externals_event DESTINATION xswiftbus/64 PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) diff --git a/cmake/install.cmake b/cmake/install.cmake new file mode 100644 index 000000000..c32ec53cc --- /dev/null +++ b/cmake/install.cmake @@ -0,0 +1,139 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +# Readme, License etc. +set(GENERAL_FILES + ${swift_SOURCE_DIR}/LICENSES/LicenseRef-swift-pilot-client-1.txt + ${swift_SOURCE_DIR}/LICENSES/LicenseRef-swift-pilot-client-1.html + ) +install(FILES ${GENERAL_FILES} DESTINATION bin) + +# 7za +if(SWIFT_WIN32) + install(FILES ${swift_SOURCE_DIR}/externals/win32-msvc/32/bin/7za.exe DESTINATION bin) +elseif(SWIFT_WIN64) + install(FILES ${swift_SOURCE_DIR}/externals/win32-msvc/64/bin/7za.exe DESTINATION bin) +elseif(APPLE) + install(FILES ${swift_SOURCE_DIR}/externals/macx-clang/64/bin/7za DESTINATION bin) +endif() + +# Crashpad +if(UNIX AND NOT APPLE) + set(crashpad_handler_path ${swift_SOURCE_DIR}/externals/linux-g++/64/bin/swift_crashpad_handler) +elseif(SWIFT_WIN32) + set(crashpad_handler_path ${swift_SOURCE_DIR}/externals/win32-msvc/32/bin/swift_crashpad_handler.exe) +elseif(SWIFT_WIN64) + set(crashpad_handler_path ${swift_SOURCE_DIR}/externals/win32-msvc/64/bin/swift_crashpad_handler.exe) +elseif(APPLE) + set(crashpad_handler_path ${swift_SOURCE_DIR}/externals/macx-clang/64/bin/swift_crashpad_handler) +endif() +install(FILES ${crashpad_handler_path} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) + +# create_dbus_machineid +if(APPLE) + install(FILES ${swift_SOURCE_DIR}/externals/macx-clang/64/bin/create_dbus_machineid.scpt DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) +endif() + +# Deploy qt libs + +# Workaround to get Qt paths for deployment (until switching to Qt6 deployment tool) +if(UNIX AND NOT APPLE) + execute_process(COMMAND qmake -query QT_INSTALL_LIBS OUTPUT_VARIABLE QT_INSTALL_LIBS) + execute_process(COMMAND qmake -query QT_INSTALL_PLUGINS OUTPUT_VARIABLE QT_INSTALL_PLUGINS) + + # Avoid line breaks + string(STRIP ${QT_INSTALL_LIBS} QT_INSTALL_LIBS) + string(STRIP ${QT_INSTALL_PLUGINS} QT_INSTALL_PLUGINS) + + function(installLib path lib) + # Follow symlink + file(REAL_PATH ${path}/${lib} followedLib) + install(FILES ${followedLib} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib RENAME ${lib}) + endfunction() + + + installLib(${QT_INSTALL_LIBS} libQt5Core.so.5) + installLib(${QT_INSTALL_LIBS} libQt5DBus.so.5) + installLib(${QT_INSTALL_LIBS} libQt5Gui.so.5) + installLib(${QT_INSTALL_LIBS} libQt5Multimedia.so.5) + installLib(${QT_INSTALL_LIBS} libQt5MultimediaWidgets.so.5) + installLib(${QT_INSTALL_LIBS} libQt5Network.so.5) + installLib(${QT_INSTALL_LIBS} libQt5OpenGL.so.5) + installLib(${QT_INSTALL_LIBS} libQt5Qml.so.5) + installLib(${QT_INSTALL_LIBS} libQt5Svg.so.5) + installLib(${QT_INSTALL_LIBS} libQt5Widgets.so.5) + installLib(${QT_INSTALL_LIBS} libQt5XcbQpa.so.5) + installLib(${QT_INSTALL_LIBS} libQt5Xml.so.5) + installLib(${QT_INSTALL_LIBS} libQt5MultimediaGstTools.so.5) + + macro(resolve_symlink lib_name) + # Adapted from CMake file() documentation + file(READ_SYMLINK ${ICU_${lib_name}_LIBRARIES} ICU_${lib_name}_ABS) + + if(NOT IS_ABSOLUTE "${ICU_${lib_name}_ABS}") + get_filename_component(dir "${ICU_${lib_name}_LIBRARIES}" DIRECTORY) + set(ICU_${lib_name}_ABS "${dir}/${ICU_${lib_name}_ABS}") + endif() + endmacro() + + + if(EXISTS ${QT_INSTALL_LIBS}/libicui18n.so.56 AND EXISTS ${QT_INSTALL_LIBS}/libicuuc.so.56 AND EXISTS ${QT_INSTALL_LIBS}/libicudata.so.56) + # Use specific requested version that is found in the Qt library dir (at least in the Github Actions environment) + message(STATUS "Install specific libicu version from Qt dir") + installLib(${QT_INSTALL_LIBS} libicui18n.so.56) + installLib(${QT_INSTALL_LIBS} libicuuc.so.56) + installLib(${QT_INSTALL_LIBS} libicudata.so.56) + else() + message(STATUS "Using systems libicu library") + # This might not work for creating the installer as the version can differ + find_package(ICU REQUIRED COMPONENTS i18n uc data) + resolve_symlink(I18N) + resolve_symlink(UC) + resolve_symlink(DATA) + install(FILES ${ICU_I18N_ABS} ${ICU_UC_ABS} ${ICU_DATA_ABS} TYPE LIB) + endif() + + file(GLOB audioPlugins ${QT_INSTALL_PLUGINS}/audio/*.so) + install(FILES ${audioPlugins} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/audio) + + file(GLOB bearerPlugins ${QT_INSTALL_PLUGINS}/bearer/*.so) + install(FILES ${bearerPlugins} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/bearer) + + file(GLOB iconEnginePlugins ${QT_INSTALL_PLUGINS}/iconengines/*.so) + install(FILES ${iconEnginePlugins} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/iconengines) + + file(GLOB imageformatsPlugins ${QT_INSTALL_PLUGINS}/imageformats/*.so) + install(FILES ${imageformatsPlugins} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/imageformats) + + file(GLOB mediaservicePlugins ${QT_INSTALL_PLUGINS}/mediaservice/*.so) + install(FILES ${mediaservicePlugins} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/mediaservice) + + install(FILES ${QT_INSTALL_PLUGINS}/platforms/libqxcb.so DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/platforms) + + file(GLOB platforminputcontextsPlugins ${QT_INSTALL_PLUGINS}/platforminputcontexts/*.so) + install(FILES ${platforminputcontextsPlugins} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/platforminputcontexts) + + file(GLOB platformthemesPlugins ${QT_INSTALL_PLUGINS}/platformthemes/*.so) + install(FILES ${platformthemesPlugins} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/platformthemes) + + file(GLOB xcbglintegrationsPlugins ${QT_INSTALL_PLUGINS}/xcbglintegrations/*.so) + install(FILES ${xcbglintegrationsPlugins} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/xcbglintegrations) + +elseif(WIN32) + install(SCRIPT ${PROJECT_SOURCE_DIR}/cmake/qt_deploy_win.cmake) +elseif(APPLE) + install(SCRIPT ${PROJECT_SOURCE_DIR}/cmake/qt_deploy_mac.cmake) + + # Install plugins + execute_process(COMMAND qmake -query QT_INSTALL_PLUGINS OUTPUT_VARIABLE QT_INSTALL_PLUGINS) + string(STRIP ${QT_INSTALL_PLUGINS} QT_INSTALL_PLUGINS) + + install(DIRECTORY ${QT_INSTALL_PLUGINS}/audio DESTINATION bin FILES_MATCHING PATTERN "*.dylib") + install(DIRECTORY ${QT_INSTALL_PLUGINS}/bearer DESTINATION bin FILES_MATCHING PATTERN "*.dylib") + install(DIRECTORY ${QT_INSTALL_PLUGINS}/iconengines DESTINATION bin FILES_MATCHING PATTERN "*.dylib") + install(DIRECTORY ${QT_INSTALL_PLUGINS}/imageformats DESTINATION bin FILES_MATCHING PATTERN "*.dylib") + install(DIRECTORY ${QT_INSTALL_PLUGINS}/mediaservice DESTINATION bin FILES_MATCHING PATTERN "*.dylib") + install(FILES ${QT_INSTALL_PLUGINS}/platforms/libqcocoa.dylib DESTINATION bin/platforms) + install(DIRECTORY ${QT_INSTALL_PLUGINS}/platforminputcontexts DESTINATION bin FILES_MATCHING PATTERN "*.dylib") + install(DIRECTORY ${QT_INSTALL_PLUGINS}/platformthemes DESTINATION bin FILES_MATCHING PATTERN "*.dylib") +endif() diff --git a/cmake/msgpack/CMakeLists.txt b/cmake/msgpack/CMakeLists.txt new file mode 100644 index 000000000..95d6544d1 --- /dev/null +++ b/cmake/msgpack/CMakeLists.txt @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(externals_msgpack INTERFACE) +target_include_directories(externals_msgpack INTERFACE ${PROJECT_SOURCE_DIR}/externals/common/include) diff --git a/cmake/opus/CMakeLists.txt b/cmake/opus/CMakeLists.txt new file mode 100644 index 000000000..20e7b1e0c --- /dev/null +++ b/cmake/opus/CMakeLists.txt @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(externals_opus SHARED IMPORTED GLOBAL) + + +if(UNIX AND NOT APPLE) + find_package(PkgConfig REQUIRED) + pkg_search_module(OPUS REQUIRED opus) + set_target_properties(externals_opus PROPERTIES IMPORTED_LOCATION ${OPUS_LINK_LIBRARIES}) +else() + target_include_directories(externals_opus INTERFACE ${PROJECT_SOURCE_DIR}/externals/common/include) +endif() + +if(APPLE) + set_target_properties(externals_opus PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/macx-clang/64/lib/libopus.0.dylib) +endif() + +if(SWIFT_WIN32) + set_target_properties(externals_opus PROPERTIES IMPORTED_IMPLIB ${PROJECT_SOURCE_DIR}/externals/win32-msvc/32/lib/opus.lib) + set_target_properties(externals_opus PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/win32-msvc/32/lib/opus.dll) +elseif(SWIFT_WIN64) + set_target_properties(externals_opus PROPERTIES IMPORTED_IMPLIB ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/opus.lib) + set_target_properties(externals_opus PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/opus.dll) +endif() + +if(WIN32 OR APPLE) + install(IMPORTED_RUNTIME_ARTIFACTS externals_opus + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin + ) +endif() diff --git a/cmake/pch_config.cmake b/cmake/pch_config.cmake new file mode 100644 index 000000000..ef0739826 --- /dev/null +++ b/cmake/pch_config.cmake @@ -0,0 +1,170 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +# This file contains definitions for all PCHs. +# The definitions are collected because targets might reuse headers from another target and also adds own headers. +# For example "core" uses the same PCH as "misc" but with additional headers included. + +set(SWIFT_MISC_PCH + [["blackmisc/collection.h"]] + [["blackmisc/containerbase.h"]] + [["blackmisc/dbus.h"]] + [["blackmisc/dictionary.h"]] + [["blackmisc/iterator.h"]] + [["blackmisc/json.h"]] + [["blackmisc/metaclass.h"]] + [["blackmisc/range.h"]] + [["blackmisc/sequence.h"]] + [["blackmisc/valueobject.h"]] + [["blackmisc/verify.h"]] + [["blackmisc/worker.h"]] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +) + +set(SWIFT_CORE_PCH + + + + + + + + + + + + + + + + +) + +set(SWIFT_GUI_PCH + [["blackcore/context/contextapplication.h"]] + [["blackcore/context/contextaudio.h"]] + [["blackcore/context/contextnetwork.h"]] + [["blackcore/context/contextownaircraft.h"]] + [["blackcore/context/contextsimulator.h"]] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +) diff --git a/cmake/qt_deploy_mac.cmake b/cmake/qt_deploy_mac.cmake new file mode 100644 index 000000000..243840b06 --- /dev/null +++ b/cmake/qt_deploy_mac.cmake @@ -0,0 +1,25 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +execute_process(COMMAND qmake -query QT_INSTALL_LIBS OUTPUT_VARIABLE QT_INSTALL_LIBS) + +string(STRIP ${QT_INSTALL_LIBS} QT_INSTALL_LIBS) + +function(copy_framework name) + # MacOS workaround using rsync. Otherwise all headers are also copied. + execute_process(COMMAND rsync -avzl --exclude "Headers*" --exclude "*debug*" ${QT_INSTALL_LIBS}/${name}.framework/ lib/${name}.framework/ WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}) +endfunction() + +copy_framework(QtConcurrent) +copy_framework(QtCore) +copy_framework(QtDBus) +copy_framework(QtGui) +copy_framework(QtMultimedia) +copy_framework(QtNetwork) +copy_framework(QtOpenGL) +copy_framework(QtQml) +copy_framework(QtPrintSupport) +copy_framework(QtSvg) +copy_framework(QtWidgets) +copy_framework(QtXml) + diff --git a/cmake/qt_deploy_win.cmake b/cmake/qt_deploy_win.cmake new file mode 100644 index 000000000..0c5b780d1 --- /dev/null +++ b/cmake/qt_deploy_win.cmake @@ -0,0 +1,29 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +message(STATUS "Running windeployqt") +execute_process(COMMAND qmake -query QT_INSTALL_BINS OUTPUT_VARIABLE QT_INSTALL_BINS) + +string(STRIP ${QT_INSTALL_BINS} QT_INSTALL_BINS) + +execute_process(COMMAND ${QT_INSTALL_BINS}/windeployqt.exe + ${CMAKE_INSTALL_PREFIX}/bin/core.dll + ${CMAKE_INSTALL_PREFIX}/bin/gui.dll + ${CMAKE_INSTALL_PREFIX}/bin/input.dll + ${CMAKE_INSTALL_PREFIX}/bin/misc.dll + ${CMAKE_INSTALL_PREFIX}/bin/sound.dll + ${CMAKE_INSTALL_PREFIX}/bin/swiftcore.exe + ${CMAKE_INSTALL_PREFIX}/bin/swiftdata.exe + ${CMAKE_INSTALL_PREFIX}/bin/swiftguistd.exe + ${CMAKE_INSTALL_PREFIX}/bin/swiftlauncher.exe + --no-translations + --no-compiler-runtime + --no-system-d3d-compiler + --no-opengl-sw + --no-webkit2 + --no-virtualkeyboard + -opengl # not detected automatically + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin) + +# Remove unused files +file(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/bin/playlistformats ${CMAKE_INSTALL_PREFIX}/bin/styles) diff --git a/cmake/qwt_plot/CMakeLists.txt b/cmake/qwt_plot/CMakeLists.txt new file mode 100644 index 000000000..b8ee562d1 --- /dev/null +++ b/cmake/qwt_plot/CMakeLists.txt @@ -0,0 +1,30 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(externals_qwt_plot SHARED IMPORTED GLOBAL) + +target_include_directories(externals_qwt_plot INTERFACE ${PROJECT_SOURCE_DIR}/externals/common/include/qwt) + +if(UNIX AND NOT APPLE) + set_target_properties(externals_qwt_plot PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/linux-g++/64/lib/libqwt.so) +elseif(APPLE) + set_target_properties(externals_qwt_plot PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/macx-clang/64/lib/qwt.framework/qwt) +elseif(SWIFT_WIN32) + set_target_properties(externals_qwt_plot PROPERTIES IMPORTED_IMPLIB ${PROJECT_SOURCE_DIR}/externals/win32-msvc/32/lib/qwt.lib) + set_target_properties(externals_qwt_plot PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/win32-msvc/32/lib/qwt.dll) +elseif(SWIFT_WIN64) + set_target_properties(externals_qwt_plot PROPERTIES IMPORTED_IMPLIB ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/qwt.lib) + set_target_properties(externals_qwt_plot PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/qwt.dll) +endif() + +target_link_libraries(externals_qwt_plot INTERFACE Qt::OpenGL) + +if(APPLE) + # Special handling for qwt.framework + install(DIRECTORY ${PROJECT_SOURCE_DIR}/externals/macx-clang/64/lib/qwt.framework DESTINATION lib) +else() + install(IMPORTED_RUNTIME_ARTIFACTS externals_qwt_plot + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin + ) +endif() diff --git a/cmake/rapidjson/CMakeLists.txt b/cmake/rapidjson/CMakeLists.txt new file mode 100644 index 000000000..dddeaf8f7 --- /dev/null +++ b/cmake/rapidjson/CMakeLists.txt @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(externals_rapidjson INTERFACE) +target_include_directories(externals_rapidjson INTERFACE ${PROJECT_SOURCE_DIR}/externals/common/include) diff --git a/cmake/simconnect/CMakeLists.txt b/cmake/simconnect/CMakeLists.txt new file mode 100644 index 000000000..1f96b245e --- /dev/null +++ b/cmake/simconnect/CMakeLists.txt @@ -0,0 +1,44 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +# Checks if variable for SDK path is set and SimConnect.h does exist in the include path. +# If not, disable building the simulator plugin and emit warning message + +if(SWIFT_BUILD_FSX_PLUGIN OR SWIFT_BUILD_P3D_PLUGIN OR SWIFT_BUILD_MSFS_PLUGIN) + add_library(externals_simconnect INTERFACE IMPORTED GLOBAL) + target_compile_definitions(externals_simconnect INTERFACE SIMCONNECT_H_NOMANIFEST) + target_compile_definitions(externals_simconnect INTERFACE BUID_SIMCONNECT_LIB) + if(SWIFT_WIN64) + target_include_directories(externals_simconnect INTERFACE ${PROJECT_SOURCE_DIR}/externals/common/include/simconnect/P3D-v4) + target_compile_definitions(externals_simconnect INTERFACE P3D_SDK_VERSION=400) + elseif(SWIFT_WIN32) + target_include_directories(externals_simconnect INTERFACE ${PROJECT_SOURCE_DIR}/externals/common/include/simconnect/FSX-XPack) + endif() + + add_custom_target(external_simconnects_dlls) + add_dependencies(externals_simconnect external_simconnects_dlls) + + macro(add_install_command LIB) + add_custom_command(TARGET external_simconnects_dlls + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LIB} ${PROJECT_BINARY_DIR}/out/bin/ + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + install(FILES ${LIB} DESTINATION bin) + endmacro() + + if(SWIFT_WIN32) + add_install_command(${PROJECT_SOURCE_DIR}/externals/win32-msvc/32/lib/SimConnect.dll) + elseif(SWIFT_WIN64) + list(APPEND LIBS SimConnect.MSFS.dll) + list(APPEND LIBS SimConnect.P3D-v4.0.dll) + list(APPEND LIBS SimConnect.P3D-v4.1.dll) + list(APPEND LIBS SimConnect.P3D-v4.2.dll) + list(APPEND LIBS SimConnect.P3D-v4.3.dll) + list(APPEND LIBS SimConnect.P3D-v4.3.dll) + list(APPEND LIBS SimConnect.P3D-v4.5.dll) + + foreach (LIB IN LISTS LIBS) + add_install_command( ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/${LIB}) + endforeach() + endif() +endif() diff --git a/cmake/sodium/CMakeLists.txt b/cmake/sodium/CMakeLists.txt new file mode 100644 index 000000000..df1de6567 --- /dev/null +++ b/cmake/sodium/CMakeLists.txt @@ -0,0 +1,35 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(externals_sodium SHARED IMPORTED GLOBAL) + +if(UNIX AND NOT APPLE) + find_package(PkgConfig REQUIRED) + pkg_search_module(SODIUM REQUIRED libsodium) + + # Adapted from CMake file() documentation to resolve symbolic link + file(READ_SYMLINK ${SODIUM_LINK_LIBRARIES} SODIUM_ABS) + if(NOT IS_ABSOLUTE "${SODIUM_ABS}") + get_filename_component(dir "${SODIUM_LINK_LIBRARIES}" DIRECTORY) + set(SODIUM_ABS "${dir}/${SODIUM_ABS}") + endif() + + set_target_properties(externals_sodium PROPERTIES IMPORTED_LOCATION ${SODIUM_ABS}) +else() + target_include_directories(externals_sodium INTERFACE ${PROJECT_SOURCE_DIR}/externals/common/include) +endif() + +if(APPLE) + set_target_properties(externals_sodium PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/macx-clang/64/lib/libsodium.23.dylib) +elseif(SWIFT_WIN32) + set_target_properties(externals_sodium PROPERTIES IMPORTED_IMPLIB ${PROJECT_SOURCE_DIR}/externals/win32-msvc/32/lib/sodium.lib) + set_target_properties(externals_sodium PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/win32-msvc/32/lib/libsodium.dll) +elseif(SWIFT_WIN64) + set_target_properties(externals_sodium PROPERTIES IMPORTED_IMPLIB ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/sodium.lib) + set_target_properties(externals_sodium PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/libsodium.dll) +endif() + +install(IMPORTED_RUNTIME_ARTIFACTS externals_sodium + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) diff --git a/cmake/swift_test.cmake b/cmake/swift_test.cmake new file mode 100644 index 000000000..9805eeb84 --- /dev/null +++ b/cmake/swift_test.cmake @@ -0,0 +1,16 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +function(add_swift_test) + set(single_args NAME) + set(multi_args SOURCES LINK_LIBRARIES) + cmake_parse_arguments(SWIFT_TEST "" "${single_args}" "${multi_args}" ${ARGN}) + + add_executable(tests_${SWIFT_TEST_NAME} ${SWIFT_TEST_SOURCES}) + target_link_libraries(tests_${SWIFT_TEST_NAME} PUBLIC ${SWIFT_TEST_LINK_LIBRARIES}) + add_test(NAME ${SWIFT_TEST_NAME} COMMAND tests_${SWIFT_TEST_NAME}) + + if(WIN32) + add_dependencies(tests_${SWIFT_TEST_NAME} copy_externals_to_build_dir) + endif() +endfunction() diff --git a/cmake/tls/CMakeLists.txt b/cmake/tls/CMakeLists.txt new file mode 100644 index 000000000..b4788608a --- /dev/null +++ b/cmake/tls/CMakeLists.txt @@ -0,0 +1,21 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +if(WIN32) + add_library(externals_ssl SHARED IMPORTED GLOBAL) + if(SWIFT_WIN32) + set_target_properties(externals_ssl PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/win32-msvc/32/lib/libssl-1_1.dll) + elseif(SWIFT_WIN64) + set_target_properties(externals_ssl PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/libssl-1_1-x64.dll) + endif() + install(IMPORTED_RUNTIME_ARTIFACTS externals_ssl) + + add_library(externals_crypto SHARED IMPORTED GLOBAL) + if(SWIFT_WIN32) + set_target_properties(externals_crypto PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/win32-msvc/32/lib/libcrypto-1_1.dll) + elseif(SWIFT_WIN64) + set_target_properties(externals_crypto PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/libcrypto-1_1-x64.dll) + endif() + install(IMPORTED_RUNTIME_ARTIFACTS externals_crypto) + +endif() diff --git a/cmake/tools.cmake b/cmake/tools.cmake new file mode 100644 index 000000000..949fca27f --- /dev/null +++ b/cmake/tools.cmake @@ -0,0 +1,44 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +macro(get_version_number) + execute_process(COMMAND python scripts/build.py --version + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + OUTPUT_VARIABLE SWIFT_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) + + string(REPLACE "." ";" SWIFT_SUBVERSIONS ${SWIFT_VERSION}) + list(GET SWIFT_SUBVERSIONS 0 SWIFT_VERSION_MAJOR) + list(GET SWIFT_SUBVERSIONS 1 SWIFT_VERSION_MINOR) + list(GET SWIFT_SUBVERSIONS 2 SWIFT_VERSION_REVISION) + + # Git revision + execute_process(COMMAND git rev-parse --short HEAD WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE git_sha) + string(STRIP ${git_sha} git_sha) + set(swift_git_head ${git_sha}) +endmacro() + +macro(load_vatsim_key) + # Dummy data + set(SWIFT_VATSIM_ID "123") + set(SWIFT_VATSIM_KEY "123") + + if(VATSIM_KEY_JSON) + file(READ ${PROJECT_SOURCE_DIR}/${VATSIM_KEY_JSON} KEY_FILE) + string(JSON SWIFT_VATSIM_ID GET ${KEY_FILE} vatsim id) + string(JSON SWIFT_VATSIM_KEY GET ${KEY_FILE} vatsim key) + endif() +endmacro() + +function(configure_target_platform) + set(SWIFT_WIN64 OFF PARENT_SCOPE) + set(SWIFT_WIN32 OFF PARENT_SCOPE) + + if(WIN32) + if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) + set(SWIFT_WIN64 ON PARENT_SCOPE) + else() + set(SWIFT_WIN32 ON PARENT_SCOPE) + endif() + endif() +endfunction() diff --git a/cmake/vatsimauth/CMakeLists.txt b/cmake/vatsimauth/CMakeLists.txt new file mode 100644 index 000000000..1d2bccc50 --- /dev/null +++ b/cmake/vatsimauth/CMakeLists.txt @@ -0,0 +1,28 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(externals_vatsim_auth SHARED IMPORTED GLOBAL) + +target_include_directories(externals_vatsim_auth INTERFACE ${PROJECT_SOURCE_DIR}/externals/common/include/) + +if(UNIX AND NOT APPLE) + set_target_properties(externals_vatsim_auth PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/linux-g++/64/lib/libvatsimauth.so) +elseif(APPLE) + set_target_properties(externals_vatsim_auth PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/macx-clang/64/lib/libvatsimauth.dylib) +elseif(SWIFT_WIN32) + set_target_properties(externals_vatsim_auth PROPERTIES IMPORTED_IMPLIB ${PROJECT_SOURCE_DIR}/externals/win32-msvc/32/lib/vatsimauth.lib) + set_target_properties(externals_vatsim_auth PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/win32-msvc/32/lib/vatsimauth.dll) +elseif(SWIFT_WIN64) + set_target_properties(externals_vatsim_auth PROPERTIES IMPORTED_IMPLIB ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/vatsimauth.lib) + set_target_properties(externals_vatsim_auth PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/vatsimauth.dll) +endif() + +if(UNIX AND NOT APPLE) + # https://gitlab.kitware.com/cmake/cmake/-/issues/19860#note_642079 + set_target_properties(externals_vatsim_auth PROPERTIES IMPORTED_NO_SONAME TRUE) +endif() + +install(IMPORTED_RUNTIME_ARTIFACTS externals_vatsim_auth + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) diff --git a/cmake/xp/CMakeLists.txt b/cmake/xp/CMakeLists.txt new file mode 100644 index 000000000..675eaed4c --- /dev/null +++ b/cmake/xp/CMakeLists.txt @@ -0,0 +1,28 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +if(SWIFT_WIN64 OR APPLE) + add_library(externals_xplm STATIC IMPORTED GLOBAL) +elseif(UNIX) + add_library(externals_xplm INTERFACE) +endif() + + +target_include_directories(externals_xplm INTERFACE ${PROJECT_SOURCE_DIR}/externals/common/include ${PROJECT_SOURCE_DIR}/externals/common/include/XPLM) + +if(SWIFT_WIN64) + set_target_properties(externals_xplm PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/XPLM_64.lib) +elseif(APPLE) + set_target_properties(externals_xplm PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/macx-clang/64/lib/XPLM.framework/XPLM) +endif() + +if(SWIFT_WIN64 OR APPLE) + add_library(externals_xpwidgets STATIC IMPORTED GLOBAL) + target_include_directories(externals_xpwidgets INTERFACE ${PROJECT_SOURCE_DIR}/externals/common/include) + + if(SWIFT_WIN64) + set_target_properties(externals_xpwidgets PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/win32-msvc/64/lib/XPWidgets_64.lib) + elseif(APPLE) + set_target_properties(externals_xpwidgets PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/externals/macx-clang/64/lib/XPWidgets.framework/XPWidgets) + endif() +endif() diff --git a/cmake/xswiftbus_tools.cmake b/cmake/xswiftbus_tools.cmake new file mode 100644 index 000000000..06827e24c --- /dev/null +++ b/cmake/xswiftbus_tools.cmake @@ -0,0 +1,16 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +macro(get_xswiftbus_commit_id) + set(XSWIFTBUS_DEPENDENTS src/xswiftbus src/blackmisc/simulation/xplane/qtfreeutils.* src/blackmisc/simulation/settings/xswiftbussettingsqtfree.*) + + execute_process(COMMAND git log -n 1 --format=%h -- ${XSWIFTBUS_DEPENDENTS} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE XSWIFTBUS_COMMIT_ID) + + if(XSWIFTBUS_COMMIT_ID STREQUAL "") + message(FATAL_ERROR "Unable to get xswiftbus commit id") + endif() + + # Strip newline + string(STRIP ${XSWIFTBUS_COMMIT_ID} XSWIFTBUS_COMMIT_ID) + +endmacro() diff --git a/default.json b/default.json deleted file mode 100644 index 47c3d805c..000000000 --- a/default.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "version": { - "major": 0, - "minor": 13 - }, - "libs": { - "blackcore": true, - "blackgui": true, - "blacksound": true, - "blackinput": true - }, - "samples": true, - "unitTests": true, - "apps": { - "swiftdata": true, - "swiftcore": true, - "swiftgui": true, - "swiftlauncher": true - }, - "sims": { - "fs9": true, - "fsx": true, - "p3d": true, - "fsuipc": true, - "xplane": true, - "xswiftbus": true, - "fg": true, - "msfs": true - }, - "releaseWithDebugInfo": true, - "profileRelease": false, - "assertsInRelease": true, - "allowNoisyWarnings": false, - "packageInstaller": true, - "static": false, - "doxygen": true, - "devBranch": false, - "stableBranch": false, - "vatsimSupport": true, - "vatsim": { - "id": "0xb9ba", - "key": "727d1efd5cb9f8d2c28372469d922bb4" - } -} diff --git a/docs/conf.py b/docs/conf.py index 31fc309a8..c5a047d43 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -11,7 +11,7 @@ import os import json import subprocess -swift_config_file = open('../default.json') +swift_config_file = open('../version.json') swift_config = json.load(swift_config_file) swift_config_file.close() diff --git a/installer/installbuilder/swift-pilotclient.xml b/installer/installbuilder/swift-pilotclient.xml index 10500fc01..3212ed7c2 100644 --- a/installer/installbuilder/swift-pilotclient.xml +++ b/installer/installbuilder/swift-pilotclient.xml @@ -86,28 +86,28 @@ This installs the binaries to run all swift applications. ../../dist/bin/swiftlauncher.exe - ../../dist/bin/blacksound.dll + ../../dist/bin/sound.dll - ../../dist/bin/blackcore.dll + ../../dist/bin/core.dll - ../../dist/bin/blackgui.dll + ../../dist/bin/gui.dll - ../../dist/bin/blackinput.dll + ../../dist/bin/input.dll - ../../dist/bin/blackmisc.dll + ../../dist/bin/misc.dll - ../../dist/bin/simulatorplugincommon.dll + ../../dist/bin/plugincommon.dll - ../../dist/bin/simulatorfscommon.dll + ../../dist/bin/fscommon.dll - ../../dist/bin/simulatorfsxcommon.dll + ../../dist/bin/fsxcommon.dll @@ -130,32 +130,32 @@ This installs the binaries to run all swift applications. 1 - ../../dist/lib/libblackcore* + ../../dist/lib/libcore* */*.debug 1 - ../../dist/lib/libblackgui* + ../../dist/lib/libgui* */*.debug 1 - ../../dist/lib/libblackinput* + ../../dist/lib/libinput* */*.debug 1 - ../../dist/lib/libblackmisc* + ../../dist/lib/libmisc* */*.debug 1 - ../../dist/lib/libblacksound* + ../../dist/lib/libsound* */*.debug 1 - ../../dist/lib/libsimulatorplugincommon* + ../../dist/lib/libplugincommon* */*.debug @@ -168,32 +168,32 @@ This installs the binaries to run all swift applications. 1 - ../../dist/lib/libblackcore*.dylib + ../../dist/lib/libcore*.dylib */*.dSYM 1 - ../../dist/lib/libblackgui*.dylib + ../../dist/lib/libgui*.dylib */*.dSYM 1 - ../../dist/lib/libblackinput*.dylib + ../../dist/lib/libinput*.dylib */*.dSYM 1 - ../../dist/lib/libblackmisc*.dylib + ../../dist/lib/libmisc*.dylib */*.dSYM 1 - ../../dist/lib/libblacksound*.dylib + ../../dist/lib/libsound*.dylib */*.dSYM 1 - ../../dist/lib/libsimulatorplugincommon*.dylib + ../../dist/lib/libplugincommon*.dylib */*.dSYM diff --git a/installer/installbuilder/swift.xml b/installer/installbuilder/swift.xml index 41c71f218..29b16247d 100644 --- a/installer/installbuilder/swift.xml +++ b/installer/installbuilder/swift.xml @@ -22,8 +22,8 @@ swift-externals.xml - + diff --git a/installer/installbuilder/vcredist-x64.xml b/installer/installbuilder/vcredist-x64.xml index d84b41f77..64ed7412d 100644 --- a/installer/installbuilder/vcredist-x64.xml +++ b/installer/installbuilder/vcredist-x64.xml @@ -17,7 +17,7 @@ 0 - ${installdir}/vcredist/vcredist_x64.exe + ${installdir}/vcredist/vc_redist.x64.exe /install /quiet /norestart Installing Visual Studio 2019 x64 Redistributables 0 @@ -65,7 +65,7 @@ The installation will now continue, but swift might not work properly. If this i - ../../dist/vcredist/vcredist_x64.exe + ../../dist/vcredist/vc_redist.x64.exe diff --git a/installer/installbuilder/vcredist-x86.xml b/installer/installbuilder/vcredist-x86.xml index ff957430a..f15b2ec64 100644 --- a/installer/installbuilder/vcredist-x86.xml +++ b/installer/installbuilder/vcredist-x86.xml @@ -17,7 +17,7 @@ 0 - ${installdir}/vcredist/vcredist_x86.exe + ${installdir}/vcredist/vc_redist.x86.exe /install /quiet /norestart Installing Visual Studio 2019 x86 Redistributables 0 @@ -65,7 +65,7 @@ The installation will now continue, but swift might not work properly. If this i - ../../dist/vcredist/vcredist_x86.exe + ../../dist/vcredist/vc_redist.x86.exe diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt new file mode 100644 index 000000000..26d811245 --- /dev/null +++ b/resources/CMakeLists.txt @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_custom_target(resources) + +add_custom_command(TARGET resources + PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different share/ ${PROJECT_BINARY_DIR}/out/share/ + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + +install(DIRECTORY share/ DESTINATION ${CMAKE_INSTALL_PREFIX}/share) diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt new file mode 100644 index 000000000..5db446e53 --- /dev/null +++ b/samples/CMakeLists.txt @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_subdirectory(afvclient) +add_subdirectory(blackmisc) +#add_subdirectory(blackmiscdbus) +add_subdirectory(blackmiscquantities) +add_subdirectory(blackmiscsim) +#add_subdirectory(cliclient) +add_subdirectory(fsd) +add_subdirectory(hotkey) +add_subdirectory(weatherdata) diff --git a/samples/afvclient/CMakeLists.txt b/samples/afvclient/CMakeLists.txt new file mode 100644 index 000000000..30b092acc --- /dev/null +++ b/samples/afvclient/CMakeLists.txt @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_executable(samples_afvclient main.cpp afvclientbridge.h afvclientbridge.cpp qml/qml.qrc) +target_link_libraries(samples_afvclient PUBLIC core misc blackconfig Qt::Core Qt::Qml Qt::Gui) +target_compile_definitions(samples_afvclient PRIVATE _USE_MATH_DEFINES) diff --git a/samples/blackmisc/CMakeLists.txt b/samples/blackmisc/CMakeLists.txt new file mode 100644 index 000000000..7a1c5d0f9 --- /dev/null +++ b/samples/blackmisc/CMakeLists.txt @@ -0,0 +1,22 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_executable(samples_misc + main.cpp + sampleblackmisc.h + samplesalgorithm.cpp + samplesalgorithm.h + sampleschangeobject.cpp + sampleschangeobject.h + samplescontainer.cpp + samplescontainer.h + samplesfile.cpp + samplesfile.h + samplesjson.cpp + samplesjson.h + samplesmetadata.cpp + samplesmetadata.h + samplesperformance.cpp + samplesperformance.h +) +target_link_libraries(samples_misc core misc Qt::Core) diff --git a/samples/blackmiscquantities/CMakeLists.txt b/samples/blackmiscquantities/CMakeLists.txt new file mode 100644 index 000000000..b62b4b98d --- /dev/null +++ b/samples/blackmiscquantities/CMakeLists.txt @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_executable(samples_pq + main.cpp + sampleblackmiscquantities.h + samplesaviation.cpp + samplesaviation.h + samplesgeo.cpp + samplesgeo.h + samplesphysicalquantities.cpp + samplesphysicalquantities.h +) +target_link_libraries(samples_pq core misc Qt::Core) diff --git a/samples/blackmiscsim/CMakeLists.txt b/samples/blackmiscsim/CMakeLists.txt new file mode 100644 index 000000000..4a7996a17 --- /dev/null +++ b/samples/blackmiscsim/CMakeLists.txt @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_executable(samples_miscsim + main.cpp + sampleblackmiscsim.h + samplesfscommon.cpp + samplesfscommon.h + samplesfsuipc.cpp + samplesfsuipc.h + samplesfsx.cpp + samplesfsx.h + samplesmodelmapping.cpp + samplesmodelmapping.h + samplesp3d.cpp + samplesp3d.h + samplesvpilotrules.cpp + samplesvpilotrules.h + sampleutils.cpp + sampleutils.h + ) +target_link_libraries(samples_miscsim core misc Qt::Core) + +if(WIN32) + target_link_libraries(samples_miscsim fscommon) +endif() + +if(SWIFT_WIN32) + target_link_libraries(samples_miscsim fsuipc_32) +elseif(SWIFT_WIN64) + target_link_libraries(samples_miscsim fsuipc_64) +endif() diff --git a/samples/cliclient/CMakeLists.txt b/samples/cliclient/CMakeLists.txt new file mode 100644 index 000000000..dcf5ac260 --- /dev/null +++ b/samples/cliclient/CMakeLists.txt @@ -0,0 +1,10 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_executable(samples_cliclient + main.cpp + reader.cpp + reader.h + samplecliclient.h + ) +target_link_libraries(samples_cliclient core misc Qt::Core) diff --git a/samples/fsd/CMakeLists.txt b/samples/fsd/CMakeLists.txt new file mode 100644 index 000000000..eb076c113 --- /dev/null +++ b/samples/fsd/CMakeLists.txt @@ -0,0 +1,7 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_executable(samples_fsd + main.cpp +) +target_link_libraries(samples_fsd core misc Qt::Core) diff --git a/samples/hotkey/CMakeLists.txt b/samples/hotkey/CMakeLists.txt new file mode 100644 index 000000000..0642a34a4 --- /dev/null +++ b/samples/hotkey/CMakeLists.txt @@ -0,0 +1,8 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_executable(samples_hotkey + main.cpp + samplehotkey.h + ) +target_link_libraries(samples_hotkey gui misc Qt::Core) diff --git a/samples/weatherdata/CMakeLists.txt b/samples/weatherdata/CMakeLists.txt new file mode 100644 index 000000000..c8ceced1d --- /dev/null +++ b/samples/weatherdata/CMakeLists.txt @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_executable(samples_weatherdata + main.cpp + reader.cpp + reader.h + sampleweatherdata.h + weatherdataprinter.cpp + weatherdataprinter.h + ) +target_link_libraries(samples_weatherdata core misc Qt::Core) diff --git a/scripts/build.py b/scripts/build.py index c576d7379..c4a8c11d4 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -26,7 +26,6 @@ class Builder: Build processes will be called with the environment modified by this function. """ print('Preparing environment ...') - self.make_cmd = self._get_make_cmd() self._specific_prepare() print('Updating from datastore ...') @@ -36,7 +35,7 @@ class Builder: shared_path = os.path.abspath(os.path.join(source_path, 'resources', 'share')) datastore.update_shared(host, datastore_version, shared_path) - def build(self, jobs, qmake_args, dev_build): + def build(self, jobs, cmake_args, dev_build): """ Run the build itself. Pass dev_build=True to enable a dev build """ @@ -46,17 +45,24 @@ class Builder: os.makedirs(build_path) os.chdir(build_path) - qmake_call = ['qmake'] + qmake_args - if dev_build: - qmake_call += ['SWIFT_CONFIG.devBranch=true'] + use_crashpad = "ON" if platform.system() == 'Darwin' or platform.system() == 'Windows' else "OFF" - qmake_call += ['-r', os.pardir] - subprocess.check_call(qmake_call, env=dict(os.environ)) + cmake_call = ['cmake', + '..', + '-G {}'.format(self._get_generator()), + '-DCMAKE_BUILD_TYPE=RelWithDebInfo', + '-DCMAKE_INSTALL_PREFIX=../dist', + '-DSWIFT_USE_CRASHPAD={}'.format(use_crashpad)] + cmake_args + subprocess.check_call(cmake_call, env=dict(os.environ)) - if not jobs: - jobs = multiprocessing.cpu_count() - jobs_arg = '-j{0}'.format(jobs) - subprocess.check_call([self.make_cmd, jobs_arg], env=dict(os.environ)) + # Workaround while using Make for MacOS to pass number of jobs + if self.__class__.__name__ == 'MacOSBuilder': + subprocess.check_call(["cmake", "--build", ".", "-j3"], env=dict(os.environ)) + elif self.__class__.__name__ == 'MSVCBuilder': + # it seems that ninja does not automatically spawn the correct number of jobs on Windows + subprocess.check_call(["cmake", "--build", ".", "-j2"], env=dict(os.environ)) + else: + subprocess.check_call(["cmake", "--build", "."], env=dict(os.environ)) def checks(self): """ @@ -66,9 +72,39 @@ class Builder: build_path = self._get_swift_build_path() os.chdir(build_path) if self._should_run_checks(): - subprocess.check_call([self.make_cmd, 'check', '-j1'], env=dict(os.environ)) + subprocess.check_call(["ctest", "--verbose"], env=dict(os.environ)) pass + def create_installer(self): + bitrock_builder_bin = os.environ["BITROCK_BUILDER"] + os.chdir(self._get_swift_source_path()) + os_map = {'Linux': 'linux', 'Darwin': 'macos', 'Windows': 'windows'} + installer_platform_map = {'Linux': 'linux-x{}'.format(self.word_size), 'Darwin': 'osx', 'Windows': 'windows'} + extension_map = {'Linux': 'run', 'Darwin': 'app', 'Windows': 'exe'} + extension = extension_map[platform.system()] + os_name = os_map[platform.system()] + version_full = self.__get_swift_version_base() + version_rev = self.__get_rev_count() + windows64 = 1 if os_name == 'windows' and int(self.word_size) == 64 else 0 + installer_platform = installer_platform_map[platform.system()] + + subprocess.check_call([os.path.expanduser(bitrock_builder_bin), + "quickbuild", + "installer/installbuilder/project.xml", + "{}".format(installer_platform), + "--verbose", + "--license", + "~/license.xml", + "--setvars", + "project.outputDirectory=build", + "project.installerFilename=swiftinstaller-{}-{}-{}.{}".format(os_name, self.word_size, version_full, extension), + "project.version={}".format(version_full), + "versionFull={}.{}".format(version_full, version_rev), + "project.windows64bitMode={}".format(windows64), + "project.enableDebugger=0", + "architecture={}".format(self.word_size) + ], env=dict(os.environ)) + def install(self): """ Installs all products to the default path. @@ -76,12 +112,11 @@ class Builder: print('Running install ...') build_path = self._get_swift_build_path() os.chdir(build_path) + subprocess.check_call(["cmake", "--install", "."], env=dict(os.environ)) + if self._should_publish(): - subprocess.check_call([self.make_cmd, 'create_installer'], env=dict(os.environ)) - pass - else: - subprocess.check_call([self.make_cmd, 'install'], env=dict(os.environ)) - pass + self._strip_debug() + self.create_installer() def publish(self): if self._should_publish(): @@ -108,8 +143,8 @@ class Builder: os_map = {'Linux': 'linux', 'Darwin': 'macos', 'Windows': 'windows'} archive_name = '-'.join(['xswiftbus', os_map[platform.system()], self.word_size, self.version]) + '.7z' archive_path = path.abspath(path.join(os.pardir, archive_name)) - content_path = path.abspath(path.join(os.curdir, 'dist', 'xswiftbus')) - subprocess.check_call(['7z', 'a', '-mx=9', archive_path, content_path], env=dict(os.environ)) + content_path = path.abspath(path.join(self._get_swift_source_path(), 'dist', 'xswiftbus')) + subprocess.check_call(['7z', 'a', '-mx=9', archive_path, content_path, "-xr!*.debug", "-xr!*.dSYM"], env=dict(os.environ)) def symbols(self, upload_symbols): """ @@ -123,7 +158,13 @@ class Builder: build_path = self._get_swift_build_path() os.chdir(build_path) print('Creating symbols') - binary_path = path.abspath(path.join(build_path, 'out')) + + # Debug symbols for Windows are in the build folder + # and for OSX and Linux in dist/install folder (after splitting) + if platform.system() == 'Windows': + binary_path = path.abspath(path.join(build_path, 'out')) + else: + binary_path = path.abspath(path.join(self._get_swift_source_path(), 'dist')) os_map = {'Linux': 'linux', 'Darwin': 'macos', 'Windows': 'windows'} tar_filename = '-'.join( @@ -164,6 +205,9 @@ class Builder: tar.close() self.__upload_symbol_files(tar_path) + def bundle_csl2xsb(self): + pass + def _get_swift_source_path(self): return self.__source_path @@ -176,7 +220,7 @@ class Builder: def _get_qmake_spec(self): raise NotImplementedError() - def _get_make_cmd(self): + def _get_generator(self): raise NotImplementedError() def _should_run_checks(self): @@ -195,15 +239,16 @@ class Builder: self.__source_path = path.abspath(path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)) self.__build_path = path.abspath(path.join(self.__source_path, 'build')) - swift_project_file = path.join(self.__source_path, 'swift.pro') - if not os.path.isfile(swift_project_file): - raise RuntimeError('Cannot find swift.pro! Are we in the right directory?') + files = os.listdir(self.__source_path) + for dir in ['src', 'installer', 'externals']: + if dir not in files: + raise RuntimeError('Cannot find {} folder! Are we in the right directory?'.format(dir)) self.word_size = word_size self.version = self.__get_swift_version() def __get_config_file(self): - return path.abspath(path.join(self._get_swift_source_path(), 'default')) + '.json'; + return path.abspath(path.join(self._get_swift_source_path(), 'version')) + '.json' def __get_swift_version(self): return self.__get_swift_version_base() + '.' + str(self.__get_rev_count()) @@ -220,7 +265,7 @@ class Builder: this_version = self.__get_swift_version_base() config_log = subprocess.check_output(['git', 'log', '--format=%H', self.__get_config_file()]) for sha in config_log.decode("utf-8").split(): - json_data = subprocess.check_output(['git', 'show', sha + ':default.json']) + json_data = subprocess.check_output(['git', 'show', sha + ':version.json']) config_json = json.loads(json_data.decode("utf-8")) version_major = config_json['version']['major'] version_minor = config_json['version']['minor'] @@ -265,33 +310,16 @@ class MSVCBuilder(Builder): def _get_qmake_spec(self): return 'win32-msvc' - def _get_make_cmd(self): - return "C:/ProgramData/chocolatey/lib/jom/tools/jom.exe" + def _get_generator(self): + return "Ninja" - def __init__(self, word_size): - Builder.__init__(self, word_size) + def _strip_debug(self): + pass - -class MinGWBuilder(Builder): - - def _specific_prepare(self): - # See comment in MSVCBuilder. - os.environ['QT_FORCE_STDERR_LOGGING'] = '1' - - def _get_qmake_spec(self): - return 'win32-g++' - - def _get_make_cmd(self): - return 'mingw32-make' - - def _should_run_checks(self): - return False - - def _should_publish(self): - return True - - def _should_create_symbols(self): - return False + def bundle_csl2xsb(self): + os.chdir(self._get_swift_source_path()) + subprocess.check_call(["pyinstaller", "-y", "--distpath", "dist/share", + "--workpath", os.environ["TEMP"], "scripts/csl2xsb/CSL2XSB.py"]) def __init__(self, word_size): Builder.__init__(self, word_size) @@ -300,15 +328,41 @@ class MinGWBuilder(Builder): class LinuxBuilder(Builder): def _specific_prepare(self): - os.environ['LD_LIBRARY_PATH'] = path.abspath(path.join(self._get_swift_build_path(), 'build', 'out', 'release', 'lib')) - os.environ['LD_LIBRARY_PATH'] += os.pathsep + path.abspath(path.join(self._get_swift_source_path(), 'lib')) - os.environ['LD_LIBRARY_PATH'] += os.pathsep + self._get_externals_path() + pass def _get_qmake_spec(self): return 'linux-g++' - def _get_make_cmd(self): - return 'make' + def _get_generator(self): + return 'Ninja' + + def _strip_debug(self): + files = [ + "bin/swiftcore", + "bin/swiftdata", + "bin/swiftguistd", + "bin/swiftlauncher", + "lib/libcore.so", + "lib/libgui.so", + "lib/libinput.so", + "lib/libmisc.so", + "lib/libplugincommon.so", + "lib/libsound.so", + "bin/plugins/simulator/libsimulatoremulated.so", + "bin/plugins/simulator/libsimulatoremulatedconfig.so", + "bin/plugins/simulator/libsimulatorflightgear.so", + "bin/plugins/simulator/libsimulatorflightgearconfig.so", + "bin/plugins/simulator/libsimulatorxplane.so", + "bin/plugins/simulator/libsimulatorxplaneconfig.so", + "bin/plugins/weatherdata/libweatherdatagfs.so", + "xswiftbus/64/lin.xpl", + ] + dist_path = path.join(self._get_swift_source_path(), "dist") + for file in files: + subprocess.check_call(["objcopy", "--only-keep-debug", + path.join(dist_path, file), + path.join(dist_path, file + ".debug")], env=dict(os.environ)) + subprocess.check_call(["objcopy", "--strip-debug", path.join(dist_path, file)], env=dict(os.environ)) def __init__(self, word_size): Builder.__init__(self, word_size) @@ -317,18 +371,42 @@ class LinuxBuilder(Builder): class MacOSBuilder(Builder): def _specific_prepare(self): - os.environ['LD_LIBRARY_PATH'] = path.abspath(path.join(self._get_swift_build_path(), 'build', 'out', 'release', 'lib')) - os.environ['LD_LIBRARY_PATH'] += os.pathsep + self._get_externals_path() + pass def _get_qmake_spec(self): return 'macx-clang' - def _get_make_cmd(self): - return 'make' + def _get_generator(self): + return 'Unix Makefiles' def _should_create_symbols(self): return True + def _strip_debug(self): + files = [ + "bin/swiftcore", + "bin/swiftdata", + "bin/swiftguistd", + "bin/swiftlauncher", + "lib/libcore.dylib", + "lib/libgui.dylib", + "lib/libinput.dylib", + "lib/libmisc.dylib", + "lib/libplugincommon.dylib", + "lib/libsound.dylib", + "bin/plugins/simulator/libsimulatoremulated.dylib", + "bin/plugins/simulator/libsimulatoremulatedconfig.dylib", + "bin/plugins/simulator/libsimulatorflightgear.dylib", + "bin/plugins/simulator/libsimulatorflightgearconfig.dylib", + "bin/plugins/simulator/libsimulatorxplane.dylib", + "bin/plugins/simulator/libsimulatorxplaneconfig.dylib", + "bin/plugins/weatherdata/libweatherdatagfs.dylib", + "xswiftbus/64/mac.xpl", + ] + dist_path = path.join(self._get_swift_source_path(), "dist") + for file in files: + subprocess.check_call(["dsymutil", path.join(dist_path, file)], env=dict(os.environ)) + def __init__(self, word_size): Builder.__init__(self, word_size) @@ -336,7 +414,7 @@ class MacOSBuilder(Builder): def print_help(): supported_compilers = {'Linux': ['gcc'], 'Darwin': ['clang'], - 'Windows': ['msvc', 'mingw'] + 'Windows': ['msvc'] } compiler_help = '|'.join(supported_compilers[platform.system()]) print('build.py -w <32|64> -t <' + compiler_help + '> [-v] [-d] [-q ]') @@ -349,7 +427,7 @@ def main(argv): dev_build = False jobs = None upload_symbols = False - qmake_args = [] + cmake_args = [] try: opts, args = getopt.getopt(argv, 'hw:t:j:duq:v', ['wordsize=', 'toolchain=', 'jobs=', 'dev', 'upload', 'qmake-arg=', 'version']) @@ -379,7 +457,7 @@ def main(argv): elif opt in ('-u', '--upload'): upload_symbols = True elif opt in ('-q', '--qmake-arg'): - qmake_args += [arg] + cmake_args += [arg] if word_size not in ['32', '64']: print('Unsupported word size. Choose 32 or 64') @@ -391,7 +469,6 @@ def main(argv): 'clang': MacOSBuilder}, 'Windows': { 'msvc': MSVCBuilder, - 'mingw': MinGWBuilder } } @@ -402,7 +479,8 @@ def main(argv): builder = builders[platform.system()][tool_chain](word_size) builder.prepare() - builder.build(jobs, qmake_args, dev_build) + builder.build(jobs, cmake_args, dev_build) + builder.bundle_csl2xsb() builder.checks() builder.install() builder.publish() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 000000000..daaa1674d --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,20 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_subdirectory(blackconfig) +add_subdirectory(blackcore) +add_subdirectory(blackmisc) +add_subdirectory(blackgui) +add_subdirectory(blackinput) +add_subdirectory(blacksound) + +add_subdirectory(swiftguistandard) +add_subdirectory(swiftdata) +add_subdirectory(swiftcore) +add_subdirectory(swiftlauncher) + +add_subdirectory(plugins) + +if(SWIFT_BUILD_XSWIFTBUS) + add_subdirectory(xswiftbus) +endif() diff --git a/src/blackconfig/CMakeLists.txt b/src/blackconfig/CMakeLists.txt new file mode 100644 index 000000000..79857b22a --- /dev/null +++ b/src/blackconfig/CMakeLists.txt @@ -0,0 +1,21 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +configure_file(buildconfig_gen.inc.in buildconfig_gen.inc) +configure_file(buildconfig_gen.cpp.in buildconfig_gen.cpp) + +add_library(blackconfig STATIC + buildconfig.cpp + buildconfig.h + buildconfig.inc + ${CMAKE_CURRENT_BINARY_DIR}/buildconfig_gen.inc + ${CMAKE_CURRENT_BINARY_DIR}/buildconfig_gen.cpp + ) + +target_link_libraries(blackconfig PUBLIC Qt::Core) + +target_include_directories(blackconfig + PUBLIC + ${PROJECT_SOURCE_DIR}/src + ${CMAKE_CURRENT_BINARY_DIR} +) diff --git a/src/blackconfig/buildconfig_gen.cpp.in b/src/blackconfig/buildconfig_gen.cpp.in index e98394e60..84548b9ae 100644 --- a/src/blackconfig/buildconfig_gen.cpp.in +++ b/src/blackconfig/buildconfig_gen.cpp.in @@ -1,33 +1,33 @@ // SPDX-FileCopyrightText: Copyright (C) 2016 swift Project Community / Contributors // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 -#include \"blackconfig/buildconfig.h\" +#include "blackconfig/buildconfig.h" #include #include int BlackConfig::CBuildConfig::vatsimClientId() { - static const int id { $$swiftConfig(vatsim.id) }; + static const int id { ${SWIFT_VATSIM_ID} }; return id; } const QString &BlackConfig::CBuildConfig::vatsimPrivateKey() { - static const auto pk = QString { \"$$swiftConfig(vatsim.key)\" }; + static const auto pk = QString { "${SWIFT_VATSIM_KEY}" }; return pk; } const QString &BlackConfig::CBuildConfig::backtraceToken() { - static const auto bt = QString { \"$$(BACKTRACE_MINIDUMP_TOKEN)\" }; + static const auto bt = QString { "$ENV{BACKTRACE_MINIDUMP_TOKEN}" }; return bt; } const QString &BlackConfig::CBuildConfig::gitHeadSha1() { - static const QString gitHeadSha1(\"$$GIT_HEAD_SHA1\"); + static const QString gitHeadSha1("${swift_git_head}"); Q_ASSERT(!gitHeadSha1.isEmpty()); return gitHeadSha1; } -int BlackConfig::CBuildConfig::versionRevision() { return $$GIT_REV_COUNT; } +int BlackConfig::CBuildConfig::versionRevision() { return ${SWIFT_VERSION_REVISION}; } diff --git a/src/blackconfig/buildconfig_gen.inc.in b/src/blackconfig/buildconfig_gen.inc.in index 93017f47a..7713d914a 100644 --- a/src/blackconfig/buildconfig_gen.inc.in +++ b/src/blackconfig/buildconfig_gen.inc.in @@ -5,104 +5,66 @@ #error This file is only to be included by buildconfig.inc #endif +#define SWIFTCONFIG_ON true +#define SWIFTCONFIG_OFF false + constexpr bool BlackConfig::CBuildConfig::isCompiledWithBlackCore() { -!!IF swiftConfig(libs.blackcore) - return true; -!!ELSE - return false; -!!ENDIF + return SWIFTCONFIG_${SWIFT_BUILD_BLACKCORE}; } constexpr bool BlackConfig::CBuildConfig::isCompiledWithBlackSound() { -!!IF swiftConfig(libs.blacksound) - return true; -!!ELSE - return false; -!!ENDIF + return SWIFTCONFIG_${SWIFT_BUILD_BLACKSOUND}; } constexpr bool BlackConfig::CBuildConfig::isCompiledWithBlackInput() { -!!IF swiftConfig(libs.blackinput) - return true; -!!ELSE - return false; -!!ENDIF + return SWIFTCONFIG_${SWIFT_BUILD_BLACKINPUT}; } constexpr bool BlackConfig::CBuildConfig::isCompiledWithFs9Support() { -!!IF swiftConfig(sims.fs9) - return true; -!!ELSE - return false; -!!ENDIF + return SWIFTCONFIG_${SWIFT_BUILD_FS9_PLUGIN}; } constexpr bool BlackConfig::CBuildConfig::isCompiledWithP3DSupport() { -!!IF swiftConfig(sims.p3d) - return true; -!!ELSE - return false; -!!ENDIF + return SWIFTCONFIG_${SWIFT_BUILD_P3D_PLUGIN}; } constexpr bool BlackConfig::CBuildConfig::isCompiledWithFsxSupport() { -!!IF swiftConfig(sims.fsx) - return true; -!!ELSE - return false; -!!ENDIF + return SWIFTCONFIG_${SWIFT_BUILD_FSX_PLUGIN}; } constexpr bool BlackConfig::CBuildConfig::isCompiledWithFsuipcSupport() { -!!IF swiftConfig(sims.fsuipc) - return true; -!!ELSE - return false; -!!ENDIF + return isCompiledWithFsxSupport() || isCompiledWithP3DSupport() || isCompiledWithFs9Support() || SWIFTCONFIG_${SWIFT_BUILD_MSFS_PLUGIN}; } constexpr bool BlackConfig::CBuildConfig::isCompiledWithXPlaneSupport() { -!!IF swiftConfig(sims.xplane) - return true; -!!ELSE - return false; -!!ENDIF + return SWIFTCONFIG_${SWIFT_BUILD_XPLANE_PLUGIN}; } constexpr bool BlackConfig::CBuildConfig::isCompiledWithFGSupport() { -!!IF swiftConfig(sims.fg) - return true; -!!ELSE - return false; -!!ENDIF + return SWIFTCONFIG_${SWIFT_BUILD_FLIGHTGEAR_PLUGIN}; } constexpr bool BlackConfig::CBuildConfig::isCompiledWithGui() { -!!IF swiftConfig(libs.blackgui) - return true; -!!ELSE - return false; -!!ENDIF + return SWIFTCONFIG_${SWIFT_BUILD_BLACKGUI}; } constexpr bool BlackConfig::CBuildConfig::isVatsimVersion() { -!!IF swiftConfig(vatsimSupport) - return true; -!!ELSE - return false; -!!ENDIF + return SWIFTCONFIG_${SWIFT_VATSIM_SUPPORT}; } -constexpr int BlackConfig::CBuildConfig::versionMajor() { return $$swiftConfig(version.major); } -constexpr int BlackConfig::CBuildConfig::versionMinor() { return $$swiftConfig(version.minor); } +constexpr int BlackConfig::CBuildConfig::versionMajor() { return ${SWIFT_VERSION_MAJOR}; } +constexpr int BlackConfig::CBuildConfig::versionMinor() { return ${SWIFT_VERSION_MINOR}; } + +#undef SWIFTCONFIG_ON +#undef SWIFTCONFIG_OFF diff --git a/src/blackcore/CMakeLists.txt b/src/blackcore/CMakeLists.txt new file mode 100644 index 000000000..85c8aea8b --- /dev/null +++ b/src/blackcore/CMakeLists.txt @@ -0,0 +1,284 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(core SHARED + # AFV + afv/audio/output.h + afv/audio/output.cpp + afv/audio/callsigndelaycache.cpp + afv/audio/soundcardsampleprovider.h + afv/audio/callsignsampleprovider.h + afv/audio/callsigndelaycache.h + afv/audio/soundcardsampleprovider.cpp + afv/audio/receiversampleprovider.cpp + afv/audio/callsignsampleprovider.cpp + afv/audio/input.h + afv/audio/input.cpp + afv/audio/receiversampleprovider.h + afv/crypto/cryptodtochannel.cpp + afv/crypto/cryptodtoserializer.cpp + afv/crypto/cryptodtomode.h + afv/crypto/cryptodtochannel.h + afv/crypto/cryptodtoserializer.h + afv/crypto/cryptodtoheaderdto.h + afv/model/atcstationmodel.h + afv/model/atcstationmodel.cpp + afv/model/afvmapreader.h + afv/model/afvmapreader.cpp + afv/dto.h + afv/clients/afvclient.h + afv/clients/afvclient.cpp + afv/connection/clientconnection.h + afv/connection/apiserverconnection.cpp + afv/connection/apiserverconnection.h + afv/connection/clientconnection.cpp + afv/connection/clientconnectiondata.cpp + afv/connection/clientconnectiondata.h + afv/constants.h + + # Application + application/applicationsettings.h + application/updatesettings.h + + # Audio + audio/audiosettings.h + + # Context + context/contextapplicationproxy.cpp + context/contextownaircraftproxy.h + context/context.h + context/contextsimulator.h + context/contextaudio.cpp + context/contextaudio.h + context/contextapplicationimpl.cpp + context/contextsimulatorproxy.cpp + context/contextownaircraft.h + context/contextownaircraftimpl.cpp + context/contextnetwork.cpp + context/contextapplication.h + context/contextsimulatorempty.h + context/contextapplication.cpp + context/contextaudioimpl.cpp + context/contextapplicationempty.h + context/contextownaircraft.cpp + context/contextnetworkproxy.h + context/contextsimulatorimpl.cpp + context/contextapplicationproxy.h + context/contextapplicationimpl.h + context/contextsimulatorproxy.h + context/contextaudioproxy.h + context/contextaudioimpl.h + context/contextownaircraftproxy.cpp + context/contextsimulator.cpp + context/contextaudioproxy.cpp + context/contextnetwork.h + context/context.cpp + context/contextnetworkempty.h + context/contextnetworkproxy.cpp + context/contextownaircraftimpl.h + context/contextsimulatorimpl.h + context/contextnetworkimpl.cpp + context/contextnetworkimpl.h + context/contextownaircraftempty.h + + # Data + data/authenticateduser.h + data/dbcaches.h + data/globalsetup.cpp + data/globalsetup.h + data/launchersetup.cpp + data/launchersetup.h + data/networksetup.cpp + data/networksetup.h + data/vatsimsetup.cpp + data/vatsimsetup.h + + # DB + db/backgrounddataupdater.cpp + db/airportdatareader.cpp + db/databaseutils.h + db/modeldatareader.h + db/infodatareader.h + db/networkwatchdog.h + db/databasereader.h + db/databaseauthentication.cpp + db/databasewriter.cpp + db/databasereaderconfig.h + db/networkwatchdog.cpp + db/backgrounddataupdater.h + db/databaseutils.cpp + db/modeldatareader.cpp + db/databasereader.cpp + db/databasereaderconfig.cpp + db/infodatareader.cpp + db/icaodatareader.cpp + db/databaseauthentication.h + db/icaodatareader.h + db/databasewriter.h + db/airportdatareader.h + + # FSD + fsd/fsdidentification.cpp + fsd/clientresponse.cpp + fsd/planeinforequestfsinn.cpp + fsd/textmessage.cpp + fsd/killrequest.cpp + fsd/revbclientparts.cpp + fsd/clientidentification.cpp + fsd/visualpilotdatatoggle.h + fsd/rehost.h + fsd/visualpilotdataupdate.cpp + fsd/planeinformationfsinn.h + fsd/clientquery.h + fsd/flightplan.cpp + fsd/pong.cpp + fsd/planeinformationfsinn.cpp + fsd/addatc.h + fsd/servererror.h + fsd/servererror.cpp + fsd/fsdclient.cpp + fsd/atcdataupdate.h + fsd/authchallenge.h + fsd/atcdataupdate.cpp + fsd/ping.h + fsd/messagebase.h + fsd/visualpilotdataupdate.h + fsd/rehost.cpp + fsd/interimpilotdataupdate.h + fsd/authresponse.h + fsd/addatc.cpp + fsd/textmessage.h + fsd/visualpilotdataperiodic.cpp + fsd/visualpilotdatastopped.h + fsd/authresponse.cpp + fsd/pilotdataupdate.cpp + fsd/ping.cpp + fsd/messagebase.cpp + fsd/enums.h + fsd/deleteatc.h + fsd/clientidentification.h + fsd/revbclientparts.h + fsd/deletepilot.h + fsd/fsdclient.h + fsd/flightplan.h + fsd/pbh.h + fsd/killrequest.h + fsd/planeinforequest.h + fsd/addpilot.h + fsd/planeinformation.cpp + fsd/clientquery.cpp + fsd/addpilot.cpp + fsd/deleteatc.cpp + fsd/authchallenge.cpp + fsd/planeinformation.h + fsd/serializer.cpp + fsd/euroscopesimdata.cpp + fsd/pong.h + fsd/euroscopesimdata.h + fsd/interimpilotdataupdate.cpp + fsd/clientresponse.h + fsd/visualpilotdatatoggle.cpp + fsd/planeinforequestfsinn.h + fsd/planeinforequest.cpp + fsd/deletepilot.cpp + fsd/pilotdataupdate.h + fsd/serializer.h + fsd/visualpilotdatastopped.cpp + fsd/fsdidentification.h + fsd/visualpilotdataperiodic.h + + # VATSIM + vatsim/vatsimbookingreader.cpp + vatsim/vatsimbookingreader.h + vatsim/vatsimdatafilereader.cpp + vatsim/vatsimdatafilereader.h + vatsim/vatsimmetarreader.cpp + vatsim/vatsimmetarreader.h + vatsim/vatsimsettings.cpp + vatsim/vatsimsettings.h + vatsim/vatsimstatusfilereader.cpp + vatsim/vatsimstatusfilereader.h + vatsim/vatsimserverfilereader.cpp + vatsim/vatsimserverfilereader.h + + # Main + actionbind.cpp + actionbind.h + aircraftmatcher.cpp + aircraftmatcher.h + airspaceanalyzer.cpp + airspaceanalyzer.h + airspacemonitor.cpp + airspacemonitor.h + application.cpp + application.h + blackcoreexport.h + cookiemanager.cpp + cookiemanager.h + corefacade.cpp + corefacade.h + corefacadeconfig.cpp + corefacadeconfig.h + coremodeenums.h + githubpackagesreader.cpp + githubpackagesreader.h + inputmanager.cpp + inputmanager.h + modelsetbuilder.cpp + modelsetbuilder.h + pluginmanager.cpp + pluginmanager.h + pluginmanagersimulator.cpp + pluginmanagersimulator.h + pluginmanagerweatherdata.cpp + pluginmanagerweatherdata.h + progress.h + registermetadata.cpp + registermetadata.h + setupreader.cpp + setupreader.h + simulator.cpp + simulator.h + threadedreader.cpp + threadedreader.h + weatherdata.h + weathermanager.cpp + weathermanager.h + webdataservices.cpp + webdataservices.h + webdataservicesms.cpp + webdataservicesms.h + webreaderflags.cpp + webreaderflags.h +) + + +target_include_directories(core PUBLIC ${PROJECT_SOURCE_DIR}/src) + +target_link_libraries(core + PUBLIC + Qt::Core + misc + input + sound + externals_sodium + externals_msgpack + blackconfig + externals_vatsim_auth + PRIVATE + Qt::Qml + Qt::Xml +) + +target_compile_definitions(core PRIVATE BUILD_BLACKCORE_LIB) + +target_precompile_headers(core + PRIVATE + ${SWIFT_MISC_PCH} + ${SWIFT_CORE_PCH} +) + +install(TARGETS core + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) diff --git a/src/blackgui/CMakeLists.txt b/src/blackgui/CMakeLists.txt new file mode 100644 index 000000000..7c4984449 --- /dev/null +++ b/src/blackgui/CMakeLists.txt @@ -0,0 +1,980 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(gui SHARED + showhidebar.cpp + foreignwindows.h + dockwidget.cpp + labelandicon.cpp + altitudeedit.cpp + overlaymessages.h + stylesheetutility.h + systemtraywindow.h + singleapplicationui.h + dockwidgetinfobar.h + loginmodebuttons.ui + elidedpushbutton.cpp + models/liveryfilter.cpp + models/distributorlistmodel.h + models/actionmodel.h + models/airportlistmodel.h + models/liverylistmodel.h + models/listmodelcallsignobjects.cpp + models/liverylistmodel.cpp + models/listmodeltimestampobjects.h + models/statusmessagelistmodel.cpp + models/userlistmodel.h + models/aircraftcategorylistmodel.h + models/aircrafticaolistmodel.h + models/actionitem.cpp + models/listmodeldbobjects.cpp + models/identifierlistmodel.cpp + models/listmodelbasesimulation.cpp + models/listmodelbasenontemplate.h + models/distributorfilter.cpp + models/columns.h + models/aircraftsituationchangelistmodel.h + models/windlayerlistmodel.h + models/actionhotkeylistmodel.cpp + models/listmodelbaseaviation.cpp + models/interpolationsetupmodel.cpp + models/windlayerlistmodel.cpp + models/matchingstatisticsmodel.h + models/modelfilter.cpp + models/aircrafticaolistmodel.cpp + models/columnformatters.h + models/distributorfilter.h + models/allmodelcontainers.h + models/audiodeviceinfolistmodel.cpp + models/serverlistmodel.h + models/aircraftmodelfilter.cpp + models/simulatedaircraftlistmodel.cpp + models/aircraftsituationlistmodel.cpp + models/namevariantpairlistmodel.h + models/aircraftsituationchangelistmodel.cpp + models/airlineicaolistmodel.cpp + models/interpolationsetupmodel.h + models/airlineicaofilter.h + models/columns.cpp + models/liveryfilter.h + models/textmessagelistmodel.cpp + models/allmodels.h + models/textmessagelistmodel.h + models/actionmodel.cpp + models/listmodelbasenetwork.cpp + models/countryfilter.h + models/aircraftpartslistmodel.h + models/listmodelbaseweather.cpp + models/aircraftpartslistmodel.cpp + models/aircraftsituationlistmodel.h + models/aircraftmodelfilter.h + models/listmodeldbobjects.h + models/selectionmodel.h + models/clientlistmodel.h + models/aircraftmodellistmodel.cpp + models/listmodeltimestampobjects.cpp + models/distributorlistmodel.cpp + models/matchingstatisticsmodel.cpp + models/aircrafticaofilter.cpp + models/listmodelcallsignobjects.h + models/columnformatters.cpp + models/atcstationtreemodel.h + models/clientlistmodel.cpp + models/aircrafticaofilter.h + models/atcstationlistmodel.cpp + models/cloudlayerlistmodel.cpp + models/simulatedaircraftlistmodel.h + models/statusmessagelistmodel.h + models/aircraftcategorytreemodel.cpp + models/aircraftmodellistmodel.h + models/countrylistmodel.cpp + models/aircraftcategorylistmodel.cpp + models/namevariantpairlistmodel.cpp + models/actionitem.h + models/listmodelbase.cpp + models/audiodeviceinfolistmodel.h + models/listmodelbasemisc.cpp + models/listmodelbase.h + models/aircraftcategorytreemodel.h + models/airlineicaolistmodel.h + models/statusmessagefilter.h + models/listmodelbasenontemplate.cpp + models/countrylistmodel.h + models/temperaturelayerlistmodel.h + models/temperaturelayerlistmodel.cpp + models/serverlistmodel.cpp + models/countryfilter.cpp + models/applicationinfolistmodel.h + models/identifierlistmodel.h + models/modelfilter.h + models/cloudlayerlistmodel.h + models/userlistmodel.cpp + models/airportlistmodel.cpp + models/actionhotkeylistmodel.h + models/atcstationtreemodel.cpp + models/applicationinfolistmodel.cpp + models/statusmessagefilter.cpp + models/airlineicaofilter.cpp + models/atcstationlistmodel.h + enableforviewbasedindicator.h + pluginconfigwindow.h + views/cloudlayerview.cpp + views/interpolationsetupview.cpp + views/userview.h + views/aircraftcategorytreeview.h + views/windlayerview.h + views/viewtimestampobjects.cpp + views/aircrafticaoview.h + views/viewbase.h + views/viewbasemisc.cpp + views/windlayerview.cpp + views/temperaturelayerview.h + views/distributorview.h + views/checkboxdelegate.cpp + views/viewbaseproxystyle.cpp + views/serverview.cpp + views/distributorview.cpp + views/aircraftpartsview.cpp + views/radarview.h + views/serverview.h + views/airportview.h + views/audiodeviceinfoview.h + views/viewtimestampobjects.h + views/atcstationview.h + views/aircraftsituationview.cpp + views/temperaturelayerview.cpp + views/viewbaseproxystyle.h + views/identifierview.h + views/simulatedaircraftview.cpp + views/airportview.cpp + views/aircraftpartsview.h + views/airlineicaoview.cpp + views/applicationinfoview.h + views/userview.cpp + views/aircrafticaoview.cpp + views/simulatedaircraftview.h + views/clientview.h + views/viewbasenontemplate.cpp + views/airlineicaoview.h + views/matchingstatisticsview.h + views/aircraftsituationview.h + views/matchingstatisticsview.cpp + views/aircraftsituationchangeview.h + views/aircraftmodelstatisticsdialog.cpp + views/textmessageview.cpp + views/identifierview.cpp + views/viewbase.cpp + views/aircraftmodelvalidationdialog.cpp + views/viewdbobjects.cpp + views/viewcallsignobjects.h + views/aircraftmodelvalidationdialog.h + views/viewbaseaviation.cpp + views/interpolationsetupview.h + views/namevariantpairview.h + views/textmessageview.h + views/aircraftmodelstatisticsdialog.ui + views/aircraftmodelstatisticsdialog.h + views/audiodeviceinfoview.cpp + views/viewbaseweather.cpp + views/clientview.cpp + views/viewbaseitemdelegate.cpp + views/aircraftsituationchangeview.cpp + views/viewbasenetwork.cpp + views/viewbaseitemdelegate.h + views/flightplandialog.ui + views/atcstationtreeview.cpp + views/aircraftmodelview.h + views/namevariantpairview.cpp + views/statusmessageview.cpp + views/viewdbobjects.h + views/aircraftmodelvalidationdialog.ui + views/statusmessageview.h + views/viewcallsignobjects.cpp + views/aircraftcategoryview.h + views/applicationinfoview.cpp + views/atcstationtreeview.h + views/aircraftcategorytreeview.cpp + views/atcstationview.cpp + views/aircraftcategoryview.cpp + views/countryview.h + views/aircraftmodelview.cpp + views/checkboxdelegate.h + views/flightplandialog.h + views/radarview.cpp + views/liveryview.cpp + views/viewbasesimulation.cpp + views/cloudlayerview.h + views/countryview.cpp + views/liveryview.h + views/flightplandialog.cpp + plugindetailswindow.h + shortcut.cpp + led.cpp + qml + qml/Transceiver.qml + qml/qml.qrc + qml/AFVMap.qml + qml/AtcRing.qml + textmessagetextedit.cpp + labelandicon.ui + editors/networksetupform.ui + editors/fsdsetupform.cpp + editors/liveryform.ui + editors/relativeaircraftposition.ui + editors/networksetupform.cpp + editors/fsdsetupform.h + editors/cockpitcomform.cpp + editors/situationform.ui + editors/coordinateform.h + editors/liveryform.h + editors/situationform.h + editors/aircraftmodelform.h + editors/voicesetupform.h + editors/fsdsetupform.ui + editors/aircraftpartsform.cpp + editors/ownmodelsetform.h + editors/pilotform.cpp + editors/interpolationsetupform.ui + editors/matchingform.ui + editors/distributorform.cpp + editors/ownmodelsetform.ui + editors/coordinateform.cpp + editors/matchingform.h + editors/pilotform.h + editors/cockpitcomform.ui + editors/relativeaircraftposition.cpp + editors/matchingform.cpp + editors/modelmappingform.ui + editors/pilotform.ui + editors/form.h + editors/modelmappingmodifyform.h + editors/modelmappingmodifyform.cpp + editors/serverform.h + editors/liveryform.cpp + editors/validationindicator.h + editors/modelmappingform.h + editors/modelmappingform.cpp + editors/distributorform.ui + editors/networksetupform.h + editors/aircrafticaoform.h + editors/voicesetupform.ui + editors/aircraftpartsform.ui + editors/serverform.cpp + editors/modelmappingmodifyform.ui + editors/pbhsform.cpp + editors/validationindicator.ui + editors/aircraftpartsform.h + editors/pbhsform.ui + editors/coordinateform.ui + editors/distributorform.h + editors/airlineicaoform.cpp + editors/airlineicaoform.ui + editors/relativeaircraftposition.h + editors/form.cpp + editors/validationindicator.cpp + editors/interpolationsetupform.h + editors/situationform.cpp + editors/aircraftmodelform.cpp + editors/serverform.ui + editors/ownmodelsetform.cpp + editors/aircraftmodelform.ui + editors/airlineicaoform.h + editors/interpolationsetupform.cpp + editors/aircrafticaoform.ui + editors/pbhsform.h + editors/voicesetupform.cpp + editors/aircrafticaoform.cpp + editors/cockpitcomform.h + blackguiexport.h + pluginselector.cpp + levelmeter.cpp + loadindicator.h + pluginselector.h + infoarea.cpp + graphs + graphs/barchart.h + graphs/barchart.cpp + overlaymessagesframe.cpp + managedstatusbar.h + lineedithistory.cpp + dropsite.h + horizontalcombobox.h + dropsite.cpp + led.h + pluginconfigwindow.cpp + mainwindowaccess.cpp + guiapplication.h + labelandicon.h + loginmodebuttons.cpp + dockwidgetinfoarea.h + enableforframelesswindow.h + lineedithistory.h + showhidebar.h + overlaymessagesframe.h + loginmodebuttons.h + dockwidget.h + ticklabel.h + sharedstringlistcompleter.h + plugindetailswindow.cpp + enablefordockwidgetinfoarea.cpp + levelmeter.h + registermetadata.cpp + guiutility.cpp + showhidebar.ui + dropbase.cpp + windowfinder.cpp + textmessagetextedit.h + guiactionbind.cpp + components/interpolationcomponent.cpp + components/statusmessageform.h + components/firstmodelsetdialog.ui + components/legalinfocomponent.ui + components/cockpitcomaudiodialog.ui + components/dbmodelkeycompleter.cpp + components/radarcomponent.cpp + components/dbmappingcomponentaware.h + components/serverlistselector.cpp + components/settingssimulatorcomponent.h + components/settingsswiftplugin.cpp + components/updateinfodialog.h + components/rawfsdmessagesdialog.h + components/installxswiftbusdialog.cpp + components/distributorpreferencescomponent.ui + components/modelmatcherlogenable.ui + components/settingsxswiftbuscomponent.ui + components/selcalcodeselector.cpp + components/audionotificationcomponent.h + components/loginoverviewcomponent.h + components/updateinfodialog.ui + components/aircraftpartshistory.ui + components/copyconfigurationdialog.ui + components/autopublishdialog.ui + components/logincomponent.h + components/audionotificationcomponent.ui + components/settingsfontdialog.cpp + components/matchingstatisticscomponent.ui + components/modelmatcherlogcomponent.ui + components/ownaircraftcomponent.h + components/autopublishdialog.cpp + components/dbairlineicaocomponent.h + components/aircraftpartscomponent.ui + components/aircraftmodelstringcompleter.cpp + components/dbliveryselectorcomponent.ui + components/transpondermodecomponent.ui + components/autopublishcomponent.h + components/audioadvanceddistributeddialog.ui + components/settingsadvancedcomponent.h + components/dbdebugdatabasesetup.h + components/copyconfigurationcomponent.h + components/airportdialog.h + components/settingsmatchingdialog.cpp + components/modelmatcherlogcomponent.h + components/settingsmodelcomponent.h + components/coreinfoareacomponent.cpp + components/aircraftcomponent.h + components/modelconverterxsetupcomponent.ui + components/maininfoareacomponent.ui + components/altitudedialog.ui + components/callsigncompleter.cpp + components/audioadvanceddistributeddialog.h + components/mainkeypadareacomponent.h + components/textmessagecomponent.h + components/networkdetailscomponent.ui + components/settingsnetworkcomponent.h + components/infobarwebreadersstatussmallcomponent.ui + components/legalinfocomponent.cpp + components/usercomponent.ui + components/dbreducemodelduplicates.ui + components/installfsxterrainprobecomponent.cpp + components/weathercomponent.h + components/interpolationsetupcomponent.h + components/registermetadatacomponents.cpp + components/networkaircraftvaluescomponent.h + components/datainfoareacomponent.ui + components/settingstextmessageinlinecomponent.h + components/cockpitcomaudiodialog.h + components/dbautosimulatorstashingcomponent.h + components/settingsswiftplugin.ui + components/dbliverycolorsearchdialog.cpp + components/atcbuttoncomponent.cpp + components/cockpitcomcomponent.ui + components/dbreducemodelduplicates.cpp + components/countryselector.ui + components/coordinatedialog.ui + components/dbquickmappingwizard.h + components/dbmodelcomponent.cpp + components/modelconverterxsetupcomponent.cpp + components/logcomponent.h + components/dbstashcomponent.cpp + components/texteditdialog.ui + components/dbownmodelsetcomponent.ui + components/weathercomponent.cpp + components/scalescreenfactor.h + components/rawfsdmessagesdialog.cpp + components/flightplancomponent.h + components/dbownmodelsetcomponent.cpp + components/settingsmatchingdialog.h + components/aircraftmodelvalidationcomponent.h + components/autopublishdialog.h + components/maininfoareacomponent.h + components/logindialog.h + components/commandinput.h + components/configsimulatorcomponent.ui + components/datamaininfoareacomponent.cpp + components/settingsatcstationsinlinecomponent.cpp + components/applicationclosedialog.cpp + components/settingshotkeycomponent.h + components/datamaininfoareacomponent.h + components/settingsnetworkserverscomponent.ui + components/settingsmodelcomponent.ui + components/dbaircrafticaoselectorcomponent.h + components/corestatuscomponent.cpp + components/audioadvanceddistributedcomponent.ui + components/settingsfontcomponent.cpp + components/colorselector.cpp + components/aircraftmodelvalidationcomponent.cpp + components/settingsguicomponent.h + components/dbaircrafticaocomponent.cpp + components/loginoverviewcomponent.ui + components/setuploadingdialog.ui + components/dbmappingcomponent.ui + components/mappingcomponent.cpp + components/settingsfontdialog.h + components/dbownmodelsetdialog.cpp + components/statusmessageform.ui + components/distributorpreferencescomponent.h + components/firstmodelsetdialog.cpp + components/cockpitcomaudiodialog.cpp + components/dbairlineicaoselectorcomponent.ui + components/modelmatchercomponent.ui + components/dblogincomponent.h + components/coordinatedialog.h + components/settingsadvancedcomponent.cpp + components/dbdistributorselectorcomponent.ui + components/dbliverycomponent.h + components/dbairlineicaocomponent.ui + components/radarcomponent.h + components/coresettingsdialog.ui + components/simulatorcomponent.ui + components/simulatorcomponent.h + components/airportsmallcompleter.h + components/dbusserveraddressselector.ui + components/settingscomponent.ui + components/settingstextmessagestyle.ui + components/dbownmodelsdialog.h + components/settingsvatsimreaderscomponent.cpp + components/settingscomponent.h + components/updateinfocomponent.ui + components/infobarwebreadersstatuscomponent.h + components/setuploadingdialog.cpp + components/flightplancomponent.ui + components/dbautosimulatorstashingcomponent.ui + components/downloaddialog.ui + components/hotkeydialog.h + components/dbloaddatadialog.h + components/dbcountryselectorcomponent.cpp + components/interpolationlogdisplay.ui + components/statusmessagesdetail.ui + components/firstmodelsetcomponent.h + components/internalscomponent.ui + components/dbmappingcomponent.cpp + components/ownaircraftcomponent.cpp + components/dbcountrycomponent.cpp + components/otherswiftversionscomponent.ui + components/logcomponent.ui + components/settingsmatchingdialog.ui + components/settingsfontdialog.ui + components/loginadvcomponent.h + components/simulatorselector.ui + components/aircraftcomponent.ui + components/scalescreenfactor.ui + components/settingsmatchingcomponent.h + components/autopublishcomponent.ui + components/modelmatchercomponent.cpp + components/dbmodelmappingmodifydialog.ui + components/dbliverycolorsearch.cpp + components/rawfsdmessagescomponent.h + components/settingsswiftplugin.h + components/simbriefdownloaddialog.ui + components/atcstationcomponent.cpp + components/initialdataloadcomponent.h + components/airportsmallcompleter.cpp + components/dbownmodelsetdialog.ui + components/applicationclosedialog.ui + components/modelbrowsercomponent.ui + components/installsimulatorspecificwizardpage.h + components/dbliverycomponent.cpp + components/aircraftmodelvalidationcomponent.ui + components/settingsnetworkserverscomponent.h + components/copymodelsfromotherswiftversionsdialog.h + components/ownaircraftcomponent.ui + components/networkaircraftvaluescomponent.cpp + components/settingsxswiftbuscomponent.cpp + components/installxswiftbuscomponent.ui + components/aircraftmodelsetvalidationdialog.ui + components/dbloadoverviewcomponent.ui + components/dbliverycolorsearchdialog.ui + components/dbmodelkeycompleter.h + components/firstmodelsetdialog.h + components/audionotificationcomponent.cpp + components/dbownmodelsetformdialog.ui + components/registercomponent.ui + components/infobarwebreadersstatussmallcomponent.cpp + components/otherswiftversionsdialog.cpp + components/dbloadoverviewcomponent.cpp + components/airportsmallcompleter.ui + components/internalscomponent.cpp + components/interpolationlogdisplaydialog.h + components/mappingcomponent.ui + components/datasettingscomponent.h + components/dbmodelworkbenchcomponent.cpp + components/dbquickmappingwizard.ui + components/aircraftpartshistory.cpp + components/radarcomponent.ui + components/simbriefdownloaddialog.h + components/dbownmodelscomponent.ui + components/texteditdialog.h + components/interpolationcomponent.ui + components/dbownmodelsetformdialog.h + components/airportcompleter.cpp + components/dbdebugdatabasesetup.cpp + components/modelmatcherlogenable.h + components/updateinfocomponent.h + components/countryselector.cpp + components/infobarstatuscomponent.h + components/dbownmodelscomponent.h + components/hotkeydialog.cpp + components/configsimulatorcomponent.h + components/dbloaddatadialog.cpp + components/settingscomponent.cpp + components/dbairlinenameselectorcomponent.h + components/matchingstatisticscomponent.cpp + components/dbliveryselectorcomponent.cpp + components/firstmodelsetcomponent.cpp + components/cgsourceselector.ui + components/modelconverterxsetupcomponent.h + components/aircraftpartscomponent.h + components/settingsviewupdatetimes.cpp + components/dbaircrafticaoselectorcomponent.ui + components/textmessagecomponenttab.h + components/modelmatcherlogenable.cpp + components/aircraftcombinedtypeselector.cpp + components/modelbrowserdialog.ui + components/dbcountryselectorcomponent.ui + components/dbusserveraddressselector.h + components/copysettingsandcachescomponent.cpp + components/settingstextmessageinlinecomponent.ui + components/colorselector.ui + components/dbusserveraddressselector.cpp + components/audioadvanceddistributedcomponent.h + components/initialdataloadcomponent.ui + components/copymodelsfromotherswiftversionsdialog.ui + components/settingssimulatorcomponent.ui + components/initialdataloadcomponent.cpp + components/dbaircraftcategorycomponent.cpp + components/dbmappingcomponentaware.cpp + components/coreinfoareacomponent.ui + components/coordinatedialog.cpp + components/dbliveryselectorcomponent.h + components/dbmodelcomponent.h + components/networkdetailscomponent.cpp + components/downloadcomponent.cpp + components/aboutdialog.cpp + components/dbliverycolorsearch.h + components/aircraftpartscomponent.cpp + components/settingssimulatorbasicscomponent.cpp + components/hotkeydialog.ui + components/dbcountryselectorcomponent.h + components/configurationwizard.ui + components/coresettingsdialog.cpp + components/modelbrowsercomponent.h + components/abouthtmlcomponent.h + components/abouthtmlcomponent.ui + components/dbairlinenameselectorcomponent.ui + components/dbdistributorcomponent.h + components/autopublishcomponent.cpp + components/statusmessageformsmall.ui + components/audiodevicevolumesetupcomponent.h + components/applicationclosedialog.h + components/dbmappingcomponent.h + components/modelmatchercomponent.h + components/simulatorcomponent.cpp + components/allmaininfoareacomponents.h + components/downloaddialog.h + components/statusmessagesdetail.h + components/settingsfontcomponent.ui + components/remoteaircraftselector.ui + components/aircraftcombinedtypeselector.ui + components/infobarwebreadersstatuscomponent.cpp + components/afvmapdialog.ui + components/dbdistributorselectorcomponent.cpp + components/networkdetailscomponent.h + components/otherswiftversionsdialog.h + components/coresettingsdialog.h + components/serverlistselector.h + components/navigatordialog.ui + components/installxswiftbuscomponent.cpp + components/cockpitcomponent.ui + components/navigatordialog.h + components/logincomponent.cpp + components/callsigncompleter.ui + components/cockpitcomponent.cpp + components/simbriefdownloaddialog.cpp + components/simulatorselector.cpp + components/audiodevicevolumesetupcomponent.ui + components/dbloaddatadialog.ui + components/mainkeypadareacomponent.cpp + components/modelmodeselector.ui + components/copymodelsfromotherswiftversionscomponent.h + components/corestatuscomponent.h + components/countryselector.h + components/settingsviewupdatetimes.h + components/dbstashcomponent.ui + components/dbdistributorcomponent.cpp + components/settingssimulatormessagescomponent.h + components/texteditdialog.cpp + components/dbairlineicaoselectorbase.cpp + components/aircraftmodelstringcompleter.h + components/settingsatcstationsinlinecomponent.ui + components/modelbrowserdialog.cpp + components/airportdialog.cpp + components/rawfsdmessagescomponent.ui + components/transpondercodespinbox.h + components/cockpitcomcomponent.h + components/interpolationsetupcomponent.cpp + components/infobarstatuscomponent.cpp + components/registermetadatacomponents.h + components/modelmodeselector.h + components/settingsviewupdatetimes.ui + components/airportcompleter.h + components/cockpitinfoareacomponent.cpp + components/dbdebugdatabasesetup.ui + components/cockpittranspondermodeledscomponent.cpp + components/installfsxterrainprobecomponent.h + components/interpolationlogdisplay.h + components/selcalcodeselector.ui + components/stringlistdialog.h + components/matchingstatisticscomponent.h + components/dbloadoverviewcomponent.h + components/dbdistributorselectorcomponent.h + components/setuploadingdialog.h + components/copysettingsandcachescomponent.h + components/downloaddialog.cpp + components/callsigncompleter.h + components/altitudedialog.cpp + components/copymodelsfromotherswiftversionscomponent.cpp + components/settingssimulatormessagescomponent.cpp + components/dbaircraftcategorycomponent.ui + components/loginoverviewcomponent.cpp + components/cockpitcomtransmissioncomponent.ui + components/interpolationlogdisplay.cpp + components/dblogincomponent.cpp + components/aircraftmodelsetvalidationdialog.h + components/audiodevicevolumesetupcomponent.cpp + components/settingsatcstationsinlinecomponent.h + components/aboutdialog.h + components/textmessagecomponent.ui + components/aircraftmodelsetvalidationdialog.cpp + components/coreinfoareacomponent.h + components/rawfsdmessagesdialog.ui + components/dbautostashingcomponent.h + components/afvmapdialog.h + components/transpondermodecomponent.h + components/remoteaircraftselector.cpp + components/stringlistdialog.cpp + components/atcstationcomponent.ui + components/mainkeypadareacomponent.ui + components/settingssimulatorcomponent.cpp + components/dbairlineicaoselectorbase.h + components/dbownmodelsdialog.ui + components/afvmapdialog.cpp + components/dbmodelcomponent.ui + components/modelmatcherlogcomponent.cpp + components/airportcompleter.ui + components/cgsourceselector.h + components/legalinfocomponent.h + components/settingsvatsimreaderscomponent.ui + components/infobarwebreadersstatuscomponent.ui + components/dbmodelmappingmodifydialog.cpp + components/dbliverycolorsearchdialog.h + components/modelbrowserdialog.h + components/aboutdialog.ui + components/logindialog.ui + components/cockpitcomcomponent.cpp + components/logcomponent.cpp + components/copyconfigurationdialog.cpp + components/configurationwizard.cpp + components/downloadcomponent.ui + components/dbquickmappingwizard.cpp + components/aircraftcombinedtypeselector.h + components/dbownmodelsetformdialog.cpp + components/dbmodelworkbenchcomponent.ui + components/otherswiftversionsdialog.ui + components/dbreducemodelduplicates.h + components/colorselector.h + components/weathercomponent.ui + components/dbstashcomponent.h + components/transpondercodespinbox.cpp + components/interpolationcomponent.h + components/dbairlineicaoselectorcomponent.h + components/logindialog.cpp + components/maininfoareacomponent.cpp + components/mappingcomponent.h + components/dbautostashingcomponent.ui + components/copysettingsandcachescomponent.ui + components/dbaircraftcategorycomponent.h + components/copymodelsfromotherswiftversionscomponent.ui + components/settingsnetworkserverscomponent.cpp + components/aircraftmodelstringcompleter.ui + components/altitudedialog.h + components/textmessagecomponent.cpp + components/flightplancomponent.cpp + components/usercomponent.cpp + components/cockpitinfoareacomponent.h + components/interpolationlogdisplaydialog.ui + components/installxswiftbusdialog.h + components/settingssimulatorbasicscomponent.ui + components/copyconfigurationdialog.h + components/scalescreenfactor.cpp + components/downloadcomponent.h + components/audioadvanceddistributeddialog.cpp + components/configurationwizard.h + components/atcbuttoncomponent.ui + components/transpondermodeselector.h + components/statusmessageformsmall.h + components/dbaircrafticaoselectorcomponent.cpp + components/infobarstatuscomponent.ui + components/interpolationlogdisplaydialog.cpp + components/dbdistributorcomponent.ui + components/cockpittranspondermodeledscomponent.h + components/settingssimulatormessagescomponent.ui + components/settingsmatchingcomponent.cpp + components/modelbrowsercomponent.cpp + components/settingsguicomponent.ui + components/dbautostashingcomponent.cpp + components/transpondermodecomponent.cpp + components/configsimulatorcomponent.cpp + components/atcbuttoncomponent.h + components/cockpitinfoareacomponent.ui + components/settingssimulatorbasicscomponent.h + components/settingsvatsimreaderscomponent.h + components/marginsinput.ui + components/aircraftcomponent.cpp + components/settingsmodelcomponent.cpp + components/logincomponent.ui + components/stringlistdialog.ui + components/dbcountrycomponent.ui + components/loginadvcomponent.cpp + components/selcalcodeselector.h + components/navigatordialog.cpp + components/dblogincomponent.ui + components/usercomponent.h + components/dbairlinenameselectorcomponent.cpp + components/dbautosimulatorstashingcomponent.cpp + components/statusmessageformsmall.cpp + components/marginsinput.cpp + components/dbliverycolorsearch.ui + components/dbcountrycomponent.h + components/transpondermodeselector.cpp + components/dbownmodelsetcomponent.h + components/networkaircraftvaluescomponent.ui + components/dbaircrafticaocomponent.h + components/corestatuscomponent.ui + components/loginadvcomponent.ui + components/datasettingscomponent.ui + components/cockpitcomtransmissioncomponent.cpp + components/copyconfigurationcomponent.cpp + components/firstmodelsetcomponent.ui + components/settingsnetworkcomponent.ui + components/cgsourceselector.cpp + components/statusmessagesdetail.cpp + components/otherswiftversionscomponent.cpp + components/audioadvanceddistributedcomponent.cpp + components/dbmodelmappingmodifydialog.h + components/interpolationsetupcomponent.ui + components/datasettingscomponent.cpp + components/dbownmodelsetdialog.h + components/infobarwebreadersstatussmallcomponent.h + components/installxswiftbusdialog.ui + components/dbmodelworkbenchcomponent.h + components/updateinfodialog.cpp + components/copymodelsfromotherswiftversionsdialog.cpp + components/settingsadvancedcomponent.ui + components/datainfoareacomponent.h + components/dbownmodelscomponent.cpp + components/marginsinput.h + components/copyconfigurationcomponent.ui + components/registercomponent.cpp + components/statusmessageform.cpp + components/settingsxswiftbuscomponent.h + components/datainfoareacomponent.cpp + components/dbownmodelsdialog.cpp + components/updateinfocomponent.cpp + components/rawfsdmessagescomponent.cpp + components/dbairlineicaoselectorcomponent.cpp + components/abouthtmlcomponent.cpp + components/settingsmatchingcomponent.ui + components/otherswiftversionscomponent.h + components/settingsfontcomponent.h + components/commandinput.cpp + components/settingstextmessageinlinecomponent.cpp + components/atcstationcomponent.h + components/settingsguicomponent.cpp + components/cockpitcomtransmissioncomponent.h + components/modelmodeselector.cpp + components/remoteaircraftselector.h + components/installxswiftbuscomponent.h + components/installfsxterrainprobecomponent.ui + components/internalscomponent.h + components/settingshotkeycomponent.ui + components/settingstextmessagestyle.cpp + components/dbaircrafticaocomponent.ui + components/simulatorselector.h + components/distributorpreferencescomponent.cpp + components/settingsnetworkcomponent.cpp + components/airportdialog.ui + components/registercomponent.h + components/cockpitcomponent.h + components/datamaininfoareacomponent.ui + components/dbairlineicaocomponent.cpp + components/aircraftpartshistory.h + components/settingshotkeycomponent.cpp + components/settingstextmessagestyle.h + components/dbliverycomponent.ui + elidedpushbutton.h + enableforframelesswindow.cpp + overlaymessages.cpp + foreignwindows.cpp + stylesheetutility.cpp + dropbase.h + eventfilter.cpp + copyxswiftbusdialog.h + infoarea.h + altitudeedit.h + copyxswiftbusdialog.cpp + ecosystemcombobox.h + dockwidgetinfoarea.cpp + guiutility.h + uppercasevalidator.cpp + mainwindowaccess.h + eventfilter.h + singleapplicationui.cpp + ecosystemcombobox.cpp + menus/fontmenus.h + menus/menuaction.h + menus/aircraftmodelmenus.h + menus/fontmenus.cpp + menus/menuaction.cpp + menus/menudelegate.h + menus/aircraftmodelmenus.cpp + dockwidgetinfobar.cpp + splashscreen.cpp + filters/aircraftmodelfilterbar.cpp + filters/countryfilterbar.ui + filters/aircraftmodelfilterbar.ui + filters/liveryfilterbar.ui + filters/distributorfilterbar.ui + filters/airlineicaofilterbar.cpp + filters/countryfilterbar.cpp + filters/aircrafticaofilterbar.cpp + filters/aircraftmodelfilterdialog.h + filters/airlineicaofilterbar.ui + filters/aircrafticaofilterbar.ui + filters/distributorfilterbar.h + filters/aircraftmodelfilterdialog.cpp + filters/statusmessagefilterdialog.ui + filters/filterwidget.cpp + filters/liveryfilterbar.h + filters/statusmessagefilterdialog.cpp + filters/liveryfilterbar.cpp + filters/statusmessagefilterbar.cpp + filters/statusmessagefilterbar.h + filters/statusmessagefilterbar.ui + filters/filterwidget.h + filters/aircraftmodelfilterdialog.ui + filters/aircraftmodelfilterbar.h + filters/countryfilterbar.h + filters/airlineicaofilterbar.h + filters/distributorfilterbar.cpp + filters/aircrafticaofilterbar.h + filters/filterbarbuttons.h + filters/filterbarbuttons.cpp + filters/filterdialog.h + filters/filterbarbuttons.ui + filters/statusmessagefilterdialog.h + filters/filterdialog.cpp + pluginconfig.h + ticklabel.cpp + guiactionbind.h + guiapplication.cpp + registermetadata.h + enablefordockwidgetinfoarea.h + shortcut.h + plugindetailswindow.ui + loadindicator.cpp + horizontalcombobox.cpp + settings/dockwidgetsettings.h + settings/navigatorsettings.h + settings/guisettings.h + settings/viewupdatesettings.h + settings/updatenotification.h + settings/viewupdatesettings.cpp + settings/navigatorsettings.cpp + settings/guisettings.cpp + settings/textmessagesettings.h + settings/atcstationssettings.h + settings/dockwidgetsettings.cpp + settings/textmessagesettings.cpp + settings/atcstationssettings.cpp + managedstatusbar.cpp + sharedstringlistcompleter.cpp + overlaymessages.ui + windowfinder.h + splashscreen.h + enableforviewbasedindicator.cpp + uppercasevalidator.h + systemtraywindow.cpp + + ) + +if(WIN32) + target_sources(gui PRIVATE + win/windowfinderwindows.cpp + win/windowfinderwindows.h + ) +endif() + +# Copy resources +add_custom_command(TARGET gui + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different share ${PROJECT_BINARY_DIR}/out/share + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + +target_include_directories(gui PUBLIC ${PROJECT_SOURCE_DIR}/src) + +target_link_libraries(gui + PUBLIC + Qt::Core + misc + core + Qt::Widgets + Qt::Svg + externals_qwt_plot + ) + +target_compile_definitions(gui PRIVATE BUILD_BLACKGUI_LIB) +target_compile_definitions(gui PRIVATE QWT_DLL) + +target_precompile_headers(gui + PRIVATE + ${SWIFT_MISC_PCH} + ${SWIFT_CORE_PCH} + ${SWIFT_GUI_PCH} +) + +install(TARGETS gui + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) + +install(DIRECTORY share/qss DESTINATION ${CMAKE_INSTALL_PREFIX}/share/) diff --git a/src/blackinput/CMakeLists.txt b/src/blackinput/CMakeLists.txt new file mode 100644 index 000000000..3ffb9e13f --- /dev/null +++ b/src/blackinput/CMakeLists.txt @@ -0,0 +1,53 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(input SHARED + blackinputexport.h + joystick.cpp + joystick.h + keyboard.cpp + keyboard.h +) + +if(WIN32) + target_sources(input PRIVATE + win/joystickwindows.cpp + win/joystickwindows.h + win/keyboardwindows.cpp + win/keyboardwindows.h + ) + target_compile_definitions(input PRIVATE DIRECTINPUT_VERSION=0x0800) + target_link_libraries(input PUBLIC dxguid ole32 dinput8 User32) +elseif(APPLE) + target_sources(input PRIVATE + macos/joystickmacos.mm + macos/joystickmacos.h + macos/keyboardmacos.mm + macos/keyboardmacos.h + macos/macosinpututils.h + macos/macosinpututils.mm + ) + target_link_libraries(input PUBLIC "-framework CoreFoundation" "-framework ApplicationServices" "-framework Foundation" "-framework AppKit" "-framework IOKit") +else() + target_sources(input PRIVATE + linux/joysticklinux.cpp + linux/joysticklinux.h + linux/keyboardlinux.cpp + linux/keyboardlinux.h + ) +endif() + +target_include_directories(input PUBLIC ${PROJECT_SOURCE_DIR}/src) + +target_link_libraries(input + PUBLIC + Qt::Core + misc +) + +target_compile_definitions(input PRIVATE BUILD_BLACKINPUT_LIB) + +install(TARGETS input + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) diff --git a/src/blackmisc/CMakeLists.txt b/src/blackmisc/CMakeLists.txt new file mode 100644 index 000000000..9401a1eaa --- /dev/null +++ b/src/blackmisc/CMakeLists.txt @@ -0,0 +1,750 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_subdirectory(share/dbus-1) + +add_library(misc SHARED + # Audio + audio/audiodeviceinfo.cpp + audio/audiodeviceinfo.h + audio/audiodeviceinfolist.cpp + audio/audiodeviceinfolist.h + audio/audiosettings.cpp + audio/audiosettings.h + audio/audioutils.cpp + audio/audioutils.h + audio/notificationsounds.cpp + audio/notificationsounds.h + audio/ptt.h + audio/registermetadataaudio.cpp + audio/registermetadataaudio.h + audio/voicesetup.cpp + audio/voicesetup.h + + # Aviation + aviation/aircraftcategory.cpp + aviation/aircraftcategory.h + aviation/aircraftcategorylist.cpp + aviation/aircraftcategorylist.h + aviation/aircraftengine.cpp + aviation/aircraftengine.h + aviation/aircraftenginelist.cpp + aviation/aircraftenginelist.h + aviation/aircrafticaocode.cpp + aviation/aircrafticaocode.h + aviation/aircrafticaocodelist.cpp + aviation/aircrafticaocodelist.h + aviation/aircraftlights.cpp + aviation/aircraftlights.h + aviation/aircraftparts.cpp + aviation/aircraftparts.h + aviation/aircraftpartslist.cpp + aviation/aircraftpartslist.h + aviation/aircraftsituation.cpp + aviation/aircraftsituation.h + aviation/aircraftsituationchange.cpp + aviation/aircraftsituationchange.h + aviation/aircraftsituationchangelist.cpp + aviation/aircraftsituationchangelist.h + aviation/aircraftsituationlist.cpp + aviation/aircraftsituationlist.h + aviation/aircraftvelocity.cpp + aviation/aircraftvelocity.h + aviation/airlineicaocode.cpp + aviation/airlineicaocode.h + aviation/airlineicaocodelist.cpp + aviation/airlineicaocodelist.h + aviation/airport.cpp + aviation/airport.h + aviation/airporticaocode.cpp + aviation/airporticaocode.h + aviation/airportlist.cpp + aviation/airportlist.h + aviation/altitude.cpp + aviation/altitude.h + aviation/atcstation.cpp + aviation/atcstation.h + aviation/atcstationlist.cpp + aviation/atcstationlist.h + aviation/callsign.cpp + aviation/callsign.h + aviation/callsignobjectlist.h + aviation/callsignset.cpp + aviation/callsignset.h + aviation/comsystem.cpp + aviation/comsystem.h + aviation/flightplan.cpp + aviation/flightplan.h + aviation/flightplanlist.cpp + aviation/flightplanlist.h + aviation/heading.cpp + aviation/heading.h + aviation/informationmessage.cpp + aviation/informationmessage.h + aviation/livery.cpp + aviation/livery.h + aviation/liverylist.cpp + aviation/liverylist.h + aviation/modulator.cpp + aviation/modulator.h + aviation/navsystem.h + aviation/percallsign.h + aviation/registermetadataaviation.cpp + aviation/registermetadataaviation.h + aviation/selcal.cpp + aviation/selcal.h + aviation/simbriefdata.cpp + aviation/simbriefdata.h + aviation/track.cpp + aviation/track.h + aviation/transponder.cpp + aviation/transponder.h + + # DB + db/artifact.cpp + db/artifact.h + db/artifactlist.cpp + db/artifactlist.h + db/datastore.cpp + db/datastore.h + db/datastoreobjectlist.h + db/datastoreutility.cpp + db/datastoreutility.h + db/dbflags.cpp + db/dbflags.h + db/dbinfo.cpp + db/dbinfo.h + db/dbinfolist.cpp + db/dbinfolist.h + db/distribution.cpp + db/distribution.h + db/distributionlist.cpp + db/distributionlist.h + db/registermetadatadb.cpp + db/registermetadatadb.h + db/updateinfo.cpp + db/updateinfo.h + + # Geo + geo/coordinategeodetic.cpp + geo/coordinategeodetic.h + geo/coordinategeodeticlist.cpp + geo/coordinategeodeticlist.h + geo/earthangle.cpp + geo/earthangle.h + geo/elevationplane.cpp + geo/elevationplane.h + geo/geoobjectlist.h + geo/kmlutils.cpp + geo/kmlutils.h + geo/latitude.h + geo/longitude.h + geo/registermetadatageo.cpp + geo/registermetadatageo.h + + # Input + input/actionhotkey.cpp + input/actionhotkey.h + input/actionhotkeydefs.cpp + input/actionhotkeydefs.h + input/actionhotkeylist.cpp + input/actionhotkeylist.h + input/hotkeycombination.cpp + input/hotkeycombination.h + input/joystickbutton.cpp + input/joystickbutton.h + input/joystickbuttonlist.cpp + input/joystickbuttonlist.h + input/keyboardkey.cpp + input/keyboardkey.h + input/keyboardkeylist.cpp + input/keyboardkeylist.h + input/keycodes.h + input/registermetadatainput.cpp + input/registermetadatainput.h + + # Main + algorithm.h + applicationinfo.h + applicationinfo.cpp + applicationinfolist.cpp + applicationinfolist.h + atomicfile.cpp + atomicfile.h + blackmiscexport.h + cachesettingsutils.cpp + cachesettingsutils.h + collection.h + comparefunctions.h + compressutils.cpp + compressutils.h + connectionguard.cpp + connectionguard.h + containerbase.h + country.cpp + country.h + countrylist.cpp + countrylist.h + cputime.cpp + cputime.h + crashhandler.cpp + crashhandler.h + crashinfo.cpp + crashinfo.h + crashsettings.cpp + crashsettings.h + datacache.cpp + datacache.h + datastream.h + dbus.cpp + dbus.h + dbusserver.cpp + dbusserver.h + dbusutils.cpp + dbusutils.h + dictionary.h + digestsignal.cpp + digestsignal.h + directories.cpp + directories.h + directoryutils.cpp + directoryutils.h + eventloop.h + filelogger.cpp + filelogger.h + fileutils.cpp + fileutils.h + genericdbusinterface.h + htmlutils.cpp + htmlutils.h + icon.cpp + icon.h + iconlist.cpp + iconlist.h + icons.cpp + icons.h + identifiable.cpp + identifiable.h + identifier.cpp + identifier.h + identifierlist.cpp + identifierlist.h + identifierset.cpp + identifierset.h + imageutils.cpp + imageutils.h + inheritancetraits.h + integersequence.h + invoke.h + iterator.h + json.cpp + json.h + jsonexception.cpp + jsonexception.h + librarypath.cpp + librarypath.h + lockfree.h + logcategories.h + logcategory.cpp + logcategory.h + logcategorylist.cpp + logcategorylist.h + loghandler.cpp + loghandler.h + loghistory.cpp + loghistory.h + logmessage.cpp + logmessage.h + logpattern.cpp + logpattern.h + mapbuilder.h + memotable.h + metaclass.h + metadatautils.cpp + metadatautils.h + namevariantpair.cpp + namevariantpair.h + namevariantpairlist.cpp + namevariantpairlist.h + obfuscation.cpp + obfuscation.h + optional.h + orderable.cpp + orderable.h + orderablelist.h + pixmap.cpp + pixmap.h + platform.cpp + platform.h + platformset.cpp + platformset.h + predicates.h + processctrl.cpp + processctrl.h + processinfo.cpp + processinfo.h + promise.h + propertyindex.cpp + propertyindex.h + propertyindexallclasses.h + propertyindexlist.cpp + propertyindexlist.h + propertyindexref.cpp + propertyindexref.h + propertyindexvariantmap.cpp + propertyindexvariantmap.h + provider.cpp + provider.h + range.h + registermetadata.cpp + registermetadata.h + restricted.h + rgbcolor.cpp + rgbcolor.h + sequence.cpp + sequence.h + setbuilder.h + settingscache.cpp + settingscache.h + simplecommandparser.cpp + simplecommandparser.h + slot.h + stacktrace.cpp + stacktrace.h + statusexception.cpp + statusexception.h + statusmessage.cpp + statusmessage.h + statusmessagelist.cpp + statusmessagelist.h + stringutils.cpp + stringutils.h + swiftdirectories.cpp + swiftdirectories.h + threadutils.cpp + threadutils.h + timestampbased.cpp + timestampbased.h + timestampobjectlist.h + tokenbucket.cpp + tokenbucket.h + tuple.h + typetraits.h + valuecache.cpp + valuecache.h + valuecacheprivate.h + valueobject.h + variant.cpp + variant.h + variantlist.cpp + variantlist.h + variantmap.cpp + variantmap.h + variantprivate.h + verify.cpp + verify.h + windllutils.cpp + windllutils.h + worker.cpp + worker.h + blackmisc.qrc + + # Math + math/constants.h + math/mathutils.cpp + math/mathutils.h + + # Mixin + mixin/mixincompare.h + mixin/mixindatastream.h + mixin/mixindbus.h + mixin/mixinhash.h + mixin/mixinicon.h + mixin/mixinindex.h + mixin/mixinjson.h + mixin/mixinmetatype.h + mixin/mixinstring.h + + # Network + network/data/lastserver.h + network/settings/serversettings.h + network/authenticateduser.cpp + network/authenticateduser.h + network/external/qjsonwebtoken.cpp + network/external/qjsonwebtoken.h + network/client.cpp + network/client.h + network/clientlist.cpp + network/clientlist.h + network/clientprovider.cpp + network/clientprovider.h + network/connectionstatus.cpp + network/connectionstatus.h + network/ecosystem.cpp + network/ecosystem.h + network/ecosystemlist.cpp + network/ecosystemlist.h + network/ecosystemprovider.cpp + network/ecosystemprovider.h + network/entityflags.cpp + network/entityflags.h + network/facilitytype.cpp + network/facilitytype.h + network/fsdsetup.cpp + network/fsdsetup.h + network/loginmode.cpp + network/loginmode.h + network/networkutils.cpp + network/networkutils.h + network/ping.cpp + network/ping.h + network/rawfsdmessage.cpp + network/rawfsdmessage.h + network/rawfsdmessagelist.cpp + network/rawfsdmessagelist.h + network/registermetadatanetwork.cpp + network/registermetadatanetwork.h + network/remotefile.cpp + network/remotefile.h + network/remotefilelist.cpp + network/remotefilelist.h + network/role.cpp + network/role.h + network/rolelist.cpp + network/rolelist.h + network/server.cpp + network/server.h + network/serverlist.cpp + network/serverlist.h + network/textmessage.cpp + network/textmessage.h + network/textmessagelist.cpp + network/textmessagelist.h + network/url.cpp + network/url.h + network/urllist.cpp + network/urllist.h + network/urllog.cpp + network/urllog.h + network/urlloglist.cpp + network/urlloglist.h + network/user.cpp + network/user.h + network/userlist.cpp + network/userlist.h + network/voicecapabilities.cpp + network/voicecapabilities.h + + # PQ + pq/acceleration.h + pq/angle.cpp + pq/angle.h + pq/constants.h + pq/frequency.h + pq/length.h + pq/literals.cpp + pq/literals.h + pq/mass.h + pq/measurementunit.cpp + pq/measurementunit.h + pq/physicalquantity.cpp + pq/physicalquantity.h + pq/pqstring.cpp + pq/pqstring.h + pq/pressure.h + pq/registermetadatapq.cpp + pq/registermetadatapq.h + pq/speed.h + pq/temperature.h + pq/time.cpp + pq/time.h + pq/units.cpp + pq/units.h + + # Shared state + sharedstate/dbus/duplex.cpp + sharedstate/dbus/duplex.h + sharedstate/dbus/dupleximpl.cpp + sharedstate/dbus/dupleximpl.h + sharedstate/dbus/duplexproxy.cpp + sharedstate/dbus/duplexproxy.h + sharedstate/dbus/hub.cpp + sharedstate/dbus/hub.h + sharedstate/dbus/hubimpl.cpp + sharedstate/dbus/hubimpl.h + sharedstate/dbus/hubproxy.cpp + sharedstate/dbus/hubproxy.h + sharedstate/activemutator.cpp + sharedstate/activemutator.h + sharedstate/activeobserver.cpp + sharedstate/activeobserver.h + sharedstate/datalink.cpp + sharedstate/datalink.h + sharedstate/datalinkdbus.cpp + sharedstate/datalinkdbus.h + sharedstate/datalinklocal.cpp + sharedstate/datalinklocal.h + sharedstate/listjournal.cpp + sharedstate/listjournal.h + sharedstate/listmutator.cpp + sharedstate/listmutator.h + sharedstate/listobserver.cpp + sharedstate/listobserver.h + sharedstate/passivemutator.cpp + sharedstate/passivemutator.h + sharedstate/passiveobserver.cpp + sharedstate/passiveobserver.h + sharedstate/scalarjournal.cpp + sharedstate/scalarjournal.h + sharedstate/scalarmutator.cpp + sharedstate/scalarmutator.h + sharedstate/scalarobserver.cpp + sharedstate/scalarobserver.h + + # Simulation + simulation/distributorlistpreferences.h + simulation/aircraftmatchersetup.h + simulation/simulatorplugininfo.cpp + simulation/matchingutils.cpp + simulation/categorymatcher.cpp + simulation/matchingstatisticsentry.cpp + simulation/matchinglog.cpp + simulation/simulatorinfo.h + simulation/simulatedaircraftlist.h + simulation/ownaircraftproviderdummy.h + simulation/matchingscript.cpp + simulation/aircraftmodelloaderprovider.h + simulation/aircraftmodelsetprovider.cpp + simulation/simulatorinternals.cpp + simulation/fscommon/vpilotrulesreader.h + simulation/fscommon/vpilotmodelruleset.cpp + simulation/fscommon/aircraftcfgparser.cpp + simulation/fscommon/vpilotrulesreader.cpp + simulation/fscommon/aircraftcfgentries.h + simulation/fscommon/fscommonutil.h + simulation/fscommon/bcdconversions.h + simulation/fscommon/fscommonutil.cpp + simulation/fscommon/fsdirectories.cpp + simulation/fscommon/aircraftcfgentrieslist.cpp + simulation/fscommon/fsdirectories.h + simulation/fscommon/bcdconversions.cpp + simulation/fscommon/aircraftcfgentrieslist.h + simulation/fscommon/aircraftcfgentries.cpp + simulation/fscommon/vpilotmodelrule.cpp + simulation/fscommon/vpilotmodelrule.h + simulation/fscommon/fscommon.h + simulation/fscommon/aircraftcfgparser.h + simulation/fscommon/vpilotmodelruleset.h + simulation/aircraftmodel.cpp + simulation/distributor.cpp + simulation/interpolatorspline.h + simulation/distributorlist.cpp + simulation/registermetadatasimulation.cpp + simulation/interpolatormulti.h + simulation/interpolationsetupprovider.h + simulation/aircraftmodellist.h + simulation/interpolationsetupprovider.cpp + simulation/interpolatorlinear.h + simulation/backgroundvalidation.cpp + simulation/airspaceaircraftsnapshot.cpp + simulation/autopublishdata.h + simulation/interpolationrenderingsetup.h + simulation/matchingscriptmisc.h + simulation/interpolationsetuplist.cpp + simulation/remoteaircraftprovider.h + simulation/interpolant.h + simulation/ownaircraftprovider.cpp + simulation/backgroundvalidation.h + simulation/xplane/xswiftbusconfigwriter.cpp + simulation/xplane/navdatareference.h + simulation/xplane/navdatareference.cpp + simulation/xplane/xplaneutil.h + simulation/xplane/aircraftmodelloaderxplane.h + simulation/xplane/xplaneutil.cpp + simulation/xplane/qtfreeutils.h + simulation/xplane/aircraftmodelloaderxplane.cpp + simulation/xplane/xswiftbusconfigwriter.h + simulation/matchingutils.h + simulation/registermetadatasimulation.h + simulation/interpolatorpbh.h + simulation/fsx/simconnectutilities.h + simulation/fsx/simconnectutilities.cpp + simulation/fsx/fsx.h + simulation/aircraftmodelinterfaces.h + simulation/interpolationlogger.h + simulation/interpolatormulti.cpp + simulation/remoteaircraftprovider.cpp + simulation/modelconverterx.cpp + simulation/simulatorinfolist.h + simulation/simulationenvironmentprovider.cpp + simulation/interpolator.h + simulation/interpolatorspline.cpp + simulation/aircraftmodelloaderprovider.cpp + simulation/simulatorplugininfolist.h + simulation/remoteaircraftproviderdummy.cpp + simulation/interpolationlogger.cpp + simulation/matchingscript.h + simulation/categorymatcher.h + simulation/flightgear/flightgearutil.h + simulation/flightgear/aircraftmodelloaderflightgear.h + simulation/flightgear/aircraftmodelloaderflightgear.cpp + simulation/flightgear/flightgearutil.cpp + simulation/aircraftmodelloader.h + simulation/simulatedaircraft.cpp + simulation/aircraftmodellist.cpp + simulation/aircraftmodel.h + simulation/interpolatorlinear.cpp + simulation/data/lastmodel.h + simulation/data/modelcaches.h + simulation/data/modelcaches.cpp + simulation/airspaceaircraftsnapshot.h + simulation/interpolatorfunctions.h + simulation/ownaircraftprovider.h + simulation/distributorlistpreferences.cpp + simulation/interpolatorpbh.cpp + simulation/reverselookup.h + simulation/autopublishdata.cpp + simulation/simulationenvironmentprovider.h + simulation/simulatorplugininfo.h + simulation/interpolationrenderingsetup.cpp + simulation/simulatorinfo.cpp + simulation/matchingstatistics.cpp + simulation/ownaircraftproviderdummy.cpp + simulation/simulatorinfolist.cpp + simulation/aircraftmodelloader.cpp + simulation/distributor.h + simulation/matchinglog.h + simulation/remoteaircraftproviderdummy.h + simulation/simulatorplugininfolist.cpp + simulation/aircraftmodelsetprovider.h + simulation/simulatorinternals.h + simulation/distributorlist.h + simulation/aircraftmodelutils.h + simulation/interpolator.cpp + simulation/matchingstatistics.h + simulation/modelconverterx.h + simulation/settings/modelsettings.cpp + simulation/settings/simulatorsettings.cpp + simulation/settings/xswiftbussettings.cpp + simulation/settings/xswiftbussettings.h + simulation/settings/fgswiftbussettings.h + simulation/settings/xswiftbussettingsqtfree.h + simulation/settings/modelsettings.h + simulation/settings/xswiftbussettingsqtfree.inc + simulation/settings/fgswiftbussettings.h + simulation/settings/fgswiftbussettings.cpp + simulation/settings/modelmatchersettings.h + simulation/settings/swiftpluginsettings.cpp + simulation/settings/interpolationrenderingsetupsettings.h + simulation/settings/simulatorsettings.h + simulation/settings/swiftpluginsettings.h + simulation/aircraftmatchersetup.cpp + simulation/matchingscriptmisc.cpp + simulation/simulatedaircraft.h + simulation/aircraftmodelutils.cpp + simulation/simulatedaircraftlist.cpp + simulation/matchingstatisticsentry.h + simulation/interpolationsetuplist.h + + # Test + test/testdata.cpp + test/testdata.h + test/testing.cpp + test/testing.h + test/testservice.cpp + test/testservice.h + test/testserviceinterface.cpp + test/testserviceinterface.h + + # Third party + thirdparty/simplecrypt.cpp + thirdparty/simplecrypt.h + + # Weather + weather/cloudlayer.cpp + weather/cloudlayer.h + weather/cloudlayerlist.cpp + weather/cloudlayerlist.h + weather/gridpoint.cpp + weather/gridpoint.h + weather/metar.cpp + weather/metar.h + weather/metardecoder.cpp + weather/metardecoder.h + weather/metarlist.cpp + weather/metarlist.h + weather/presentweather.cpp + weather/presentweather.h + weather/presentweatherlist.cpp + weather/presentweatherlist.h + weather/registermetadataweather.cpp + weather/registermetadataweather.h + weather/temperaturelayer.cpp + weather/temperaturelayer.h + weather/temperaturelayerlist.cpp + weather/temperaturelayerlist.h + weather/visibilitylayer.cpp + weather/visibilitylayer.h + weather/visibilitylayerlist.cpp + weather/visibilitylayerlist.h + weather/weatherdataplugininfo.cpp + weather/weatherdataplugininfo.h + weather/weatherdataplugininfolist.cpp + weather/weatherdataplugininfolist.h + weather/weathergrid.cpp + weather/weathergrid.h + weather/weathergridprovider.cpp + weather/weathergridprovider.h + weather/weatherscenario.cpp + weather/weatherscenario.h + weather/windlayer.cpp + weather/windlayer.h + weather/windlayerlist.cpp + weather/windlayerlist.h +) + +if(APPLE) + target_sources(misc PRIVATE + macos/microphoneaccess.h + macos/microphoneaccess.mm + ) +endif() + +target_include_directories(misc PUBLIC ${PROJECT_SOURCE_DIR}/src) +target_compile_definitions(misc PRIVATE BUILD_BLACKMISC_LIB) + +target_link_libraries(misc + PUBLIC + blackconfig + Qt::Core + Qt::Gui + Qt::DBus + Qt::Network + Qt::Multimedia + externals_rapidjson # used by xswiftbussettingsqtfree.inc + PRIVATE + Qt::Xml +) + +if(SWIFT_USE_CRASHPAD) + target_link_libraries(misc PUBLIC externals_crashpad) +endif() + +if(WIN32) + # Remove Advapi32 once the Reg functions are removed again from CIdentifier + target_link_libraries(misc PUBLIC Shell32 Dbghelp version Advapi32) +endif() + +if(APPLE) + target_link_libraries(misc PRIVATE "-lbsm -framework AVFoundation -framework Security -framework CoreFoundation -framework ApplicationServices -framework Foundation -framework IOKit") +endif() + +target_precompile_headers(misc + PRIVATE + ${SWIFT_MISC_PCH} +) + +install(TARGETS misc + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) diff --git a/src/blackmisc/share/dbus-1/CMakeLists.txt b/src/blackmisc/share/dbus-1/CMakeLists.txt new file mode 100644 index 000000000..6581bd393 --- /dev/null +++ b/src/blackmisc/share/dbus-1/CMakeLists.txt @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +if(WIN32) + set(DBUS_SESSION_BUS_LISTEN_ADDRESS "autolaunch:") + set(DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL "") + configure_file(session.conf.in ${CMAKE_BINARY_DIR}/out/share/dbus-1/session.conf) + install(FILES ${CMAKE_BINARY_DIR}/out/share/dbus-1/session.conf DESTINATION share/dbus-1/) +endif() diff --git a/src/blackmisc/share/dbus-1/session.conf.in b/src/blackmisc/share/dbus-1/session.conf.in index 2cd7ab97b..4e8674c33 100644 --- a/src/blackmisc/share/dbus-1/session.conf.in +++ b/src/blackmisc/share/dbus-1/session.conf.in @@ -7,17 +7,17 @@ Add a session-local.conf and edit that rather than changing this file directly. --> - + - + session - - $$DBUS_SESSION_BUS_LISTEN_ADDRESS + ${DBUS_SESSION_BUS_LISTEN_ADDRESS} - $$DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL + ${DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL} - + - + - + - + session.d - - session-local.conf + session-local.conf - contexts/dbus_contexts + contexts/dbus_contexts - - 1000000000 - 250000000 - 1000000000 - 250000000 - 1000000000 + + 1000000000 + 250000000 + 1000000000 + 250000000 + 1000000000 - 120000 - 240000 - 150000 - 100000 - 10000 - 100000 - 10000 - 50000 - 50000 - 50000 + 120000 + 240000 + 150000 + 100000 + 10000 + 100000 + 10000 + 50000 + 50000 + 50000 diff --git a/src/blacksound/CMakeLists.txt b/src/blacksound/CMakeLists.txt new file mode 100644 index 000000000..bd18703e6 --- /dev/null +++ b/src/blacksound/CMakeLists.txt @@ -0,0 +1,86 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(sound SHARED + notificationplayer.h + sampleprovider/sinusgenerator.h + sampleprovider/samples.cpp + sampleprovider/simplecompressoreffect.h + sampleprovider/resourcesoundsampleprovider.cpp + sampleprovider/resourcesoundsampleprovider.h + sampleprovider/equalizersampleprovider.cpp + sampleprovider/resourcesound.cpp + sampleprovider/bufferedwaveprovider.h + sampleprovider/samples.h + sampleprovider/volumesampleprovider.h + sampleprovider/pinknoisegenerator.h + sampleprovider/sampleprovider.pri + sampleprovider/mixingsampleprovider.h + sampleprovider/sampleprovider.h + sampleprovider/sawtoothgenerator.cpp + sampleprovider/resourcesound.h + sampleprovider/volumesampleprovider.cpp + sampleprovider/sawtoothgenerator.h + sampleprovider/pinknoisegenerator.cpp + sampleprovider/bufferedwaveprovider.cpp + sampleprovider/mixingsampleprovider.cpp + sampleprovider/simplecompressoreffect.cpp + sampleprovider/equalizersampleprovider.h + sampleprovider/sinusgenerator.cpp + tonepair.h + selcalplayer.cpp + dsp/SimpleGate.h + dsp/SimpleGate.cpp + dsp/biquadfilter.cpp + dsp/SimpleHeader.h + dsp/SimpleComp.h + dsp/SimpleLimit.cpp + dsp/SimpleLimitProcess.inl + dsp/SimpleGain.h + dsp/SimpleComp.cpp + dsp/SimpleLimit.h + dsp/biquadfilter.h + dsp/SimpleEnvelope.h + dsp/SimpleCompProcess.inl + dsp/SimpleGateProcess.inl + dsp/SimpleEnvelope.cpp + selcalplayer.h + wav/wavfile.h + wav/wavfile.cpp + threadedtonepairplayer.cpp + notificationplayer.cpp + tonepair.cpp + blacksoundexport.h + audioutilities.h + threadedtonepairplayer.h + audioutilities.cpp + codecs/opusencoder.cpp + codecs/opusdecoder.cpp + codecs/opusdecoder.h + codecs/opusencoder.h + ) + +# Copy resources +add_custom_command(TARGET sound + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different share ${PROJECT_BINARY_DIR}/out/share + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + +target_compile_definitions(sound PRIVATE BUILD_BLACKSOUND_LIB) + +target_include_directories(sound PUBLIC ${PROJECT_SOURCE_DIR}/src) + +target_link_libraries(sound + PUBLIC + Qt::Core + blackconfig + Qt::Multimedia + misc + externals_opus +) + +install(TARGETS sound + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) +install(DIRECTORY share/sounds DESTINATION ${CMAKE_INSTALL_PREFIX}/share/) diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt new file mode 100644 index 000000000..fcc32cbef --- /dev/null +++ b/src/plugins/CMakeLists.txt @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_subdirectory(simulator) +add_subdirectory(weatherdata/gfs) diff --git a/src/plugins/simulator/CMakeLists.txt b/src/plugins/simulator/CMakeLists.txt new file mode 100644 index 000000000..eac6f8718 --- /dev/null +++ b/src/plugins/simulator/CMakeLists.txt @@ -0,0 +1,53 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_subdirectory(plugincommon) + +if(SWIFT_BUILD_EMULATED_PLUGIN) + add_subdirectory(emulated) + add_subdirectory(emulatedconfig) +endif() + +if(SWIFT_BUILD_FLIGHTGEAR_PLUGIN) + add_subdirectory(flightgear) + add_subdirectory(flightgearconfig) +endif() + +if(SWIFT_BUILD_XPLANE_PLUGIN) + add_subdirectory(xplane) + add_subdirectory(xplaneconfig) +endif() + +if(SWIFT_BUILD_FS9_PLUGIN OR SWIFT_BUILD_FSX_PLUGIN OR SWIFT_BUILD_P3D_PLUGIN OR SWIFT_BUILD_MSFS_PLUGIN) + add_subdirectory(fscommon) +endif() + +if(SWIFT_BUILD_FSX_PLUGIN OR SWIFT_BUILD_P3D_PLUGIN OR SWIFT_BUILD_MSFS_PLUGIN) + add_subdirectory(fsxcommon) +endif() + +if(SWIFT_WIN32 AND (SWIFT_BUILD_FS9_PLUGIN OR SWIFT_BUILD_FSX_PLUGIN OR SWIFT_BUILD_P3D_PLUGIN OR SWIFT_BUILD_MSFS_PLUGIN)) + add_subdirectory(fsuipc32) +endif() + +if(SWIFT_WIN64 AND (SWIFT_BUILD_P3D_PLUGIN OR SWIFT_BUILD_MSFS_PLUGIN)) + add_subdirectory(fsuipc64) +endif() + +if(SWIFT_BUILD_FS9_PLUGIN) + add_subdirectory(fs9) +endif() + +if(SWIFT_BUILD_P3D_PLUGIN) + add_subdirectory(p3d) + add_subdirectory(p3dconfig) +endif() + +if(SWIFT_BUILD_MSFS_PLUGIN) + add_subdirectory(msfs) +endif() + +if(SWIFT_BUILD_FSX_PLUGIN) + add_subdirectory(fsx) + add_subdirectory(fsxconfig) +endif() diff --git a/src/plugins/simulator/emulated/CMakeLists.txt b/src/plugins/simulator/emulated/CMakeLists.txt new file mode 100644 index 000000000..e6b4e2d93 --- /dev/null +++ b/src/plugins/simulator/emulated/CMakeLists.txt @@ -0,0 +1,41 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(simulatoremulated SHARED + simulatoremulated.cpp + simulatoremulated.h + simulatoremulatedfactory.cpp + simulatoremulatedfactory.h + simulatoremulatedmonitordialog.cpp + simulatoremulatedmonitordialog.h + simulatoremulatedmonitordialog.ui + simulatoremulated.json +) + +set_target_properties(simulatoremulated PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) +set_target_properties(simulatoremulated PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) + +target_include_directories(simulatoremulated PUBLIC ${PROJECT_SOURCE_DIR}/src) + +target_link_libraries(simulatoremulated + PUBLIC + Qt::Core + misc + core + Qt::Widgets + plugincommon + PRIVATE + gui +) + + +install(TARGETS simulatoremulated + LIBRARY DESTINATION bin/plugins/simulator + RUNTIME DESTINATION bin/plugins/simulator +) + +if(APPLE) + set_target_properties(simulatoremulated PROPERTIES INSTALL_RPATH @loader_path/../../../lib) +elseif(UNIX) + set_target_properties(simulatoremulated PROPERTIES INSTALL_RPATH \$ORIGIN/../../../lib) +endif() diff --git a/src/plugins/simulator/emulatedconfig/CMakeLists.txt b/src/plugins/simulator/emulatedconfig/CMakeLists.txt new file mode 100644 index 000000000..aac96cb41 --- /dev/null +++ b/src/plugins/simulator/emulatedconfig/CMakeLists.txt @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(simulatoremulatedconfig SHARED + simulatoremulatedconfig.cpp + simulatoremulatedconfig.h + simulatoremulatedconfigwidget.cpp + simulatoremulatedconfigwidget.h + simulatoremulatedconfigwidget.ui + simulatoremulatedconfig.json +) + +set_target_properties(simulatoremulatedconfig PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) +set_target_properties(simulatoremulatedconfig PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) + +target_include_directories(simulatoremulatedconfig PUBLIC ${PROJECT_SOURCE_DIR}/src) + +target_link_libraries(simulatoremulatedconfig + PUBLIC + gui +) + +install(TARGETS simulatoremulatedconfig + LIBRARY DESTINATION bin/plugins/simulator + RUNTIME DESTINATION bin/plugins/simulator +) + +if(APPLE) + set_target_properties(simulatoremulatedconfig PROPERTIES INSTALL_RPATH @loader_path/../../../lib) +elseif(UNIX) + set_target_properties(simulatoremulatedconfig PROPERTIES INSTALL_RPATH \$ORIGIN/../../../lib) +endif() diff --git a/src/plugins/simulator/flightgear/CMakeLists.txt b/src/plugins/simulator/flightgear/CMakeLists.txt new file mode 100644 index 000000000..dc3bffe1c --- /dev/null +++ b/src/plugins/simulator/flightgear/CMakeLists.txt @@ -0,0 +1,36 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(simulatorflightgear SHARED + fgswiftbusserviceproxy.cpp + fgswiftbusserviceproxy.h + fgswiftbustrafficproxy.cpp + fgswiftbustrafficproxy.h + flightgearmpaircraft.cpp + flightgearmpaircraft.h + simulatorflightgear.cpp + simulatorflightgear.h + ) + +set_target_properties(simulatorflightgear PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) +set_target_properties(simulatorflightgear PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) + +target_include_directories(simulatorflightgear PUBLIC ${PROJECT_SOURCE_DIR}/src) + +target_link_libraries(simulatorflightgear + PUBLIC + misc + externals_dbus + plugincommon + ) + +install(TARGETS simulatorflightgear + LIBRARY DESTINATION bin/plugins/simulator + RUNTIME DESTINATION bin/plugins/simulator +) + +if(APPLE) + set_target_properties(simulatorflightgear PROPERTIES INSTALL_RPATH @loader_path/../../../lib) +elseif(UNIX) + set_target_properties(simulatorflightgear PROPERTIES INSTALL_RPATH \$ORIGIN/../../../lib) +endif() diff --git a/src/plugins/simulator/flightgearconfig/CMakeLists.txt b/src/plugins/simulator/flightgearconfig/CMakeLists.txt new file mode 100644 index 000000000..6eac9a8dc --- /dev/null +++ b/src/plugins/simulator/flightgearconfig/CMakeLists.txt @@ -0,0 +1,31 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(simulatorflightgearconfig SHARED + simulatorflightgearconfig.cpp + simulatorflightgearconfig.h + simulatorflightgearconfigwindow.cpp + simulatorflightgearconfigwindow.h + simulatorflightgearconfigwindow.ui + ) + +set_target_properties(simulatorflightgearconfig PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) +set_target_properties(simulatorflightgearconfig PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) + +target_include_directories(simulatorflightgearconfig PUBLIC ${PROJECT_SOURCE_DIR}/src) + +target_link_libraries(simulatorflightgearconfig + PUBLIC + gui + ) + +install(TARGETS simulatorflightgearconfig + LIBRARY DESTINATION bin/plugins/simulator + RUNTIME DESTINATION bin/plugins/simulator +) + +if(APPLE) + set_target_properties(simulatorflightgearconfig PROPERTIES INSTALL_RPATH @loader_path/../../../lib) +elseif(UNIX) + set_target_properties(simulatorflightgearconfig PROPERTIES INSTALL_RPATH \$ORIGIN/../../../lib) +endif() diff --git a/src/plugins/simulator/fs9/CMakeLists.txt b/src/plugins/simulator/fs9/CMakeLists.txt new file mode 100644 index 000000000..f445a7f6a --- /dev/null +++ b/src/plugins/simulator/fs9/CMakeLists.txt @@ -0,0 +1,50 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(simulatorfs9 SHARED + callbackwrapper.h + directplayerror.cpp + directplayerror.h + directplaypeer.cpp + directplaypeer.h + directplayutils.h + fs9.h + fs9client.cpp + fs9client.h + fs9host.cpp + fs9host.h + hostnode.cpp + hostnode.h + lobbyclient.cpp + lobbyclient.h + multiplayerpacketparser.cpp + multiplayerpacketparser.h + multiplayerpackets.h + registermetadata.cpp + registermetadata.h + simulatorfs9.cpp + simulatorfs9.h + simulatorfs9.json +) + +set_target_properties(simulatorfs9 PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) +set_target_properties(simulatorfs9 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) + +target_include_directories(simulatorfs9 PUBLIC ${PROJECT_SOURCE_DIR}/src) + +target_link_libraries(simulatorfs9 + PUBLIC + Qt::Core + uuid + ole32 + misc + core + fscommon + blackconfig + externals_dplay +) + +install(TARGETS simulatorfs9 + LIBRARY DESTINATION bin/plugins/simulator + RUNTIME DESTINATION bin/plugins/simulator +) diff --git a/src/plugins/simulator/fscommon/CMakeLists.txt b/src/plugins/simulator/fscommon/CMakeLists.txt new file mode 100644 index 000000000..2d0026ff3 --- /dev/null +++ b/src/plugins/simulator/fscommon/CMakeLists.txt @@ -0,0 +1,40 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(fscommon SHARED + fsuipc.h + fsuipcdummy.cpp + fsuipcimpl.cpp + simulatorfscommon.cpp + simulatorfscommon.h + simulatorfscommonfunctions.h + fscommonexport.h +) + +target_compile_definitions(fscommon PRIVATE BUILD_FSCOMMON_LIB) + +if(SWIFT_WIN32) + target_compile_definitions(fscommon PRIVATE SWIFT_USING_FSUIPC32) + target_link_libraries(fscommon PUBLIC fsuipc_32) +elseif (SWIFT_WIN64) + target_compile_definitions(fscommon PRIVATE SWIFT_USING_FSUIPC64) + target_link_libraries(fscommon PUBLIC fsuipc_64) +endif() + +target_link_libraries(fscommon + PUBLIC + Qt::Core + misc + plugincommon + PRIVATE + core + +) + +set_target_properties(fscommon PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin) +set_target_properties(fscommon PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin) + +install(TARGETS fscommon + LIBRARY DESTINATION bin + RUNTIME DESTINATION bin +) diff --git a/src/plugins/simulator/fsuipc32/CMakeLists.txt b/src/plugins/simulator/fsuipc32/CMakeLists.txt new file mode 100644 index 000000000..7828e1a8e --- /dev/null +++ b/src/plugins/simulator/fsuipc32/CMakeLists.txt @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(fsuipc_32 STATIC FSUIPC_User.h IPCuser.c IPCuser.h NewWeather.h) diff --git a/src/plugins/simulator/fsuipc64/CMakeLists.txt b/src/plugins/simulator/fsuipc64/CMakeLists.txt new file mode 100644 index 000000000..9ac32a61d --- /dev/null +++ b/src/plugins/simulator/fsuipc64/CMakeLists.txt @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(fsuipc_64 STATIC FSUIPC_User64.h IPCuser64.c IPCuser64.h NewWeather.h) diff --git a/src/plugins/simulator/fsx/CMakeLists.txt b/src/plugins/simulator/fsx/CMakeLists.txt new file mode 100644 index 000000000..d1bee196b --- /dev/null +++ b/src/plugins/simulator/fsx/CMakeLists.txt @@ -0,0 +1,29 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(simulatorfsx SHARED + simulatorfsx.cpp + simulatorfsx.h + simulatorfsx.json + simulatorfsxfactory.cpp + simulatorfsxfactory.h +) + +set_target_properties(simulatorfsx PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) +set_target_properties(simulatorfsx PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) + +target_include_directories(simulatorfsx PUBLIC ${PROJECT_SOURCE_DIR}/src) + +target_link_libraries(simulatorfsx + PUBLIC + fscommon + fsxcommon + core + misc + Qt::Core +) + +install(TARGETS simulatorfsx + LIBRARY DESTINATION bin/plugins/simulator + RUNTIME DESTINATION bin/plugins/simulator +) diff --git a/src/plugins/simulator/fsxcommon/CMakeLists.txt b/src/plugins/simulator/fsxcommon/CMakeLists.txt new file mode 100644 index 000000000..cb84b5587 --- /dev/null +++ b/src/plugins/simulator/fsxcommon/CMakeLists.txt @@ -0,0 +1,51 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(fsxcommon SHARED + simconnectsymbols.cpp + simconnectsymbols.h + fsxsettingscomponent.cpp + fsxsettingscomponent.h + fsxsettingscomponent.ui + simconnectdatadefinition.cpp + simconnectdatadefinition.h + simconnectobject.cpp + simconnectobject.h + simconnectsettingscomponent.cpp + simconnectsettingscomponent.h + simconnectsettingscomponent.ui + simconnectwindows.h + simulatorfsxcommon.cpp + simulatorfsxcommon.h + simulatorfsxconfigwindow.cpp + simulatorfsxconfigwindow.h + simulatorfsxconfigwindow.ui + simulatorfsxsimconnectproc.cpp + simconnect.rc + #SimConnect_RTM.manifest + #SimConnect_SP1.manifest + #SimConnect_XPack.manifest + fsxcommonexport.h +) + +set_target_properties(fsxcommon PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin) +set_target_properties(fsxcommon PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin) + +target_link_libraries(fsxcommon + PUBLIC + Qt::Core + misc + Qt::Widgets + externals_simconnect + PRIVATE + gui + fscommon + blackconfig +) + +target_compile_definitions(fsxcommon PRIVATE BUILD_FSXCOMMON_LIB) + +install(TARGETS fsxcommon + LIBRARY DESTINATION bin + RUNTIME DESTINATION bin +) diff --git a/src/plugins/simulator/fsxconfig/CMakeLists.txt b/src/plugins/simulator/fsxconfig/CMakeLists.txt new file mode 100644 index 000000000..25966aa58 --- /dev/null +++ b/src/plugins/simulator/fsxconfig/CMakeLists.txt @@ -0,0 +1,27 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(simulatorfsxconfig SHARED + simulatorfsxconfig.cpp + simulatorfsxconfig.h + simulatorfsxconfig.json +) + +set_target_properties(simulatorfsxconfig PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) +set_target_properties(simulatorfsxconfig PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) + +target_include_directories(simulatorfsxconfig PUBLIC ${PROJECT_SOURCE_DIR}/src) + +target_link_libraries(simulatorfsxconfig + PUBLIC + gui + misc + Qt::Core + PRIVATE + fsxcommon +) + +install(TARGETS simulatorfsxconfig + LIBRARY DESTINATION bin/plugins/simulator + RUNTIME DESTINATION bin/plugins/simulator +) diff --git a/src/plugins/simulator/msfs/CMakeLists.txt b/src/plugins/simulator/msfs/CMakeLists.txt new file mode 100644 index 000000000..7d45c476f --- /dev/null +++ b/src/plugins/simulator/msfs/CMakeLists.txt @@ -0,0 +1,29 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(simulatormsfs SHARED + simulatormsfs.cpp + simulatormsfs.h + simulatormsfs.json + simulatormsfsfactory.cpp + simulatormsfsfactory.h +) + +set_target_properties(simulatormsfs PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) +set_target_properties(simulatormsfs PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) + +target_include_directories(simulatormsfs PUBLIC ${PROJECT_SOURCE_DIR}/src) + +target_link_libraries(simulatormsfs + PUBLIC + fscommon + fsxcommon + core + misc + Qt::Core +) + +install(TARGETS simulatormsfs + LIBRARY DESTINATION bin/plugins/simulator + RUNTIME DESTINATION bin/plugins/simulator + ) diff --git a/src/plugins/simulator/p3d/CMakeLists.txt b/src/plugins/simulator/p3d/CMakeLists.txt new file mode 100644 index 000000000..4c2995147 --- /dev/null +++ b/src/plugins/simulator/p3d/CMakeLists.txt @@ -0,0 +1,29 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(simulatorp3d SHARED + simulatorp3d.h + simulatorp3d.cpp + simulatorp3d.json + simulatorp3dfactory.cpp + simulatorp3dfactory.h +) + +set_target_properties(simulatorp3d PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) +set_target_properties(simulatorp3d PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) + +target_include_directories(simulatorp3d PUBLIC ${PROJECT_SOURCE_DIR}/src) + +target_link_libraries(simulatorp3d + PUBLIC + fscommon + fsxcommon + core + misc + Qt::Core +) + +install(TARGETS simulatorp3d + LIBRARY DESTINATION bin/plugins/simulator + RUNTIME DESTINATION bin/plugins/simulator +) diff --git a/src/plugins/simulator/p3dconfig/CMakeLists.txt b/src/plugins/simulator/p3dconfig/CMakeLists.txt new file mode 100644 index 000000000..8de0af291 --- /dev/null +++ b/src/plugins/simulator/p3dconfig/CMakeLists.txt @@ -0,0 +1,27 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(simulatorp3dconfig SHARED + simulatorp3dconfig.cpp + simulatorp3dconfig.h + simulatorp3dconfig.json +) + +set_target_properties(simulatorp3dconfig PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) +set_target_properties(simulatorp3dconfig PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) + +target_include_directories(simulatorp3dconfig PUBLIC ${PROJECT_SOURCE_DIR}/src) + +target_link_libraries(simulatorp3dconfig + PUBLIC + gui + misc + Qt::Core + PRIVATE + fsxcommon +) + +install(TARGETS simulatorp3dconfig + LIBRARY DESTINATION bin/plugins/simulator + RUNTIME DESTINATION bin/plugins/simulator +) diff --git a/src/plugins/simulator/plugincommon/CMakeLists.txt b/src/plugins/simulator/plugincommon/CMakeLists.txt new file mode 100644 index 000000000..d3332d25a --- /dev/null +++ b/src/plugins/simulator/plugincommon/CMakeLists.txt @@ -0,0 +1,27 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(plugincommon SHARED + simulatorplugincommon.cpp + simulatorplugincommon.h + simulatorplugincommonexport.h +) + +target_include_directories(plugincommon PUBLIC ${PROJECT_SOURCE_DIR}/src) + +set_target_properties(plugincommon PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin) +set_target_properties(plugincommon PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin) + +target_link_libraries(plugincommon + PUBLIC + Qt::Core + core + gui +) + +target_compile_definitions(plugincommon PRIVATE BUILD_SIMULATORPLUGINCOMMON_LIB) + +install(TARGETS plugincommon + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) diff --git a/src/plugins/simulator/xplane/CMakeLists.txt b/src/plugins/simulator/xplane/CMakeLists.txt new file mode 100644 index 000000000..6e9843b21 --- /dev/null +++ b/src/plugins/simulator/xplane/CMakeLists.txt @@ -0,0 +1,44 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(simulatorxplane SHARED + simulatorxplane.cpp + simulatorxplane.h + simulatorxplane.json + xplanempaircraft.cpp + xplanempaircraft.h + xswiftbusserviceproxy.cpp + xswiftbusserviceproxy.h + xswiftbustrafficproxy.cpp + xswiftbustrafficproxy.h + xswiftbusweatherproxy.cpp + xswiftbusweatherproxy.h +) + +include(${PROJECT_SOURCE_DIR}/cmake/xswiftbus_tools.cmake) + +get_xswiftbus_commit_id() +target_compile_definitions(simulatorxplane PRIVATE XSWIFTBUS_COMMIT="${XSWIFTBUS_COMMIT_ID}") + +set_target_properties(simulatorxplane PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) +set_target_properties(simulatorxplane PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) + +target_include_directories(simulatorxplane PUBLIC ${PROJECT_SOURCE_DIR}/src) + +target_link_libraries(simulatorxplane + PUBLIC + misc + externals_dbus + plugincommon +) + +install(TARGETS simulatorxplane + LIBRARY DESTINATION bin/plugins/simulator + RUNTIME DESTINATION bin/plugins/simulator +) + +if(APPLE) + set_target_properties(simulatorxplane PROPERTIES INSTALL_RPATH @loader_path/../../../lib) +elseif(UNIX) + set_target_properties(simulatorxplane PROPERTIES INSTALL_RPATH \$ORIGIN/../../../lib) +endif() diff --git a/src/plugins/simulator/xplaneconfig/CMakeLists.txt b/src/plugins/simulator/xplaneconfig/CMakeLists.txt new file mode 100644 index 000000000..792a5818e --- /dev/null +++ b/src/plugins/simulator/xplaneconfig/CMakeLists.txt @@ -0,0 +1,33 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(simulatorxplaneconfig SHARED + simulatorxplaneconfig.cpp + simulatorxplaneconfig.h + simulatorxplaneconfigwindow.cpp + simulatorxplaneconfigwindow.h + simulatorxplaneconfigwindow.ui +) + +set_target_properties(simulatorxplaneconfig PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) +set_target_properties(simulatorxplaneconfig PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/simulator) + +target_include_directories(simulatorxplaneconfig PUBLIC ${PROJECT_SOURCE_DIR}/src) + +target_link_libraries(simulatorxplaneconfig + PUBLIC + gui + misc + Qt::Core +) + +install(TARGETS simulatorxplaneconfig + LIBRARY DESTINATION bin/plugins/simulator + RUNTIME DESTINATION bin/plugins/simulator +) + +if(APPLE) + set_target_properties(simulatorxplaneconfig PROPERTIES INSTALL_RPATH @loader_path/../../../lib) +elseif(UNIX) + set_target_properties(simulatorxplaneconfig PROPERTIES INSTALL_RPATH \$ORIGIN/../../../lib) +endif() diff --git a/src/plugins/weatherdata/gfs/CMakeLists.txt b/src/plugins/weatherdata/gfs/CMakeLists.txt new file mode 100644 index 000000000..28f7530b8 --- /dev/null +++ b/src/plugins/weatherdata/gfs/CMakeLists.txt @@ -0,0 +1,74 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(weatherdatagfs SHARED + weatherdatagfs.cpp + weatherdatagfs.h + weatherdatagfs.json + + # g2clib + g2clib/drstemplates.h + g2clib/grib2.h + g2clib/gridtemplates.h + g2clib/pdstemplates.h + g2clib/cmplxpack.c + g2clib/compack.c + g2clib/comunpack.c + g2clib/drstemplates.c + g2clib/g2_addfield.c + g2clib/g2_addgrid.c + g2clib/g2_addlocal.c + g2clib/g2_create.c + g2clib/g2_free.c + g2clib/g2_getfld.c + g2clib/g2_gribend.c + g2clib/g2_info.c + g2clib/g2_miss.c + g2clib/g2_unpack1.c + g2clib/g2_unpack2.c + g2clib/g2_unpack3.c + g2clib/g2_unpack4.c + g2clib/g2_unpack5.c + g2clib/g2_unpack6.c + g2clib/g2_unpack7.c + g2clib/gbits.c + g2clib/getdim.c + g2clib/getpoly.c + g2clib/gridtemplates.c + g2clib/int_power.c + g2clib/misspack.c + g2clib/mkieee.c + g2clib/pack_gp.c + g2clib/pdstemplates.c + g2clib/rdieee.c + g2clib/reduce.c + g2clib/seekgb.c + g2clib/simpack.c + g2clib/simunpack.c + g2clib/specpack.c + g2clib/specunpack.c +) + +set_target_properties(weatherdatagfs PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/weatherdata) +set_target_properties(weatherdatagfs PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/out/bin/plugins/weatherdata) + + +target_include_directories(weatherdatagfs PUBLIC ${PROJECT_SOURCE_DIR}/src) + +target_link_libraries(weatherdatagfs + PUBLIC + Qt::Core + misc + core +) + +install(TARGETS weatherdatagfs + LIBRARY DESTINATION bin/plugins/weatherdata + RUNTIME DESTINATION bin/plugins/weatherdata +) + +if(APPLE) + set_target_properties(weatherdatagfs PROPERTIES INSTALL_RPATH @loader_path/../../../lib) +elseif(UNIX) + set_target_properties(weatherdatagfs PROPERTIES INSTALL_RPATH \$ORIGIN/../../../lib) +endif() diff --git a/src/swiftcore/CMakeLists.txt b/src/swiftcore/CMakeLists.txt new file mode 100644 index 000000000..0d4db1fc5 --- /dev/null +++ b/src/swiftcore/CMakeLists.txt @@ -0,0 +1,31 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_executable(swiftcore WIN32 + main.cpp + swiftcore.cpp + swiftcore.h + swiftcore.ui + ) + +if(WIN32) + target_sources(swiftcore PRIVATE data.rc) +endif() + +target_include_directories(swiftcore PUBLIC ${PROJECT_SOURCE_DIR}/src) + +target_link_libraries(swiftcore + PUBLIC + Qt::Core + misc + gui + core + ) + +add_dependencies(swiftcore resources) + +if(WIN32) + add_dependencies(swiftcore copy_externals_to_build_dir) +endif() + +install(TARGETS swiftcore) diff --git a/src/swiftcore/data.rc b/src/swiftcore/data.rc new file mode 100644 index 000000000..14a817343 --- /dev/null +++ b/src/swiftcore/data.rc @@ -0,0 +1 @@ +swiftcore ICON "swiftcore.ico" diff --git a/src/swiftdata/CMakeLists.txt b/src/swiftdata/CMakeLists.txt new file mode 100644 index 000000000..90b31c1ad --- /dev/null +++ b/src/swiftdata/CMakeLists.txt @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_executable(swiftdata WIN32 + main.cpp + swiftdata.cpp + swiftdata.h + swiftdata.ui + swiftdatamenus.cpp + ) + +if(WIN32) + target_sources(swiftdata PRIVATE data.rc) +endif() + +target_include_directories(swiftdata PUBLIC ${PROJECT_SOURCE_DIR}/src) + +target_link_libraries(swiftdata + PUBLIC + Qt::Core + misc + gui + core + ) + +add_dependencies(swiftdata resources) + +if(WIN32) + add_dependencies(swiftdata copy_externals_to_build_dir) +endif() + +install(TARGETS swiftdata) diff --git a/src/swiftdata/data.rc b/src/swiftdata/data.rc new file mode 100644 index 000000000..8a8823bde --- /dev/null +++ b/src/swiftdata/data.rc @@ -0,0 +1 @@ +swiftdata ICON "swiftdata.ico" diff --git a/src/swiftguistandard/CMakeLists.txt b/src/swiftguistandard/CMakeLists.txt new file mode 100644 index 000000000..8f10f6613 --- /dev/null +++ b/src/swiftguistandard/CMakeLists.txt @@ -0,0 +1,37 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_executable(swiftguistd WIN32 + main.cpp + swiftguistd.cpp + swiftguistd.h + swiftguistd.ui + swiftguistdaircraft.cpp + swiftguistdapplication.cpp + swiftguistdapplication.h + swiftguistdinit.cpp + swiftguistdmenus.cpp + ) + +if(WIN32) + target_sources(swiftguistd PRIVATE data.rc) +endif() + +target_include_directories(swiftguistd PUBLIC ${PROJECT_SOURCE_DIR}/src) + +target_link_libraries(swiftguistd + PUBLIC + Qt::Core + misc + gui + core + sound + ) + +add_dependencies(swiftguistd resources) + +if(WIN32) + add_dependencies(swiftguistd copy_externals_to_build_dir) +endif() + +install(TARGETS swiftguistd) diff --git a/src/swiftguistandard/data.rc b/src/swiftguistandard/data.rc new file mode 100644 index 000000000..d4b1c1bb5 --- /dev/null +++ b/src/swiftguistandard/data.rc @@ -0,0 +1 @@ +swiftgui ICON "swift.ico" diff --git a/src/swiftlauncher/CMakeLists.txt b/src/swiftlauncher/CMakeLists.txt new file mode 100644 index 000000000..a0ed223b8 --- /dev/null +++ b/src/swiftlauncher/CMakeLists.txt @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_executable(swiftlauncher WIN32 + main.cpp + swiftlauncher.cpp + swiftlauncher.h + swiftlauncher.ui + swiftlauncher.qrc + ) + +if(WIN32) + target_sources(swiftlauncher PRIVATE data.rc) +endif() + +target_include_directories(swiftlauncher PUBLIC ${PROJECT_SOURCE_DIR}/src) + +target_link_libraries(swiftlauncher + PUBLIC + Qt::Core + misc + gui + core + ) + +add_dependencies(swiftlauncher resources) + +if(WIN32) + add_dependencies(swiftlauncher copy_externals_to_build_dir) +endif() + +install(TARGETS swiftlauncher) diff --git a/src/swiftlauncher/data.rc b/src/swiftlauncher/data.rc new file mode 100644 index 000000000..130aca07b --- /dev/null +++ b/src/swiftlauncher/data.rc @@ -0,0 +1 @@ +swiftlauncher ICON "swiftlauncher.ico" diff --git a/src/xswiftbus/CMakeLists.txt b/src/xswiftbus/CMakeLists.txt new file mode 100644 index 000000000..ba4c5b9e8 --- /dev/null +++ b/src/xswiftbus/CMakeLists.txt @@ -0,0 +1,192 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +if(SWIFT_WIN32) + message(FATAL_ERROR "xswiftbus only available in 64 bit environments") +endif() + +add_library(xswiftbus SHARED + org.swift_project.xswiftbus.service.xml + org.swift_project.xswiftbus.traffic.xml + org.swift_project.xswiftbus.weather.xml + xswiftbus.conf + command.h + config.cpp + config.h + datarefs.h + dbuscallbacks.h + dbusconnection.cpp + dbusconnection.h + dbusdispatcher.cpp + dbusdispatcher.h + dbuserror.cpp + dbuserror.h + dbusmessage.cpp + dbusmessage.h + dbusobject.cpp + dbusobject.h + dbusserver.cpp + dbusserver.h + drawable.h + main.cpp + menus.cpp + menus.h + messages.cpp + messages.h + navdatareference.cpp + navdatareference.h + plugin.cpp + plugin.h + service.cpp + service.h + settings.cpp + settings.h + terrainprobe.cpp + terrainprobe.h + traffic.cpp + traffic.h + utils.cpp + utils.h + weather.cpp + weather.h + + xplanemp2/src/CSL.cpp + xplanemp2/src/CSL.h + xplanemp2/src/CSLLibrary.cpp + xplanemp2/src/CSLLibrary.h + xplanemp2/src/CullInfo.cpp + xplanemp2/src/CullInfo.h + xplanemp2/src/PlanesHandoff.c + xplanemp2/src/PlaneType.cpp + xplanemp2/src/PlaneType.h + xplanemp2/src/Renderer.cpp + xplanemp2/src/Renderer.h + xplanemp2/src/TCASOverride.cpp + xplanemp2/src/TCASOverride.h + xplanemp2/src/XPMPMultiplayer.cpp + xplanemp2/src/XPMPMultiplayerVars.cpp + xplanemp2/src/XPMPMultiplayerVars.h + xplanemp2/src/XPMPPlane.cpp + xplanemp2/src/XPMPPlane.h + xplanemp2/src/XStringUtils.cpp + xplanemp2/src/XStringUtils.h + xplanemp2/src/XUtils.cpp + xplanemp2/src/XUtils.h + + xplanemp2/src/obj8/Obj8Attachment.cpp + xplanemp2/src/obj8/Obj8Attachment.h + xplanemp2/src/obj8/Obj8Common.h + xplanemp2/src/obj8/Obj8CSL.cpp + xplanemp2/src/obj8/Obj8CSL.h + xplanemp2/src/obj8/Obj8InstanceData.cpp + xplanemp2/src/obj8/Obj8InstanceData.h + ) + +if(APPLE) + target_sources(xswiftbus PRIVATE + xplanemp2/src/AplFSUtil.cpp + xplanemp2/src/AplFSUtil.h +) +endif() + +target_include_directories(xswiftbus PUBLIC + ${PROJECT_SOURCE_DIR}/src + xplanemp2 + xplanemp2/include + xplanemp2/src) + + +if(SWIFT_WIN64) + target_link_libraries(xswiftbus PUBLIC externals_xplm externals_xpwidgets) +elseif(APPLE) + target_link_libraries(xswiftbus PRIVATE externals_xplm externals_xpwidgets "-framework Cocoa" "-framework CoreFoundation") + target_compile_definitions(xswiftbus PRIVATE XUTILS_EXCLUDE_MAC_CRAP) +elseif(UNIX) + # Flags needed because there is no XPLM link library + target_link_options(xswiftbus PUBLIC -nodefaultlibs -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/xswiftbus.map) +endif() + + +target_link_libraries(xswiftbus PUBLIC externals_event externals_dbus externals_xplm) + + +if(SWIFT_WIN32) + set(PNG_LIBRARIES ${swift_SOURCE_DIR}/externals/win32-msvc/32/lib/png.lib) + set(ZLIB_LIBRARIES ${swift_SOURCE_DIR}/externals/win32-msvc/32/lib/z.lib) +elseif(SWIFT_WIN64) + set(PNG_LIBRARIES ${swift_SOURCE_DIR}/externals/win32-msvc/64/lib/png.lib) + set(ZLIB_LIBRARIES ${swift_SOURCE_DIR}/externals/win32-msvc/64/lib/z.lib) + +else() + find_package(PNG REQUIRED) + find_package(ZLIB REQUIRED) +endif() + +# Externals required by xplanemp2 +if(WIN32) + find_package(OpenGL REQUIRED) + + target_link_libraries(xswiftbus PUBLIC ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} OpenGL::GL OpenGL::GLU) +elseif(UNIX AND NOT APPLE) + target_link_libraries(xswiftbus PUBLIC ${PNG_LIBRARIES} ${ZLIB_LIBRARIES}) +endif() + +if(MSVC) + target_compile_definitions(xswiftbus PRIVATE _CRT_SECURE_NO_WARNINGS) +endif() + +if(UNIX AND NOT APPLE) + target_compile_definitions(xswiftbus PUBLIC LIN=1) +elseif(WIN32) + target_compile_definitions(xswiftbus PUBLIC IBM=1) +elseif(APPLE) + target_compile_definitions(xswiftbus PUBLIC APL=1) +endif() + + +target_compile_definitions(xswiftbus PUBLIC XPLM200=1 XPLM210=1 XPLM300=1 XPLM_DEPRECATED=1) + +target_compile_definitions(xswiftbus PUBLIC XPMP_CLIENT_NAME="xswiftbus") +target_compile_definitions(xswiftbus PUBLIC XPMP_CLIENT_LONGNAME="xswiftbus") +target_compile_definitions(xswiftbus PUBLIC XSWIFTBUS_VERSION="${swift_version_major}.${swift_version_minor}.${swift_rev_count}") + +if(APPLE) + set_target_properties(xswiftbus PROPERTIES INSTALL_RPATH @loader_path/) +endif() + +include(${PROJECT_SOURCE_DIR}/cmake/xswiftbus_tools.cmake) +get_xswiftbus_commit_id() + +target_compile_definitions(xswiftbus PUBLIC XSWIFTBUS_COMMIT="${XSWIFTBUS_COMMIT_ID}") + +set_target_properties(xswiftbus PROPERTIES PREFIX "") +set_target_properties(xswiftbus PROPERTIES SUFFIX ".xpl") + +if(UNIX AND NOT APPLE) + set_target_properties(xswiftbus PROPERTIES OUTPUT_NAME lin) +elseif(APPLE) + set_target_properties(xswiftbus PROPERTIES OUTPUT_NAME mac) +elseif(WIN32) + set_target_properties(xswiftbus PROPERTIES OUTPUT_NAME win) +endif() + +install(TARGETS xswiftbus + LIBRARY DESTINATION xswiftbus/64 + RUNTIME DESTINATION xswiftbus/64 + PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ +) +configure_file(readme.txt.in readme.txt) + + +if(WIN32) + set(DBUS_SESSION_BUS_LISTEN_ADDRESS "autolaunch:") + set(DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL "") + configure_file(${swift_SOURCE_DIR}/src/blackmisc/share/dbus-1/session.conf.in ${CMAKE_CURRENT_BINARY_DIR}/session.conf) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/session.conf DESTINATION xswiftbus/64/share/dbus-1/) + + install(FILES ${swift_SOURCE_DIR}/externals/win32-msvc/64/bin/dbus-daemon.exe DESTINATION xswiftbus/64/) + install(FILES ${swift_SOURCE_DIR}/externals/win32-msvc/64/lib/expat.dll DESTINATION xswiftbus/64/) +endif() + +install(DIRECTORY LegacyData DESTINATION xswiftbus) +install(FILES xswiftbus.conf ${CMAKE_CURRENT_BINARY_DIR}/readme.txt DESTINATION xswiftbus) diff --git a/src/xswiftbus/readme.txt.in b/src/xswiftbus/readme.txt.in index 00cfad8ad..686cf2992 100644 --- a/src/xswiftbus/readme.txt.in +++ b/src/xswiftbus/readme.txt.in @@ -1,3 +1,3 @@ -xswiftbus version $$swiftConfig(version.full).$$VER_REV +xswiftbus version ${SWIFT_VERSION} https://swift-project.org/ diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 000000000..245116b53 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_library(tests_test INTERFACE test.h) +target_link_libraries(tests_test INTERFACE Qt::Core Qt::Test) +target_include_directories(tests_test INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) + +add_subdirectory(blackcore) +add_subdirectory(blackgui) +add_subdirectory(blackmisc) + +if(SWIFT_BUILD_FSX_PLUGIN) + add_subdirectory(blacksimpluginfsxp3d) +endif() diff --git a/tests/blackcore/CMakeLists.txt b/tests/blackcore/CMakeLists.txt new file mode 100644 index 000000000..5281370d7 --- /dev/null +++ b/tests/blackcore/CMakeLists.txt @@ -0,0 +1,7 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +add_subdirectory(context) +add_subdirectory(fsd) +add_subdirectory(testconnectivity) +#add_subdirectory(testreaders) diff --git a/tests/blackcore/context/CMakeLists.txt b/tests/blackcore/context/CMakeLists.txt new file mode 100644 index 000000000..b40312fd8 --- /dev/null +++ b/tests/blackcore/context/CMakeLists.txt @@ -0,0 +1,10 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +include(${PROJECT_SOURCE_DIR}/cmake/swift_test.cmake) + +add_swift_test( + NAME core_context + SOURCES testcontext/testcontext.cpp + LINK_LIBRARIES core misc Qt::Test tests_test +) diff --git a/tests/blackcore/fsd/CMakeLists.txt b/tests/blackcore/fsd/CMakeLists.txt new file mode 100644 index 000000000..86479825a --- /dev/null +++ b/tests/blackcore/fsd/CMakeLists.txt @@ -0,0 +1,16 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +include(${PROJECT_SOURCE_DIR}/cmake/swift_test.cmake) + +add_swift_test( + NAME core_fsdclient + SOURCES testfsdclient/testfsdclient.cpp + LINK_LIBRARIES core misc Qt::Test tests_test +) + +add_swift_test( + NAME core_fsdmessages + SOURCES testfsdmessages/testfsdmessages.cpp + LINK_LIBRARIES blackconfig core tests_test Qt::Core Qt::Test +) diff --git a/tests/blackcore/testconnectivity/CMakeLists.txt b/tests/blackcore/testconnectivity/CMakeLists.txt new file mode 100644 index 000000000..a9ae61d85 --- /dev/null +++ b/tests/blackcore/testconnectivity/CMakeLists.txt @@ -0,0 +1,10 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +include(${PROJECT_SOURCE_DIR}/cmake/swift_test.cmake) + +add_swift_test( + NAME core_connectivity + SOURCES testconnectivity.cpp + LINK_LIBRARIES core misc tests_test Qt::Core Qt::Test +) diff --git a/tests/blackcore/testreaders/CMakeLists.txt b/tests/blackcore/testreaders/CMakeLists.txt new file mode 100644 index 000000000..fc5fd587a --- /dev/null +++ b/tests/blackcore/testreaders/CMakeLists.txt @@ -0,0 +1,10 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +include(${PROJECT_SOURCE_DIR}/cmake/swift_test.cmake) + +add_swift_test( + NAME core_readers + SOURCES testreaders.cpp + LINK_LIBRARIES core misc tests_test Qt::Core Qt::Test +) diff --git a/tests/blackgui/CMakeLists.txt b/tests/blackgui/CMakeLists.txt new file mode 100644 index 000000000..a804e72ec --- /dev/null +++ b/tests/blackgui/CMakeLists.txt @@ -0,0 +1,10 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +include(${PROJECT_SOURCE_DIR}/cmake/swift_test.cmake) + +add_swift_test( + NAME gui_guiutility + SOURCES testguiutility/testguiutility.cpp testguiutility/testguiutility.h + LINK_LIBRARIES gui tests_test Qt::Core +) diff --git a/tests/blackmisc/CMakeLists.txt b/tests/blackmisc/CMakeLists.txt new file mode 100644 index 000000000..d596ea938 --- /dev/null +++ b/tests/blackmisc/CMakeLists.txt @@ -0,0 +1,203 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +include(${PROJECT_SOURCE_DIR}/cmake/swift_test.cmake) + +############## +## Aviation ## +############## +add_swift_test( + NAME misc_aviation_aircraftparts + SOURCES aviation/testaircraftparts/testaircraftparts.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +add_swift_test( + NAME misc_aviation_aircraftsituation + SOURCES aviation/testaircraftsituation/testaircraftsituation.cpp + LINK_LIBRARIES blackconfig misc tests_test Qt::Core +) + +add_swift_test( + NAME misc_aviation + SOURCES aviation/testaviation/testaviation.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +add_swift_test( + NAME misc_aviation_flightplan + SOURCES aviation/testflightplan/testflightplan.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +############## +## Geo ## +############## +add_swift_test( + NAME misc_geo + SOURCES geo/testgeo/testgeo.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +############## +## Input ## +############## +add_swift_test( + NAME misc_input + SOURCES input/testinput/testinput.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +############## +## Math ## +############## +add_swift_test( + NAME misc_math + SOURCES math/testmath/testmath.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +############## +## PQ ## +############## +add_swift_test( + NAME misc_pq + SOURCES pq/testphysicalquantities/testphysicalquantities.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +################ +## Simulation ## +################ +add_swift_test( + NAME misc_simulation_interpolatorlinear + SOURCES simulation/testinterpolatorlinear/testinterpolatorlinear.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +add_swift_test( + NAME misc_simulation_interpolatormisc + SOURCES simulation/testinterpolatormisc/testinterpolatormisc.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +add_swift_test( + NAME misc_simulation_interpolatorparts + SOURCES simulation/testinterpolatorparts/testinterpolatorparts.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +add_swift_test( + NAME misc_simulation_xplane + SOURCES simulation/testxplane/testxplane.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +################ +## Various ## +################ +add_swift_test( + NAME misc_compress + SOURCES testcompress/testcompress.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +add_swift_test( + NAME misc_containers + SOURCES testcontainers/testcontainers.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +add_swift_test( + NAME misc_datastream + SOURCES testdatastream/testdatastream.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +add_swift_test( + NAME misc_dbus + SOURCES testdbus/testdbus.cpp + LINK_LIBRARIES misc tests_test Qt::Core Qt::DBus +) + +add_swift_test( + NAME misc_icon + SOURCES testicon/testicon.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +add_swift_test( + NAME misc_identifier + SOURCES testidentifier/testidentifier.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +add_swift_test( + NAME misc_librarypath + SOURCES testlibrarypath/testlibrarypath.cpp + LINK_LIBRARIES blackconfig misc tests_test Qt::Core +) + +add_swift_test( + NAME misc_process + SOURCES testprocess/testprocess.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +add_swift_test( + NAME misc_propertyindex + SOURCES testpropertyindex/testpropertyindex.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +add_swift_test( + NAME misc_sharedstate + SOURCES testsharedstate/testsharedstate.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +add_executable(tests_sharedstatetestserver testsharedstate/sharedstatetestserver/server.cpp testsharedstate/testsharedstate.h) +target_link_libraries(tests_sharedstatetestserver PRIVATE misc Qt::Core Qt::DBus) +add_dependencies(tests_misc_sharedstate tests_sharedstatetestserver) + +add_swift_test( + NAME misc_slot + SOURCES testslot/testslot.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +add_swift_test( + NAME misc_statusmessage + SOURCES teststatusmessage/teststatusmessage.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +add_swift_test( + NAME misc_stringutils + SOURCES teststringutils/teststringutils.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +add_swift_test( + NAME misc_valuecache + SOURCES testvaluecache/testvaluecache.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +add_swift_test( + NAME misc_variantandmap + SOURCES testvariantandmap/testvariantandmap.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) + +#add_swift_test( +# NAME misc_worker +# SOURCES testworker/testworker.cpp +# LINK_LIBRARIES misc tests_test Qt::Core +#) + +add_swift_test( + NAME misc_weather + SOURCES weather/testweather/testweather.cpp + LINK_LIBRARIES misc tests_test Qt::Core +) diff --git a/tests/blackmisc/testsharedstate/testsharedstate.cpp b/tests/blackmisc/testsharedstate/testsharedstate.cpp index 96826515e..4aa1fe591 100644 --- a/tests/blackmisc/testsharedstate/testsharedstate.cpp +++ b/tests/blackmisc/testsharedstate/testsharedstate.cpp @@ -127,7 +127,7 @@ namespace BlackMiscTest QObject::connect(&m_process, qOverload(&QProcess::finished), [](int code, QProcess::ExitStatus status) { qDebug() << "Server process exited" << (status ? "abnormally" : "normally") << "with exit code" << code; }); - m_process.start(QCoreApplication::applicationDirPath() + "/sharedstatetestserver", QStringList()); + m_process.start(QCoreApplication::applicationDirPath() + "/tests_sharedstatetestserver", QStringList()); if (!m_process.waitForStarted()) { qDebug() << "Server failed to start"; diff --git a/tests/blacksimpluginfsxp3d/CMakeLists.txt b/tests/blacksimpluginfsxp3d/CMakeLists.txt new file mode 100644 index 000000000..0063ce0d6 --- /dev/null +++ b/tests/blacksimpluginfsxp3d/CMakeLists.txt @@ -0,0 +1,10 @@ +# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors +# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +include(${PROJECT_SOURCE_DIR}/cmake/swift_test.cmake) + +add_swift_test( + NAME simpluginfsx + SOURCES blacksimpluginfsxp3dtest.h testblacksimpluginfsxp3d.cpp blacksimpluginfsxp3dtest.h + LINK_LIBRARIES Qt::Core fsxcommon tests_test +) diff --git a/version.json b/version.json new file mode 100644 index 000000000..bc8c3870d --- /dev/null +++ b/version.json @@ -0,0 +1,6 @@ +{ + "version": { + "major": 0, + "minor": 14 + } +} diff --git a/default.json.license b/version.json.license similarity index 100% rename from default.json.license rename to version.json.license