mirror-chatterino2/CMakeLists.txt
pajlada 0cbddf7e9b
Fix/be respectful of special characters like exclamation marks in highlight phrases since they are also word boundaries (#1890)
* Add missing includes

We would normally have these included in another file already, or even
the precompiled headers, but having the files included here too makes
testing single parts easier.

* Modify the regex building of highlight phrases for non-regex phrases

For phrases like !test, the word boundary checking we did before was not
enough, so we now check for either a word boundary, a whitespace
character, or the line start/end.

* Add tests for ensuring I haven't fully broken the highlight system

* Add changelog entry
2020-08-22 15:37:03 +02:00

44 lines
1,022 B
CMake

cmake_minimum_required(VERSION 3.8)
project(chatterino)
include_directories(src)
set(chatterino_SOURCES
src/common/UsernameSet.cpp
src/controllers/highlights/HighlightPhrase.cpp
)
find_package(Qt5 5.9.0 REQUIRED COMPONENTS
Core Widgets
)
# 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
tests/src/HighlightPhrase.cpp
)
target_link_libraries(chatterino-test Qt5::Core Qt5::Widgets)
target_link_libraries(chatterino-test gtest gtest_main)
set(BUILD_TESTS OFF)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/lib/serialize PajladaSerialize)
target_link_libraries(chatterino-test PajladaSerialize)
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()