Compare commits

...

1 Commits

Author SHA1 Message Date
Lars Melchior
9967fea35c add on-demand download script to release 2020-08-20 09:25:05 +02:00
2 changed files with 25 additions and 3 deletions

View File

@ -13,13 +13,16 @@ jobs:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: Set CPM version by tag - name: Set CPM version by tag
run: sed "s/0.27.2-development-version/${GITHUB_REF/refs\/tags\/v}/g" cmake/CPM.cmake > CPM.cmake run: |
mkdir dist
sed "s/0.27.2-development-version/${GITHUB_REF/refs\/tags\/v}/g" cmake/CPM.cmake > dist/CPM.cmake
sed "s/0.27.2-development-version/${GITHUB_REF/refs\/tags\/v}/g" cmake/get_cpm.cmake > dist/get_cpm.cmake
- name: Upload CPM.cmake to release - name: Upload CPM.cmake to release
uses: svenstaro/upload-release-action@v1-release uses: svenstaro/upload-release-action@v1-release
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
file: CPM.cmake
asset_name: CPM.cmake
tag: ${{ github.ref }} tag: ${{ github.ref }}
file: dist/*.cmake
file_glob: true
overwrite: true overwrite: true

19
cmake/get_cpm.cmake Normal file
View File

@ -0,0 +1,19 @@
set(CPM_DOWNLOAD_VERSION 0.27.2-development-version)
if(CPM_SOURCE_CACHE)
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
elseif(DEFINED ENV{CPM_SOURCE_CACHE})
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
else()
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
endif()
if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION}))
message(STATUS "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}")
file(DOWNLOAD
https://github.com/TheLartians/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
${CPM_DOWNLOAD_LOCATION}
)
endif()
include(${CPM_DOWNLOAD_LOCATION})