* refactoring: improved the performance of secure_settings * bugfix: fixed textFields on PageSetupWizardCredentials * bugfix: fixed scrolling by keys on PageSettingsApiServerInfo * chore: hide site links for ios (#1374) * chore: fixed log output with split tunneling info * chore: hide "open logs folder" button for mobule platforms * chore: fixed again log output with split tunneling info * chore: bump version * Install apparmor (#1379) Install apparmor * chore: returned the backup page for androidTV * Enable PFS for Windows IKEv2 * refactoring: moved api info pages from ServerInfo * refactoring: moved gateway interaction functions to a separate class * bugfix: fixed storeEndpoint parsing * chore: returned links for mobile platforms * Update VPN protocol descriptions * Update VPN description texts * feature: added pages for subscription settings feature * feature: added page for export api native configs * feature: added error handling and minor ui fixes * refactor: update ios build configuration to use automatic code signing and prebuilt OpenVPNAdapter framework * feat: remove OpenVPNAdapter submodule * feat: remove ios openvpn script and associated cmake configuration * Update README.md * Update README_RU.md * Update README.md fix link * feature: added share vpn key to subscription settings page * bugfix: fixed possible crush on android * add timeouts in ipc client init * apply timeouts only for Windows * apply format to file * refactoring: simplified the validity check of the config before connection - improved project structure * bugfix: fixed visability of share drawer * feature: added 409 error handling from server response * chore: fixed android build * chore: fixed qr code display * Rewrite timeouts using waitForSource * feature: added error messages handler * feature: added issued configs info parsing * feature: added functionality to revoke api configs * chore: added links to instructions * chore: fixed qr code with vpnkey processing * chore: fixed native config post processing * chore: added link to android tv instruction * change node to IpcProcessTun2SocksReplica * chore: minor ui fixes * Update Windows OpenSSL (#1426) * Update Windows OpenSSL to 3.0.16 and add shared library for QSslSocket plugin * chore: update link to submodule 3rd-prebuild --------- Co-authored-by: vladimir.kuznetsov <nethiuswork@gmail.com> * chore: added 404 handling for revoke configs - added revoke before remove api server for premium v2 * chore: added log to see proxy decrypt errors * chore: minor ui fix * chore: bump version * bugfix: fixed mobile controllers initialization (#1436) * bugfix: fixed mobile controllers initialization * chore: bump version * Merge pull request #1440 from amnezia-vpn/feature/subscription-settings-page feature/subscription settings page --------- Co-authored-by: vladimir.kuznetsov <nethiuswork@gmail.com> Co-authored-by: pokamest <pokamest@gmail.com> Co-authored-by: Mykola Baibuz <mykola.baibuz@gmail.com> Co-authored-by: Yaroslav Yashin <yaroslav.yashin@gmail.com> Co-authored-by: KsZnak <ksu@amnezia.org> Co-authored-by: Cyril Anisimov <CyAn84@gmail.com>
226 lines
6.9 KiB
CMake
226 lines
6.9 KiB
CMake
cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR)
|
|
|
|
set(PROJECT AmneziaVPN)
|
|
project(${PROJECT})
|
|
|
|
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
|
set_property(GLOBAL PROPERTY AUTOGEN_TARGETS_FOLDER "Autogen")
|
|
set_property(GLOBAL PROPERTY AUTOMOC_TARGETS_FOLDER "Autogen")
|
|
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "Autogen")
|
|
|
|
set(PACKAGES
|
|
Core Gui Network Xml
|
|
RemoteObjects Quick Svg QuickControls2
|
|
Core5Compat Concurrent LinguistTools
|
|
)
|
|
|
|
execute_process(
|
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
|
COMMAND git rev-parse --short HEAD
|
|
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
)
|
|
|
|
add_definitions(-DGIT_COMMIT_HASH="${GIT_COMMIT_HASH}")
|
|
|
|
add_definitions(-DPROD_AGW_PUBLIC_KEY="$ENV{PROD_AGW_PUBLIC_KEY}")
|
|
add_definitions(-DPROD_S3_ENDPOINT="$ENV{PROD_S3_ENDPOINT}")
|
|
|
|
add_definitions(-DDEV_AGW_PUBLIC_KEY="$ENV{DEV_AGW_PUBLIC_KEY}")
|
|
add_definitions(-DDEV_AGW_ENDPOINT="$ENV{DEV_AGW_ENDPOINT}")
|
|
add_definitions(-DDEV_S3_ENDPOINT="$ENV{DEV_S3_ENDPOINT}")
|
|
|
|
if(IOS)
|
|
set(PACKAGES ${PACKAGES} Multimedia)
|
|
endif()
|
|
|
|
if(WIN32 OR (APPLE AND NOT IOS) OR (LINUX AND NOT ANDROID))
|
|
set(PACKAGES ${PACKAGES} Widgets)
|
|
endif()
|
|
|
|
find_package(Qt6 REQUIRED COMPONENTS ${PACKAGES})
|
|
|
|
set(LIBS ${LIBS}
|
|
Qt6::Core Qt6::Gui
|
|
Qt6::Network Qt6::Xml Qt6::RemoteObjects
|
|
Qt6::Quick Qt6::Svg Qt6::QuickControls2
|
|
Qt6::Core5Compat Qt6::Concurrent
|
|
)
|
|
|
|
if(IOS)
|
|
set(LIBS ${LIBS} Qt6::Multimedia)
|
|
endif()
|
|
|
|
if(WIN32 OR (APPLE AND NOT IOS) OR (LINUX AND NOT ANDROID))
|
|
set(LIBS ${LIBS} Qt6::Widgets)
|
|
endif()
|
|
|
|
qt_standard_project_setup()
|
|
qt_add_executable(${PROJECT} MANUAL_FINALIZATION)
|
|
|
|
if(WIN32 OR (APPLE AND NOT IOS) OR (LINUX AND NOT ANDROID))
|
|
qt_add_repc_replicas(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../ipc/ipc_interface.rep)
|
|
qt_add_repc_replicas(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../ipc/ipc_process_interface.rep)
|
|
qt_add_repc_replicas(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../ipc/ipc_process_tun2socks.rep)
|
|
endif()
|
|
|
|
qt6_add_resources(QRC ${QRC} ${CMAKE_CURRENT_LIST_DIR}/resources.qrc)
|
|
|
|
# -- i18n begin
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
set(AMNEZIAVPN_TS_FILES
|
|
${CMAKE_CURRENT_LIST_DIR}/translations/amneziavpn_ru_RU.ts
|
|
${CMAKE_CURRENT_LIST_DIR}/translations/amneziavpn_zh_CN.ts
|
|
${CMAKE_CURRENT_LIST_DIR}/translations/amneziavpn_fa_IR.ts
|
|
${CMAKE_CURRENT_LIST_DIR}/translations/amneziavpn_ar_EG.ts
|
|
${CMAKE_CURRENT_LIST_DIR}/translations/amneziavpn_my_MM.ts
|
|
${CMAKE_CURRENT_LIST_DIR}/translations/amneziavpn_uk_UA.ts
|
|
${CMAKE_CURRENT_LIST_DIR}/translations/amneziavpn_ur_PK.ts
|
|
${CMAKE_CURRENT_LIST_DIR}/translations/amneziavpn_hi_IN.ts
|
|
)
|
|
|
|
file(GLOB_RECURSE AMNEZIAVPN_TS_SOURCES *.qrc *.cpp *.h *.ui)
|
|
|
|
qt_create_translation(AMNEZIAVPN_QM_FILES ${AMNEZIAVPN_TS_SOURCES} ${AMNEZIAVPN_TS_FILES})
|
|
|
|
set(QM_FILE_LIST "")
|
|
foreach(FILE ${AMNEZIAVPN_QM_FILES})
|
|
get_filename_component(QM_FILE_NAME ${FILE} NAME)
|
|
list(APPEND QM_FILE_LIST "<file>${QM_FILE_NAME}</file>")
|
|
endforeach()
|
|
string(REPLACE ";" "" QM_FILE_LIST ${QM_FILE_LIST})
|
|
|
|
configure_file(${CMAKE_CURRENT_LIST_DIR}/translations/translations.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc)
|
|
qt6_add_resources(QRC ${I18NQRC} ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc)
|
|
# -- i18n end
|
|
|
|
set(IS_CI ${CI})
|
|
if(IS_CI)
|
|
message("Detected CI env")
|
|
find_program(CCACHE "ccache")
|
|
if(CCACHE)
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE}")
|
|
endif()
|
|
endif()
|
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/cmake/3rdparty.cmake)
|
|
include(${CMAKE_CURRENT_LIST_DIR}/cmake/sources.cmake)
|
|
|
|
include_directories(
|
|
${CMAKE_CURRENT_LIST_DIR}/../ipc
|
|
${CMAKE_CURRENT_LIST_DIR}/../common/logger
|
|
${CMAKE_CURRENT_LIST_DIR}
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
)
|
|
|
|
include_directories(mozilla)
|
|
include_directories(mozilla/shared)
|
|
include_directories(mozilla/models)
|
|
|
|
configure_file(${CMAKE_CURRENT_LIST_DIR}/../version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
target_compile_definitions(${PROJECT} PRIVATE "MZ_DEBUG")
|
|
endif()
|
|
|
|
if(WIN32)
|
|
configure_file(
|
|
${CMAKE_CURRENT_LIST_DIR}/platforms/windows/amneziavpn.rc.in
|
|
${CMAKE_CURRENT_BINARY_DIR}/amneziavpn.rc
|
|
)
|
|
|
|
set(LIBS ${LIBS}
|
|
user32
|
|
rasapi32
|
|
shlwapi
|
|
iphlpapi
|
|
ws2_32
|
|
gdi32
|
|
)
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
|
|
endif()
|
|
|
|
if(APPLE)
|
|
cmake_policy(SET CMP0099 OLD)
|
|
cmake_policy(SET CMP0114 NEW)
|
|
|
|
if(NOT BUILD_OSX_APP_IDENTIFIER)
|
|
set(BUILD_OSX_APP_IDENTIFIER org.amnezia.AmneziaVPN CACHE STRING "OSX Application identifier")
|
|
endif()
|
|
if(NOT BUILD_IOS_APP_IDENTIFIER)
|
|
set(BUILD_IOS_APP_IDENTIFIER org.amnezia.AmneziaVPN CACHE STRING "iOS Application identifier")
|
|
endif()
|
|
if(NOT BUILD_IOS_GROUP_IDENTIFIER)
|
|
set(BUILD_IOS_GROUP_IDENTIFIER group.org.amnezia.AmneziaVPN CACHE STRING "iOS Group identifier")
|
|
endif()
|
|
if(NOT BUILD_VPN_DEVELOPMENT_TEAM)
|
|
set(BUILD_VPN_DEVELOPMENT_TEAM X7UJ388FXK CACHE STRING "Amnezia VPN Development Team")
|
|
endif()
|
|
|
|
set(CMAKE_XCODE_GENERATE_SCHEME FALSE)
|
|
set(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM ${BUILD_VPN_DEVELOPMENT_TEAM})
|
|
set(CMAKE_XCODE_ATTRIBUTE_GROUP_ID_IOS ${BUILD_IOS_GROUP_IDENTIFIER})
|
|
|
|
endif()
|
|
|
|
if(LINUX AND NOT ANDROID)
|
|
set(LIBS ${LIBS} -static-libstdc++ -static-libgcc -ldl)
|
|
link_directories(${CMAKE_CURRENT_LIST_DIR}/platforms/linux)
|
|
endif()
|
|
|
|
if(WIN32 OR (APPLE AND NOT IOS) OR (LINUX AND NOT ANDROID))
|
|
message("Client desktop build")
|
|
add_compile_definitions(AMNEZIA_DESKTOP)
|
|
endif()
|
|
|
|
if(ANDROID)
|
|
include(cmake/android.cmake)
|
|
endif()
|
|
|
|
if(IOS)
|
|
include(cmake/ios.cmake)
|
|
include(cmake/ios-arch-fixup.cmake)
|
|
elseif(APPLE AND NOT IOS)
|
|
include(cmake/osxtools.cmake)
|
|
include(cmake/macos.cmake)
|
|
endif()
|
|
|
|
target_link_libraries(${PROJECT} PRIVATE ${LIBS})
|
|
target_compile_definitions(${PROJECT} PRIVATE "MZ_$<UPPER_CASE:${MZ_PLATFORM_NAME}>")
|
|
|
|
# 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()
|
|
|
|
if(NOT IOS AND NOT ANDROID)
|
|
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
|
|
)
|
|
|
|
endif()
|
|
|
|
target_sources(${PROJECT} PRIVATE ${SOURCES} ${HEADERS} ${RESOURCES} ${QRC} ${I18NQRC})
|
|
qt_finalize_target(${PROJECT})
|