Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,23 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
shared: ["ON", "OFF"]
includedir: ["include", "headers"]
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} - shared=${{ matrix.shared }}
name: ${{ matrix.os }} - shared=${{ matrix.shared }} - includedir=${{ matrix.includedir }}
steps:
- uses: actions/checkout@v7
- name: Build
run: |
mkdir build
cmake -S . -B build -DBUILD_SHARED_LIBS=${{ matrix.shared }} -DUTF8PROC_ENABLE_TESTING=ON -DCMAKE_INSTALL_PREFIX=tmp/install
cmake -S . -B build -DBUILD_SHARED_LIBS=${{ matrix.shared }} -DUTF8PROC_ENABLE_TESTING=ON -DCMAKE_INSTALL_PREFIX=tmp/install -DCMAKE_INSTALL_INCLUDEDIR=${{ matrix.includedir }}
cmake --build build
- name: Run Test
run: ctest --test-dir build -V
- name: Upload shared lib
if: matrix.shared == 'ON'
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.os }}
name: ${{ matrix.os }}-${{ matrix.includedir }}
path: |
build/libutf8proc.*
build/Debug/utf8proc.*
Expand Down
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ option(UTF8PROC_INSTALL "Enable installation of utf8proc" On)
option(UTF8PROC_ENABLE_TESTING "Enable testing of utf8proc" Off)
option(LIB_FUZZING_ENGINE "Fuzzing engine to link against" Off)

include(GNUInstallDirs)

add_library (utf8proc
utf8proc.c
utf8proc.h
)
add_library (utf8proc::utf8proc ALIAS utf8proc)

# expose header path, for when this is part of a larger cmake project
target_include_directories(utf8proc PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<INSTALL_INTERFACE:include>)
target_include_directories(utf8proc PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)

if (BUILD_SHARED_LIBS)
# Building shared library
Expand All @@ -46,7 +48,6 @@ set_target_properties (utf8proc PROPERTIES
)

if (UTF8PROC_INSTALL)
include(GNUInstallDirs)
install(FILES utf8proc.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
install(TARGETS utf8proc
EXPORT utf8proc-targets
Expand Down