-
Notifications
You must be signed in to change notification settings - Fork 23
/
CMakeLists.txt
50 lines (41 loc) · 1.47 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 3.5)
project(rebase)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -O3 -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -O3 -std=c++14 -Wall")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
find_package(FLEX)
find_package(BISON)
find_package(glog)
find_package(gflags)
if (GLOG_FOUND)
include_directories(${GLOG_INCLUDE_DIR})
else()
set(GLOG_LIBRARIES "-lglog -lgflags")
endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
BISON_TARGET(Parser src/parse.y ${CMAKE_CURRENT_BINARY_DIR}/y.tab.cc COMPILE_FLAGS --defines=${CMAKE_CURRENT_BINARY_DIR}/y.tab.h)
FLEX_TARGET(Lexer src/scan.l ${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c)
ADD_FLEX_BISON_DEPENDENCY(Lexer Parser)
file(GLOB C_SOURCE_FILES
"src/*.h"
"src/*.c"
)
file(GLOB CPP_SOURCE_FILES
"src/*.h"
"src/*.cc"
)
set(SOURCE_FILES
${C_SOURCE_FILES}
${CPP_SOURCE_FILES}
${BISON_Parser_OUTPUTS}
${FLEX_Lexer_OUTPUTS}
)
add_executable(dbcreate ${SOURCE_FILES} "src/dbcreate.cpp")
add_executable(redbase ${SOURCE_FILES} "src/redbase.cpp")
add_executable(rm_test ${SOURCE_FILES} "src/rm_test.cpp")
add_executable(ix_test ${SOURCE_FILES} "src/ix_test.cpp")
target_link_libraries(dbcreate ${GLOG_LIBRARIES})
target_link_libraries(redbase ${GLOG_LIBRARIES})
target_link_libraries(rm_test ${GLOG_LIBRARIES})
target_link_libraries(ix_test ${GLOG_LIBRARIES})