2022-07-04 14:45:18 +03:00
|
|
|
cmake_minimum_required(VERSION 3.16...3.22)
|
|
|
|
|
|
|
|
project(ladybird
|
|
|
|
VERSION 0.0.1
|
|
|
|
LANGUAGES CXX
|
|
|
|
DESCRIPTION "Ladybird Web Browser"
|
|
|
|
)
|
|
|
|
|
2022-09-16 13:08:24 +03:00
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
2022-07-11 10:14:53 +03:00
|
|
|
if (ANDROID)
|
|
|
|
set(BUILD_SHARED_LIBS OFF)
|
|
|
|
endif()
|
|
|
|
|
2022-07-04 14:45:18 +03:00
|
|
|
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)
|
2022-09-16 13:08:24 +03:00
|
|
|
set(CMAKE_INSTALL_RPATH $ORIGIN;$ORIGIN/../${CMAKE_INSTALL_LIBDIR})
|
2022-07-04 14:45:18 +03:00
|
|
|
endif()
|
|
|
|
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
|
|
|
|
|
|
|
include(cmake/EnableLLD.cmake)
|
|
|
|
|
|
|
|
# Lagom
|
|
|
|
include(FetchContent)
|
|
|
|
include(cmake/FetchLagom.cmake)
|
|
|
|
|
2022-07-11 10:14:53 +03:00
|
|
|
get_filename_component(
|
|
|
|
SERENITY_SOURCE_DIR "${Lagom_SOURCE_DIR}/../.."
|
|
|
|
ABSOLUTE
|
|
|
|
)
|
|
|
|
|
2022-07-04 14:45:18 +03:00
|
|
|
# Lagom warnings
|
|
|
|
include(${Lagom_SOURCE_DIR}/../CMake/lagom_compile_options.cmake)
|
|
|
|
add_compile_options(-Wno-expansion-to-defined)
|
2022-07-13 22:33:22 +03:00
|
|
|
add_compile_options(-Wno-user-defined-literals)
|
2022-07-04 14:45:18 +03:00
|
|
|
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
2022-07-11 10:14:53 +03:00
|
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
set(CMAKE_AUTOUIC ON)
|
2022-07-05 22:13:38 +03:00
|
|
|
find_package(Qt6 REQUIRED COMPONENTS Core Widgets Network)
|
2022-07-04 14:45:18 +03:00
|
|
|
|
|
|
|
set(SOURCES
|
|
|
|
BrowserWindow.cpp
|
2022-07-17 15:47:26 +03:00
|
|
|
ConsoleClient.cpp
|
|
|
|
ConsoleGlobalObject.cpp
|
2022-07-12 18:01:07 +03:00
|
|
|
CookieJar.cpp
|
2022-09-07 21:33:15 +03:00
|
|
|
EventLoopPluginQt.cpp
|
2022-09-08 13:44:17 +03:00
|
|
|
FontPluginQt.cpp
|
2022-09-16 16:15:14 +03:00
|
|
|
ImageCodecPluginLadybird.cpp
|
2022-09-19 12:06:23 +03:00
|
|
|
PageClientLadybird.cpp
|
2022-07-05 22:13:38 +03:00
|
|
|
RequestManagerQt.cpp
|
2022-07-04 14:45:18 +03:00
|
|
|
main.cpp
|
2022-07-06 16:38:50 +03:00
|
|
|
History.cpp
|
2022-07-14 06:41:13 +03:00
|
|
|
Settings.cpp
|
2022-07-14 07:08:30 +03:00
|
|
|
SettingsDialog.cpp
|
2022-09-25 13:02:05 +03:00
|
|
|
SimpleWebView.cpp
|
2022-07-06 01:18:21 +03:00
|
|
|
Tab.cpp
|
2022-09-07 21:33:15 +03:00
|
|
|
TimerQt.cpp
|
2022-09-19 12:06:23 +03:00
|
|
|
Utilities.cpp
|
2022-09-19 12:16:42 +03:00
|
|
|
WebSocketClientManagerLadybird.cpp
|
|
|
|
WebSocketLadybird.cpp
|
2022-07-04 14:45:18 +03:00
|
|
|
)
|
|
|
|
|
2022-07-11 10:14:53 +03:00
|
|
|
qt_add_executable(ladybird ${SOURCES}
|
|
|
|
MANUAL_FINALIZATION
|
|
|
|
)
|
2022-09-16 15:10:46 +03:00
|
|
|
target_link_libraries(ladybird PRIVATE Qt::Widgets Qt::Network LibWeb LibWebSocket LibGL LibSoftGPU LibMain)
|
2022-07-04 14:45:18 +03:00
|
|
|
|
2022-07-11 10:14:53 +03:00
|
|
|
set_target_properties(ladybird PROPERTIES
|
|
|
|
MACOSX_BUNDLE_GUI_IDENTIFIER org.serenityos.ladybird
|
|
|
|
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
|
|
|
|
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
|
|
|
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist"
|
|
|
|
MACOSX_BUNDLE TRUE
|
|
|
|
WIN32_EXECUTABLE TRUE
|
2022-07-04 14:45:18 +03:00
|
|
|
)
|
|
|
|
|
2022-07-11 10:14:53 +03:00
|
|
|
if (ANDROID)
|
|
|
|
include(cmake/AndroidExtras.cmake)
|
|
|
|
endif()
|
|
|
|
|
2022-07-04 14:45:18 +03:00
|
|
|
add_custom_target(run
|
|
|
|
COMMAND "${CMAKE_COMMAND}" -E env "SERENITY_SOURCE_DIR=${SERENITY_SOURCE_DIR}" "$<TARGET_FILE:ladybird>"
|
|
|
|
USES_TERMINAL
|
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(debug
|
|
|
|
COMMAND "${CMAKE_COMMAND}" -E env "SERENITY_SOURCE_DIR=${SERENITY_SOURCE_DIR}" gdb "$<TARGET_FILE:ladybird>"
|
|
|
|
USES_TERMINAL
|
|
|
|
)
|
|
|
|
|
2022-07-11 10:14:53 +03:00
|
|
|
qt_finalize_executable(ladybird)
|
|
|
|
|
2022-09-16 13:08:24 +03:00
|
|
|
if(NOT CMAKE_SKIP_INSTALL_RULES)
|
|
|
|
include(cmake/InstallRules.cmake)
|
|
|
|
endif()
|