mirror-chatterino2/tests/CMakeLists.txt

73 lines
2.2 KiB
CMake
Raw Normal View History

2021-02-12 19:32:43 +01:00
include(GoogleTest)
2021-02-14 13:41:36 +01:00
project(chatterino-test)
2021-02-12 19:32:43 +01:00
set(main_dir ${CMAKE_SOURCE_DIR}/src)
include_directories(${main_dir})
set(chatterino_SOURCES
${main_dir}/common/NetworkRequest.cpp
${main_dir}/common/NetworkResult.cpp
${main_dir}/common/NetworkPrivate.cpp
${main_dir}/common/NetworkManager.cpp
${main_dir}/common/QLogging.cpp
${main_dir}/common/Modes.cpp
${main_dir}/common/ChatterinoSetting.cpp
${main_dir}/util/DebugCount.cpp
${main_dir}/singletons/Paths.cpp
${main_dir}/BaseSettings.cpp
${main_dir}/common/UsernameSet.cpp
${main_dir}/controllers/highlights/HighlightPhrase.cpp
${main_dir}/providers/emoji/Emojis.cpp
${main_dir}/messages/Emote.cpp
${main_dir}/messages/Image.cpp
${main_dir}/messages/ImageSet.cpp
${main_dir}/util/RapidjsonHelpers.cpp
${CMAKE_SOURCE_DIR}/resources/resources.qrc
${CMAKE_SOURCE_DIR}/resources/resources_autogenerated.qrc
2021-02-12 19:32:43 +01:00
)
message("++ Tests enabled")
add_executable(${PROJECT_NAME}
${chatterino_SOURCES}
src/main.cpp
src/NetworkRequest.cpp
src/UsernameSet.cpp
src/HighlightPhrase.cpp
src/Emojis.cpp
2021-02-12 19:32:43 +01:00
)
target_link_libraries(${PROJECT_NAME}
Qt5::Core
Qt5::Widgets
Qt5::Network
Qt5::Concurrent
)
if (USE_PACKAGE_MANAGER)
target_link_libraries(${PROJECT_NAME}
CONAN_PKG::gtest
CONAN_PKG::serialize
CONAN_PKG::settings
CONAN_PKG::signals
)
else ()
target_link_libraries(${PROJECT_NAME}
gtest gtest_main
2021-02-21 15:08:38 +01:00
Pajlada::Serialize
Pajlada::Settings
Pajlada::Signals
2021-02-21 15:14:58 +01:00
Threads::Threads
2021-02-12 19:32:43 +01:00
)
endif ()
2021-02-14 13:41:36 +01:00
target_compile_definitions(${PROJECT_NAME} PRIVATE CHATTERINO CHATTERINO_TEST UNICODE AB_CUSTOM_THEME AB_CUSTOM_SETTINGS IRC_STATIC IRC_NAMESPACE=Communi)
target_compile_definitions(${PROJECT_NAME} PRIVATE CHATTERINO_GIT_HASH=\"${GIT_HASH}\" CHATTERINO_GIT_RELEASE=\"${GIT_RELEASE}\" CHATTERINO_GIT_COMMIT=\"${GIT_COMMIT}\")
2021-02-14 13:41:36 +01:00
if (WIN32)
target_compile_definitions(${PROJECT_NAME} PRIVATE USEWINSDK)
endif ()
2021-02-21 15:08:38 +01:00
#gtest_discover_tests(${PROJECT_NAME})