Skip to content

Commit

Permalink
chore: merge pull request #34 from threeal/cpm-package-lock
Browse files Browse the repository at this point in the history
Implement Package Lock for CPM
  • Loading branch information
threeal committed Sep 21, 2023
2 parents f4b76a0 + ea5be50 commit 08d2989
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .cmake-format
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
{
"additional_commands": {
"cpmdeclarepackage": {
"kwargs": {
"VERSION": 1,
"GITHUB_REPOSITORY": 1,
"SYSTEM": 1,
"EXCLUDE_FROM_ALL": 1
}
}
},
"enable_markup": false,
"line_width": 120
}
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ target_include_directories(example PUBLIC include)

if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
include(cmake/CPM.cmake)
cpmaddpackage("gh:TheLartians/Format.cmake@1.7.3")
cpmusepackagelock(package-lock.cmake)
cpmgetpackage(Format.cmake)

if(BUILD_TESTING)
enable_testing()

cpmaddpackage("gh:catchorg/Catch2@3.4.0")
cpmgetpackage(Catch2)
include("${Catch2_SOURCE_DIR}/extras/Catch.cmake")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -fPIC -O0")
Expand Down
17 changes: 17 additions & 0 deletions package-lock.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# CPM Package Lock
# This file should be committed to version control

# Format.cmake
cpmdeclarepackage(
Format.cmake
VERSION 1.7.3
GITHUB_REPOSITORY TheLartians/Format.cmake
SYSTEM YES
EXCLUDE_FROM_ALL YES)
# Catch2
cpmdeclarepackage(
Catch2
VERSION 3.4.0
GITHUB_REPOSITORY catchorg/Catch2
SYSTEM YES
EXCLUDE_FROM_ALL YES)

0 comments on commit 08d2989

Please sign in to comment.