mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2025-11-23 12:48:05 -05:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
559b8a2d39 | ||
|
|
91ca848fec | ||
|
|
95c5426d25 | ||
|
|
cea81872cf |
21
.github/workflows/publish.yaml
vendored
Normal file
21
.github/workflows/publish.yaml
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
name: Publish
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Publish CPM.cmake
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- name: Upload CPM.cmake to release
|
||||||
|
uses: svenstaro/upload-release-action@v1-release
|
||||||
|
with:
|
||||||
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
file: cmake/CPM.cmake
|
||||||
|
asset_name: CPM.cmake
|
||||||
|
tag: ${{ github.ref }}
|
||||||
|
overwrite: true
|
||||||
@@ -36,6 +36,7 @@ CPMAddPackage(
|
|||||||
|
|
||||||
The origin may be specified by a `GIT_REPOSITORY`, but other sources, such as direct URLs, are [also supported](https://cmake.org/cmake/help/v3.11/module/ExternalProject.html#external-project-definition).
|
The origin may be specified by a `GIT_REPOSITORY`, but other sources, such as direct URLs, are [also supported](https://cmake.org/cmake/help/v3.11/module/ExternalProject.html#external-project-definition).
|
||||||
If `GIT_TAG` hasn't been explicitly specified it defaults to `v(VERSION)`, a common convention for git projects.
|
If `GIT_TAG` hasn't been explicitly specified it defaults to `v(VERSION)`, a common convention for git projects.
|
||||||
|
On the other hand, if `VERSION` hasn't been explicitly specified, CPM can automatically identify the version from the git tag in some common cases.
|
||||||
`GIT_TAG` can also be set to a specific commit or a branch name such as `master` to always download the most recent version.
|
`GIT_TAG` can also be set to a specific commit or a branch name such as `master` to always download the most recent version.
|
||||||
The optional argument `FIND_PACKAGE_ARGUMENTS` can be specified to a string of parameters that will be passed to `find_package` if enabled (see below).
|
The optional argument `FIND_PACKAGE_ARGUMENTS` can be specified to a string of parameters that will be passed to `find_package` if enabled (see below).
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ function(CPMAddPackage)
|
|||||||
OPTIONS
|
OPTIONS
|
||||||
)
|
)
|
||||||
|
|
||||||
cmake_parse_arguments(CPM_ARGS "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
cmake_parse_arguments(CPM_ARGS "" "${oneValueArgs}" "${multiValueArgs}" "${ARGN}")
|
||||||
|
|
||||||
if(CPM_USE_LOCAL_PACKAGES OR CPM_LOCAL_PACKAGES_ONLY)
|
if(CPM_USE_LOCAL_PACKAGES OR CPM_LOCAL_PACKAGES_ONLY)
|
||||||
cpm_find_package(${CPM_ARGS_NAME} "${CPM_ARGS_VERSION}" ${CPM_ARGS_FIND_PACKAGE_ARGUMENTS})
|
cpm_find_package(${CPM_ARGS_NAME} "${CPM_ARGS_VERSION}" ${CPM_ARGS_FIND_PACKAGE_ARGUMENTS})
|
||||||
|
|||||||
0
examples/build_all.py
Normal file → Executable file
0
examples/build_all.py
Normal file → Executable file
19
examples/fmt/CMakeLists.txt
Normal file
19
examples/fmt/CMakeLists.txt
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
|
||||||
|
|
||||||
|
project(CPMJSONExample)
|
||||||
|
|
||||||
|
# ---- Dependencies ----
|
||||||
|
|
||||||
|
include(../../cmake/CPM.cmake)
|
||||||
|
|
||||||
|
CPMAddPackage(
|
||||||
|
NAME fmt
|
||||||
|
GIT_TAG 6.1.2
|
||||||
|
GITHUB_REPOSITORY fmtlib/fmt
|
||||||
|
)
|
||||||
|
|
||||||
|
# ---- Executable ----
|
||||||
|
|
||||||
|
add_executable(CPMFmtExample "main.cpp")
|
||||||
|
set_target_properties(CPMFmtExample PROPERTIES CXX_STANDARD 17)
|
||||||
|
target_link_libraries(CPMFmtExample fmt)
|
||||||
6
examples/fmt/main.cpp
Normal file
6
examples/fmt/main.cpp
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#include <fmt/format.h>
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
fmt::print("Hello, {}!\n", "world");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user