mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-19 02:00:45 +07:00
847bb6923b
* refactor: move business logic from servers model * refactor: move containersModel initialization * refactor: added protocol ui controller and removed settings class from protocols model * refactor: moved cli management to separate controller * refactor: moved app split to separate controller * refactor: moved site split to separate controller * refactor: moved allowed dns to separate controller * refactor: moved language logic to separate ui controller * refactor: removed Settings from devices model * refactor: moved configs and services api logit to separate core controller * refactor: added a layer with a repository between the storage and controllers * refactor: use child parent system instead of smart pointers for controllers and models initialization * refactor: moved install functions from server controller to install controller * refactor: install controller refactoring * chore: renamed exportController to exportUiController * refactor: separate export controller * refactor: removed VpnConfigurationsController * chore: renamed ServerController to SshSession * refactor: replaced ServerController to SshSession * chore: moved qml controllers to separate folder * chore: include fixes * chore: moved utils from core root to core/utils * chore: include fixes * chore: rename core/utils files to camelCase foramt * chore: include fixes * chore: moved some utils to api and selfhosted folders * chore: include fixes * chore: remove unused file * chore: moved serialization folder to core/utils * chore: include fixes * chore: moved some files from client root to core/utils * chore: include fixes * chore: moved ui utils to ui/utils folder * chore: include fixes * chore: move utils from root to ui/utils * chore: include fixes * chore: moved configurators to core/configurators * chore: include fixes * refactor: moved iap logic from ui controller to core * refactor: moved remaining core logic from ApiConfigsController to SubscriptionController * chore: rename apiNewsController to apiNewsUiController * refactor: moved core logic from news ui controller to core * chore: renamed apiConfigsController to subscriptionUiController * chore: include fixes * refactor: merge ApiSettingsController with SubscriptionUiController * chore: moved ui selfhosted controllers to separate folder * chore: include fixes * chore: rename connectionController to connectiomUiController * refactor: moved core logic from connectionUiController * chore: rename settingsController to settingsUiController * refactor: move core logic from settingsUiController * refactor: moved core controller signal/slot connections to separate class * fix: newsController fixes after refactoring * chore: rename model to camelCase * chore: include fixes * chore: remove unused code * chore: move selfhosted core to separate folder * chore: include fixes * chore: rename importController to importUiController * refactor: move core logic from importUiController * chore: minor fixes * chore: remove prem v1 migration * refactor: remove openvpn over cloak and openvpn over shadowsocks * refactor: removed protocolsForContainer function * refactor: add core models * refactor: replace json with c++ structs for server config * refactor: move getDnsPair to ServerConfigUtils * feat: add admin selfhosted config export test * feat: add multi import test * refactor: use coreController for tests * feat: add few simple tests * chore: qrepos in all core controllers * feat: add test for settings * refactor: remove repo dependency from configurators * chore: moved protocols to core folder * chore: include fixes * refactor: moved containersDefs, defs, apiDefs, protocolsDefs to different places * chore: include fixes * chore: build fixes * chore: build fixes * refactor: remove q repo and interface repo * feat: add test for ui servers model and controller * chore: renamed to camelCase * chore: include fixes * refactor: moved core logic from sites ui controller * fix: fixed api config processing * fix: fixed processed server index processing * refactor: protocol models now use c++ structs instead of json configs * refactor: servers model now use c++ struct instead of json config * fix: fixed default server index processing * fix: fix logs init * fix: fix secure settings load keys * chore: build fixes * fix: fixed clear settings * fix: fixed restore backup * fix: sshSession usage * fix: fixed export functions signatures * fix: return missing part from buildContainerWorker * fix: fixed server description on page home * refactor: add container config helpers functions * refactor: c++ structs instead of json * chore: add dns protocol config struct * refactor: move config utils functions to config structs * feat: add test for selfhosted server setup * refactor: separate resources.qrc * fix: fixed server rename * chore: return nameOverriddenByUser * fix: build fixes * fix: fixed models init * refactor: cleanup models usage * fix: fixed models init * chore: cleanup connections and functions signatures * chore: cleanup updateModel calls * feat: added cache to servers repo * chore: cleanup unused functions * chore: ssxray processing * chore: remove transportProtoWithDefault and portWithDefault functions * chore: removed proto types any and l2tp * refactor: moved some constants * fix: fixed native configs export * refactor: remove json from processConfigWith functions * fix: fixed processed server index usage * fix: qml warning fixes * chore: merge fixes * chore: update tests * fix: fixed xray config processing * fix: fixed split tunneling processing * chore: rename sites controllers and model * chore: rename fixes * chore: minor fixes * chore: remove ability to load backup from "file with connection settings" button * fix: fixed api device revoke * fix: remove full model update when renaming a user * fix: fixed premium/free server rename * fix: fixed selfhosted new server install * fix: fixed updateContainer function * fix: fixed revoke for external premium configs * feat: add native configs qr processing * chore: codestyle fixes * fix: fixed admin config create * chore: again remove ability to load backup from "file with connection settings" button * chore: minor fixes * fix: fixed variables initialization * fix: fixed qml imports * fix: minor fixes * fix: fix vpnConnection function calls * feat: add buckup error handling * fix: fixed admin config revok * fix: fixed selfhosted awg installation * fix: ad visability * feat: add empty check for primary dns * chore: minor fixes
418 lines
18 KiB
CMake
418 lines
18 KiB
CMake
cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR)
|
|
|
|
set(PROJECT AmneziaVPN-service)
|
|
project(${PROJECT} VERSION ${AMNEZIAVPN_VERSION})
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
find_package(Qt6 REQUIRED COMPONENTS DBus Core Network Widgets RemoteObjects Core5Compat Concurrent)
|
|
qt_standard_project_setup()
|
|
|
|
|
|
configure_file(${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
|
|
|
|
set(AMNEZIA_XRAY_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../../client/3rd-prebuilt/3rd-prebuilt/amnezia_xray")
|
|
if(WIN32)
|
|
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
|
set(AMNEZIA_XRAY_LIB_PATH "${AMNEZIA_XRAY_ROOT_DIR}/windows/x86_64/amnezia_xray.lib")
|
|
set(AMNEZIA_XRAY_INCLUDE_DIR "${AMNEZIA_XRAY_ROOT_DIR}/windows/x86_64")
|
|
else()
|
|
set(AMNEZIA_XRAY_LIB_PATH "${AMNEZIA_XRAY_ROOT_DIR}/windows/x86/amnezia_xray.lib")
|
|
set(AMNEZIA_XRAY_INCLUDE_DIR "${AMNEZIA_XRAY_ROOT_DIR}/windows/x86")
|
|
endif()
|
|
elseif(APPLE AND NOT IOS)
|
|
set(AMNEZIA_XRAY_LIB_PATH "${AMNEZIA_XRAY_ROOT_DIR}/macos/x86_64/amnezia_xray.a")
|
|
set(AMNEZIA_XRAY_INCLUDE_DIR "${AMNEZIA_XRAY_ROOT_DIR}/macos/x86_64")
|
|
elseif(LINUX)
|
|
set(AMNEZIA_XRAY_LIB_PATH "${AMNEZIA_XRAY_ROOT_DIR}/linux/x86_64/amnezia_xray.a")
|
|
set(AMNEZIA_XRAY_INCLUDE_DIR "${AMNEZIA_XRAY_ROOT_DIR}/linux/x86_64")
|
|
endif()
|
|
|
|
set(QSIMPLECRYPTO_DIR ${CMAKE_CURRENT_LIST_DIR}/../../client/3rd/QSimpleCrypto/src)
|
|
|
|
|
|
set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../../client/3rd-prebuilt/3rd-prebuilt/openssl/")
|
|
set(OPENSSL_LIBRARIES_DIR "${OPENSSL_ROOT_DIR}/lib")
|
|
|
|
set(OPENSSL_INCLUDE_DIR "${OPENSSL_ROOT_DIR}/windows/include")
|
|
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
|
set(OPENSSL_LIB_SSL_PATH "${OPENSSL_ROOT_DIR}/windows/win64/libssl.lib")
|
|
set(OPENSSL_LIB_CRYPTO_PATH "${OPENSSL_ROOT_DIR}/windows/win64/libcrypto.lib")
|
|
else()
|
|
set(OPENSSL_LIB_SSL_PATH "${OPENSSL_ROOT_DIR}/windows/win32/libssl.lib")
|
|
set(OPENSSL_LIB_CRYPTO_PATH "${OPENSSL_ROOT_DIR}/windows/win32/libcrypto.lib")
|
|
endif()
|
|
|
|
|
|
if(WIN32)
|
|
set(OPENSSL_INCLUDE_DIR "${OPENSSL_ROOT_DIR}/windows/include")
|
|
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
|
set(OPENSSL_LIB_CRYPTO_PATH "${OPENSSL_ROOT_DIR}/windows/win64/libcrypto.lib")
|
|
else()
|
|
set(OPENSSL_LIB_CRYPTO_PATH "${OPENSSL_ROOT_DIR}/windows/win32/libcrypto.lib")
|
|
endif()
|
|
elseif(APPLE AND NOT IOS)
|
|
set(OPENSSL_INCLUDE_DIR "${OPENSSL_ROOT_DIR}/macos/include")
|
|
set(OPENSSL_LIB_CRYPTO_PATH "${OPENSSL_ROOT_DIR}/macos/lib/libcrypto.a")
|
|
elseif(LINUX)
|
|
set(OPENSSL_INCLUDE_DIR "${OPENSSL_ROOT_DIR}/linux/include")
|
|
set(OPENSSL_LIB_CRYPTO_PATH "${OPENSSL_ROOT_DIR}/linux/x86_64/libcrypto.a")
|
|
endif()
|
|
|
|
set(OPENSSL_USE_STATIC_LIBS TRUE)
|
|
|
|
include_directories(
|
|
${AMNEZIA_XRAY_INCLUDE_DIR}
|
|
${OPENSSL_INCLUDE_DIR}
|
|
${QSIMPLECRYPTO_DIR}
|
|
)
|
|
|
|
set(HEADERS
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/core/utils/utilities.h
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/secureQSettings.h
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/core/utils/networkUtilities.h
|
|
${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipc.h
|
|
${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipcserver.h
|
|
${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipcserverprocess.h
|
|
${CMAKE_CURRENT_LIST_DIR}/localserver.h
|
|
${CMAKE_CURRENT_LIST_DIR}/../../common/logger/logger.h
|
|
${CMAKE_CURRENT_LIST_DIR}/router.h
|
|
${CMAKE_CURRENT_LIST_DIR}/killswitch.h
|
|
${CMAKE_CURRENT_LIST_DIR}/systemservice.h
|
|
${CMAKE_CURRENT_LIST_DIR}/xray.h
|
|
${CMAKE_CURRENT_BINARY_DIR}/version.h
|
|
${QSIMPLECRYPTO_DIR}/include/QAead.h
|
|
${QSIMPLECRYPTO_DIR}/include/QBlockCipher.h
|
|
${QSIMPLECRYPTO_DIR}/include/QRsa.h
|
|
${QSIMPLECRYPTO_DIR}/include/QSimpleCrypto_global.h
|
|
${QSIMPLECRYPTO_DIR}/include/QX509.h
|
|
${QSIMPLECRYPTO_DIR}/include/QX509Store.h
|
|
)
|
|
|
|
set(SOURCES
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/core/utils/utilities.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/secureQSettings.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/core/utils/networkUtilities.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipcserver.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipcserverprocess.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/localserver.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/../../common/logger/logger.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/main.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/router.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/killswitch.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/systemservice.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/xray.cpp
|
|
${QSIMPLECRYPTO_DIR}/sources/QAead.cpp
|
|
${QSIMPLECRYPTO_DIR}/sources/QBlockCipher.cpp
|
|
${QSIMPLECRYPTO_DIR}/sources/QRsa.cpp
|
|
${QSIMPLECRYPTO_DIR}/sources/QX509.cpp
|
|
${QSIMPLECRYPTO_DIR}/sources/QX509Store.cpp
|
|
)
|
|
|
|
# Mozilla headres
|
|
set(HEADERS ${HEADERS}
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/daemon/dnsutils.h
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/daemon/iputils.h
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/daemon/interfaceconfig.h
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/daemon/wireguardutils.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/platforms/dummy/dummynetworkwatcher.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/mozilla/shared/ipaddress.h
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/mozilla/shared/loglevel.h
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/mozilla/shared/leakdetector.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/mozilla/models/server.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/mozilla/controllerimpl.h
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/mozilla/dnspingsender.h
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/mozilla/networkwatcher.h
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/mozilla/networkwatcherimpl.h
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/mozilla/pinghelper.h
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/mozilla/pingsender.h
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/mozilla/pingsenderfactory.h
|
|
)
|
|
|
|
include_directories(../../client/mozilla)
|
|
include_directories(../../client/mozilla/shared)
|
|
include_directories(../../client/mozilla/models)
|
|
include_directories(../../client/platforms/)
|
|
|
|
# Mozilla sources
|
|
set(SOURCES ${SOURCES}
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/mozilla/models/server.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/platforms/dummy/dummynetworkwatcher.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/daemon/interfaceconfig.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/mozilla/shared/ipaddress.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/mozilla/shared/leakdetector.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/mozilla/dnspingsender.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/mozilla/networkwatcher.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/mozilla/pinghelper.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/mozilla/pingsender.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/mozilla/pingsenderfactory.cpp
|
|
)
|
|
|
|
if(UNIX)
|
|
set(HEADERS ${HEADERS}
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/mozilla/shared/signalhandler.h
|
|
)
|
|
set(SOURCES ${SOURCES}
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/mozilla/shared/signalhandler.cpp
|
|
)
|
|
endif()
|
|
|
|
if (WIN32 OR APPLE OR LINUX)
|
|
set(HEADERS ${HEADERS}
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/daemon/daemon.h
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/daemon/daemonlocalserver.h
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/daemon/daemonlocalserverconnection.h
|
|
)
|
|
set(SOURCES ${SOURCES}
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/daemon/daemon.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/daemon/daemonlocalserver.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/daemon/daemonlocalserverconnection.cpp
|
|
)
|
|
endif()
|
|
|
|
set(RESOURCES)
|
|
|
|
if(WIN32)
|
|
configure_file(
|
|
${CMAKE_CURRENT_LIST_DIR}/amneziavpn-service.rc.in
|
|
${CMAKE_CURRENT_BINARY_DIR}/amneziavpn-service.rc
|
|
)
|
|
|
|
set(HEADERS ${HEADERS}
|
|
${CMAKE_CURRENT_LIST_DIR}/tapcontroller_win.h
|
|
${CMAKE_CURRENT_LIST_DIR}/router_win.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/daemon/windowsdaemon.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/daemon/windowsdaemontunnel.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/daemon/windowsfirewall.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/windowscommons.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/windowsservicemanager.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/daemon/dnsutilswindows.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/daemon/windowssplittunnel.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/daemon/windowstunnelservice.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/daemon/wireguardutilswindows.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/daemon/windowstunnellogger.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/daemon/windowsroutemonitor.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/windowsutils.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/windowspingsender.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/windowsnetworkwatcher.h
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client/daemon/daemonerrors.h
|
|
)
|
|
|
|
set(SOURCES ${SOURCES}
|
|
${CMAKE_CURRENT_LIST_DIR}/tapcontroller_win.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/router_win.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/daemon/windowsdaemon.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/daemon/windowsdaemontunnel.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/daemon/windowsfirewall.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/windowscommons.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/windowsservicemanager.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/daemon/dnsutilswindows.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/daemon/windowssplittunnel.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/daemon/windowstunnelservice.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/daemon/wireguardutilswindows.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/daemon/windowstunnellogger.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/daemon/windowsroutemonitor.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/windowspingsender.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/windowsnetworkwatcher.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/windows/windowsutils.cpp
|
|
)
|
|
|
|
set(RESOURCES ${RESOURCES}
|
|
${CMAKE_CURRENT_BINARY_DIR}/amneziavpn-service.rc
|
|
)
|
|
|
|
set(LIBS
|
|
user32
|
|
rasapi32
|
|
shlwapi
|
|
iphlpapi
|
|
ws2_32
|
|
iphlpapi
|
|
gdi32
|
|
Advapi32
|
|
Kernel32
|
|
${AMNEZIA_XRAY_LIB_PATH}
|
|
${OPENSSL_LIB_CRYPTO_PATH}
|
|
qt6keychain
|
|
)
|
|
|
|
add_compile_definitions(_WINSOCKAPI_)
|
|
endif()
|
|
|
|
if(APPLE)
|
|
set(HEADERS ${HEADERS}
|
|
${CMAKE_CURRENT_LIST_DIR}/helper_route_mac.h
|
|
${CMAKE_CURRENT_LIST_DIR}/router_mac.h
|
|
)
|
|
|
|
set(SOURCES ${SOURCES}
|
|
${CMAKE_CURRENT_LIST_DIR}/helper_route_mac.c
|
|
${CMAKE_CURRENT_LIST_DIR}/router_mac.cpp
|
|
)
|
|
|
|
#Mozilla
|
|
set(HEADERS ${HEADERS}
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/ios/iosnetworkwatcher.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/macos/macosnetworkwatcher.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/macos/macospingsender.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/macos/daemon/dnsutilsmacos.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/macos/daemon/iputilsmacos.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/macos/daemon/macosdaemon.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/macos/daemon/macosroutemonitor.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/macos/daemon/wireguardutilsmacos.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/macos/daemon/macosfirewall.h
|
|
)
|
|
|
|
set(SOURCES ${SOURCES}
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/ios/iosnetworkwatcher.mm
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/macos/macosnetworkwatcher.mm
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/macos/macospingsender.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/macos/daemon/dnsutilsmacos.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/macos/daemon/iputilsmacos.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/macos/daemon/macosdaemon.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/macos/daemon/macosroutemonitor.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/macos/daemon/wireguardutilsmacos.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/macos/daemon/macosfirewall.cpp
|
|
)
|
|
|
|
set(LIBS
|
|
resolv
|
|
${AMNEZIA_XRAY_LIB_PATH}
|
|
${OPENSSL_LIB_CRYPTO_PATH}
|
|
qt6keychain
|
|
)
|
|
|
|
endif()
|
|
|
|
if(LINUX)
|
|
|
|
set(HEADERS ${HEADERS}
|
|
${CMAKE_CURRENT_LIST_DIR}/router_linux.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/linux/linuxnetworkwatcher.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/linux/linuxnetworkwatcherworker.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/linux/linuxdependencies.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/linux/linuxpingsender.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/linux/daemon/iputilslinux.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/linux/daemon/dbustypeslinux.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/linux/daemon/linuxdaemon.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/linux/daemon/dnsutilslinux.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/linux/daemon/wireguardutilslinux.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/linux/daemon/linuxroutemonitor.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/linux/daemon/linuxfirewall.h
|
|
)
|
|
|
|
set(SOURCES ${SOURCES}
|
|
${CMAKE_CURRENT_LIST_DIR}/router_linux.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/linux/linuxnetworkwatcher.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/linux/linuxnetworkwatcherworker.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/linux/linuxdependencies.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/linux/linuxpingsender.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/linux/daemon/dnsutilslinux.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/linux/daemon/iputilslinux.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/linux/daemon/linuxdaemon.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/linux/daemon/wireguardutilslinux.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/linux/daemon/linuxroutemonitor.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../client/platforms/linux/daemon/linuxfirewall.cpp
|
|
)
|
|
|
|
set(LIBS
|
|
${AMNEZIA_XRAY_LIB_PATH}
|
|
${OPENSSL_LIB_CRYPTO_PATH}
|
|
qt6keychain
|
|
-static-libstdc++
|
|
-static-libgcc
|
|
-ldl
|
|
)
|
|
|
|
endif()
|
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/../src/qtservice.cmake)
|
|
|
|
include_directories(
|
|
${CMAKE_CURRENT_LIST_DIR}
|
|
${CMAKE_CURRENT_LIST_DIR}/../../client
|
|
${CMAKE_CURRENT_LIST_DIR}/../../ipc
|
|
${CMAKE_CURRENT_LIST_DIR}/../../common/logger
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
)
|
|
|
|
|
|
add_executable(${PROJECT} ${SOURCES} ${HEADERS} ${RESOURCES})
|
|
target_link_libraries(${PROJECT} PRIVATE Qt6::Core Qt6::Widgets Qt6::Network Qt6::RemoteObjects Qt6::Core5Compat Qt6::DBus Qt6::Concurrent ${LIBS})
|
|
target_compile_definitions(${PROJECT} PRIVATE "MZ_$<UPPER_CASE:${MZ_PLATFORM_NAME}>")
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
target_compile_definitions(${PROJECT} PRIVATE "MZ_DEBUG")
|
|
endif()
|
|
|
|
if(APPLE)
|
|
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
set_target_properties(${PROJECT} PROPERTIES
|
|
INSTALL_RPATH "@executable_path/../Frameworks"
|
|
BUILD_WITH_INSTALL_RPATH TRUE
|
|
)
|
|
endif()
|
|
|
|
find_library(FW_COREFOUNDATION CoreFoundation)
|
|
find_library(FW_SYSTEMCONFIG SystemConfiguration)
|
|
find_library(FW_SERVICEMGMT ServiceManagement)
|
|
find_library(FW_SECURITY Security)
|
|
find_library(FW_COREWLAN CoreWLAN)
|
|
find_library(FW_NETWORK Network)
|
|
find_library(FW_USER_NOTIFICATIONS UserNotifications)
|
|
|
|
target_link_libraries(${PROJECT} PRIVATE ${FW_COREFOUNDATION})
|
|
target_link_libraries(${PROJECT} PRIVATE ${FW_SYSTEMCONFIG})
|
|
target_link_libraries(${PROJECT} PRIVATE ${FW_SERVICEMGMT})
|
|
target_link_libraries(${PROJECT} PRIVATE ${FW_SECURITY})
|
|
target_link_libraries(${PROJECT} PRIVATE ${FW_COREWLAN})
|
|
target_link_libraries(${PROJECT} PRIVATE ${FW_NETWORK})
|
|
target_link_libraries(${PROJECT} PRIVATE ${FW_USER_NOTIFICATIONS})
|
|
|
|
|
|
endif()
|
|
|
|
qt_add_repc_sources(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipc_interface.rep)
|
|
qt_add_repc_sources(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipc_process_interface.rep)
|
|
|
|
# copy deploy artifacts required to run the application to the debug build folder
|
|
if(WIN32)
|
|
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
|
set(DEPLOY_PLATFORM_PATH "windows/x64")
|
|
else()
|
|
set(DEPLOY_PLATFORM_PATH "windows/x32")
|
|
endif()
|
|
elseif(LINUX)
|
|
set(DEPLOY_PLATFORM_PATH "linux/client")
|
|
elseif(APPLE AND NOT IOS)
|
|
set(DEPLOY_PLATFORM_PATH "macos")
|
|
endif()
|
|
|
|
add_custom_command(
|
|
TARGET ${PROJECT} POST_BUILD
|
|
COMMAND ${CMAKE_COMMAND} -E $<IF:$<CONFIG:Debug>,copy_directory,true>
|
|
${CMAKE_SOURCE_DIR}/deploy/data/${DEPLOY_PLATFORM_PATH}
|
|
$<TARGET_FILE_DIR:${PROJECT}>
|
|
COMMAND_EXPAND_LISTS
|
|
)
|
|
add_custom_command(
|
|
TARGET ${PROJECT} POST_BUILD
|
|
COMMAND ${CMAKE_COMMAND} -E $<IF:$<CONFIG:Debug>,copy_directory,true>
|
|
${CMAKE_SOURCE_DIR}/client/3rd-prebuilt/deploy-prebuilt/${DEPLOY_PLATFORM_PATH}
|
|
$<TARGET_FILE_DIR:${PROJECT}>
|
|
COMMAND_EXPAND_LISTS
|
|
)
|