Skip to content

Commit

Permalink
Use Catch2 from conan
Browse files Browse the repository at this point in the history
  • Loading branch information
pinkwah committed Dec 5, 2022
1 parent 74e5581 commit 091946e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 17,888 deletions.
16 changes: 9 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,20 @@ conan_cmake_run(
# Packages
REQUIRES
backward-cpp/1.6
catch2/2.13.9
fmt/8.0.1
# Options
OPTIONS
catch2:with_main=True
${conan_opts}
# Force cppstd to be the same as this CMakeLists.txt's
SETTINGS
compiler.cppstd=${CMAKE_CXX_STANDARD}
# Build from source if there are no pre-compiled binaries
BUILD
missing
# CMAKE_TARGETS gives us CMake 3 style CONAN_PKG:: dependencies
BASIC_SETUP
CMAKE_TARGETS)
GENERATORS
cmake_find_package)

# -----------------------------------------------------------------

Expand Down Expand Up @@ -235,11 +236,14 @@ if(MSVC)
add_definitions("/W3 /D_CRT_SECURE_NO_WARNINGS /wd4996")
endif()

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules "${CMAKE_CURRENT_BINARY_DIR}")
find_package(CXX11Features)

# -----------------------------------------------------------------

find_package(Backward REQUIRED)
find_package(fmt REQUIRED)

# create targets for (required and optional) dependencies to link to

find_package(OpenMP)
Expand Down Expand Up @@ -433,9 +437,7 @@ if(ERT_LINUX)
endif()

if(BUILD_TESTS)
set(CATCH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/Catch2)
add_library(Catch INTERFACE)
target_include_directories(Catch INTERFACE ${CATCH_INCLUDE_DIR})
find_package(Catch2 REQUIRED)
endif()

add_subdirectory(lib)
Expand Down
Loading

0 comments on commit 091946e

Please sign in to comment.