Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ BraceWrapping:
AfterFunction : 'false'
AfterNamespace : 'false'
AfterStruct : 'true'
AfterCaseLabel : 'false'
AfterUnion : 'false'
AfterExternBlock : 'false'
BeforeCatch : 'false'
Expand Down
47 changes: 11 additions & 36 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@ if (${CMAKE_VERSION} VERSION_GREATER "3.24")
cmake_policy(SET CMP0135 OLD)
endif()

project(inklink VERSION 0.1.0)
project(VERSION 0.1.0)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

include(cmake/get_boost_lib.cmake)

option(ENABLE_BACKEND "Set to \"ON\" to build back" ON)
option(ENABLE_FRONTEND "Set to \"ON\" to build front" ON)

option(CLEAR_CACHE "Set to \"ON\" to clear cache" ON)

option(ENABLE_TEST "Set to \"ON\" for test build" ON)
Expand All @@ -26,43 +23,21 @@ option(ENABLE_CPPCHECK "Set to \"ON\" to enable cppcheck" OFF)

option(ENABLE_SANITIZER "Set to \"ON\" to enable sanitizer in debug build" OFF)

set(UTILS_DIR "${PROJECT_SOURCE_DIR}/utils")

include(cmake/apply_options.cmake)

# services
set(MESSAGE_BROKER_SERVICE service_${PROJECT_NAME}_message_broker)
set(SIMULTANEOUS_ACCESS_SERVICE service_${PROJECT_NAME}_simultaneous_access)
set(SERVICE_REGISTRY service_${PROJECT_NAME}_service_registry)
# backend utils
set(AUTHORIZER ${PROJECT_NAME}_authorizer)
set(BASE_SERVICE_CHASSIS ${PROJECT_NAME}_base_service_chassis)
set(DB_ADAPTER ${PROJECT_NAME}_db_adapter)
set(EXTERNAL_SERVICE_CHASSIS ${PROJECT_NAME}_external_service_chassis)
set(SERVER_NETWORK ${PROJECT_NAME}_server_network)
set(CHASSIS_CONFIGURATOR ${PROJECT_NAME}_services_chassis_configurator)
set(TOKEN_GENERATOR ${PROJECT_NAME}_token_generator)
# TODO(novak) so versioned

# global utils
set(CLIENT_NETWORK ${PROJECT_NAME}_client_network)
set(NETWORK_ADAPTER ${PROJECT_NAME}_network_adapter)
set(SERIALIZER ${PROJECT_NAME}_serializer)
if (${CMAKE_VERSION} VERSION_GREATER "3.28")
# modules example (>=.28)
# target_sources(foo
# PUBLIC
# FILE_SET CXX_MODULES FILES
# foo.cxx
# )
endif()

# frontend
set(AUTH ${PROJECT_NAME}_AUTH)
set(DRAW ${PROJECT_NAME}_DRAW)
set(GRAPH ${PROJECT_NAME}_GRAPH)
set(MENU ${PROJECT_NAME}_MENU)
set(GENERAL ${PROJECT_NAME}_GENERAL)
add_subdirectory(src)

add_subdirectory(${UTILS_DIR})
if (ENABLE_BACKEND)
add_subdirectory(backend)
endif()
if (ENABLE_FRONTEND)
include(cmake/apply_qt.cmake)
add_subdirectory(frontend)
endif()
if (ENABLE_TEST)
add_subdirectory(tests)
endif()
Expand Down
29 changes: 18 additions & 11 deletions cmake/get_boost_lib.cmake
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
# find third party libraries (boost:: beast, asio, system)
find_package(Boost 1.74)
find_package(Boost 1.84 CONFIG COMPONENTS
program_options
# other libs
)

if(${Boost_FOUND})
else()
set(BOOST_INCLUDE_LIBRARIES
program_options
# other libs
)
set(BOOST_ENABLE_CMAKE ON)

include(FetchContent)
FetchContent_Declare(boost URL https://github.com/boostorg/boost/releases/download/boost-1.82.0/boost-1.82.0.tar.xz)
FetchContent_MakeAvailable(boost)
FetchContent_Declare(Boost
URL https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.7z
USES_TERMINAL_DOWNLOAD TRUE
GIT_PROGRESS TRUE
DOWNLOAD_NO_EXTRACT FALSE
)
FetchContent_MakeAvailable(Boost)

if(${Boost_INCLUDE_DIRS} STREQUAL "Boost_INCLUDE_DIR-NOTFOUND")
if(Boost_INCLUDE_DIRS STREQUAL "Boost_INCLUDE_DIR-NOTFOUND")
set(Boost_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/_deps/boost-build/libs")
endif()

set(Boost_LIBRARIES
"Boost::system"
"Boost::asio"
"Boost::beast"
)
endif()
Empty file.
Empty file added scripts/build_realease.sh
Empty file.