mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2025-11-16 22:27:41 -05:00
Support CPM_SOURCE_CACHE on windows (#109)
* use semicolon as empty command and add test * remove platform specific test coverage * only run actions for pushes and prs into master (avoid duplication) * remove cache test as it's already part of the test suite * update version * test cache reuse
This commit is contained in:
@@ -2,10 +2,6 @@ cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
|
||||
|
||||
project(CPMExampleCatch2)
|
||||
|
||||
# ---- Options ----
|
||||
|
||||
option(ENABLE_TEST_COVERAGE "Enable test coverage" OFF)
|
||||
|
||||
# ---- Dependencies ----
|
||||
|
||||
include(../../cmake/CPM.cmake)
|
||||
@@ -26,16 +22,9 @@ CPMAddPackage(
|
||||
|
||||
add_executable(CPMExampleCatch2 main.cpp)
|
||||
target_link_libraries(CPMExampleCatch2 fibonacci Catch2)
|
||||
set_target_properties(CPMExampleCatch2 PROPERTIES CXX_STANDARD 17 COMPILE_FLAGS "-Wall -pedantic -Wextra -Werror")
|
||||
set_target_properties(CPMExampleCatch2 PROPERTIES CXX_STANDARD 17)
|
||||
|
||||
# ---- Enable testing ----
|
||||
|
||||
ENABLE_TESTING()
|
||||
ADD_TEST(CPMExampleCatch2 CPMExampleCatch2)
|
||||
|
||||
# ---- Add code coverage ----
|
||||
|
||||
if (${ENABLE_TEST_COVERAGE})
|
||||
set_target_properties(CPMExampleCatch2 PROPERTIES CXX_STANDARD 17 COMPILE_FLAGS "-O0 -g -fprofile-arcs -ftest-coverage --coverage")
|
||||
target_link_options(CPMExampleCatch2 PUBLIC "--coverage")
|
||||
endif()
|
||||
|
||||
@@ -2,10 +2,6 @@ cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
|
||||
|
||||
project(CPMExampleCXXOpts)
|
||||
|
||||
# ---- Options ----
|
||||
|
||||
option(ENABLE_TEST_COVERAGE "Enable test coverage" OFF)
|
||||
|
||||
# ---- Dependencies ----
|
||||
|
||||
include(../../cmake/CPM.cmake)
|
||||
@@ -23,4 +19,4 @@ CPMAddPackage(
|
||||
|
||||
add_executable(CPMExampleCXXOpts main.cpp)
|
||||
target_link_libraries(CPMExampleCXXOpts cxxopts)
|
||||
set_target_properties(CPMExampleCXXOpts PROPERTIES CXX_STANDARD 17 COMPILE_FLAGS "-Wall -pedantic -Wextra -Werror")
|
||||
set_target_properties(CPMExampleCXXOpts PROPERTIES CXX_STANDARD 17)
|
||||
|
||||
@@ -2,10 +2,6 @@ cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
|
||||
|
||||
project(CPMExampleDoctest)
|
||||
|
||||
# ---- Options ----
|
||||
|
||||
option(ENABLE_TEST_COVERAGE "Enable test coverage" OFF)
|
||||
|
||||
# ---- Dependencies ----
|
||||
|
||||
include(../../cmake/CPM.cmake)
|
||||
@@ -26,16 +22,9 @@ CPMAddPackage(
|
||||
|
||||
add_executable(CPMExampleDoctest main.cpp)
|
||||
target_link_libraries(CPMExampleDoctest fibonacci doctest)
|
||||
set_target_properties(CPMExampleDoctest PROPERTIES CXX_STANDARD 17 COMPILE_FLAGS "-Wall -pedantic -Wextra -Werror")
|
||||
set_target_properties(CPMExampleDoctest PROPERTIES CXX_STANDARD 17)
|
||||
|
||||
# ---- Enable testing ----
|
||||
|
||||
ENABLE_TESTING()
|
||||
ADD_TEST(CPMExampleDoctest CPMExampleDoctest)
|
||||
|
||||
# ---- Add code coverage ----
|
||||
|
||||
if (${ENABLE_TEST_COVERAGE})
|
||||
set_target_properties(CPMExampleDoctest PROPERTIES CXX_STANDARD 17 COMPILE_FLAGS "-O0 -g -fprofile-arcs -ftest-coverage --coverage")
|
||||
target_link_options(CPMExampleDoctest PUBLIC "--coverage")
|
||||
endif()
|
||||
|
||||
@@ -2,10 +2,6 @@ cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
|
||||
|
||||
project(CPMExampleGtest)
|
||||
|
||||
# ---- Options ----
|
||||
|
||||
option(ENABLE_TEST_COVERAGE "Enable test coverage" OFF)
|
||||
|
||||
# ---- Dependencies ----
|
||||
|
||||
include(../../cmake/CPM.cmake)
|
||||
@@ -36,10 +32,3 @@ set_target_properties(CPMExampleGtest PROPERTIES CXX_STANDARD 17)
|
||||
|
||||
enable_testing()
|
||||
add_test(CPMExampleGtest CPMExampleGtest)
|
||||
|
||||
# ---- Add code coverage ----
|
||||
|
||||
if (${ENABLE_TEST_COVERAGE})
|
||||
set_target_properties(CPMExampleGtest PROPERTIES CXX_STANDARD 17 COMPILE_FLAGS "-O0 -g -fprofile-arcs -ftest-coverage --coverage")
|
||||
target_link_options(CPMExampleGtest PUBLIC "--coverage")
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user