diff --git a/internal/frontend/CMakeLists.txt b/internal/frontend/CMakeLists.txt new file mode 100644 index 00000000..32a3bd4f --- /dev/null +++ b/internal/frontend/CMakeLists.txt @@ -0,0 +1,34 @@ +# Copyright (c) 2022 Proton AG +# +# This file is part of Proton Mail Bridge. +# +# Proton Mail Bridge is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Proton Mail Bridge is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Proton Mail Bridge. If not, see . + + +cmake_minimum_required(VERSION 3.22) + + +#***************************************************************************************************************************************************** +# Project +#***************************************************************************************************************************************************** + + +set(VCPKG_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../../extern/vcpkg") +include("bridge_setup.cmake") + +project(frontend) + +add_subdirectory(bridgepp) +add_subdirectory(bridge-gui) + diff --git a/internal/frontend/bridge-gui/CMakeLists.txt b/internal/frontend/bridge-gui/CMakeLists.txt index 6740109f..45ce73c8 100644 --- a/internal/frontend/bridge-gui/CMakeLists.txt +++ b/internal/frontend/bridge-gui/CMakeLists.txt @@ -15,12 +15,10 @@ # You should have received a copy of the GNU General Public License # along with Proton Mail Bridge. If not, see . + cmake_minimum_required(VERSION 3.22) - - -include_guard() set(VCPKG_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../../../extern/vcpkg") -include(../bridgepp/bridge_setup.cmake) +include(../bridge_setup.cmake) #***************************************************************************************************************************************************** @@ -69,9 +67,11 @@ message(STATUS "Using Qt ${Qt6_VERSION}") #***************************************************************************************************************************************************** -configure_file(Version.h.in ${CMAKE_SOURCE_DIR}/Version.h) +configure_file(Version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/Version.h) +if (NOT TARGET bridgepp) add_subdirectory(../bridgepp bridgepp) +endif() if (APPLE) set(DOCK_ICON_SRC_FILE DockIcon/DockIcon.mm) diff --git a/internal/frontend/bridgepp/bridge_setup.cmake b/internal/frontend/bridge_setup.cmake similarity index 96% rename from internal/frontend/bridgepp/bridge_setup.cmake rename to internal/frontend/bridge_setup.cmake index 77ca306d..5054e15b 100644 --- a/internal/frontend/bridgepp/bridge_setup.cmake +++ b/internal/frontend/bridge_setup.cmake @@ -25,7 +25,10 @@ include_guard() # We rely on vcpkg for to get gRPC / Protobuf # run build.sh / build.ps1 to get gRPC / Protobuf and dependencies installed. -set(VCPKG_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../../../extern/vcpkg") +if (NOT DEFINED VCPKG_ROOT) + message(FATAL_ERROR "VCPKG_ROOT is not defined.") +endif() + message(STATUS "VCPKG_ROOT is ${VCPKG_ROOT}") if (WIN32) find_program(VCPKG_EXE "${VCPKG_ROOT}/vcpkg.exe") diff --git a/internal/frontend/bridgepp/CMakeLists.txt b/internal/frontend/bridgepp/CMakeLists.txt index a685dbe0..292d6c6b 100644 --- a/internal/frontend/bridgepp/CMakeLists.txt +++ b/internal/frontend/bridgepp/CMakeLists.txt @@ -17,11 +17,8 @@ cmake_minimum_required(VERSION 3.22) - - -include_guard() set(VCPKG_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../../../extern/vcpkg") -include(bridge_setup.cmake) +include(../bridge_setup.cmake) #**************************************************************************************************************************************************** @@ -38,6 +35,7 @@ else() message(STATUS "Bridge version is ${BRIDGE_APP_VERSION}") endif() + #**************************************************************************************************************************************************** # Qt #****************************************************************************************************************************************************