aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: c7147c4826d49de549de545532fe28d1f3c2bd1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
cmake_minimum_required(VERSION 3.18)

project(smolbote VERSION 0.1.0 LANGUAGES CXX)

include(FeatureSummary)
include(GNUInstallDirs)
include(cmake/StandardProjectSettings.cmake)
include(cmake/CompilerWarnings.cmake)
include(cmake/Sanitize.cmake)
include(cmake/ThirdParty.cmake)

option(b_manpages "Build manpages (requires scdoc" OFF)
option(b_translations "Build translations" OFF)
option(b_tests "Build tests" ON)

# TODO
#option(b_signPlugins "Generate OpenSSL signing key and sign plugins" ON)

if(b_manpages)
  add_subdirectory(doc/man)
endif()

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)

if(b_tests)
  enable_testing()
endif()
enable_warnings()

find_package(Qt5 COMPONENTS Widgets Svg Network WebEngine WebEngineWidgets REQUIRED)
find_package(spdlog REQUIRED)
add_compile_options(-DSPDLOG_FMT_EXTERNAL)
find_package(Catch2)
find_package(OpenSSL REQUIRED)

download_third_party(SingleApplication-3.1.5
    "https://github.com/itay-grudev/SingleApplication/archive/v3.1.5.tar.gz" singleapplication-v3.1.5.tar.gz
    SHA256 09b1e088dae8cf69187262554819b77f4ca7b65576b3f39c5b6885823e8a2dbb)
set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication")
add_subdirectory(third-party/SingleApplication-3.1.5)

download_third_party(rcc-0.1.2
    https://neueland.iserlohn-fortress.net/cgit/rcc/snapshot/rcc-0.1.2.tar.xz rcc-0.1.2.tar.xz
    SHA256 5ee18b94401b720e6e65d8e0e38dd6ea23cab7ae4727742be313530969a69d50)
set(RCC ${CMAKE_SOURCE_DIR}/third-party/rcc-0.1.2/rcc)

download_third_party(tabler-icons-1.34.0
    https://github.com/tabler/tabler-icons/archive/v1.34.0.tar.gz v1.34.0.tar.gz
    SHA256 bc74e5bd28531445f2e50df44f3688b1116397a25a0086e6944ab52260b70ffd)
set(ICONS_PATH ${CMAKE_SOURCE_DIR}/third-party/tabler-icons-1.34.0)

add_subdirectory(lib/bookmarks)
add_subdirectory(lib/configuration)
add_subdirectory(lib/downloads)
add_subdirectory(lib/pluginloader)
add_subdirectory(lib/session_formats)
add_subdirectory(lib/smolblok)
add_subdirectory(src)

add_subdirectory(plugins/HostlistFilter)

# TODO
#add_subdirectory(lang)

add_subdirectory(linux)

feature_summary(WHAT ALL)
message(STATUS "Project
      name: ${CMAKE_PROJECT_NAME}
   version: ${CMAKE_PROJECT_VERSION}")
message(STATUS "Compiler
        id: ${CMAKE_CXX_COMPILER_ID}
   version: ${CMAKE_CXX_COMPILER_VERSION}
  compiler: ${CMAKE_CXX_COMPILER}")
message(STATUS "Install paths
    prefix: ${CMAKE_INSTALL_PREFIX}
    bindir: ${CMAKE_INSTALL_BINDIR}
    libdir: ${CMAKE_INSTALL_LIBDIR}
   datadir: ${CMAKE_INSTALL_DATADIR}
    mandir: ${CMAKE_INSTALL_MANDIR}")
message(STATUS "Build options
  manpages: ${b_manpages}
      i18n: ${b_translations}
     tests: ${b_tests}")