Fix Catch2 version

This commit is contained in:
Dawid Drozd 2018-07-31 08:49:46 +02:00
parent 354b0d08b4
commit e27041d095
2 changed files with 5 additions and 8 deletions

View File

@ -47,8 +47,8 @@ matrix:
before_install:
# Install catch 2 dependency
- wget https://github.com/catchorg/Catch2/archive/master.zip
- unzip master.zip && cd Catch2-master && mkdir -p build/ && cd build/
- wget https://github.com/catchorg/Catch2/archive/v2.2.3.zip
- unzip master.zip && cd Catch2-2.2.3 && mkdir -p build/ && cd build/
- cmake -DCMAKE_BUILD_TYPE=Release .. -DCMAKE_INSTALL_PREFIX=~/.local/ && cmake --build . --target install
- cd ../..

View File

@ -11,7 +11,8 @@ if (NOT TARGET Dexode::EventBus)
find_package(EventBus CONFIG REQUIRED)
endif ()
find_package(Catch2 REQUIRED)
# From 2.3.X they broke back compatibility
find_package(Catch2 2.2 REQUIRED)
# Target definition
add_executable(EventBusTest
@ -46,11 +47,7 @@ set(EVENTBUS_DEBUG_FLAGS
target_compile_options(EventBusTest PUBLIC "$<$<CONFIG:DEBUG>:${EVENTBUS_DEBUG_FLAGS}>")
if (TARGET Catch2::Catch2) # Fix for naming library
target_link_libraries(EventBusTest PUBLIC Dexode::EventBus Catch2::Catch2)
elseif (TARGET Catch2::Catch)
target_link_libraries(EventBusTest PUBLIC Dexode::EventBus Catch2::Catch)
endif ()
target_link_libraries(EventBusTest PUBLIC Dexode::EventBus Catch2::Catch)
add_test(NAME EventBus.UnitTests COMMAND EventBusTest)