mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2025-11-22 04:07:49 -05:00
reorganise source and add CPMFindPackage (#92)
* reorganise source and add CPMFindPackage * add consistent find_package behaviour * document CPMFindPackage * reset examples to CPMAddPackage unless tested * update version * update README.md * Update README.md
This commit is contained in:
11
test/unit/cache/CMakeLists.txt.in
vendored
11
test/unit/cache/CMakeLists.txt.in
vendored
@@ -13,18 +13,11 @@ include(@CPM_PATH@/CPM.cmake)
|
||||
CPMAddPackage(
|
||||
NAME fibonacci
|
||||
GIT_REPOSITORY https://github.com/TheLartians/Fibonacci.git
|
||||
VERSION 1.0
|
||||
)
|
||||
|
||||
CPMAddPackage(
|
||||
NAME Catch2
|
||||
GITHUB_REPOSITORY catchorg/Catch2
|
||||
VERSION @CATCH2_VERSION@
|
||||
GIT_SHALLOW YES
|
||||
VERSION @FIBONACCI_VERSION@
|
||||
)
|
||||
|
||||
# ---- Create binary ----
|
||||
|
||||
add_executable(CPMExampleCatch2 main.cpp)
|
||||
target_link_libraries(CPMExampleCatch2 fibonacci Catch2)
|
||||
target_link_libraries(CPMExampleCatch2 fibonacci)
|
||||
set_target_properties(CPMExampleCatch2 PROPERTIES CXX_STANDARD 17 COMPILE_FLAGS "-Wall -pedantic -Wextra -Werror")
|
||||
|
||||
12
test/unit/cache/main.cpp
vendored
12
test/unit/cache/main.cpp
vendored
@@ -1,13 +1,9 @@
|
||||
#define CATCH_CONFIG_MAIN
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <fibonacci.h>
|
||||
#include <iostream>
|
||||
|
||||
TEST_CASE("fibonnacci"){
|
||||
REQUIRE(fibonnacci(0) == 0);
|
||||
REQUIRE(fibonnacci(1) == 1);
|
||||
REQUIRE(fibonnacci(2) == 1);
|
||||
REQUIRE(fibonnacci(3) == 2);
|
||||
REQUIRE(fibonnacci(4) == 3);
|
||||
REQUIRE(fibonnacci(5) == 5);
|
||||
int main(){
|
||||
std::cout << "fib(10) = " << fastFibonacci(10) << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user