annotate CMakeLists.txt @ 101:c537996cf67b

*: multitude of config changes 1. theme is now configurable from the settings menu (but you have to restart for it to apply) 2. config is now stored in an INI file, with no method of conversion from json (this repo is private-ish anyway)
author Paper <mrpapersonic@gmail.com>
date Fri, 03 Nov 2023 14:06:02 -0400
parents c4bb49c2f6eb
children b315f3759c56
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
1 cmake_minimum_required(VERSION 3.16)
17
db445ce42057 cmake: only enable OBJCXX on OS X
Paper <mrpapersonic@gmail.com>
parents: 15
diff changeset
2 project(minori LANGUAGES CXX)
db445ce42057 cmake: only enable OBJCXX on OS X
Paper <mrpapersonic@gmail.com>
parents: 15
diff changeset
3
47
d8eb763e6661 information.cpp: add widgets to the list tab, and add an
Paper <mrpapersonic@gmail.com>
parents: 46
diff changeset
4 # this should check for the target system, rather than
d8eb763e6661 information.cpp: add widgets to the list tab, and add an
Paper <mrpapersonic@gmail.com>
parents: 46
diff changeset
5 # the host system, for cross-compiling purposes
17
db445ce42057 cmake: only enable OBJCXX on OS X
Paper <mrpapersonic@gmail.com>
parents: 15
diff changeset
6 if(APPLE)
db445ce42057 cmake: only enable OBJCXX on OS X
Paper <mrpapersonic@gmail.com>
parents: 15
diff changeset
7 enable_language(OBJCXX)
db445ce42057 cmake: only enable OBJCXX on OS X
Paper <mrpapersonic@gmail.com>
parents: 15
diff changeset
8 endif()
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
9
64
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
10 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
11 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
12 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
13
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
14 option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
15 option(USE_QT6 "Build with Qt 6 instead of Qt 5" OFF)
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
16
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
17 add_subdirectory(dep/anitomy)
64
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
18 add_subdirectory(dep/animia)
55
d10b6c6b432e add xml lib, we will need to use it eventually
Paper <mrpapersonic@gmail.com>
parents: 54
diff changeset
19 add_subdirectory(dep/pugixml)
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
20
12
cf6a73a5ba1c cmake: fix for mingw
Paper <mrpapersonic@gmail.com>
parents: 11
diff changeset
21 # Fix for mingw64
cf6a73a5ba1c cmake: fix for mingw
Paper <mrpapersonic@gmail.com>
parents: 11
diff changeset
22 list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a")
cf6a73a5ba1c cmake: fix for mingw
Paper <mrpapersonic@gmail.com>
parents: 11
diff changeset
23
62
4c6dd5999b39 *: update
Paper <mrpapersonic@gmail.com>
parents: 57
diff changeset
24 if(USE_QT6)
4c6dd5999b39 *: update
Paper <mrpapersonic@gmail.com>
parents: 57
diff changeset
25 find_package(Qt6 COMPONENTS Widgets REQUIRED)
4c6dd5999b39 *: update
Paper <mrpapersonic@gmail.com>
parents: 57
diff changeset
26 else()
4c6dd5999b39 *: update
Paper <mrpapersonic@gmail.com>
parents: 57
diff changeset
27 find_package(Qt5 COMPONENTS Widgets REQUIRED)
4c6dd5999b39 *: update
Paper <mrpapersonic@gmail.com>
parents: 57
diff changeset
28 endif()
12
cf6a73a5ba1c cmake: fix for mingw
Paper <mrpapersonic@gmail.com>
parents: 11
diff changeset
29 find_package(CURL REQUIRED)
cf6a73a5ba1c cmake: fix for mingw
Paper <mrpapersonic@gmail.com>
parents: 11
diff changeset
30
cf6a73a5ba1c cmake: fix for mingw
Paper <mrpapersonic@gmail.com>
parents: 11
diff changeset
31 set(LIBRARIES
cf6a73a5ba1c cmake: fix for mingw
Paper <mrpapersonic@gmail.com>
parents: 11
diff changeset
32 ${CURL_LIBRARIES}
cf6a73a5ba1c cmake: fix for mingw
Paper <mrpapersonic@gmail.com>
parents: 11
diff changeset
33 anitomy
64
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
34 animia
12
cf6a73a5ba1c cmake: fix for mingw
Paper <mrpapersonic@gmail.com>
parents: 11
diff changeset
35 )
cf6a73a5ba1c cmake: fix for mingw
Paper <mrpapersonic@gmail.com>
parents: 11
diff changeset
36
62
4c6dd5999b39 *: update
Paper <mrpapersonic@gmail.com>
parents: 57
diff changeset
37 if(USE_QT6)
4c6dd5999b39 *: update
Paper <mrpapersonic@gmail.com>
parents: 57
diff changeset
38 list(APPEND LIBRARIES ${Qt6Widgets_LIBRARIES})
4c6dd5999b39 *: update
Paper <mrpapersonic@gmail.com>
parents: 57
diff changeset
39 else()
4c6dd5999b39 *: update
Paper <mrpapersonic@gmail.com>
parents: 57
diff changeset
40 list(APPEND LIBRARIES ${Qt5Widgets_LIBRARIES})
4c6dd5999b39 *: update
Paper <mrpapersonic@gmail.com>
parents: 57
diff changeset
41 endif()
4c6dd5999b39 *: update
Paper <mrpapersonic@gmail.com>
parents: 57
diff changeset
42
12
cf6a73a5ba1c cmake: fix for mingw
Paper <mrpapersonic@gmail.com>
parents: 11
diff changeset
43 # We need Cocoa for some OS X stuff
cf6a73a5ba1c cmake: fix for mingw
Paper <mrpapersonic@gmail.com>
parents: 11
diff changeset
44 if(APPLE)
cf6a73a5ba1c cmake: fix for mingw
Paper <mrpapersonic@gmail.com>
parents: 11
diff changeset
45 find_library(COCOA_LIBRARY Cocoa)
cf6a73a5ba1c cmake: fix for mingw
Paper <mrpapersonic@gmail.com>
parents: 11
diff changeset
46 list(APPEND LIBRARIES ${COCOA_LIBRARY})
cf6a73a5ba1c cmake: fix for mingw
Paper <mrpapersonic@gmail.com>
parents: 11
diff changeset
47 endif()
cf6a73a5ba1c cmake: fix for mingw
Paper <mrpapersonic@gmail.com>
parents: 11
diff changeset
48
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
49 set(SRC_FILES
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
50 # Main entrypoint
81
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
51 src/main.cc
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
52
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
53 # Core files and datatype declarations...
81
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
54 src/core/anime.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
55 src/core/anime_db.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
56 src/core/config.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
57 src/core/date.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
58 src/core/filesystem.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
59 src/core/http.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
60 src/core/json.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
61 src/core/strings.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
62 src/core/time.cc
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
63
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents: 17
diff changeset
64 # Main window
81
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
65 src/gui/window.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
66 src/gui/dark_theme.cc
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents: 17
diff changeset
67
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents: 17
diff changeset
68 # Main window pages
81
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
69 src/gui/pages/anime_list.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
70 src/gui/pages/now_playing.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
71 src/gui/pages/statistics.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
72 src/gui/pages/search.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
73 src/gui/pages/seasons.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
74 src/gui/pages/torrents.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
75 src/gui/pages/history.cc
54
466ac9870df9 add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
76
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents: 17
diff changeset
77
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents: 17
diff changeset
78 # Custom widgets
81
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
79 src/gui/widgets/anime_info.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
80 src/gui/widgets/poster.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
81 src/gui/widgets/clickable_label.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
82 src/gui/widgets/sidebar.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
83 src/gui/widgets/text.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
84 src/gui/widgets/optional_date.cc
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
85
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
86 # Dialogs
81
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
87 src/gui/dialog/about.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
88 src/gui/dialog/information.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
89 src/gui/dialog/settings.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
90 src/gui/dialog/settings/application.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
91 src/gui/dialog/settings/services.cc
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
92
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
93 # Translate
81
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
94 src/gui/translate/anime.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
95 src/gui/translate/anilist.cc
90
c4bb49c2f6eb config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents: 82
diff changeset
96 src/gui/translate/config.cc
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
97
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
98 # Services (only AniList for now)
81
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
99 src/services/services.cc
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
100 src/services/anilist.cc
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
101
64
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
102 # Tracking
82
8b65c417c225 *: fix old stuff, make video players and extensions constants
Paper <mrpapersonic@gmail.com>
parents: 81
diff changeset
103 src/track/constants.cc
81
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
104 src/track/media.cc
64
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
105
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
106 # Qt resources
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
107 rc/icons.qrc
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
108 dep/darkstyle/darkstyle.qrc
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
109 )
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
110
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
111 if(APPLE) # Mac OS X (or OS X (or macOS))
5
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
112 list(APPEND SRC_FILES
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
113 src/sys/osx/dark_theme.mm
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
114 src/sys/osx/filesystem.mm
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
115 )
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
116 elseif(WIN32) # Windows
81
9b2b41f83a5e boring: mass rename to cc
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
117 list(APPEND SRC_FILES src/sys/win32/dark_theme.cc)
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
118 endif()
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
119
51
75c804f713b2 window: add about window,
Paper <mrpapersonic@gmail.com>
parents: 47
diff changeset
120 add_executable(minori ${SRC_FILES})
63
3d2decf093bb *: fix many clang warnings
Paper <mrpapersonic@gmail.com>
parents: 62
diff changeset
121 set_property(TARGET minori PROPERTY CXX_STANDARD 11)
11
fc1bf97c528b *: use C++11 standard
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
122 set_property(TARGET minori PROPERTY AUTOMOC ON)
fc1bf97c528b *: use C++11 standard
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
123 set_property(TARGET minori PROPERTY AUTORCC ON)
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
124
101
c537996cf67b *: multitude of config changes
Paper <mrpapersonic@gmail.com>
parents: 90
diff changeset
125 target_include_directories(minori PUBLIC ${CURL_INCLUDE_DIRS} PRIVATE include dep/pugixml/src dep/animia/include dep/anitomy dep/mini)
62
4c6dd5999b39 *: update
Paper <mrpapersonic@gmail.com>
parents: 57
diff changeset
126 if(USE_QT6)
4c6dd5999b39 *: update
Paper <mrpapersonic@gmail.com>
parents: 57
diff changeset
127 target_include_directories(minori PUBLIC ${Qt6Widgets_INCLUDE_DIRS})
4c6dd5999b39 *: update
Paper <mrpapersonic@gmail.com>
parents: 57
diff changeset
128 else()
4c6dd5999b39 *: update
Paper <mrpapersonic@gmail.com>
parents: 57
diff changeset
129 target_include_directories(minori PUBLIC ${Qt5Widgets_INCLUDE_DIRS})
4c6dd5999b39 *: update
Paper <mrpapersonic@gmail.com>
parents: 57
diff changeset
130 endif()
64
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
131 target_compile_options(minori PRIVATE -Wall -Wpedantic -Wextra -Wsuggest-override -Wold-style-cast)
5
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
132 if(APPLE)
11
fc1bf97c528b *: use C++11 standard
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
133 target_compile_definitions(minori PUBLIC MACOSX)
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
134 elseif(WIN32)
11
fc1bf97c528b *: use C++11 standard
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
135 target_compile_definitions(minori PUBLIC WIN32)
5
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
136 endif()
11
fc1bf97c528b *: use C++11 standard
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
137 target_link_libraries(minori ${LIBRARIES})