annotate CMakeLists.txt @ 11:fc1bf97c528b

*: use C++11 standard I've been meaning to do this for a while, but I didn't want to reimplement the filesystem code. Now we are on C++11 and most compilers from the past 5 centuries should support this now
author Paper <mrpapersonic@gmail.com>
date Sun, 17 Sep 2023 06:14:30 -0400
parents 4b198a111713
children cf6a73a5ba1c
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)
11
fc1bf97c528b *: use C++11 standard
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
2 project(minori LANGUAGES CXX OBJCXX)
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
3
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
4 add_subdirectory(dep/anitomy)
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
5
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
6 set(SRC_FILES
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
7 # Main entrypoint
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
8 src/main.cpp
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
10 # Core files and datatype declarations...
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
11 src/core/anime.cpp
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
12 src/core/anime_db.cpp
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
13 src/core/config.cpp
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
14 src/core/date.cpp
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
15 src/core/filesystem.cpp
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
16 src/core/json.cpp
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
17 src/core/strings.cpp
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
18 src/core/time.cpp
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
19
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
20 # GUI stuff
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
21 src/gui/window.cpp
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
22 src/gui/sidebar.cpp
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
23 src/gui/ui_utils.cpp
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
24
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
25 # Dialogs
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
26 src/gui/dialog/information.cpp
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
27 src/gui/dialog/settings.cpp
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
28 src/gui/dialog/settings/application.cpp
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
29 src/gui/dialog/settings/services.cpp
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
30
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
31 # Main window pages
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
32 src/gui/pages/anime_list.cpp
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
33 src/gui/pages/now_playing.cpp
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
34 src/gui/pages/statistics.cpp
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
35
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
36 # Translate
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
37 src/gui/translate/anime.cpp
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
38
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
39 # Services (only AniList for now)
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
40 src/services/services.cpp
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
41 src/services/anilist.cpp
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
42
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
43 # Qt resources
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
44 rc/icons.qrc
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
45 dep/darkstyle/darkstyle.qrc
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
46 )
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
47
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
48 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
49 list(APPEND SRC_FILES
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
50 src/sys/osx/dark_theme.mm
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
51 src/sys/osx/filesystem.mm
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
52 )
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
53 elseif(WIN32) # Windows
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
54 list(APPEND SRC_FILES src/sys/win32/dark_theme.cpp)
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
55 endif()
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
56
11
fc1bf97c528b *: use C++11 standard
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
57 add_executable(minori ${SRC_FILES})
fc1bf97c528b *: use C++11 standard
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
58 set_property(TARGET minori PROPERTY CXX_STANDARD 11)
fc1bf97c528b *: use C++11 standard
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
59 set_property(TARGET minori PROPERTY AUTOMOC ON)
fc1bf97c528b *: use C++11 standard
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
60 set_property(TARGET minori PROPERTY AUTORCC ON)
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
61
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
62 find_package(Qt5 COMPONENTS Widgets Test REQUIRED)
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
63 find_package(CURL REQUIRED)
5
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
64
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
65 set(LIBRARIES
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
66 ${Qt5Widgets_LIBRARIES}
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
67 ${Qt5Test_LIBRARIES}
5
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
68 ${CURL_LIBRARIES}
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
69 anitomy
5
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
70 )
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
71
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
72 if(APPLE)
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
73 find_library(COCOA_LIBRARY Cocoa)
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
74 list(APPEND LIBRARIES ${COCOA_LIBRARY})
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
75 endif()
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
76
11
fc1bf97c528b *: use C++11 standard
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
77 target_include_directories(minori PUBLIC ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Test_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS} PRIVATE include)
fc1bf97c528b *: use C++11 standard
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
78 target_compile_options(minori PRIVATE -Wall -Wextra -Wsuggest-override)
5
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
79 if(APPLE)
11
fc1bf97c528b *: use C++11 standard
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
80 target_compile_definitions(minori PUBLIC MACOSX)
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
81 elseif(WIN32)
11
fc1bf97c528b *: use C++11 standard
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
82 target_compile_definitions(minori PUBLIC WIN32)
5
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
83 endif()
11
fc1bf97c528b *: use C++11 standard
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
84 target_link_libraries(minori ${LIBRARIES})