-
Notifications
You must be signed in to change notification settings - Fork 19
/
CMakeLists.txt
50 lines (38 loc) · 1.24 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
cmake_minimum_required(VERSION 2.6)
project(yodb CXX)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
endif()
set(CXX_FLAGS
-g
-Wall
-march=native
-rdynamic
-std=c++0x
)
string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CXX_FLAGS}")
set(CMAKE_CXX_COMPILER "g++")
set(CMAKE_CXX_FLAGS_DEBUG "-O2")
string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE)
message(STATUS "CXX_FLAGS = " ${CMAKE_CXX_FLAGS} " " ${CMAKE_CXX_FLAGS_${BUILD_TYPE}})
find_package(Boost REQUIRED)
find_package(GTest REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/include)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
file(GLOB_RECURSE SOURCE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/db/*.cc
${CMAKE_CURRENT_SOURCE_DIR}/sys/*.cc
${CMAKE_CURRENT_SOURCE_DIR}/fs/*.cc
${CMAKE_CURRENT_SOURCE_DIR}/util/*.cc
${CMAKE_CURRENT_SOURCE_DIR}/tree/*.cc
${CMAKE_CURRENT_SOURCE_DIR}/cache/*.cc
)
add_library(yodb ${SOURCE})
target_link_libraries(yodb pthread rt aio)
set_target_properties(yodb PROPERTIES OUTPUT_NAME yodb)
install(TARGETS yodb DESTINATION lib)
add_subdirectory(test)