Skip to content

Commit d306290

Browse files
authored
Merge pull request #260 from eseiler/infra/cpm
[INFRA] Use CPM
2 parents 2ebe212 + ca4680e commit d306290

35 files changed

+318
-3307
lines changed

.cmake-format.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,83 @@ parse:
4141
pargs: 1
4242
kwargs:
4343
CYCLIC_DEPENDING_INCLUDES: '+'
44+
cpmaddpackage:
45+
pargs:
46+
nargs: '*'
47+
flags: []
48+
spelling: CPMAddPackage
49+
kwargs: &cpmaddpackagekwargs
50+
NAME: 1
51+
FORCE: 1
52+
VERSION: 1
53+
GIT_TAG: 1
54+
DOWNLOAD_ONLY: 1
55+
GITHUB_REPOSITORY: 1
56+
GITLAB_REPOSITORY: 1
57+
GIT_REPOSITORY: 1
58+
SVN_REPOSITORY: 1
59+
SVN_REVISION: 1
60+
SOURCE_DIR: 1
61+
DOWNLOAD_COMMAND: 1
62+
FIND_PACKAGE_ARGUMENTS: 1
63+
NO_CACHE: 1
64+
GIT_SHALLOW: 1
65+
URL: 1
66+
URL_HASH: 1
67+
URL_MD5: 1
68+
DOWNLOAD_NAME: 1
69+
DOWNLOAD_NO_EXTRACT: 1
70+
HTTP_USERNAME: 1
71+
HTTP_PASSWORD: 1
72+
EXCLUDE_FROM_ALL: 1
73+
SYSTEM: 1
74+
SOURCE_SUBDIR: 1
75+
QUIET: 1
76+
PATCHES: +
77+
OPTIONS: +
78+
cpmfindpackage:
79+
pargs:
80+
nargs: '*'
81+
flags: []
82+
spelling: CPMFindPackage
83+
kwargs: *cpmaddpackagekwargs
84+
cpmdeclarepackage:
85+
pargs:
86+
nargs: '*'
87+
flags: []
88+
spelling: CPMDeclarePackage
89+
kwargs: *cpmaddpackagekwargs
90+
packageproject:
91+
pargs:
92+
nargs: '*'
93+
flags: []
94+
spelling: packageProject
95+
kwargs:
96+
NAME: 1
97+
VERSION: 1
98+
NAMESPACE: 1
99+
INCLUDE_DIR: 1
100+
INCLUDE_DESTINATION: 1
101+
INCLUDE_HEADER_PATTERN: 1
102+
BINARY_DIR: 1
103+
COMPATIBILITY: 1
104+
VERSION_HEADER: 1
105+
EXPORT_HEADER: 1
106+
DISABLE_VERSION_SUFFIX: 1
107+
CPACK: 1
108+
DEPENDENCIES: +
109+
cpmgetpackage:
110+
pargs: 1
111+
spelling: CPMGetPackage
112+
cpmusepackagelock:
113+
pargs: 1
114+
spelling: CPMUsePackageLock
115+
cpmregisterpackage:
116+
pargs: 1
117+
spelling: CPMRegisterPackage
118+
cpmgetpackageversion:
119+
pargs: 2
120+
spelling: CPMGetPackageVersion
44121
_help_override_spec:
45122
- Override configurations per-command where available
46123
override_spec: {}

.github/workflows/ci_coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
run: |
6262
mkdir build && cd build
6363
cmake ../test/coverage -DCMAKE_BUILD_TYPE=Coverage
64-
make gtest_build yaml-cpp
64+
make gtest_main yaml-cpp
6565
6666
- name: Build tests
6767
working-directory: build

.github/workflows/ci_cpm.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
2+
# SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
name: Update CPM
6+
7+
on:
8+
schedule:
9+
- cron: "0 12 * * SAT"
10+
workflow_dispatch:
11+
12+
env:
13+
TZ: Europe/Berlin
14+
15+
concurrency:
16+
group: update-cpm-actions
17+
cancel-in-progress: true
18+
19+
jobs:
20+
update_cpm:
21+
name: Update CPM
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 15
24+
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch'
25+
steps:
26+
- name: Run update CPM
27+
uses: seqan/actions/update_cpm_package_lock@main
28+
with:
29+
token: ${{ secrets.SEQAN_ACTIONS_PAT }}
30+
gpg_key: ${{ secrets.SEQAN_ACTIONS_GPG_KEY }}
31+
gpg_passphrase: ${{ secrets.SEQAN_ACTIONS_GPG_PASSPHRASE }}
32+
package_lock_file: cmake/package-lock.cmake

.github/workflows/ci_linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
mkdir build && cd build
6464
cmake ../test/unit -DCMAKE_BUILD_TYPE=Release \
6565
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}"
66-
make gtest_build yaml-cpp
66+
make gtest_main yaml-cpp
6767
6868
- name: Build tests
6969
working-directory: build

.github/workflows/ci_misc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
mkdir build && cd build
6363
cmake ../test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=Release \
6464
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}"
65-
make gtest_build yaml-cpp
65+
make gtest_main yaml-cpp
6666
6767
- name: Build tests
6868
working-directory: build

.gitmodules

Lines changed: 0 additions & 7 deletions
This file was deleted.

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
cmake_minimum_required (VERSION 3.12)
1010

11-
find_path (SHARG_MODULE_PATH "sharg-config.cmake" HINTS "${CMAKE_CURRENT_LIST_DIR}/build_system/")
11+
find_path (SHARG_MODULE_PATH "sharg-config.cmake" HINTS "${CMAKE_CURRENT_LIST_DIR}/cmake/")
1212
list (APPEND CMAKE_MODULE_PATH "${SHARG_MODULE_PATH}")
1313

1414
include (sharg-config-version)

build_system/sharg-package.cmake

Lines changed: 0 additions & 24 deletions
This file was deleted.

cmake/CPM.cmake

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# SPDX-License-Identifier: MIT
2+
#
3+
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors
4+
5+
set (CPM_DOWNLOAD_VERSION 0.40.2)
6+
set (CPM_HASH_SUM "c8cdc32c03816538ce22781ed72964dc864b2a34a310d3b7104812a5ca2d835d")
7+
8+
if (CPM_SOURCE_CACHE)
9+
set (CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
10+
elseif (DEFINED ENV{CPM_SOURCE_CACHE})
11+
set (CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
12+
else ()
13+
set (CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
14+
endif ()
15+
16+
# Expand relative path. This is important if the provided path contains a tilde (~)
17+
get_filename_component (CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)
18+
19+
file (DOWNLOAD https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
20+
${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM})
21+
22+
include (${CPM_DOWNLOAD_LOCATION})

cmake/cpack_install.cmake.in

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# SPDX-FileCopyrightText: 2006-2024, Knut Reinert & Freie Universität Berlin
2+
# SPDX-FileCopyrightText: 2016-2024, Knut Reinert & MPI für molekulare Genetik
3+
# SPDX-License-Identifier: BSD-3-Clause
4+
5+
# Only if creating the source package (`make package_source`):
6+
# Copy dependency include directories into package's staging folder
7+
if (CPACK_SOURCE_INSTALLED_DIRECTORIES)
8+
configure_file ("@CPM_DOWNLOAD_LOCATION@" "${CMAKE_CURRENT_BINARY_DIR}/cmake/CPM.cmake" COPYONLY)
9+
if ("@use_ccache_ADDED@" STREQUAL "YES")
10+
configure_file ("@use_ccache_SOURCE_DIR@/ccache/CMakeLists.txt"
11+
"${CMAKE_CURRENT_BINARY_DIR}/test/cmake/sharg_require_ccache.cmake" COPYONLY)
12+
endif ()
13+
endif ()

0 commit comments

Comments
 (0)