-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
30 lines (22 loc) · 865 Bytes
/
CMakeLists.txt
File metadata and controls
30 lines (22 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
cmake_minimum_required(VERSION 3.8)
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.19.123.tar.gz"
SHA1 "57d07480686f82ddc916a5980b4f2a18e5954c2b"
)
project(vector)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
option(BUILD_TESTS "Build tests" OFF)
option(BUILD_EXAMPLES "Build Examples" OFF)
add_library(${PROJECT_NAME} "${PROJECT_SOURCE_DIR}/sources/vector.cpp")
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/)
if(BUILD_TESTS)
hunter_add_package(Catch)
find_package(Catch CONFIG REQUIRED)
enable_testing()
file(GLOB ${PROJECT_NAME}_TEST_SOURCES tests/*.cpp)
add_executable(tests ${${PROJECT_NAME}_TEST_SOURCES})
target_link_libraries(tests ${PROJECT_NAME} Catch::Catch )
add_test(NAME test_name COMMAND tests "-s" "-r" "compact" "--use-colour" "yes")
endif()