Add CPM_SOURCE_CACHE environmental variable support and keep existing sources (#83)

* read CPM_SOURCE_CACHE from environment

* update readme

* cleanup

* add cache tests
This commit is contained in:
Lars Melchior
2019-10-10 20:13:10 +02:00
committed by GitHub
parent b1855e9275
commit 4064a45552
28 changed files with 300 additions and 58 deletions

View File

@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(CPMExampleBenchmark)
# ---- Dependencies ----
include(../../cmake/CPM.cmake)

View File

@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(CPMExampleBoost)
# ---- Create binary ----
add_executable(CPMExampleBoost main.cpp)

View File

@@ -22,7 +22,7 @@ for example in examples:
print("running example %s" % example.name)
print("================" + ('=' * len(example.name)))
project = Path(".") / 'build' / example.name
configure = runCommand('cmake -H%s -B%s -DCMAKE_BUILD_TYPE=RelWithDebInfo' % (example, project))
configure = runCommand('cmake -H%s -B%s' % (example, project))
print(' ' + '\n '.join([line for line in configure.split('\n') if 'CPM:' in line]))
build = runCommand('cmake --build %s -j4' % (project))
print(' ' + '\n '.join([line for line in build.split('\n') if 'Built target' in line]))

View File

@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(CPMExampleCatch2)
# ---- Options ----
option(ENABLE_TEST_COVERAGE "Enable test coverage" OFF)

View File

@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(CPMExampleCXXOpts)
# ---- Options ----
option(ENABLE_TEST_COVERAGE "Enable test coverage" OFF)

View File

@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(CPMExampleDoctest)
# ---- Options ----
option(ENABLE_TEST_COVERAGE "Enable test coverage" OFF)

View File

@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(CPMEnTTExample)
# ---- Dependencies ----
include(../../cmake/CPM.cmake)

View File

@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(CPMJSONExample)
# ---- Dependencies ----
include(../../cmake/CPM.cmake)

View File

@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(CPMlinenoiseExample)
# ---- Dependencies ----
include(../../cmake/CPM.cmake)

View File

@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(CPMParserLuaExample)
include(../../cmake/CPM.cmake)
# ---- Dependencies ----

View File

@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(CPMParserExample)
# add dependencies
include(../../cmake/CPM.cmake)

View File

@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(CPMRangev3Example)
# ---- Dependencies ----
include(../../cmake/CPM.cmake)

View File

@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(CPMSimpleMatchExample)
# ---- Dependencies ----
include(../../cmake/CPM.cmake)

View File

@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(CPMSol2Example)
# ---- Dependencies ----
include(../../cmake/CPM.cmake)

View File

@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(CPMYamlExample)
# ---- Dependencies ----
include(../../cmake/CPM.cmake)
@@ -7,7 +9,7 @@ include(../../cmake/CPM.cmake)
CPMAddPackage(
NAME yaml-cpp
GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git
# 0.6.2 uses depricated CMake syntax
# 0.6.2 uses deprecated CMake syntax
VERSION 0.6.3
# 0.6.3 is not released yet, so use the most recent commit
GIT_TAG 012269756149ae99745b6dafefd415843d7420bb