Add option to use system libcommuni (off by default, "old" behaviour)

This commit is contained in:
Rasmus Karlsson 2021-02-20 16:34:38 +01:00
parent 98e108710a
commit 4c633a570f

View file

@ -10,6 +10,7 @@ option(BUILD_APP "Build Chatterino2" ON)
option(BUILD_TESTS "Build the tests for Chatterino2" OFF)
option(USE_PACKAGE_MANAGER "Use conan for managing packages" OFF)
option(USE_SYSTEM_PAJLADA_SETTINGS "Use system pajlada settings library" OFF)
option(USE_SYSTEM_LIBCOMMUNI "Use system communi library" OFF)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
@ -102,7 +103,16 @@ else (USE_PACKAGE_MANAGER)
endif()
if (BUILD_APP)
if (USE_SYSTEM_LIBCOMMUNI)
find_package(LibCommuni REQUIRED)
else()
set(LIBCOMMUNI_ROOT_LIB_FOLDER "${CMAKE_SOURCE_DIR}/lib/libcommuni-cmake")
if (NOT EXISTS "${LIBCOMMUNI_ROOT_LIB_FOLDER}/CMakeLists.txt")
message(FATAL_ERROR "Submodules probably not loaded, unable to find lib/libcommuni/CMakeLists.txt")
endif()
add_subdirectory("${LIBCOMMUNI_ROOT_LIB_FOLDER}" EXCLUDE_FROM_ALL)
endif()
find_package(Qt5keychain REQUIRED)
find_package(Rapidjson REQUIRED)
find_package(Websocketpp REQUIRED)