aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: a7cd876931c82b1e255b980ae3a97d72e79f0918 (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
cmake_minimum_required(VERSION 3.1.0)
project(smolbote)

# Options
option(CompilerWarnings "Compiler warnings" ON)
option(QtDeprecatedWarnings "Qt deprecated warnings" ON)
option(UseLibCpp "Use libc++ over stdlibc++ (requires clang)" OFF)

# Libraries
find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Concurrent REQUIRED)
find_package(Qt5WebEngineWidgets REQUIRED)
find_package(Boost COMPONENTS program_options REQUIRED)

# Global C++ settings
set(CMAKE_CXX_STANDARD 17)

if(CompilerWarnings)
    if(CMAKE_COMPILER_IS_GNUCC)
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
    endif()
    if(MSVC)
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
    endif()
endif(CompilerWarnings)

if(QtDeprecatedWarnings)
    add_definitions(-DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050900)
endif(QtDeprecatedWarnings)

# link to libc++
if (UseLibCpp)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
endif (UseLibCpp)

add_subdirectory(lib/bookmarks)
add_subdirectory(lib/downloads)
add_subdirectory(lib/configuration)

add_subdirectory(plugins/ProfileEditor)

# browser source code
add_subdirectory(src)

# configuration program
add_subdirectory(config)