forked from LadybirdBrowser/ancient-history
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
71 lines (57 loc) · 1.93 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.16...3.22)
project(coccinellidae
VERSION 0.0.1
LANGUAGES CXX
DESCRIPTION "Coccinellidae Web Browser"
)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
# See slide 100 of the following ppt :^)
# https://crascit.com/wp-content/uploads/2019/09/Deep-CMake-For-Library-Authors-Craig-Scott-CppCon-2019.pdf
if (NOT APPLE)
set(CMAKE_INSTALL_RPATH $ORIGIN)
endif()
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
include(cmake/EnableLLD.cmake)
# Lagom
include(FetchContent)
include(cmake/FetchLagom.cmake)
# Lagom warnings
include(${Lagom_SOURCE_DIR}/../CMake/lagom_compile_options.cmake)
add_compile_options(-Wno-expansion-to-defined)
add_compile_options(-Wno-user-defined-literals)
set(CMAKE_AUTOMOC ON)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Gui Network Widgets REQUIRED)
find_package(Qt5 COMPONENTS Core Gui Network Widgets )
#find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Network Widgets )
set(SOURCES
BrowserWindow.cpp
ConsoleClient.cpp
ConsoleGlobalObject.cpp
CookieJar.cpp
RequestManagerQt.cpp
main.cpp
WebView.cpp
History.cpp
Settings.cpp
SettingsDialog.cpp
Tab.cpp
)
add_executable(coccinellidae ${SOURCES})
target_link_libraries(coccinellidae PRIVATE Qt5::Widgets Qt5::Network Lagom::Web Lagom::WebSocket Lagom::Main)
#target_link_libraries(coccinellidae PRIVATE Qt::Widgets Qt::Network Lagom::Web Lagom::WebSocket Lagom::Main)
get_filename_component(
SERENITY_SOURCE_DIR "${Lagom_SOURCE_DIR}/../.."
ABSOLUTE
)
add_custom_target(run
COMMAND "${CMAKE_COMMAND}" -E env "SERENITY_SOURCE_DIR=${SERENITY_SOURCE_DIR}" "$<TARGET_FILE:coccinellidae>"
USES_TERMINAL
)
add_custom_target(debug
COMMAND "${CMAKE_COMMAND}" -E env "SERENITY_SOURCE_DIR=${SERENITY_SOURCE_DIR}" gdb "$<TARGET_FILE:coccinellidae>"
USES_TERMINAL
)