Skip to content

Commit

Permalink
CMake support.
Browse files Browse the repository at this point in the history
  • Loading branch information
eerimoq committed Mar 2, 2022
1 parent a968ebc commit 6f01b34
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ jobs:
- name: Test C
run: |
make test-c
- name: Test CMake
run: |
mkdir lib/build
cd lib/build
cmake ..
make
cmake --install . --prefix foo
ls foo/include/pbtools.h foo/lib/libpbtools.a
- name: Examples
run: |
make -C examples
Expand Down
8 changes: 8 additions & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.16)
project(pbtools C)
add_library(pbtools src/pbtools.c)
target_include_directories(pbtools PUBLIC
"${PROJECT_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}/include")
install(TARGETS pbtools DESTINATION lib)
install(FILES include/pbtools.h DESTINATION include)

0 comments on commit 6f01b34

Please sign in to comment.