diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 195cda8..4a2d459 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -66,16 +66,20 @@ jobs: -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S ${{ github.workspace }} + - name: PreInstall + # Perform pre-installation. + run: ./preinstall + - name: Build # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} + - name: PostInstall + # Perform post-installation. + run: ./postinstall + - name: Test working-directory: ${{ steps.strings.outputs.build-output-dir }} # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: ctest --build-config ${{ matrix.build_type }} - - - name: Install - # By running "install" script to install project header files and shared object file later on after the compilation. - run: ./install diff --git a/postinstall b/postinstall new file mode 100755 index 0000000..12dd101 --- /dev/null +++ b/postinstall @@ -0,0 +1,6 @@ +#!/bin/sh + +# Install Compound library. +echo "Installing libcompound:" +cp -v "libcompound.so" "/usr/lib" + diff --git a/install b/preinstall similarity index 93% rename from install rename to preinstall index 6057dbb..4f94d2a 100755 --- a/install +++ b/preinstall @@ -19,6 +19,7 @@ if [ ! -d "$DST" ]; then mkdir -pv "$DST" fi +# Install project-like headers. PROJLEN=${#PROJ[*]} echo "======== $PROJLEN projects in total ========" @@ -38,11 +39,9 @@ while :; do echo done +# Install individual headers. cp -v "common.h" "const.h" "platform.h"\ "name.h" "namescope.h" "type.h" "catlog.h"\ "attr.h" "registry.h" "class.h" "function.h" "$DST" -echo "Installing libcompound:" -cp -v "libcompound.so" "/usr/lib" - printf "\nDone\n"