Skip to content

Commit

Permalink
Merge pull request #14 from threeal/simplify-cpm-add-package
Browse files Browse the repository at this point in the history
Simplify CPM Add Package
  • Loading branch information
threeal authored Dec 21, 2022
2 parents a7b06e8 + 8c5da35 commit 6924616
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
cmake_minimum_required(VERSION 3.14)

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wshadow -Wnon-virtual-dtor -Wpedantic")

project(result)

include(Format)
include(cmake/CPM.cmake)
cpmaddpackage("gh:TheLartians/[email protected]")

add_library(result INTERFACE)
target_include_directories(result INTERFACE include)

if(BUILD_TESTING)
enable_testing()

find_package(Catch2 REQUIRED)

cpmaddpackage("gh:catchorg/Catch2@3.2.0")
include("${Catch2_SOURCE_DIR}/extras/Catch.cmake")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -fPIC -O0")

add_executable(result_test test/result_test.cpp test/result_or_test.cpp)
target_link_libraries(result_test PRIVATE result Catch2::Catch2WithMain)
catch_discover_tests(result_test)
Expand Down
8 changes: 0 additions & 8 deletions cmake/FindCatch2.cmake

This file was deleted.

2 changes: 0 additions & 2 deletions cmake/Format.cmake

This file was deleted.

0 comments on commit 6924616

Please sign in to comment.