2013-12-11 10:02:12 +01:00
|
|
|
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
|
|
|
|
2012-09-30 23:49:46 +02:00
|
|
|
MESSAGE(STATUS "Configuring OQGraph")
|
|
|
|
FIND_PACKAGE(Boost)
|
2011-12-30 11:21:39 +01:00
|
|
|
IF(NOT Boost_FOUND)
|
2012-09-30 23:49:46 +02:00
|
|
|
MESSAGE(STATUS "Boost not found")
|
2011-12-30 11:21:39 +01:00
|
|
|
RETURN()
|
|
|
|
ENDIF()
|
|
|
|
INCLUDE_DIRECTORIES(BEFORE ${Boost_INCLUDE_DIRS})
|
2011-10-19 21:45:18 +02:00
|
|
|
|
2013-02-14 19:38:35 +01:00
|
|
|
FIND_PACKAGE(Judy)
|
|
|
|
IF(NOT Judy_FOUND)
|
2013-01-20 07:56:10 +01:00
|
|
|
MESSAGE(STATUS "Judy not found")
|
2013-12-11 10:02:12 +01:00
|
|
|
RETURN()
|
2012-09-30 23:49:46 +02:00
|
|
|
ENDIF()
|
2013-02-14 19:38:35 +01:00
|
|
|
INCLUDE_DIRECTORIES(${Judy_INCLUDE_DIR})
|
2011-10-19 21:45:18 +02:00
|
|
|
|
2012-08-02 23:17:27 +02:00
|
|
|
IF(MSVC)
|
|
|
|
# lp:756966 OQGRAPH on Win64 does not compile
|
|
|
|
IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
SET(BOOST_OK 0)
|
|
|
|
ELSE()
|
|
|
|
SET(BOOST_OK 1)
|
|
|
|
ENDIF()
|
2011-12-30 11:21:39 +01:00
|
|
|
ELSE()
|
2012-07-31 22:39:33 +02:00
|
|
|
# See if that works. On old gcc it'll fail because of -fno-rtti
|
|
|
|
CHECK_CXX_SOURCE_COMPILES(
|
|
|
|
"
|
2013-02-11 01:07:55 +01:00
|
|
|
#define BOOST_NO_RTTI 1
|
|
|
|
#define BOOST_NO_TYPEID 1
|
2012-07-31 22:39:33 +02:00
|
|
|
#include <boost/config.hpp>
|
|
|
|
#include <boost/property_map/property_map.hpp>
|
|
|
|
int main() { return 0; }
|
|
|
|
" BOOST_OK)
|
2011-10-19 21:45:18 +02:00
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
IF(BOOST_OK)
|
|
|
|
ADD_DEFINITIONS(-DHAVE_OQGRAPH)
|
|
|
|
IF(MSVC)
|
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
|
2011-10-21 23:07:13 +02:00
|
|
|
ELSE(MSVC)
|
2013-09-06 12:57:33 +02:00
|
|
|
# Fix lp bug 1221555 with -fpermissive, so that errors in gcc 4.7 become warnings for the time being
|
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -fno-strict-aliasing -fpermissive")
|
2011-10-19 21:45:18 +02:00
|
|
|
STRING(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
|
|
|
STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
2011-10-21 23:07:13 +02:00
|
|
|
ENDIF(MSVC)
|
2011-10-19 21:45:18 +02:00
|
|
|
|
2013-02-11 01:07:55 +01:00
|
|
|
ADD_DEFINITIONS(-DBOOST_NO_RTTI=1 -DBOOST_NO_TYPEID=1 -DBOOST_DISABLE_ASSERTS=1)
|
2013-04-25 15:12:52 +02:00
|
|
|
|
2013-02-11 01:07:55 +01:00
|
|
|
MYSQL_ADD_PLUGIN(oqgraph ha_oqgraph.cc graphcore.cc graphcore-graph.cc
|
|
|
|
oqgraph_shim.cc oqgraph_thunk.cc oqgraph_judy.cc
|
|
|
|
STORAGE_ENGINE
|
|
|
|
MODULE_ONLY
|
2013-12-16 10:55:43 +01:00
|
|
|
COMPONENT oqgraph-engine
|
2013-02-14 19:38:35 +01:00
|
|
|
LINK_LIBRARIES ${Judy_LIBRARIES})
|
2012-09-30 23:49:46 +02:00
|
|
|
ELSE(BOOST_OK)
|
|
|
|
MESSAGE(STATUS "Requisites for OQGraph not met")
|
2011-10-19 21:45:18 +02:00
|
|
|
ENDIF(BOOST_OK)
|