2019-05-11 14:13:03 +02:00
|
|
|
cmake_minimum_required(VERSION 3.8)
|
2021-02-12 11:36:42 +01:00
|
|
|
include(FeatureSummary)
|
2019-05-11 14:13:03 +02:00
|
|
|
|
2021-02-12 17:21:04 +01:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_BINARY_DIR})
|
|
|
|
|
2021-02-12 19:32:43 +01:00
|
|
|
project(Chatterino2)
|
|
|
|
|
|
|
|
option(BUILD_APP "Build Chatterino2" ON)
|
|
|
|
option(BUILD_TESTS "Build the tests for Chatterino2" OFF)
|
2021-02-12 17:21:04 +01:00
|
|
|
option(USE_PACKAGE_MANAGER "Use conan for managing packages" OFF)
|
2021-02-12 12:52:50 +01:00
|
|
|
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
set(CMAKE_AUTOUIC ON)
|
|
|
|
|
2021-02-12 17:21:04 +01:00
|
|
|
SET(RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/")
|
|
|
|
SET(LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/")
|
|
|
|
SET(ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/")
|
|
|
|
SET(EXECUTABLE_OUTPUT_PATH ${RUNTIME_OUTPUT_DIRECTORY})
|
|
|
|
SET(LIBRARY_OUTPUT_PATH ${RUNTIME_OUTPUT_DIRECTORY})
|
|
|
|
|
|
|
|
if (WIN32)
|
|
|
|
# fix executable paths for windows
|
|
|
|
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${RUNTIME_OUTPUT_DIRECTORY})
|
|
|
|
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${RUNTIME_OUTPUT_DIRECTORY})
|
|
|
|
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${RUNTIME_OUTPUT_DIRECTORY})
|
|
|
|
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${RUNTIME_OUTPUT_DIRECTORY})
|
2021-02-12 19:32:43 +01:00
|
|
|
endif ()
|
2019-05-11 14:13:03 +02:00
|
|
|
|
2021-02-13 10:40:27 +01:00
|
|
|
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui Network Multimedia Svg Concurrent)
|
|
|
|
|
|
|
|
if (WIN32)
|
|
|
|
find_package(WinToast REQUIRED)
|
|
|
|
endif()
|
|
|
|
|
2021-02-12 17:21:04 +01:00
|
|
|
if (USE_PACKAGE_MANAGER)
|
|
|
|
include(pmm)
|
|
|
|
pmm(CONAN)
|
|
|
|
else (USE_PACKAGE_MANAGER)
|
|
|
|
set(CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/dependencies" CACHE PATH "Path to the dependencies")
|
|
|
|
|
|
|
|
find_package(Boost REQUIRED)
|
|
|
|
find_package(OpenSSL REQUIRED)
|
|
|
|
|
2021-02-13 13:07:08 +01:00
|
|
|
find_package(Serialize REQUIRED)
|
2021-02-12 17:21:04 +01:00
|
|
|
find_package(Signals REQUIRED)
|
|
|
|
find_package(Settings REQUIRED)
|
2021-02-12 19:32:43 +01:00
|
|
|
|
2021-02-13 13:07:08 +01:00
|
|
|
if (BUILD_APP)
|
|
|
|
find_package(LibCommuni REQUIRED)
|
|
|
|
find_package(Qt5keychain REQUIRED)
|
|
|
|
find_package(Rapidjson REQUIRED)
|
|
|
|
find_package(Websocketpp REQUIRED)
|
|
|
|
endif ()
|
2021-02-12 19:32:43 +01:00
|
|
|
if (BUILD_TESTS)
|
|
|
|
find_package(GTest REQUIRED)
|
|
|
|
endif ()
|
2021-02-12 17:21:04 +01:00
|
|
|
endif (USE_PACKAGE_MANAGER)
|
2021-02-12 12:52:50 +01:00
|
|
|
|
2021-02-13 13:07:08 +01:00
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
2020-12-26 12:42:39 +01:00
|
|
|
|
2021-02-12 19:32:43 +01:00
|
|
|
if (BUILD_APP)
|
|
|
|
add_subdirectory(src)
|
|
|
|
endif ()
|
|
|
|
if (BUILD_TESTS)
|
|
|
|
enable_testing()
|
|
|
|
add_subdirectory(tests)
|
|
|
|
endif ()
|
2020-12-26 12:42:39 +01:00
|
|
|
|
2021-02-12 11:36:42 +01:00
|
|
|
feature_summary(WHAT ALL)
|