Skip to content

Commit

Permalink
[WIP] Use CPM
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiler committed Oct 14, 2024
1 parent 31886fe commit 46ff9f5
Show file tree
Hide file tree
Showing 42 changed files with 361 additions and 3,197 deletions.
77 changes: 77 additions & 0 deletions .cmake-format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,83 @@ parse:
pargs: 1
kwargs:
CYCLIC_DEPENDING_INCLUDES: '+'
cpmaddpackage:
pargs:
nargs: '*'
flags: []
spelling: CPMAddPackage
kwargs: &cpmaddpackagekwargs
NAME: 1
FORCE: 1
VERSION: 1
GIT_TAG: 1
DOWNLOAD_ONLY: 1
GITHUB_REPOSITORY: 1
GITLAB_REPOSITORY: 1
GIT_REPOSITORY: 1
SVN_REPOSITORY: 1
SVN_REVISION: 1
SOURCE_DIR: 1
DOWNLOAD_COMMAND: 1
FIND_PACKAGE_ARGUMENTS: 1
NO_CACHE: 1
GIT_SHALLOW: 1
URL: 1
URL_HASH: 1
URL_MD5: 1
DOWNLOAD_NAME: 1
DOWNLOAD_NO_EXTRACT: 1
HTTP_USERNAME: 1
HTTP_PASSWORD: 1
EXCLUDE_FROM_ALL: 1
SYSTEM: 1
SOURCE_SUBDIR: 1
QUIET: 1
PATCHES: +
OPTIONS: +
cpmfindpackage:
pargs:
nargs: '*'
flags: []
spelling: CPMFindPackage
kwargs: *cpmaddpackagekwargs
cpmdeclarepackage:
pargs:
nargs: '*'
flags: []
spelling: CPMDeclarePackage
kwargs: *cpmaddpackagekwargs
packageproject:
pargs:
nargs: '*'
flags: []
spelling: packageProject
kwargs:
NAME: 1
VERSION: 1
NAMESPACE: 1
INCLUDE_DIR: 1
INCLUDE_DESTINATION: 1
INCLUDE_HEADER_PATTERN: 1
BINARY_DIR: 1
COMPATIBILITY: 1
VERSION_HEADER: 1
EXPORT_HEADER: 1
DISABLE_VERSION_SUFFIX: 1
CPACK: 1
DEPENDENCIES: +
cpmgetpackage:
pargs: 1
spelling: CPMGetPackage
cpmusepackagelock:
pargs: 1
spelling: CPMUsePackageLock
cpmregisterpackage:
pargs: 1
spelling: CPMRegisterPackage
cpmgetpackageversion:
pargs: 2
spelling: CPMGetPackageVersion
_help_override_spec:
- Override configurations per-command where available
override_spec: {}
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/ci_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Checkout SeqAn2
uses: actions/checkout@v4
with:
repository: seqan/seqan
path: submodules/seqan

- name: Configure tests
run: |
Expand All @@ -68,7 +60,7 @@ jobs:
-DCMAKE_DEPENDS_USE_COMPILER="${{ matrix.cmake_depends_use_compiler }}" \
-DSEQAN3_USE_INCLUDE_DEPENDENCIES="${{ matrix.use_include_dependencies }}"
case "${{ matrix.build }}" in
unit) make gtest_build;;
unit) make gtest_main;;
external_project) make seqan3_test_prerequisite sharg_test_prerequisite;;
esac
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/ci_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Checkout SeqAn2
uses: actions/checkout@v4
with:
repository: seqan/seqan
path: submodules/seqan

- name: Load ccache
uses: actions/cache@v4
with:
Expand All @@ -68,7 +61,7 @@ jobs:
run: |
mkdir build && cd build
cmake ../test/coverage -DCMAKE_BUILD_TYPE=Coverage
make gtest_build
make gtest_main
- name: Build tests
working-directory: build
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Checkout SeqAn2
uses: actions/checkout@v4
with:
repository: seqan/seqan
path: submodules/seqan

- name: Load ccache
uses: actions/cache@v4
Expand All @@ -66,10 +58,11 @@ jobs:
- name: Configure tests
run: |
$CXX --version || true
cmake --version || true
mkdir build && cd build
cmake ../test/unit -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}"
make gtest_build
make gtest_main
- name: Build tests
working-directory: build
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Checkout SeqAn2
uses: actions/checkout@v4
with:
repository: seqan/seqan
path: submodules/seqan

- name: Setup toolchain
uses: seqan/actions/setup-toolchain@main
Expand All @@ -56,7 +48,7 @@ jobs:
run: |
mkdir build && cd build
cmake ../test/unit -DCMAKE_BUILD_TYPE=Release
make gtest_build
make gtest_main
- name: Build tests
working-directory: build
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/ci_misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Checkout SeqAn2
uses: actions/checkout@v4
with:
repository: seqan/seqan
path: submodules/seqan

- name: Load ccache
uses: actions/cache@v4
Expand All @@ -71,9 +63,9 @@ jobs:
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" \
-DSEQAN3_BENCHMARK_MIN_TIME=0.01
case "${{ matrix.build }}" in
snippet) make gtest_build;;
performance) make gbenchmark_build;;
header) make gtest_build gbenchmark_build;;
snippet) make gtest_main;;
performance) make benchmark_main;;
header) make gtest_main benchmark_main;;
esac
- name: Build tests
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/cron_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Checkout SeqAn2
uses: actions/checkout@v4
with:
repository: seqan/seqan
path: submodules/seqan

- name: Configure tests
run: |
Expand Down
17 changes: 5 additions & 12 deletions .github/workflows/cron_avx2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@ jobs:
uses: actions/checkout@v4
with:
path: seqan3
submodules: true

- name: Checkout SeqAn2
uses: actions/checkout@v4
with:
repository: seqan/seqan
path: seqan3/submodules/seqan

- name: Setup compiler
uses: seqan/actions/setup-compiler@main
Expand All @@ -67,16 +60,16 @@ jobs:
-DSEQAN3_BENCHMARK_MIN_TIME=0.01 \
-DCMAKE_CXX_FLAGS="-mavx2"
case "${{ matrix.build }}" in
unit) make -j2 gtest_build;;
snippet) make -j2 gtest_build;;
performance) make -j2 gbenchmark_build;;
header) make -j2 gtest_build gbenchmark_build;;
unit) make gtest_main;;
snippet) make gtest_main;;
performance) make benchmark_main;;
header) make gtest_main benchmark_main;;
esac
- name: Build tests
run: |
cd seqan3-build
make -k -j2 2>&1 | tee build.log
make -k 2>&1 | tee build.log
- name: Setup Python
if: ${{ failure() }}
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/cron_latest_libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
name: Latest Libraries

on:
# Will always run on the default branch
schedule:
- cron: "0 4 * * SUN"
# Enables a manual trigger, may run on any branch
workflow_dispatch:

Expand Down Expand Up @@ -90,16 +87,16 @@ jobs:
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" \
-DSEQAN3_BENCHMARK_MIN_TIME=0.01
case "${{ matrix.build }}" in
unit) make -j2 gtest_build;;
snippet) make -j2 gtest_build;;
performance) make -j2 gbenchmark_build;;
header) make -j2 gtest_build gbenchmark_build;;
unit) make gtest_main;;
snippet) make gtest_main;;
performance) make benchmark_main;;
header) make gtest_main benchmark_main;;
esac
- name: Build tests
run: |
cd seqan3-build
make -k -j2 2>&1 | tee build.log
make -k 2>&1 | tee build.log
- name: Setup Python
if: ${{ failure() }}
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/ram_usage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@ jobs:
uses: actions/checkout@v4
with:
path: seqan3
submodules: true

- name: Checkout SeqAn2
uses: actions/checkout@v4
with:
repository: seqan/seqan
path: seqan3/submodules/seqan
fetch-depth: 1

- name: Setup compiler
uses: seqan/actions/setup-compiler@main
Expand Down
9 changes: 0 additions & 9 deletions .gitmodules

This file was deleted.

22 changes: 22 additions & 0 deletions build_system/CPM.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# SPDX-License-Identifier: MIT
#
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors

set (CPM_DOWNLOAD_VERSION 0.40.2)
set (CPM_HASH_SUM "c8cdc32c03816538ce22781ed72964dc864b2a34a310d3b7104812a5ca2d835d")

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 ()

# Expand relative path. This is important if the provided path contains a tilde (~)
get_filename_component (CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)

file (DOWNLOAD https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM})

include (${CPM_DOWNLOAD_LOCATION})
15 changes: 15 additions & 0 deletions build_system/cpack_install.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# SPDX-FileCopyrightText: 2006-2024, Knut Reinert & Freie Universität Berlin
# SPDX-FileCopyrightText: 2016-2024, Knut Reinert & MPI für molekulare Genetik
# SPDX-License-Identifier: BSD-3-Clause

# Only if creating the source package (`make package_source`):
# Copy dependency include directories into package's staging folder
if (CPACK_SOURCE_INSTALLED_DIRECTORIES)
file (COPY "@SEQAN3_SDSL_INCLUDE_DIR@/" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/include/seqan3/vendor")
file (COPY "@SEQAN3_CEREAL_INCLUDE_DIR@/" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/include/seqan3/vendor")
configure_file ("@CPM_DOWNLOAD_LOCATION@" "${CMAKE_CURRENT_BINARY_DIR}/build_system/CPM.cmake" COPYONLY)
if ("@use_ccache_ADDED@" STREQUAL "YES")
configure_file ("@use_ccache_SOURCE_DIR@/ccache/CMakeLists.txt"
"${CMAKE_CURRENT_BINARY_DIR}/test/cmake/seqan3_require_ccache.cmake" COPYONLY)
endif ()
endif ()
Loading

0 comments on commit 46ff9f5

Please sign in to comment.