1 cmake_minimum_required (VERSION 2.6 FATAL_ERROR)
2 cmake_policy (VERSION 2.6.0)
4 set(CMAKE_SKIP_RPATH FALSE)
5 set(CMAKE_SKIP_BUILD_RPATH FALSE)
8 set(ELLIPTICS_VERSION_ABI "2.17")
9 set(ELLIPTICS_VERSION_MINOR "0.1")
11 option(WITH_PYTHON "Build python bindings" ON)
12 option(WITH_COCAINE "Build with cocaine support" ON)
13 option(WITH_EXAMPLES "Build example applications" ON)
14 option(WITH_SMACK "Build ioserv with smack backend" ON)
16 set(ELLIPTICS_VERSION "${ELLIPTICS_VERSION_ABI}.${ELLIPTICS_VERSION_MINOR}")
18 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
19 include(CheckLargefile)
21 include(CheckSendfile)
23 include(TestBigEndian)
24 include(CheckProcStats)
27 create_stdint(${CMAKE_BINARY_DIR}/include/elliptics/typedefs.h)
28 include_directories(${CMAKE_BINARY_DIR}/include/)
34 add_definitions(-DCONFIG_ID_SIZE=${ID_SIZE})
37 test_big_endian(HAVE_BIG_ENDIAN)
39 add_definitions(-DBYTEORDER=4321)
40 add_definitions(-DWORDS_BIGENDIAN=1)
42 add_definitions(-DBYTEORDER=1234)
46 add_definitions(-W -Wall -Wextra -fstack-protector-all -fno-strict-aliasing -g)
51 set(CMAKE_THREAD_LIBS -pthread)
52 set(CMAKE_USE_PTHREADS ON)
53 set(CMAKE_EXE_LINKER_FLAGS -pthread -Wl,--as-needed)
56 set(CMAKE_THREAD_PREFER_PTHREAD ON)
57 find_package(Threads REQUIRED)
60 find_package(ZMQ REQUIRED)
61 include_directories(${ZMQ_INCLUDE_DIRS})
64 find_package(Cocaine REQUIRED)
65 include_directories(${COCAINE_INCLUDE_DIRS})
66 add_definitions(${COCAINE_CFLAGS})
70 find_package(Eblob REQUIRED)
71 include_directories(${EBLOB_INCLUDE_DIRS})
75 find_package(Smack REQUIRED)
76 include_directories(${SMACK_INCLUDE_DIRS})
79 # Collect all libraries together
80 set(ELLIPTICS_LIBRARIES
86 ${CMAKE_THREAD_LIBS_INIT}
91 add_subdirectory(cache)
92 add_subdirectory(library)
93 add_subdirectory(bindings)
95 add_subdirectory(example)
99 include/elliptics/core.h
100 include/elliptics/cppdef.h
101 include/elliptics/interface.h
102 include/elliptics/packet.h
103 include/elliptics/srw.h
104 ${CMAKE_BINARY_DIR}/include/elliptics/typedefs.h
105 DESTINATION include/elliptics/