Mercurial > minori
annotate CMakeLists.txt @ 72:893ad99b174d
dep/anitomy: add CXX_STANDARD to CMakeLists.txt
this fixes bugs when building on macOS, because Apple clang defaults to
C++98(?)
HG Enter commit message. Lines beginning with 'HG:' are removed.
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Tue, 03 Oct 2023 04:58:38 -0400 |
parents | 442065432549 |
children | d3e9310598b1 |
rev | line source |
---|---|
5 | 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 | 9 |
64 | 10 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") |
11 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") | |
12 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") | |
13 | |
14 option(BUILD_SHARED_LIBS "Build using shared libraries" ON) | |
15 option(USE_QT6 "Build with Qt 6 instead of Qt 5" OFF) | |
16 | |
9 | 17 add_subdirectory(dep/anitomy) |
64 | 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 | 20 |
12 | 21 # Fix for mingw64 |
22 list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a") | |
23 | |
62 | 24 if(USE_QT6) |
25 find_package(Qt6 COMPONENTS Widgets REQUIRED) | |
26 else() | |
27 find_package(Qt5 COMPONENTS Widgets REQUIRED) | |
28 endif() | |
12 | 29 find_package(CURL REQUIRED) |
30 | |
31 set(LIBRARIES | |
32 ${CURL_LIBRARIES} | |
33 anitomy | |
64 | 34 animia |
12 | 35 ) |
36 | |
62 | 37 if(USE_QT6) |
38 list(APPEND LIBRARIES ${Qt6Widgets_LIBRARIES}) | |
39 else() | |
40 list(APPEND LIBRARIES ${Qt5Widgets_LIBRARIES}) | |
41 endif() | |
42 | |
12 | 43 # We need Cocoa for some OS X stuff |
44 if(APPLE) | |
45 find_library(COCOA_LIBRARY Cocoa) | |
46 list(APPEND LIBRARIES ${COCOA_LIBRARY}) | |
47 endif() | |
48 | |
2 | 49 set(SRC_FILES |
9 | 50 # Main entrypoint |
2 | 51 src/main.cpp |
9 | 52 |
53 # Core files and datatype declarations... | |
54 src/core/anime.cpp | |
55 src/core/anime_db.cpp | |
56 src/core/config.cpp | |
57 src/core/date.cpp | |
58 src/core/filesystem.cpp | |
59 src/core/json.cpp | |
60 src/core/strings.cpp | |
61 src/core/time.cpp | |
62 | |
46 | 63 # Main window |
9 | 64 src/gui/window.cpp |
46 | 65 src/gui/dark_theme.cpp |
66 | |
67 # Main window pages | |
68 src/gui/pages/anime_list.cpp | |
69 src/gui/pages/now_playing.cpp | |
70 src/gui/pages/statistics.cpp | |
54
466ac9870df9
add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents:
51
diff
changeset
|
71 src/gui/pages/search.cpp |
466ac9870df9
add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents:
51
diff
changeset
|
72 src/gui/pages/seasons.cpp |
466ac9870df9
add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents:
51
diff
changeset
|
73 src/gui/pages/torrents.cpp |
466ac9870df9
add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents:
51
diff
changeset
|
74 src/gui/pages/history.cpp |
466ac9870df9
add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents:
51
diff
changeset
|
75 |
46 | 76 |
77 # Custom widgets | |
64 | 78 src/gui/widgets/anime_info.cpp |
66
6481c5aed3e1
posters: add poster widget...
Paper <mrpapersonic@gmail.com>
parents:
64
diff
changeset
|
79 src/gui/widgets/poster.cpp |
67
442065432549
poster: make posters link to AniList
Paper <mrpapersonic@gmail.com>
parents:
66
diff
changeset
|
80 src/gui/widgets/clickable_label.cpp |
46 | 81 src/gui/widgets/sidebar.cpp |
82 src/gui/widgets/text.cpp | |
47
d8eb763e6661
information.cpp: add widgets to the list tab, and add an
Paper <mrpapersonic@gmail.com>
parents:
46
diff
changeset
|
83 src/gui/widgets/optional_date.cpp |
9 | 84 |
85 # Dialogs | |
51 | 86 src/gui/dialog/about.cpp |
9 | 87 src/gui/dialog/information.cpp |
88 src/gui/dialog/settings.cpp | |
89 src/gui/dialog/settings/application.cpp | |
90 src/gui/dialog/settings/services.cpp | |
91 | |
10 | 92 # Translate |
93 src/gui/translate/anime.cpp | |
15 | 94 src/gui/translate/anilist.cpp |
10 | 95 |
9 | 96 # Services (only AniList for now) |
10 | 97 src/services/services.cpp |
9 | 98 src/services/anilist.cpp |
99 | |
64 | 100 # Tracking |
101 src/track/media.cpp | |
102 | |
9 | 103 # Qt resources |
2 | 104 rc/icons.qrc |
105 dep/darkstyle/darkstyle.qrc | |
106 ) | |
107 | |
9 | 108 if(APPLE) # Mac OS X (or OS X (or macOS)) |
5 | 109 list(APPEND SRC_FILES |
110 src/sys/osx/dark_theme.mm | |
111 src/sys/osx/filesystem.mm | |
112 ) | |
9 | 113 elseif(WIN32) # Windows |
2 | 114 list(APPEND SRC_FILES src/sys/win32/dark_theme.cpp) |
115 endif() | |
116 | |
51 | 117 add_executable(minori ${SRC_FILES}) |
63 | 118 set_property(TARGET minori PROPERTY CXX_STANDARD 11) |
11 | 119 set_property(TARGET minori PROPERTY AUTOMOC ON) |
120 set_property(TARGET minori PROPERTY AUTORCC ON) | |
2 | 121 |
64 | 122 target_include_directories(minori PUBLIC ${CURL_INCLUDE_DIRS} PRIVATE include dep/pugixml/src dep/animia/include dep/anitomy) |
62 | 123 if(USE_QT6) |
124 target_include_directories(minori PUBLIC ${Qt6Widgets_INCLUDE_DIRS}) | |
125 else() | |
126 target_include_directories(minori PUBLIC ${Qt5Widgets_INCLUDE_DIRS}) | |
127 endif() | |
64 | 128 target_compile_options(minori PRIVATE -Wall -Wpedantic -Wextra -Wsuggest-override -Wold-style-cast) |
5 | 129 if(APPLE) |
11 | 130 target_compile_definitions(minori PUBLIC MACOSX) |
9 | 131 elseif(WIN32) |
11 | 132 target_compile_definitions(minori PUBLIC WIN32) |
5 | 133 endif() |
11 | 134 target_link_libraries(minori ${LIBRARIES}) |