-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
33 lines (27 loc) · 996 Bytes
/
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
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
PROJECT(kvsafe VERSION 0.1.0)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
SET(CMAKE_VERBOSE_MAKEFILE ON)
ADD_DEFINITIONS(-pipe -Wall -Wextra -Werror)
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
ADD_DEFINITIONS(-O0)
ADD_DEFINITIONS(-ggdb)
ENDIF()
# Find libxo
FIND_PATH(LIBXO_PREFIX include/libxo/xo.h REQUIRED)
FIND_LIBRARY(LIBXO_LIBRARY xo REQUIRED)
INCLUDE_DIRECTORIES(${LIBXO_PREFIX}/include)
LIST(APPEND LIBS ${LIBXO_LIBRARY})
# Find nacl
FIND_PATH(NACL_PREFIX include/crypto_stream.h REQUIRED)
IF(${NACL_PREFIX} STREQUAL "NACL_PREFIX-NOTFOUND")
MESSAGE(FATAL_ERROR "Cannot find NaCL includes")
ENDIF()
FIND_LIBRARY(NACL_LIBRARY nacl REQUIRED)
INCLUDE_DIRECTORIES(${NACL_PREFIX}/include)
LIST(APPEND LIBS ${NACL_LIBRARY})
# Build kvsafe executable
FILE(GLOB SRCS ${CMAKE_SOURCE_DIR}/src/*.cpp)
ADD_EXECUTABLE(kvsafe ${SRCS})
TARGET_INCLUDE_DIRECTORIES(kvsafe PRIVATE ${CMAKE_SOURCE_DIR}/src)
TARGET_LINK_LIBRARIES(kvsafe util ${LIBS})