summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: e9785f73e95cc77d49d3c1ff5e8ac5479bc426cd (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
cmake_minimum_required(VERSION 3.16)

project(bookmouse VERSION 1.0.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CXX_CPPCHECK "project=build/compile_commands.json;enable=information;force")
set(CMAKE_EXPORT_COMPILE_COMMANDS true)

add_library(stb_image SHARED
    src/stb_image.cpp)

add_executable(bookmouse
    src/main.cpp
    src/archive.cpp
    src/image.cpp
    src/fud_mem.cpp
    src/sdl_context.cpp
    src/sdl_main_window.cpp
    src/imgui_context.cpp
    src/gl_context.cpp
    src/bookmouse.cpp
    src/file_dialog.cpp
    src/bookmouse_time.cpp
)

include(warnings.cmake)

find_package(spdlog REQUIRED)
find_package(Fud REQUIRED)
find_package(SDL2 REQUIRED)
find_package(SDL2_image REQUIRED)
find_package(SDL2_ttf REQUIRED)
include(FindPkgConfig)
PKG_SEARCH_MODULE(SDL2_gfx REQUIRED SDL2_gfx)
find_package(OpenGL REQUIRED)

target_include_directories(bookmouse PRIVATE
    ${FUD_INCLUDE_DIR}
    ${spdlog_INCLUDE_DIR}
    ${SDL2_INCLUDE_DIRS}
)

target_link_libraries(bookmouse PRIVATE
    zip
    spdlog::spdlog
    fud
    stb_image
    imgui
    ${SDL2_LIBRARIES}
    SDL2_image::SDL2_image
    SDL2_ttf::SDL2_ttf
    SDL2_gfx
    OpenGL
)

target_compile_options(bookmouse PRIVATE ${BOOKMOUSE_WARNINGS})