Skip to content

Commit

Permalink
latest deps, remove unused ones
Browse files Browse the repository at this point in the history
  • Loading branch information
iboB committed Nov 24, 2023
1 parent 41b3acd commit c07cef1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
2 changes: 0 additions & 2 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
find_package(Threads REQUIRED)

macro(pb_example name)
set(tgt picobench-example-${name})
add_executable(${tgt} ${ARGN})
Expand Down
11 changes: 2 additions & 9 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)

include(./get_cpm.cmake)
CPMAddPackage(
NAME doctest-lib
VERSION 2.4.8a
GITHUB_REPOSITORY iboB/doctest-lib
)
CPMAddPackage(gh:iboB/icm@1.3.3)
find_package(Threads REQUIRED)
include(${icm_SOURCE_DIR}/icm_testing.cmake)
CPMAddPackage(gh:iboB/doctest-util@0.1.2)

macro(pb_test test)
icm_add_doctest_lib_test(${test} picobench ${ARGN} LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
add_doctest_lib_test(${test} picobench ${ARGN})
endmacro()

pb_test(basic basic.cpp)
Expand Down
20 changes: 16 additions & 4 deletions test/get_cpm.cmake
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
set(CPM_DOWNLOAD_VERSION 0.34.3)
set(CPM_DOWNLOAD_VERSION 0.38.1)

if(CPM_SOURCE_CACHE)
# Expand relative path. This is important if the provided path contains a tilde (~)
get_filename_component(CPM_SOURCE_CACHE ${CPM_SOURCE_CACHE} ABSOLUTE)
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}))
# Expand relative path. This is important if the provided path contains a tilde (~)
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)

function(download_cpm)
message(STATUS "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}")
file(DOWNLOAD
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
${CPM_DOWNLOAD_LOCATION}
)
endfunction()

if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION}))
download_cpm()
else()
# resume download if it previously failed
file(READ ${CPM_DOWNLOAD_LOCATION} check)
if("${check}" STREQUAL "")
download_cpm()
endif()
unset(check)
endif()

include(${CPM_DOWNLOAD_LOCATION})

0 comments on commit c07cef1

Please sign in to comment.