Skip to content

Commit

Permalink
Rename action name; package CMakeLists.txt in artifacts.
Browse files Browse the repository at this point in the history
  • Loading branch information
levalup committed Jun 16, 2024
1 parent d006320 commit 347ec4a
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: CMake on multiple platforms
name: Build

on:
push:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Libuvcxx is a header only library, so only the source code needs to be packaged.

name: Create Release and Upload Asset
name: Release

on:
push:
Expand All @@ -18,7 +18,7 @@ jobs:
- name: Package project files
if: success()
run: |
zip -r archives.zip examples/ include/ tests/ CHANGELOG.md LICENSE README.md
zip -r archives.zip examples/ include/ tests/ CHANGELOG.md CMakeLists.txt LICENSE README.md
- name: Get the tag name
if: success()
Expand All @@ -35,7 +35,9 @@ jobs:
tag_name: ${{ steps.get_tag.outputs.TAG }}
release_name: Release ${{ steps.get_tag.outputs.TAG }}
body: |
See the CHANGELOG.md for details on this release.
See the
[CHANGELOG](${{ github.server_url }}/${{ github.repository }}/blob/${{ steps.get_tag.outputs.TAG }}/CHANGELOG.md)
for details on this release.
draft: false
prerelease: false

Expand Down
40 changes: 31 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,37 @@ set(CMAKE_CXX_STANDARD 17)

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

# compile static libuv
option(LIBUV_BUILD_SHARED "" OFF)
option(LIBUV_BUILD_TESTS "" OFF)
option(LIBUV_BUILD_BENCH "" OFF)
add_subdirectory(libuv)

# using libuv
include_directories(libuv/include include)
link_libraries(libuv::libuv)
if (EXISTS "libuv/CMakeLists.txt")
# compile static libuv
option(LIBUV_BUILD_SHARED "" OFF)
option(LIBUV_BUILD_TESTS "" OFF)
option(LIBUV_BUILD_BENCH "" OFF)
add_subdirectory(libuv)

# using libuv
include_directories(libuv/include)
link_libraries(libuv::libuv)
else ()
# find libuv in system
find_path(LIBUV_INCLUDE_DIR NAMES uv.h)
find_library(LIBUV_LIBRARY NAMES uv libuv)

if (LIBUV_LIBRARY AND LIBUV_INCLUDE_DIR)
# using libuv
include_directories(${LIBUV_INCLUDE_DIR})
link_libraries(${LIBUV_LIBRARY})
else ()
# find libuv witch pkg-config
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBUV REQUIRED IMPORTED_TARGET libuv)

# using libuv
include_directories(${LIBUV_INCLUDE_DIRS})
link_libraries(PkgConfig::LIBUV)
endif ()
endif ()

include_directories(include)

file(GLOB_RECURSE HEADERS ${PROJECT_SOURCE_DIR}/include/*.h)

Expand Down
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# libuvcxx

[![License](https://img.shields.io/badge/License-MIT-blue.svg?logo=)](LICENSE)
[![libuv](https://img.shields.io/badge/libuv-v1.48.0-green?logo=libuv&logoColor=green)](https://github.com/libuv/libuv)
[![C++](https://img.shields.io/badge/C++-17-%23512BD4.svg?logo=C%2B%2B&logoColor=%23512BD4)](https://en.cppreference.com/w/cpp/17)
[![CMake](https://img.shields.io/badge/CMake-v3.9-%23064F8C?logo=cmake&logoColor=%23064F8C)](https://cmake.org)

[![build](https://img.shields.io/github/check-runs/levalup/libuvcxx/master)]()

[![License](https://img.shields.io/badge/License-MIT-blue.svg?logo=)](
LICENSE)
[![libuv](https://img.shields.io/badge/libuv-v1.48.0-green?logo=libuv&logoColor=green)](
https://github.com/libuv/libuv)
[![C++](https://img.shields.io/badge/C++-17-%23512BD4.svg?logo=C%2B%2B&logoColor=%23512BD4)](
https://en.cppreference.com/w/cpp/17)
[![CMake](https://img.shields.io/badge/CMake-v3.9-%23064F8C?logo=cmake&logoColor=%23064F8C)](
https://cmake.org)

[![Build](https://github.com/levalup/libuvcxx/actions/workflows/build.yml/badge.svg)](
https://github.com/levalup/libuvcxx/actions/workflows/build.yml)
[![Release](https://github.com/levalup/libuvcxx/actions/workflows/release.yml/badge.svg)](
https://github.com/levalup/libuvcxx/actions/workflows/release.yml)
> C++ wrapper for libuv, header only.
## 1. Usage
Expand Down

0 comments on commit 347ec4a

Please sign in to comment.