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 FILE (READ "${CMAKE_CURRENT_SOURCE_DIR}/debian/changelog" DEBCHANGELOG)
12 string(REGEX MATCH "([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)" DEBFULLVERSION "${DEBCHANGELOG}")
13 STRING (REGEX MATCH "([0-9]+\\.[0-9]+)" ELLIPTICS_VERSION_ABI "${DEBFULLVERSION}")
14 STRING (REGEX MATCH "([0-9]+\\.[0-9]+$)" ELLIPTICS_VERSION_MINOR "${DEBFULLVERSION}")
16 option(WITH_PYTHON "Build python bindings" ON)
17 option(WITH_COCAINE "Build with cocaine support" ON)
18 option(WITH_EXAMPLES "Build example applications" ON)
19 option(WITH_SMACK "Build ioserv with smack backend" ON)
20 option(WITH_LEVELDB "Build ioserv with LevelDB backend" ON)
22 set(ELLIPTICS_VERSION "${ELLIPTICS_VERSION_ABI}.${ELLIPTICS_VERSION_MINOR}")
24 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
25 include(CheckLargefile)
27 include(CheckSendfile)
29 include(TestBigEndian)
30 include(CheckProcStats)
33 create_stdint(${CMAKE_BINARY_DIR}/include/elliptics/typedefs.h)
34 include_directories(${CMAKE_BINARY_DIR}/include/)
40 add_definitions(-DCONFIG_ID_SIZE=${ID_SIZE})
43 test_big_endian(HAVE_BIG_ENDIAN)
45 add_definitions(-DBYTEORDER=4321)
46 add_definitions(-DWORDS_BIGENDIAN=1)
48 add_definitions(-DBYTEORDER=1234)
52 add_definitions(-W -Wall -Wextra -fstack-protector-all -fno-strict-aliasing -g)
57 set(CMAKE_THREAD_LIBS -pthread)
58 set(CMAKE_USE_PTHREADS ON)
59 set(CMAKE_EXE_LINKER_FLAGS -pthread -Wl,--as-needed)
62 set(CMAKE_THREAD_PREFER_PTHREAD ON)
63 find_package(Threads REQUIRED)
66 find_package(ZMQ REQUIRED)
67 include_directories(${ZMQ_INCLUDE_DIRS})
70 find_package(Cocaine REQUIRED)
71 include_directories(${COCAINE_INCLUDE_DIRS})
72 add_definitions(${COCAINE_CFLAGS})
76 find_package(Eblob REQUIRED)
77 include_directories(${EBLOB_INCLUDE_DIRS})
81 find_package(Smack REQUIRED)
82 include_directories(${SMACK_INCLUDE_DIRS})
87 find_package(LevelDB REQUIRED)
88 include_directories(${LEVELDB_INCLUDE_DIRS})
91 # GoLD does no overlinking
92 find_package(Boost REQUIRED COMPONENTS thread system)
93 message(STATUS "Boost information:")
94 message(STATUS " Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}")
95 message(STATUS " Boost_LIBRARY_DIRS: ${Boost_LIBRARY_DIRS}")
96 message(STATUS " Boost_LIBRARIES: ${Boost_LIBRARIES}")
97 include_directories(${Boost_INCLUDE_DIRS})
98 link_directories(${Boost_LIBRARY_DIRS})
100 # Collect all libraries together
101 set(ELLIPTICS_LIBRARIES
102 ${SENDFILE_LIBRARIES}
107 ${CMAKE_THREAD_LIBS_INIT}
111 add_subdirectory(srw)
112 add_subdirectory(cache)
113 add_subdirectory(library)
114 add_subdirectory(bindings)
116 add_subdirectory(example)
120 include/elliptics/core.h
121 include/elliptics/cppdef.h
122 include/elliptics/interface.h
123 include/elliptics/packet.h
124 include/elliptics/srw.h
125 ${CMAKE_BINARY_DIR}/include/elliptics/typedefs.h
126 DESTINATION include/elliptics/