1 cmake_minimum_required (VERSION 2.6 FATAL_ERROR)
2 cmake_policy (VERSION 2.6.0)
4 set(CMAKE_SKIP_RPATH OFF)
5 set(CMAKE_SKIP_BUILD_RPATH OFF)
6 set(CMAKE_SKIP_INSTALL_RPATH OFF)
7 set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
10 set(ELLIPTICS_VERSION_ABI "2.18")
11 set(ELLIPTICS_VERSION_MINOR "3.0")
13 option(WITH_PYTHON "Build python bindings" ON)
14 option(WITH_COCAINE "Build with cocaine support" ON)
15 option(WITH_EXAMPLES "Build example applications" ON)
16 option(WITH_SMACK "Build ioserv with smack backend" ON)
18 set(ELLIPTICS_VERSION "${ELLIPTICS_VERSION_ABI}.${ELLIPTICS_VERSION_MINOR}")
20 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
21 include(CheckLargefile)
23 include(CheckSendfile)
25 include(TestBigEndian)
26 include(CheckProcStats)
29 create_stdint(${CMAKE_BINARY_DIR}/include/elliptics/typedefs.h)
30 include_directories(${CMAKE_BINARY_DIR}/include/)
36 add_definitions(-DCONFIG_ID_SIZE=${ID_SIZE})
39 test_big_endian(HAVE_BIG_ENDIAN)
41 add_definitions(-DBYTEORDER=4321)
42 add_definitions(-DWORDS_BIGENDIAN=1)
44 add_definitions(-DBYTEORDER=1234)
48 add_definitions(-W -Wall -Wextra -fstack-protector-all -fno-strict-aliasing -g)
53 set(CMAKE_THREAD_LIBS -pthread)
54 set(CMAKE_USE_PTHREADS ON)
55 set(CMAKE_EXE_LINKER_FLAGS -pthread -Wl,--as-needed)
58 set(CMAKE_THREAD_PREFER_PTHREAD ON)
59 find_package(Threads REQUIRED)
62 find_package(ZMQ REQUIRED)
63 include_directories(${ZMQ_INCLUDE_DIRS})
66 find_package(Cocaine REQUIRED)
67 include_directories(${COCAINE_INCLUDE_DIRS})
68 add_definitions(${COCAINE_CFLAGS})
72 find_package(Eblob REQUIRED)
73 include_directories(${EBLOB_INCLUDE_DIRS})
77 find_package(Smack REQUIRED)
78 include_directories(${SMACK_INCLUDE_DIRS})
81 # Collect all libraries together
82 set(ELLIPTICS_LIBRARIES
88 ${CMAKE_THREAD_LIBS_INIT}
93 add_subdirectory(cache)
94 add_subdirectory(library)
95 add_subdirectory(bindings)
97 add_subdirectory(example)
101 include/elliptics/core.h
102 include/elliptics/cppdef.h
103 include/elliptics/interface.h
104 include/elliptics/packet.h
105 include/elliptics/srw.h
106 ${CMAKE_BINARY_DIR}/include/elliptics/typedefs.h
107 DESTINATION include/elliptics/