CMakeLists.txt
ASCII text
1
cmake_minimum_required(VERSION 3.30)
2
project(gpanthera)
3
4
set(CMAKE_CXX_STANDARD 20)
5
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
6
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--export-dynamic")
7
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og")
8
9
add_library(gpanthera SHARED gpanthera.cc)
10
add_library(test_plugin SHARED test_plugin.cc)
11
12
add_executable(panthera-www panthera-www.cc)
13
target_link_libraries(panthera-www gpanthera)
14
target_link_libraries(panthera-www webkitgtk-6.0)
15
target_link_libraries(panthera-www nlohmann_json::nlohmann_json)
16
target_link_libraries(panthera-www sqlite3)
17
18
find_package(PkgConfig REQUIRED)
19
pkg_check_modules(GTKMM REQUIRED gtkmm-4.0)
20
pkg_check_modules(WebKit REQUIRED webkitgtk-6.0)
21
find_package(nlohmann_json 3.10.0 REQUIRED)
22
23
include_directories(
24
${GTKMM_INCLUDE_DIRS}
25
${CMAKE_CURRENT_SOURCE_DIR}
26
)
27
link_directories(${GTKMM_LIBRARY_DIRS})
28
include_directories(${WebKit_INCLUDE_DIRS})
29
30
add_definitions(${GTKMM_CFLAGS_OTHER})
31
target_link_libraries(gpanthera ${GTKMM_LIBRARIES})
32
33
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/locales")
34
message(FATAL_ERROR "locales directory not found in source tree")
35
endif()
36
37
file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/locales)
38
file(COPY locales DESTINATION ${CMAKE_BINARY_DIR})
39