annotate CMakeLists.txt @ 5:51ae25154b70

Fix OS X support code
author Paper <mrpapersonic@gmail.com>
date Sat, 12 Aug 2023 13:10:34 -0400
parents 5af270662505
children 1d82f6e04d7d
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)
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
2 project(weeaboo LANGUAGES CXX OBJCXX)
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
3
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
4 set(SRC_FILES
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
5 src/main.cpp
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
6 src/config.cpp
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
7 src/filesystem.cpp
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
8 src/anilist.cpp
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
9 src/anime.cpp
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
10 src/json.cpp
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
11 src/date.cpp
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
12 src/time.cpp
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
13 src/dialog/information.cpp
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
14 src/ui_utils.cpp
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
15 src/string_utils.cpp
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
16 rc/icons.qrc
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
17 dep/darkstyle/darkstyle.qrc
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
18 # src/pages/statistics.cpp
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
19 # src/pages/now_playing.cpp
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
20 )
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
21
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
22 if(APPLE)
5
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
23 list(APPEND SRC_FILES
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
24 src/sys/osx/dark_theme.mm
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
25 src/sys/osx/filesystem.mm
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
26 )
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
27 elseif(WIN32)
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
28 list(APPEND SRC_FILES src/sys/win32/dark_theme.cpp)
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
29 endif()
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
30
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
31 add_executable(weeaboo WIN32 MACOSX_BUNDLE ${SRC_FILES})
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
32 set_property(TARGET weeaboo PROPERTY CXX_STANDARD 20)
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
33 set_property(TARGET weeaboo PROPERTY AUTOMOC ON)
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
34 set_property(TARGET weeaboo PROPERTY AUTORCC ON)
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
35
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
36 find_package(Qt5 COMPONENTS Widgets REQUIRED)
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
37 find_package(CURL REQUIRED)
5
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
38
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
39 set(LIBRARIES
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
40 ${Qt5Widgets_LIBRARIES}
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
41 ${CURL_LIBRARIES}
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
42 )
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
43
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
44 if(APPLE)
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
45 find_library(COCOA_LIBRARY Cocoa)
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
46 list(APPEND LIBRARIES ${COCOA_LIBRARY})
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
47 endif()
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
48
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
49 target_include_directories(weeaboo PUBLIC ${Qt5Widgets_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS} PRIVATE src/include src/icons)
4
5af270662505 Set override functions as override
Paper <mrpapersonic@gmail.com>
parents: 3
diff changeset
50 target_compile_options(weeaboo PRIVATE -Wall -Wextra -Wsuggest-override)
5
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
51 if(APPLE)
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
52 target_compile_definitions(weeaboo PUBLIC MACOSX)
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
53 endif()
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 4
diff changeset
54 target_link_libraries(weeaboo ${LIBRARIES})