File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 branches : [master]
88
99jobs :
10- gtest :
11- runs-on : ubuntu-latest
12- steps :
13- - uses : actions/checkout@v4
14-
15- - name : Install dependencies
16- run : |
17- sudo apt-get update
18- sudo apt-get install -y libgtest-dev pkg-config
10+ test :
11+ strategy :
12+ fail-fast : false
13+ matrix :
14+ os : [ubuntu-latest, macos-latest, windows-latest]
1915
20- - name : Build tests
21- run : make gtests
16+ runs-on : ${{ matrix.os }}
2217
23- - name : Run tests
24- run : ./gtests --gtest_filter=*
25-
26- samples :
27- runs-on : ubuntu-latest
2818 steps :
2919 - uses : actions/checkout@v4
3020
31- - name : Build sample
32- run : make sample
21+ - name : Configure
22+ run : cmake -S . -B build -DBUILD_TESTING=ON
23+
24+ - name : Build
25+ run : cmake --build build --config Release
3326
34- - name : Run sample
35- run : ./sample
27+ - name : Test
28+ run : ctest --test-dir build --config Release --output-on-failure
Original file line number Diff line number Diff line change @@ -15,13 +15,28 @@ target_compile_features(CppGeometryLibrary INTERFACE cxx_std_17)
1515if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME )
1616 include (CTest )
1717 if (BUILD_TESTING)
18- find_package (GTest REQUIRED )
18+ find_package (GTest QUIET )
19+ if (NOT GTest_FOUND)
20+ include (FetchContent )
21+ FetchContent_Declare (
22+ googletest
23+ URL https://github.com/google/googletest/archive/v1.14.0.tar.gz
24+ DOWNLOAD_EXTRACT_TIMESTAMP ON
25+ )
26+ # Prevent overriding the parent project's compiler/linker settings on Windows
27+ set (gtest_force_shared_crt ON CACHE BOOL "" FORCE )
28+ FetchContent_MakeAvailable (googletest)
29+ endif ()
30+
1931 add_executable (cpp_geometry_tests tests/Tests.cpp )
2032 target_link_libraries (cpp_geometry_tests
2133 PRIVATE CppGeometryLibrary GTest::GTest GTest::Main
2234 )
2335 add_test (NAME cpp_geometry_tests COMMAND cpp_geometry_tests )
2436 endif ()
37+
38+ add_executable (cpp_geometry_sample samples/samples.cpp )
39+ target_link_libraries (cpp_geometry_sample PRIVATE CppGeometryLibrary )
2540endif ()
2641
2742# Installation
You can’t perform that action at this time.
0 commit comments