diff --git a/.github/workflows/build.linux.workflow.yml b/.github/workflows/build.linux.workflow.yml index cb6441cf..5e2dedd0 100644 --- a/.github/workflows/build.linux.workflow.yml +++ b/.github/workflows/build.linux.workflow.yml @@ -53,3 +53,12 @@ jobs: run: | cd build cmake --build . --target install + + - name: Prepare install folder for upload + run: mv prefix tilibs_linux_static${{ matrix.statictype }}_${{ github.sha }} + + - name: Upload install folder + uses: actions/upload-artifact@v3 + with: + name: tilibs_linux_static${{ matrix.statictype }}_${{ github.sha }} + path: ${{ github.workspace }}/tilibs_linux_static${{ matrix.statictype }}_${{ github.sha }}/ diff --git a/.github/workflows/build.mac.workflow.yml b/.github/workflows/build.mac.workflow.yml index f4baff0d..6af38def 100644 --- a/.github/workflows/build.mac.workflow.yml +++ b/.github/workflows/build.mac.workflow.yml @@ -54,3 +54,12 @@ jobs: run: | cd build cmake --build . --target install + + - name: Prepare install folder for upload + run: mv prefix tilibs_mac_static${{ matrix.statictype }}_${{ github.sha }} + + - name: Upload install folder + uses: actions/upload-artifact@v3 + with: + name: tilibs_mac_static${{ matrix.statictype }}_${{ github.sha }} + path: ${{ github.workspace }}/tilibs_mac_static${{ matrix.statictype }}_${{ github.sha }}/ diff --git a/.github/workflows/build.windows.workflow.yml b/.github/workflows/build.windows.workflow.yml index 2968bac8..b61590bd 100644 --- a/.github/workflows/build.windows.workflow.yml +++ b/.github/workflows/build.windows.workflow.yml @@ -45,6 +45,23 @@ jobs: cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' configurePreset: '${{ matrix.arch }}-${{ matrix.config }}' buildPreset: '${{ matrix.arch }}-${{ matrix.config }}' - configurePresetAdditionalArgs: "['-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/prefix']" env: VCPKG_FORCE_SYSTEM_BINARIES: 1 + CMAKE_INSTALL_PREFIX_OVERRIDE: '${{ github.workspace }}/prefix' + + - name: Install tilibs + uses: lukka/run-cmake@d8897e1de33ed2ec4628ec5acf69861da7c719db # latest as of 2023-01-13 + with: + cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' + buildPreset: '${{ matrix.arch }}-${{ matrix.config }}' + buildPresetAdditionalArgs: "['--target install']" + + - name: Prepare install folder for upload + shell: cmd + run: rename prefix tilibs_windows_${{ github.sha }} + + - name: Upload install folder + uses: actions/upload-artifact@v3 + with: + name: tilibs_windows_${{ github.sha }} + path: tilibs_windows_${{ github.sha }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 3577f249..e8d49cc7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,17 @@ project(tilibs C CXX) # - WISH: provide Find* CMake modules for the libs themselves? # +# In case there was an env-var override... +if(DEFINED ENV{CMAKE_INSTALL_PREFIX_OVERRIDE}) + set(CMAKE_INSTALL_PREFIX "$ENV{CMAKE_INSTALL_PREFIX_OVERRIDE}") +endif() +# Be sure to have the expected install prefix format +if(CMAKE_INSTALL_PREFIX) + file(TO_CMAKE_PATH "${CMAKE_INSTALL_PREFIX}" CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "CMAKE_INSTALL_PREFIX" FORCE) + message("CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}") +endif() + # Our modules list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/.cmake) file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/.cmake/*.cmake")