diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 05b8bd3..0419b5c 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -14,14 +14,15 @@ 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 @@ -29,7 +30,7 @@ jobs: if: matrix.shared == 'ON' uses: actions/upload-artifact@v7 with: - name: ${{ matrix.os }} + name: ${{ matrix.os }}-${{ matrix.includedir }} path: | build/libutf8proc.* build/Debug/utf8proc.* diff --git a/CMakeLists.txt b/CMakeLists.txt index f9f1542..cd49310 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,8 @@ 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 @@ -25,7 +27,7 @@ add_library (utf8proc add_library (utf8proc::utf8proc ALIAS utf8proc) # expose header path, for when this is part of a larger cmake project -target_include_directories(utf8proc PUBLIC $ $) +target_include_directories(utf8proc PUBLIC $ $) if (BUILD_SHARED_LIBS) # Building shared library @@ -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