mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2025-06-26 00:00:14 -04:00
Compare commits
1 Commits
master
...
v0.27.2-on
Author | SHA1 | Date | |
---|---|---|---|
|
9967fea35c |
9
.github/workflows/publish.yaml
vendored
9
.github/workflows/publish.yaml
vendored
@ -13,13 +13,16 @@ jobs:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- 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
|
||||
uses: svenstaro/upload-release-action@v1-release
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: CPM.cmake
|
||||
asset_name: CPM.cmake
|
||||
tag: ${{ github.ref }}
|
||||
file: dist/*.cmake
|
||||
file_glob: true
|
||||
overwrite: true
|
||||
|
19
cmake/get_cpm.cmake
Normal file
19
cmake/get_cpm.cmake
Normal 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})
|
Loading…
x
Reference in New Issue
Block a user