@ -20,27 +20,22 @@ 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 "
)
)
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 )
@ -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 )
@ -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,7 +645,7 @@ 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
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 >
@ -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 ( )