2019-05-11 14:13:03 +02:00
|
|
|
cmake_minimum_required(VERSION 3.8)
|
|
|
|
|
|
|
|
project(chatterino)
|
|
|
|
|
|
|
|
include_directories(src)
|
|
|
|
|
|
|
|
set(chatterino_SOURCES
|
2020-12-26 12:42:39 +01:00
|
|
|
src/common/NetworkRequest.cpp
|
|
|
|
src/common/NetworkResult.cpp
|
|
|
|
src/common/NetworkPrivate.cpp
|
|
|
|
src/common/NetworkManager.cpp
|
|
|
|
src/common/QLogging.cpp
|
|
|
|
src/common/Modes.cpp
|
|
|
|
src/common/ChatterinoSetting.cpp
|
|
|
|
|
|
|
|
src/util/DebugCount.cpp
|
|
|
|
|
|
|
|
src/singletons/Paths.cpp
|
|
|
|
|
|
|
|
src/BaseSettings.cpp
|
|
|
|
|
2019-05-11 14:13:03 +02:00
|
|
|
src/common/UsernameSet.cpp
|
2020-08-22 15:37:03 +02:00
|
|
|
src/controllers/highlights/HighlightPhrase.cpp
|
2021-02-13 19:17:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
src/providers/emoji/Emojis.cpp
|
|
|
|
|
|
|
|
src/messages/Emote.cpp
|
|
|
|
src/messages/Image.cpp
|
|
|
|
src/messages/ImageSet.cpp
|
|
|
|
src/util/RapidjsonHelpers.cpp
|
|
|
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/resources/resources.qrc
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/resources/resources_autogenerated.qrc
|
2019-05-11 14:13:03 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
find_package(Qt5 5.9.0 REQUIRED COMPONENTS
|
2020-12-26 12:42:39 +01:00
|
|
|
Core Widgets Network Concurrent
|
2019-05-11 14:13:03 +02:00
|
|
|
)
|
|
|
|
|
2020-12-26 12:42:39 +01:00
|
|
|
set(CMAKE_AUTOMOC ON)
|
2021-02-13 19:17:22 +01:00
|
|
|
set(CMAKE_AUTORCC ON)
|
2019-05-11 14:13:03 +02:00
|
|
|
|
|
|
|
if (BUILD_TESTS)
|
2020-12-26 23:40:47 +01:00
|
|
|
set(BUILD_TESTS OFF)
|
2019-05-11 14:13:03 +02:00
|
|
|
message("++ Tests enabled")
|
|
|
|
find_package(GTest)
|
|
|
|
enable_testing()
|
|
|
|
|
|
|
|
add_executable(chatterino-test
|
|
|
|
${chatterino_SOURCES}
|
|
|
|
|
|
|
|
tests/src/main.cpp
|
2021-02-13 19:17:22 +01:00
|
|
|
tests/src/Emojis.cpp
|
2020-12-26 12:42:39 +01:00
|
|
|
tests/src/NetworkRequest.cpp
|
2019-05-11 14:13:03 +02:00
|
|
|
tests/src/UsernameSet.cpp
|
2020-08-22 15:37:03 +02:00
|
|
|
tests/src/HighlightPhrase.cpp
|
2019-05-11 14:13:03 +02:00
|
|
|
)
|
|
|
|
|
2021-02-13 19:17:22 +01:00
|
|
|
target_compile_definitions(chatterino-test PRIVATE CHATTERINO_GIT_HASH="test" AB_CUSTOM_SETTINGS CHATTERINO_TEST)
|
2020-12-26 12:42:39 +01:00
|
|
|
|
|
|
|
target_link_libraries(chatterino-test Qt5::Core Qt5::Widgets Qt5::Network Qt5::Concurrent)
|
2019-05-11 14:13:03 +02:00
|
|
|
|
|
|
|
target_link_libraries(chatterino-test gtest gtest_main)
|
|
|
|
|
2020-12-26 23:40:47 +01:00
|
|
|
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/lib/settings)
|
2020-12-26 12:42:39 +01:00
|
|
|
target_link_libraries(chatterino-test PajladaSettings)
|
|
|
|
target_include_directories(chatterino-test PUBLIC PajladaSettings)
|
|
|
|
|
2020-12-26 23:40:47 +01:00
|
|
|
find_package(Threads)
|
|
|
|
|
|
|
|
target_link_libraries(chatterino-test Threads::Threads)
|
|
|
|
|
2020-08-22 15:37:03 +02:00
|
|
|
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/lib/serialize PajladaSerialize)
|
|
|
|
|
|
|
|
target_link_libraries(chatterino-test PajladaSerialize)
|
|
|
|
|
2020-12-20 16:43:35 +01:00
|
|
|
set_property(TARGET chatterino-test PROPERTY CXX_STANDARD 17)
|
|
|
|
set_property(TARGET chatterino-test PROPERTY CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
2020-12-26 12:42:39 +01:00
|
|
|
# gtest_discover_tests(chatterino-test)
|
2019-05-11 14:13:03 +02:00
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "This cmake file is only intended for tests right now. Use qmake to build chatterino2")
|
|
|
|
endif()
|