mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2025-11-18 07:07:47 -05:00
* create FindXXX.cmake modules for added CPM packages * don't use list(PREPEND) as it unsupported on older CMake versions * use CMAKE_BINARY_DIR * ensure CPM.cmake is initialized only once * import CPM.cmake in modules
27 lines
560 B
CMake
27 lines
560 B
CMake
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
|
|
|
|
project(CPMExampleCatch2)
|
|
|
|
# ---- Options ----
|
|
|
|
option(ENABLE_TEST_COVERAGE "Enable test coverage" OFF)
|
|
|
|
# ---- Dependencies ----
|
|
|
|
include(@CPM_PATH@/CPM.cmake)
|
|
|
|
CPMAddPackage(
|
|
NAME @TEST_DEPENDENCY_NAME@
|
|
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/dependency
|
|
)
|
|
|
|
# ---- check if generated modules override find_package ----
|
|
|
|
if (@test_check_find_package@)
|
|
find_package(@TEST_DEPENDENCY_NAME@ REQUIRED)
|
|
endif()
|
|
|
|
# ---- Call dependency method to validate correct addition of directory ----
|
|
|
|
dependency_function()
|