-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
108 lines (85 loc) · 2.79 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
cmake_minimum_required(VERSION 3.0)
project(BooruSurfer2)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
# Turn on warnings
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
set(SOURCES
src/api/Api.cpp
src/api/ApiHandler.cpp
src/api/DanApi.cpp
src/api/KonachanApi.cpp
src/api/LocalApi.cpp
src/api/SanApi.cpp
src/api/ShimmieApi.cpp
src/db/AddLocal.cpp
src/db/Booru.cpp
src/db/Database.cpp
src/db/LocalDb.cpp
src/db/Statement.cpp
src/objects/Comment.cpp
src/objects/Image.cpp
src/objects/Index.cpp
src/objects/Note.cpp
src/objects/Pool.cpp
src/objects/Post.cpp
src/objects/Tag.cpp
src/pages/APage.cpp
src/pages/FaviconPage.cpp
src/pages/FilePage.cpp
src/pages/HomePage.cpp
src/pages/IndexPage.cpp
src/pages/IndexStubPage.cpp
src/pages/NotFoundPage.cpp
src/pages/OpenSearchPage.cpp
src/pages/PageHandler.cpp
src/pages/PostPage.cpp
src/pages/ProxyPage.cpp
src/pages/TagSearchPage.cpp
src/pages/RssPage.cpp
src/pages/SavePage.cpp
src/pages/Styler.cpp
src/pages/UrlHandler.cpp
src/parsing/OpenSearchDescription.cpp
src/parsing/pugixml.cpp #Remove from project?
src/parsing/Rss.cpp
#src/server/ArgsParsing.cpp
src/server/PocoServer.cpp
src/system/TimeHandling.cpp
src/main.cpp
)
find_package(Poco REQUIRED NetSSL Net JSON XML Crypto)
include_directories( Poco_INCLUDE_DIRS )
set( POCO_LINKS Poco_NetSSL_LIBRARY Poco_Net_LIBRARY Poco_JSON_LIBRARY Poco_XML_LIBRARY Poco_Crypto_LIBRARY )
if( NOT Poco_FOUND )
message( FATAL_ERROR "Could not find Poco" )
endif()
if( UNIX )
set(THUMB_SOURCES src/system/Thumbnailer-kde.cpp)
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
set(CMAKE_AUTOMOC ON)
find_package(KF5KIO REQUIRED)
set(SYSTEM_LINKS Qt5::Core Qt5::Gui KF5::KIOCore KF5::KIOFileWidgets KF5::KIOWidgets KF5::KIONTLM)
message( WARNING "Using KDE for thumbnailing" )
add_definitions( -DLINUX )
add_definitions( -DUSES_QT )
#TODO: Find this path
include_directories( /usr/include/KF5/KIOWidgets/kio/ )
elseif( WIN32 )
set(THUMB_SOURCES src/system/Thumbnailer-windows.cpp)
set(SYSTEM_LINKS -lShell32 -lUuid -lGdi32 -lOle32 -lWindowscodecs -lboost_system-mt -lboost_filesystem-mt)
#TODO: find boost
else()
set(THUMB_SOURCES src/system/Thumbnailer-fallback.cpp)
message( WARNING "Using null implementation of thumbnail" )
endif()
add_executable(BooruSurfer2 ${SOURCES} ${THUMB_SOURCES} )
target_link_libraries(BooruSurfer2 -ljansson -lpng -lsqlite3 -llzma -lmyhtml_static -lpugixml ${Poco_LIBRARIES} ${SYSTEM_LINKS})
# C++14
set_property(TARGET BooruSurfer2 PROPERTY CXX_STANDARD 17)
set_property(TARGET BooruSurfer2 PROPERTY CXX_STANDARD_REQUIRED ON)
if( WIN32 )
target_compile_definitions(BooruSurfer2 PUBLIC POCO_WIN32_UTF8)
endif()