aboutsummaryrefslogtreecommitdiff
path: root/mapman/CMakeLists.txt
blob: 99f1d6731a9d19e9567544dd2f9b6814e63667f2 (plain) (blame)
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
cmake_minimum_required(VERSION 3.14.0)
project(mapman CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

option(USE_QT6 "Build with Qt 6" OFF)
if (USE_QT6)
    find_package(Qt6 REQUIRED COMPONENTS Widgets)
else()
    find_package(Qt5 REQUIRED COMPONENTS Widgets)
endif()

find_package(ZLIB REQUIRED)
find_package(SQLite3 REQUIRED)
include_directories(${ZLIB_INCLUDE_DIRS})
include_directories(${SQLite3_INCLUDE_DIRS})

INCLUDE (CheckTypeSize)

SET(CMAKE_EXTRA_INCLUDE_FILES "filesystem")
check_type_size("std::filesystem::path::value_type" PATH_VALSIZE LANGUAGE CXX)
SET(CMAKE_EXTRA_INCLUDE_FILES)

add_compile_definitions(PATH_VALSIZE=${PATH_VALSIZE})

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

set(mapman_SOURCES
    src/main.cpp
    src/mapdump.cpp
    src/utils.cpp
    src/library.cpp
    src/painter.cpp
    src/sliceview.cpp
    src/groupview.cpp
    src/diffview.cpp
    src/mainwindow.cpp
)
add_executable(mapman ${mapman_SOURCES})

target_link_libraries(mapman
    ${ZLIB_LIBRARIES}
)

if (USE_QT6)
    target_link_libraries(mapman Qt6::Widgets ${SQLite3_LIBRARIES})
else()
    target_link_libraries(mapman Qt5::Widgets ${SQLite3_LIBRARIES})
endif()