- name: Configure CMake
working-directory: ./build
- run: cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DGGML_METAL=OFF ..
+ run: cmake ..
+ -DCMAKE_C_COMPILER=clang
+ -DCMAKE_CXX_COMPILER=clang++
+ -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/installed
+ -DGGML_METAL=OFF
- name: Build
working-directory: ./build
working-directory: ./build
run: ctest --verbose --timeout 900
+ - name: Install
+ working-directory: ./build
+ run: cmake --build . --target install
+
+ - name: Test CMake config
+ run: |
+ mkdir test-cmake
+ cmake -S examples/test-cmake -B test-cmake -DCMAKE_PREFIX_PATH=${{ github.workspace }}/installed
+ cmake --build test-cmake
+
windows:
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' ||
github.event.inputs.run_type == 'full-ci' }}
--- /dev/null
+cmake_minimum_required(VERSION 3.14)
+project(ggml-simple)
+
+set(CMAKE_CXX_STANDARD 17)
+
+find_package(ggml CONFIG REQUIRED)
+
+set(TEST_TARGET test-cmake)
+add_executable(test-cmake test-cmake.cpp)
+target_link_libraries(test-cmake PRIVATE ggml::ggml)