-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
38 lines (33 loc) · 1.31 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
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9)
PROJECT(subjson)
SET(SUBJSON_GTEST ${PROJECT_SOURCE_DIR}/contrib/gtest)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR})
if (COUCHBASE_SERVER_BUILD)
INCLUDE_DIRECTORIES(AFTER ${Platform_SOURCE_DIR}/include)
ADD_DEFINITIONS(-DCOUCHBASE_BUILD)
SET(EXTRA_LIBS platform)
else(COUCHBASE_SERVER_BUILD)
SET(EXTRA_LIBS "")
endif(COUCHBASE_SERVER_BUILD)
if((CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
AND NOT COUCHBASE_SERVER_BUILD)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -pedantic")
endif()
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
IF(WIN32)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
ELSE()
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
ENDIF()
SET(SUBJSON_SRC subdoc/match.cc subdoc/operations.cc subdoc/path.cc
subdoc/util.cc)
ADD_LIBRARY(subjson ${SUBJSON_SRC})
TARGET_LINK_LIBRARIES(subjson ${EXTRA_LIBS})
ADD_EXECUTABLE(bench bench.cc contrib/cliopts/cliopts.c)
TARGET_LINK_LIBRARIES(bench subjson)
IF(EXISTS ${SUBJSON_GTEST} OR EXISTS ${gtest_SOURCE_DIR})
ENABLE_TESTING()
ADD_SUBDIRECTORY(tests)
ENDIF(EXISTS ${SUBJSON_GTEST} OR EXISTS ${gtest_SOURCE_DIR})