-
Notifications
You must be signed in to change notification settings - Fork 11
/
CMakeLists.txt
74 lines (58 loc) · 1.96 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
cmake_minimum_required(VERSION 3.0.2)
project(execq DESCRIPTION "Threadpool-like implementation that supports task execution in queue-like and stream-like ways.")
if (NOT WIN32)
add_compile_options(-std=c++11)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_compile_options(-stdlib=libc++)
endif()
endif()
if (APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9")
endif()
OPTION(EXECQ_TESTING_ENABLE "Build execq's unit-tests." OFF)
### execq library ###
set(LIB_SOURCES
include/execq/IExecutionStream.h
include/execq/IExecutionQueue.h
include/execq/execq.h
include/execq/internal/execq_private.h
include/execq/internal/ExecutionPool.h
include/execq/internal/ExecutionQueue.h
include/execq/internal/ExecutionStream.h
include/execq/internal/ThreadWorker.h
include/execq/internal/TaskProviderList.h
include/execq/internal/CancelTokenProvider.h
src/execq.cpp
src/ExecutionPool.cpp
src/ExecutionStream.cpp
src/ThreadWorker.cpp
src/TaskProviderList.cpp
src/CancelTokenProvider.cpp
)
add_library(execq STATIC ${LIB_SOURCES})
target_include_directories(execq PUBLIC
"include"
)
include_directories(execq PRIVATE
"include/execq"
"include/execq/internal"
)
### execq unit-tests ###
if (EXECQ_TESTING_ENABLE)
set(TEST_SOURCES
tests/ExecqTestUtil.h
tests/CancelTokenProviderTest.cpp
tests/ExecutionStreamTest.cpp
tests/ExecutionQueueTest.cpp
tests/TaskExecutionQueueTest.cpp
tests/TaskProviderListTest.cpp
)
add_executable(execq_tests ${TEST_SOURCES})
# setup 3rdParty
add_subdirectory(3rdParty/googletest)
set_target_properties(gmock PROPERTIES FOLDER 3rdParty)
set_target_properties(gmock_main PROPERTIES FOLDER 3rdParty)
set_target_properties(gtest PROPERTIES FOLDER 3rdParty)
set_target_properties(gtest_main PROPERTIES FOLDER 3rdParty)
target_link_libraries(execq_tests execq gtest gmock gmock_main)
endif()