@ -18,29 +18,24 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "compile as PIC by default")
option ( HUNTER_ENABLED "Enable Hunter package manager" OFF )
include ( "cmake/HunterGate.cmake" )
HunterGate (
U R L " h t t p s : / / g i t h u b . c o m / c p p - p m / h u n t e r / a r c h i v e / v 0 . 2 3 . 2 8 8 . t a r . g z "
S H A 1 " 6 c 9 b 2 b c 6 0 6 d 8 6 a e 3 1 f 9 6 a 6 2 f c 6 8 f 0 a 5 9 3 0 2 4 8 1 5 b "
)
U R L " h t t p s : / / g i t h u b . c o m / c p p - p m / h u n t e r / a r c h i v e / v 0 . 2 3 . 2 8 8 . t a r . g z "
S H A 1 " 6 c 9 b 2 b c 6 0 6 d 8 6 a e 3 1 f 9 6 a 6 2 f c 6 8 f 0 a 5 9 3 0 2 4 8 1 5 b "
)
option ( USE_BUNDLED_BOOST "Use the bundled version of Boost." ${ HUNTER_ENABLED } )
option ( USE_BUNDLED_SPDLOG "Use the bundled version of spdlog."
$ { H U N T E R _ E N A B L E D } )
option ( USE_BUNDLED_SPDLOG "Use the bundled version of spdlog." ${ HUNTER_ENABLED } )
option ( USE_BUNDLED_OLM "Use the bundled version of libolm." ${ HUNTER_ENABLED } )
option ( USE_BUNDLED_GTEST "Use the bundled version of Google Test."
$ { H U N T E R _ E N A B L E D } )
option ( USE_BUNDLED_CMARK "Use the bundled version of cmark."
$ { H U N T E R _ E N A B L E D } )
option ( USE_BUNDLED_JSON "Use the bundled version of nlohmann json."
$ { H U N T E R _ E N A B L E D } )
option ( USE_BUNDLED_OPENSSL "Use the bundled version of OpenSSL."
O F F )
option ( USE_BUNDLED_GTEST "Use the bundled version of Google Test." ${ HUNTER_ENABLED } )
option ( USE_BUNDLED_CMARK "Use the bundled version of cmark." ${ HUNTER_ENABLED } )
option ( USE_BUNDLED_JSON "Use the bundled version of nlohmann json." ${ HUNTER_ENABLED } )
option ( USE_BUNDLED_OPENSSL "Use the bundled version of OpenSSL." OFF )
option ( USE_BUNDLED_MTXCLIENT "Use the bundled version of the Matrix Client library." ${ HUNTER_ENABLED } )
option ( USE_BUNDLED_LMDB "Use the bundled version of lmdb."
$ { H U N T E R _ E N A B L E D } )
option ( USE_BUNDLED_LMDBXX "Use the bundled version of lmdb++."
$ { H U N T E R _ E N A B L E D } )
option ( USE_BUNDLED_QTKEYCHAIN "Use the bundled version of Qt5Keychain."
option ( USE_BUNDLED_LMDB "Use the bundled version of lmdb." ${ HUNTER_ENABLED } )
option ( USE_BUNDLED_LMDBXX "Use the bundled version of lmdb++." ${ HUNTER_ENABLED } )
option ( USE_BUNDLED_QTKEYCHAIN "Use the bundled version of Qt5Keychain." ${ HUNTER_ENABLED } )
option ( USE_BUNDLED_COEURL "Use a bundled version of the Curl wrapper"
$ { H U N T E R _ E N A B L E D } )
option ( USE_BUNDLED_LIBEVENT "Use the bundled version of spdlog." ${ HUNTER_ENABLED } )
option ( USE_BUNDLED_LIBCURL "Use the bundled version of spdlog." ${ HUNTER_ENABLED } )
list ( APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" )
@ -119,6 +114,38 @@ if (BUILD_DOCS)
endif ( DOXYGEN_FOUND )
endif ( )
#
# # c o e u r l
#
# # N e e d t o r e p e a t a l l l i b e v e n t d e p s ? ! ?
if ( USE_BUNDLED_LIBEVENT )
hunter_add_package ( Libevent )
find_package ( Libevent CONFIG REQUIRED )
else ( )
find_package ( PkgConfig REQUIRED )
pkg_check_modules ( libevent_core REQUIRED IMPORTED_TARGET libevent_core )
if ( WIN32 )
pkg_check_modules ( libevent_windows REQUIRED IMPORTED_TARGET libevent_windows )
else ( )
pkg_check_modules ( libevent_pthreads REQUIRED IMPORTED_TARGET
l i b e v e n t _ p t h r e a d s )
endif ( )
endif ( )
# c u r l
if ( USE_BUNDLED_LIBCURL )
hunter_add_package ( CURL )
find_package ( CURL CONFIG REQUIRED )
else ( )
find_package ( PkgConfig REQUIRED )
pkg_check_modules ( libcurl REQUIRED IMPORTED_TARGET libcurl )
endif ( )
# s p d l o g
if ( USE_BUNDLED_SPDLOG )
hunter_add_package ( spdlog )
endif ( )
find_package ( spdlog 1.0.0 CONFIG REQUIRED )
#
# L M D B
@ -156,7 +183,7 @@ if (USE_BUNDLED_QTKEYCHAIN)
set ( BUILD_TEST_APPLICATION OFF CACHE INTERNAL "" )
FetchContent_MakeAvailable ( qt5keychain )
else ( )
find_package ( Qt5Keychain REQUIRED )
find_package ( Qt5Keychain REQUIRED )
endif ( )
if ( APPLE )
@ -261,7 +288,7 @@ set(SRC_FILES
# E m o j i
s r c / e m o j i / E m o j i M o d e l . c p p
s r c / e m o j i / P r o v i d e r . c p p
s r c / e m o j i / P r o v i d e r . c p p
# T i m e l i n e
@ -301,8 +328,8 @@ set(SRC_FILES
s r c / u i / T o g g l e B u t t o n . c p p
s r c / u i / U s e r P r o f i l e . c p p
# G e n e r i c n o t i f i c a t i o n s t u f f
s r c / n o t i f i c a t i o n s / M a n a g e r . c p p
# G e n e r i c n o t i f i c a t i o n s t u f f
s r c / n o t i f i c a t i o n s / M a n a g e r . c p p
s r c / A v a t a r P r o v i d e r . c p p
s r c / B l u r h a s h P r o v i d e r . c p p
@ -339,13 +366,6 @@ set(SRC_FILES
include ( FeatureSummary )
if ( USE_BUNDLED_BOOST )
hunter_add_package ( Boost COMPONENTS iostreams system thread )
endif ( )
find_package ( Boost 1.70 REQUIRED
C O M P O N E N T S i o s t r e a m s
s y s t e m
t h r e a d )
if ( USE_BUNDLED_OPENSSL )
hunter_add_package ( OpenSSL )
@ -417,10 +437,10 @@ set_package_properties(nlohmann_json PROPERTIES
if ( USE_BUNDLED_LMDBXX )
include ( FetchContent )
FetchContent_Declare (
l m d b x x
U R L " h t t p s : / / r a w . g i t h u b u s e r c o n t e n t . c o m / h o y t e c h / l m d b x x / 1 . 0 . 0 / l m d b + + . h "
D O W N L O A D _ N O _ E X T R A C T T R U E
)
l m d b x x
U R L " h t t p s : / / r a w . g i t h u b u s e r c o n t e n t . c o m / h o y t e c h / l m d b x x / 1 . 0 . 0 / l m d b + + . h "
D O W N L O A D _ N O _ E X T R A C T T R U E
)
if ( NOT lmdbxx_POPULATED )
FetchContent_Populate ( lmdbxx )
endif ( )
@ -604,14 +624,11 @@ target_include_directories(nheko PRIVATE src includes third_party/blurhash third
# F i x u p b u n d l e d k e y c h a i n i n c l u d e d i r s
if ( USE_BUNDLED_QTKEYCHAIN )
target_include_directories ( nheko PRIVATE ${ qt5keychain_SOURCE_DIR } ${ qt5keychain_BINARY_DIR } )
target_include_directories ( nheko PRIVATE ${ qt5keychain_SOURCE_DIR } ${ qt5keychain_BINARY_DIR } )
endif ( )
target_link_libraries ( nheko PRIVATE
M a t r i x C l i e n t : : M a t r i x C l i e n t
B o o s t : : i o s t r e a m s
B o o s t : : s y s t e m
B o o s t : : t h r e a d
c m a r k : : c m a r k
s p d l o g : : s p d l o g
Q t 5 : : W i d g e t s
@ -628,11 +645,11 @@ target_link_libraries(nheko PRIVATE
S i n g l e A p p l i c a t i o n : : S i n g l e A p p l i c a t i o n )
if ( ${ CMAKE_VERSION } VERSION_GREATER_EQUAL "3.16.0" )
target_precompile_headers ( nheko
P R I V A T E
< s t r i n g >
< a l g o r i t h m >
)
target_precompile_headers ( nheko
P R I V A T E
< s t r i n g >
< a l g o r i t h m >
)
endif ( )
if ( TARGET PkgConfig::GSTREAMER )
@ -644,6 +661,24 @@ if (TARGET PkgConfig::GSTREAMER)
endif ( )
endif ( )
if ( USE_BUNDLED_COEURL )
include ( FetchContent )
FetchContent_Declare (
c o e u r l
G I T _ R E P O S I T O R Y h t t p s : / / n h e k o . i m / N h e k o - R e b o r n / c o e u r l . g i t
G I T _ T A G 4 1 7 8 2 1 a 0 7 c f e 4 4 2 9 b 0 8 a 2 e f e d 5 e 4 8 0 a 4 9 8 0 8 7 a f d
)
FetchContent_MakeAvailable ( coeurl )
target_link_libraries ( nheko PUBLIC coeurl::coeurl )
elseif ( coeurl_DIR )
find_package ( coeurl CONFIG REQUIRED )
target_link_libraries ( nheko PUBLIC coeurl::coeurl )
else ( )
find_package ( PkgConfig REQUIRED )
pkg_check_modules ( coeurl REQUIRED IMPORTED_TARGET coeurl )
target_link_libraries ( nheko PUBLIC PkgConfig::coeurl )
endif ( )
if ( MSVC )
target_link_libraries ( nheko PRIVATE ntdll )
endif ( )