-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
72 lines (60 loc) · 2.58 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
cmake_minimum_required(VERSION 3.3)
project(monsoon_cache)
set(MONSOON_CACHE_VERSION_MAJOR 0 CACHE STRING "major version" FORCE)
set(MONSOON_CACHE_VERSION_MINOR 5 CACHE STRING "minor version" FORCE)
set(MONSOON_CACHE_VERSION ${MONSOON_CACHE_VERSION_MAJOR}.${MONSOON_CACHE_VERSION_MINOR} CACHE STRING "version" FORCE)
enable_testing()
find_package(instrumentation 1.0 REQUIRED)
include (CheckCXXCompilerFlag)
check_cxx_compiler_flag ("-std=c++17" STD_CXX17)
check_cxx_compiler_flag ("-std=c++1z" STD_CXX1Z)
if(STD_CXX17)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
elseif(STD_CXX1Z)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1z")
else()
message(WARNING "Cannot figure out how to enable C++17 on compiler.")
endif()
set(headers
include/monsoon/cache/access_expire_decorator.h
include/monsoon/cache/allocator.h
include/monsoon/cache/bucket.h
include/monsoon/cache/builder.h
include/monsoon/cache/cache.h
include/monsoon/cache/cache_impl.h
include/monsoon/cache/cache_query.h
include/monsoon/cache/create_handler.h
include/monsoon/cache/doc_.h
include/monsoon/cache/element.h
include/monsoon/cache/expire_queue.h
include/monsoon/cache/impl.h
include/monsoon/cache/key_decorator.h
include/monsoon/cache/max_age_decorator.h
include/monsoon/cache/max_size_decorator.h
include/monsoon/cache/mem_use.h
include/monsoon/cache/stats.h
include/monsoon/cache/storage_pointer_decorator.h
include/monsoon/cache/store_delete_lock.h
include/monsoon/cache/thread_safe_decorator.h
include/monsoon/cache/weaken_decorator.h
)
add_library(monsoon_cache INTERFACE)
target_link_libraries(monsoon_cache INTERFACE instrumentation)
find_package (Threads REQUIRED)
if(CMAKE_USE_PTHREADS_INIT)
target_link_libraries(monsoon_cache INTERFACE ${CMAKE_THREAD_LIBS_INIT})
endif()
target_include_directories(monsoon_cache INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
install(FILES ${headers} DESTINATION "include/monsoon/cache")
install(TARGETS monsoon_cache EXPORT monsoon_cache DESTINATION "lib")
install(EXPORT monsoon_cache DESTINATION "lib/cmake/monsoon_cache")
configure_file(monsoon_cache-config-version.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/monsoon_cache-config-version.cmake @ONLY)
install(FILES monsoon_cache-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/monsoon_cache-config-version.cmake DESTINATION "lib/cmake/monsoon_cache")
add_subdirectory(test)
find_package(Doxygen COMPONENTS mscgen OPTIONAL_COMPONENTS dot)
if(DOXYGEN_FOUND)
doxygen_add_docs(monsoon_cache-doc include)
endif()