Mercurial > minori
annotate CMakeLists.txt @ 105:6d8da6e64d61
theme: add dark stylesheet, make it actually usable
win32: make the titlebar black where available
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 05 Nov 2023 03:54:26 -0500 |
parents | 621084cc542c |
children | 2004b41d4a59 |
rev | line source |
---|---|
5 | 1 cmake_minimum_required(VERSION 3.16) |
103 | 2 project(minori LANGUAGES CXX VERSION 0.1.0) |
17
db445ce42057
cmake: only enable OBJCXX on OS X
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
3 |
db445ce42057
cmake: only enable OBJCXX on OS X
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
4 if(APPLE) |
db445ce42057
cmake: only enable OBJCXX on OS X
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
5 enable_language(OBJCXX) |
db445ce42057
cmake: only enable OBJCXX on OS X
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
6 endif() |
2 | 7 |
64 | 8 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") |
9 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") | |
10 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") | |
11 | |
12 option(BUILD_SHARED_LIBS "Build using shared libraries" ON) | |
13 option(USE_QT6 "Build with Qt 6 instead of Qt 5" OFF) | |
14 | |
9 | 15 add_subdirectory(dep/anitomy) |
64 | 16 add_subdirectory(dep/animia) |
55
d10b6c6b432e
add xml lib, we will need to use it eventually
Paper <mrpapersonic@gmail.com>
parents:
54
diff
changeset
|
17 add_subdirectory(dep/pugixml) |
9 | 18 |
12 | 19 # Fix for mingw64 |
20 list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a") | |
21 | |
62 | 22 if(USE_QT6) |
23 find_package(Qt6 COMPONENTS Widgets REQUIRED) | |
24 else() | |
25 find_package(Qt5 COMPONENTS Widgets REQUIRED) | |
26 endif() | |
12 | 27 find_package(CURL REQUIRED) |
28 | |
29 set(LIBRARIES | |
30 ${CURL_LIBRARIES} | |
31 anitomy | |
64 | 32 animia |
12 | 33 ) |
34 | |
62 | 35 if(USE_QT6) |
36 list(APPEND LIBRARIES ${Qt6Widgets_LIBRARIES}) | |
37 else() | |
38 list(APPEND LIBRARIES ${Qt5Widgets_LIBRARIES}) | |
39 endif() | |
40 | |
12 | 41 # We need Cocoa for some OS X stuff |
42 if(APPLE) | |
43 find_library(COCOA_LIBRARY Cocoa) | |
44 list(APPEND LIBRARIES ${COCOA_LIBRARY}) | |
45 endif() | |
46 | |
2 | 47 set(SRC_FILES |
9 | 48 # Main entrypoint |
81 | 49 src/main.cc |
9 | 50 |
51 # Core files and datatype declarations... | |
81 | 52 src/core/anime.cc |
53 src/core/anime_db.cc | |
54 src/core/config.cc | |
55 src/core/date.cc | |
56 src/core/filesystem.cc | |
57 src/core/http.cc | |
58 src/core/json.cc | |
59 src/core/strings.cc | |
60 src/core/time.cc | |
9 | 61 |
46 | 62 # Main window |
81 | 63 src/gui/window.cc |
102 | 64 src/gui/theme.cc |
46 | 65 |
66 # Main window pages | |
81 | 67 src/gui/pages/anime_list.cc |
68 src/gui/pages/now_playing.cc | |
69 src/gui/pages/statistics.cc | |
70 src/gui/pages/search.cc | |
71 src/gui/pages/seasons.cc | |
72 src/gui/pages/torrents.cc | |
73 src/gui/pages/history.cc | |
54
466ac9870df9
add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents:
51
diff
changeset
|
74 |
46 | 75 # Custom widgets |
81 | 76 src/gui/widgets/anime_info.cc |
77 src/gui/widgets/poster.cc | |
78 src/gui/widgets/clickable_label.cc | |
79 src/gui/widgets/sidebar.cc | |
80 src/gui/widgets/text.cc | |
81 src/gui/widgets/optional_date.cc | |
9 | 82 |
83 # Dialogs | |
81 | 84 src/gui/dialog/about.cc |
85 src/gui/dialog/information.cc | |
86 src/gui/dialog/settings.cc | |
87 src/gui/dialog/settings/application.cc | |
88 src/gui/dialog/settings/services.cc | |
9 | 89 |
10 | 90 # Translate |
81 | 91 src/gui/translate/anime.cc |
92 src/gui/translate/anilist.cc | |
90
c4bb49c2f6eb
config: improve handling of vars
Paper <mrpapersonic@gmail.com>
parents:
82
diff
changeset
|
93 src/gui/translate/config.cc |
10 | 94 |
9 | 95 # Services (only AniList for now) |
81 | 96 src/services/services.cc |
97 src/services/anilist.cc | |
9 | 98 |
64 | 99 # Tracking |
82
8b65c417c225
*: fix old stuff, make video players and extensions constants
Paper <mrpapersonic@gmail.com>
parents:
81
diff
changeset
|
100 src/track/constants.cc |
81 | 101 src/track/media.cc |
64 | 102 |
9 | 103 # Qt resources |
2 | 104 rc/icons.qrc |
105
6d8da6e64d61
theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents:
103
diff
changeset
|
105 rc/dark.qrc |
2 | 106 ) |
107 | |
103 | 108 set(RC_INFO_STRING "A lightweight anime tracker built with Qt.") |
109 | |
9 | 110 if(APPLE) # Mac OS X (or OS X (or macOS)) |
103 | 111 set(MACOSX_BUNDLE_BUNDLE_NAME "Minori") |
112 set(MACOSX_BUNDLE_BUNDLE_VERSION ${minori_VERSION}) | |
113 set(MACOSX_BUNDLE_COPYRIGHT "Copyright (C) Paper 2023") | |
114 set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.eu.us.paper.minori") | |
115 set(MACOSX_BUNDLE_INFO_STRING ${RC_INFO_STRING}) | |
116 set(MACOSX_BUNDLE_ICON_FILE rc/osx/favicon.icns) | |
117 set(app_icon_osx "${CMAKE_CURRENT_SOURCE_DIR}/rc/osx/favicon.icns") | |
118 set_source_files_properties(${app_icon_osx} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") | |
119 | |
5 | 120 list(APPEND SRC_FILES |
121 src/sys/osx/dark_theme.mm | |
122 src/sys/osx/filesystem.mm | |
103 | 123 ${app_icon_osx} |
5 | 124 ) |
9 | 125 elseif(WIN32) # Windows |
103 | 126 configure_file( |
127 ${CMAKE_CURRENT_SOURCE_DIR}/rc/win32/version.rc.in | |
128 ${CMAKE_CURRENT_BINARY_DIR}/rc/version.rc | |
129 @ONLY | |
130 ) | |
131 list(APPEND SRC_FILES | |
132 src/sys/win32/dark_theme.cc | |
133 rc/win32/resource.rc | |
134 ${CMAKE_CURRENT_BINARY_DIR}/rc/version.rc | |
135 ) | |
2 | 136 endif() |
137 | |
103 | 138 add_executable(minori WIN32 MACOSX_BUNDLE ${SRC_FILES}) |
63 | 139 set_property(TARGET minori PROPERTY CXX_STANDARD 11) |
11 | 140 set_property(TARGET minori PROPERTY AUTOMOC ON) |
141 set_property(TARGET minori PROPERTY AUTORCC ON) | |
2 | 142 |
102 | 143 target_include_directories(minori PUBLIC ${CURL_INCLUDE_DIRS} PRIVATE include dep/pugixml/src dep/animia/include dep/anitomy dep) |
62 | 144 if(USE_QT6) |
145 target_include_directories(minori PUBLIC ${Qt6Widgets_INCLUDE_DIRS}) | |
146 else() | |
147 target_include_directories(minori PUBLIC ${Qt5Widgets_INCLUDE_DIRS}) | |
148 endif() | |
64 | 149 target_compile_options(minori PRIVATE -Wall -Wpedantic -Wextra -Wsuggest-override -Wold-style-cast) |
5 | 150 if(APPLE) |
11 | 151 target_compile_definitions(minori PUBLIC MACOSX) |
9 | 152 elseif(WIN32) |
11 | 153 target_compile_definitions(minori PUBLIC WIN32) |
5 | 154 endif() |
11 | 155 target_link_libraries(minori ${LIBRARIES}) |