-
Notifications
You must be signed in to change notification settings - Fork 47
/
CMakeLists.txt
59 lines (48 loc) · 1.51 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
cmake_minimum_required(VERSION 2.8.12)
project(L4 CXX)
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
message(FATAL_ERROR "Use provided solution file.")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(-std=c++14)
add_definitions(-DBOOST_TEST_DYN_LINK)
endif()
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost 1.45.0 COMPONENTS unit_test_framework REQUIRED)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/inc
${CMAKE_CURRENT_SOURCE_DIR}/inc/L4)
# Need to expand the followings for installation.
set(L4_HEADERS
inc/L4/Utils/MurmurHash3.h)
set(L4_SOURCES
src/EpochActionManager.cpp
src/MurmurHash3.cpp
src/PerfLogger.cpp)
add_library(L4
${L4_SOURCES}
${L4_HEADERS})
enable_testing()
add_executable(L4.UnitTests
Unittests/CacheHashTableTest.cpp
Unittests/EpochManagerTest.cpp
Unittests/HashTableManagerTest.cpp
Unittests/HashTableRecordTest.cpp
Unittests/HashTableServiceTest.cpp
Unittests/PerfInfoTest.cpp
Unittests/ReadWriteHashTableSerializerTest.cpp
Unittests/ReadWriteHashTableTest.cpp
Unittests/SettingAdapterTest.cpp
Unittests/Utils.cpp
Unittests/UtilsTest.cpp
Unittests/Main.cpp)
target_link_libraries(L4.UnitTests
L4
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
-lpthread)
#${CMAKE_THREAD_LIBS_INIT})
add_test(NAME L4UnitTests COMMAND L4.UnitTests)