-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
48 lines (37 loc) · 1.14 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
39
40
41
42
43
44
45
46
47
48
project(curly)
cmake_minimum_required(VERSION 2.8)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(CodeCoverage)
set(CMAKE_CXX_FLAGS --std=c++11)
find_package(Boost COMPONENTS regex)
include_directories(${Boost_INCLUDE_DIRS})
set(src client.cpp
request.cpp
response.cpp
url.cpp
)
if (APPLE)
set(src ${src} event_darwin.cpp)
elseif (UNIX)
set(src ${src} event_linux.cpp)
endif()
add_library(urly SHARED
${src}
)
target_link_libraries(urly ${Boost_LIBRARIES})
add_executable(curly curly.cpp)
target_link_libraries(curly urly)
find_package(GTest)
if (GTEST_FOUND)
add_executable(test_curly tests.cpp)
include_directories(${GTEST_INCLUDE_DIRS})
target_link_libraries(test_curly urly ${GTEST_BOTH_LIBRARIES})
option(BUILD_COVERAGE "enable coverage build" OFF)
if(BUILD_COVERAGE)
set(COVERAGE_EXCLUDES boost/* c++/* "*/include/gtest/*")
setup_target_for_coverage(NAME curly_coverage
EXECUTABLE test_curly --gtest_output=xml
DEPENDENCIES urly)
append_coverage_compiler_flags()
endif()
endif()