5
|
1 cmake_minimum_required(VERSION 3.16)
|
11
|
2 project(minori LANGUAGES CXX OBJCXX)
|
2
|
3
|
9
|
4 add_subdirectory(dep/anitomy)
|
|
5
|
12
|
6 # Fix for mingw64
|
|
7 list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a")
|
|
8
|
|
9 find_package(Qt5 COMPONENTS Widgets REQUIRED)
|
|
10 find_package(CURL REQUIRED)
|
|
11
|
|
12 set(LIBRARIES
|
|
13 ${Qt5Widgets_LIBRARIES}
|
|
14 ${CURL_LIBRARIES}
|
|
15 anitomy
|
|
16 )
|
|
17
|
|
18 # We need Cocoa for some OS X stuff
|
|
19 if(APPLE)
|
|
20 find_library(COCOA_LIBRARY Cocoa)
|
|
21 list(APPEND LIBRARIES ${COCOA_LIBRARY})
|
|
22 endif()
|
|
23
|
2
|
24 set(SRC_FILES
|
9
|
25 # Main entrypoint
|
2
|
26 src/main.cpp
|
9
|
27
|
|
28 # Core files and datatype declarations...
|
|
29 src/core/anime.cpp
|
|
30 src/core/anime_db.cpp
|
|
31 src/core/config.cpp
|
|
32 src/core/date.cpp
|
|
33 src/core/filesystem.cpp
|
|
34 src/core/json.cpp
|
|
35 src/core/strings.cpp
|
|
36 src/core/time.cpp
|
|
37
|
|
38 # GUI stuff
|
|
39 src/gui/window.cpp
|
|
40 src/gui/sidebar.cpp
|
|
41 src/gui/ui_utils.cpp
|
|
42
|
|
43 # Dialogs
|
|
44 src/gui/dialog/information.cpp
|
|
45 src/gui/dialog/settings.cpp
|
|
46 src/gui/dialog/settings/application.cpp
|
|
47 src/gui/dialog/settings/services.cpp
|
|
48
|
|
49 # Main window pages
|
|
50 src/gui/pages/anime_list.cpp
|
|
51 src/gui/pages/now_playing.cpp
|
|
52 src/gui/pages/statistics.cpp
|
|
53
|
10
|
54 # Translate
|
|
55 src/gui/translate/anime.cpp
|
|
56
|
9
|
57 # Services (only AniList for now)
|
10
|
58 src/services/services.cpp
|
9
|
59 src/services/anilist.cpp
|
|
60
|
|
61 # Qt resources
|
2
|
62 rc/icons.qrc
|
|
63 dep/darkstyle/darkstyle.qrc
|
|
64 )
|
|
65
|
9
|
66 if(APPLE) # Mac OS X (or OS X (or macOS))
|
5
|
67 list(APPEND SRC_FILES
|
|
68 src/sys/osx/dark_theme.mm
|
|
69 src/sys/osx/filesystem.mm
|
|
70 )
|
9
|
71 elseif(WIN32) # Windows
|
2
|
72 list(APPEND SRC_FILES src/sys/win32/dark_theme.cpp)
|
|
73 endif()
|
|
74
|
11
|
75 add_executable(minori ${SRC_FILES})
|
12
|
76 set_property(TARGET minori PROPERTY CXX_STANDARD 20)
|
11
|
77 set_property(TARGET minori PROPERTY AUTOMOC ON)
|
|
78 set_property(TARGET minori PROPERTY AUTORCC ON)
|
2
|
79
|
12
|
80 target_include_directories(minori PUBLIC ${Qt5Widgets_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS} PRIVATE include)
|
11
|
81 target_compile_options(minori PRIVATE -Wall -Wextra -Wsuggest-override)
|
5
|
82 if(APPLE)
|
11
|
83 target_compile_definitions(minori PUBLIC MACOSX)
|
9
|
84 elseif(WIN32)
|
11
|
85 target_compile_definitions(minori PUBLIC WIN32)
|
5
|
86 endif()
|
11
|
87 target_link_libraries(minori ${LIBRARIES})
|