aboutsummaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
blob: 975cc1bc555e12bb3f29f1a97378407416c9f894 (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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)

# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

set(srclist
        # main
        main.cpp
        browser.cpp
        browser.h
        session.cpp
        session.h
        util.cpp
        util.h

        # resources (icons, etc)
        ${PROJECT_SOURCE_DIR}/data/resources.qrc

        # main window
        mainwindow/mainwindow.cpp
        mainwindow/mainwindow.h
        mainwindow/mainwindow.ui
        mainwindow/widgets/dockwidget.cpp
        mainwindow/widgets/dockwidget.h
        mainwindow/widgets/navigationbar.cpp
        mainwindow/widgets/navigationbar.h
        mainwindow/widgets/searchform.cpp
        mainwindow/widgets/searchform.h
        mainwindow/widgets/searchform.ui

        # subwindow
        subwindow/subwindow.cpp
        subwindow/subwindow.h
        subwindow/tabwidget.cpp
        subwindow/tabwidget.h

        # webengine
        webengine/filter.cpp
        webengine/filter.h
        webengine/urlinterceptor.cpp
        webengine/urlinterceptor.h
        webengine/webpage.cpp
        webengine/webpage.h
        webengine/webview.cpp
        webengine/webview.h

    # wallet (form autofill)
    wallet/wallet.cpp
    wallet/wallet.h

    # interfaces
    ${PROJECT_SOURCE_DIR}/include/plugininterface.h
    ${PROJECT_SOURCE_DIR}/include/profileinterface.h
    ${PROJECT_SOURCE_DIR}/include/browserinterface.h
)

if(CONFIG_QTBUG-62511)
    set_property(SOURCE ${PROJECT_SOURCE_DIR}/data/resources.qrc PROPERTY AUTORCC_OPTIONS "--format-version=1")
endif(CONFIG_QTBUG-62511)

# if you are using a custom build location for breakpad:
#if(CONFIG_USEBREAKPAD)
#    link_directories("${BREAKPAD_LIBRARY_DIRS}")
#endif(CONFIG_USEBREAKPAD)

if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
    add_executable(${CONFIG_POI_EXE} WIN32 ${srclist} ${PROJECT_SOURCE_DIR}/data/windows.rc)
else()
    add_executable(${CONFIG_POI_EXE} ${srclist})
endif()

target_include_directories(${CONFIG_POI_EXE}
    PRIVATE ${Boost_INCLUDE_DIRS}
    PRIVATE ${PROJECT_SOURCE_DIR}/include
    PRIVATE ${PROJECT_SOURCE_DIR}/lib
    PRIVATE ${PROJECT_SOURCE_DIR}/plugins
)

target_link_libraries(${CONFIG_POI_EXE}
        Qt5::Core Qt5::Widgets Qt5::WebEngineWidgets
        ${Boost_LIBRARIES}
        SingleApplication
        about
        addressbar
        configuration
        bookmarks downloads web urlfilter
)

if(CONFIG_USEBREAKPAD)
    target_link_libraries(${CONFIG_POI_EXE} Threads::Threads ${BREAKPAD_LIBRARIES})
    target_include_directories(${CONFIG_POI_EXE} PRIVATE ${BREAKPAD_INCLUDE_DIRS})
    target_compile_options(${CONFIG_POI_EXE} PRIVATE ${BREAKPAD_CFLAGS_OTHER})

    target_compile_definitions(${CONFIG_POI_EXE} PRIVATE BreakpadEnabled)
endif(CONFIG_USEBREAKPAD)

if(CONFIG_USEPLASMA)
    target_link_libraries(${CONFIG_POI_EXE} KF5::Wallet KF5::WindowSystem)
    target_compile_definitions(${CONFIG_POI_EXE} PRIVATE PLASMA)
endif(CONFIG_USEPLASMA)

target_compile_definitions(${CONFIG_POI_EXE}
    PRIVATE QAPPLICATION_CLASS=QApplication
    PRIVATE POI_NAME="${CONFIG_POI_NAME}"
    PRIVATE QTBUG_65223_WORKAROUND
    #PRIVATE QTBUG_68224_WORKAROUND
)

install(TARGETS ${CONFIG_POI_EXE} RUNTIME DESTINATION ${CONFIG_INSTALL_BIN} CONFIGURATIONS Release)