2019-05-11 14:13:03 +02:00
|
|
|
cmake_minimum_required(VERSION 3.8)
|
|
|
|
|
|
|
|
project(chatterino)
|
|
|
|
|
|
|
|
include_directories(src)
|
|
|
|
|
|
|
|
set(chatterino_SOURCES
|
|
|
|
src/common/UsernameSet.cpp
|
2020-08-22 15:37:03 +02:00
|
|
|
src/controllers/highlights/HighlightPhrase.cpp
|
2019-05-11 14:13:03 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
find_package(Qt5 5.9.0 REQUIRED COMPONENTS
|
2020-08-22 15:37:03 +02:00
|
|
|
Core Widgets
|
2019-05-11 14:13:03 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
# set(CMAKE_AUTOMOC ON)
|
|
|
|
|
|
|
|
if (BUILD_TESTS)
|
|
|
|
message("++ Tests enabled")
|
|
|
|
find_package(GTest)
|
|
|
|
enable_testing()
|
|
|
|
|
|
|
|
add_executable(chatterino-test
|
|
|
|
${chatterino_SOURCES}
|
|
|
|
|
|
|
|
tests/src/main.cpp
|
|
|
|
tests/src/UsernameSet.cpp
|
2020-08-22 15:37:03 +02:00
|
|
|
tests/src/HighlightPhrase.cpp
|
2019-05-11 14:13:03 +02:00
|
|
|
)
|
|
|
|
|
2020-08-22 15:37:03 +02:00
|
|
|
target_link_libraries(chatterino-test Qt5::Core Qt5::Widgets)
|
2019-05-11 14:13:03 +02:00
|
|
|
|
|
|
|
target_link_libraries(chatterino-test gtest gtest_main)
|
|
|
|
|
2020-08-22 15:37:03 +02:00
|
|
|
set(BUILD_TESTS OFF)
|
|
|
|
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)
|
|
|
|
|
2019-05-11 14:13:03 +02:00
|
|
|
gtest_discover_tests(chatterino-test)
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "This cmake file is only intended for tests right now. Use qmake to build chatterino2")
|
|
|
|
endif()
|