-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
38 lines (27 loc) · 1.17 KB
/
CMakeLists.txt
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
31
32
33
34
35
36
37
38
cmake_minimum_required(VERSION 3.0)
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.12.26.tar.gz"
SHA1 "fb52c562bc5d8b48278cc2a84b0de682014adae5"
)
project(Algorithms)
hunter_add_package(GTest)
find_package(GTest CONFIG REQUIRED NO_CMAKE_BUILDS_PATH)
file(GLOB_RECURSE HEADERS "src/*.h")
file(GLOB_RECURSE SOURCES "src/*.cpp")
file(GLOB_RECURSE UNIT_TEST_HEADERS "test/unit/*.h")
file(GLOB_RECURSE UNIT_TEST_SOURCES "test/unit/*.cpp")
file(GLOB_RECURSE FUNC_TEST_HEADERS "test/functional/*.h")
file(GLOB_RECURSE FUNC_TEST_SOURCES "test/functional/*.cpp")
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "-std=gnu++0x -Wall")
endif(CMAKE_COMPILER_IS_GNUCXX)
include_directories(${CMAKE_SOURCE_DIR})
add_library(algorithms ${HEADERS} ${SOURCES})
add_executable(algorithms_unit ${UNIT_TEST_HEADERS} ${UNIT_TEST_SOURCES} )
target_link_libraries(algorithms_unit algorithms GTest::main)
add_executable(algorithms_functional ${FUNC_TEST_HEADERS} ${FUNC_TEST_SOURCES} )
target_link_libraries(algorithms_functional algorithms GTest::main)
enable_testing()
add_test(UnitTests algorithms_unit)
add_test(FunctionalTests algorithms_functional)