File tree Expand file tree Collapse file tree 4 files changed +27
-30
lines changed Expand file tree Collapse file tree 4 files changed +27
-30
lines changed Original file line number Diff line number Diff line change 99 - name : Install dependencies
1010 run : |
1111 sudo apt-get update
12- sudo apt-get install -y libjpeg-turbo8-dev libpng-dev
12+ sudo apt-get install -y libjpeg-turbo8-dev libpng-dev catch2
1313 - name : Build string_theory
1414 run : |
1515 mkdir -p build_deps && cd build_deps
Original file line number Diff line number Diff line change 1- include (FetchContent)
2- FetchContent_Declare(Catch2
3- GIT_REPOSITORY https://github.com/catchorg/Catch2.git
4- GIT_TAG v2.13.10
5- )
6- FetchContent_MakeAvailable(Catch2)
1+ find_package (Catch2 3.4 QUIET )
2+ if (NOT Catch2_FOUND)
3+ # Force Catch2 to be built as a static lib
4+ set (BUILD_SHARED_LIBS__save ${BUILD_SHARED_LIBS} )
5+ set (BUILD_SHARED_LIBS OFF )
6+
7+ include (FetchContent)
8+ FetchContent_Declare(Catch2
9+ GIT_REPOSITORY https://github.com/catchorg/Catch2.git
10+ GIT_TAG v3.11.0
11+ )
12+ FetchContent_MakeAvailable(Catch2)
13+ list (APPEND CMAKE_MODULE_PATH "${catch2_SOURCE_DIR} /contrib" )
14+
15+ set (BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS__save} )
16+ endif ()
717
818set (test_SOURCES
9- catch2_main.cpp
1019 Test_Location.cpp
1120)
1221add_executable (test_HSPlasma ${test_SOURCES} )
13- target_link_libraries (test_HSPlasma PRIVATE Catch2::Catch2 HSPlasma)
22+ target_link_libraries (test_HSPlasma PRIVATE Catch2::Catch2WithMain HSPlasma)
23+
24+ if (WIN32 AND BUILD_SHARED_LIBS )
25+ # Catch2 needs the HSPlasma DLL available to run <test_executable> --list-tests
26+ add_custom_command (
27+ TARGET test_HSPlasma PRE_BUILD
28+ COMMAND "${CMAKE_COMMAND} " -E copy $<TARGET_FILE:HSPlasma> $<TARGET_FILE_DIR:test_HSPlasma>
29+ )
30+ endif ()
1431
1532# Integrate with CTest so we can use the built-in test targets
16- list (APPEND CMAKE_MODULE_PATH "${catch2_SOURCE_DIR} /contrib" )
1733include (CTest)
1834include (Catch)
1935catch_discover_tests(test_HSPlasma)
Original file line number Diff line number Diff line change 1414 * along with HSPlasma. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17- #include < catch2/catch .hpp>
17+ #include < catch2/catch_test_macros .hpp>
1818
1919#include " PRP/KeyedObject/plLocation.h"
2020
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments