Commit a0114b86 authored by Sergei Golubchik's avatar Sergei Golubchik

cmake: don't repeat yourself

make repeated cmake runs less verbose:
* remove few not very useful MESSAGE's
* only run pkg_check_modules() if there's no cached result
* only print QQGraph messages on the first run
parent e74f91df
......@@ -147,7 +147,6 @@ MACRO (MYSQL_CHECK_SSL)
IF (WITH_SSL_PATH)
LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
ENDIF()
MESSAGE(STATUS "suffixes <${CMAKE_FIND_LIBRARY_SUFFIXES}>")
FIND_LIBRARY(OPENSSL_LIBRARIES
NAMES ssl ssleay32 ssleay32MD
HINTS ${OPENSSL_ROOT_DIR}/lib)
......
......@@ -48,7 +48,7 @@ IF(UNIX)
# Bar: -Wfatal-errors removed (does not present in gcc on solaris10)
if(WITH_WARNINGS)
add_definitions(-Wall -Wextra -Wmissing-declarations)
message(STATUS "CONNECT: GCC: All warnings enabled")
#message(STATUS "CONNECT: GCC: All warnings enabled")
else()
add_definitions(-Wall -Wmissing-declarations)
add_definitions(-Wno-write-strings)
......@@ -69,7 +69,7 @@ IF(UNIX)
# These switches are for C++ only
# add_definitions(-Wno-reorder)
message(STATUS "CONNECT: GCC: Some warnings disabled")
#message(STATUS "CONNECT: GCC: Some warnings disabled")
endif(WITH_WARNINGS)
add_definitions( -DUNIX -DLINUX -DUBUNTU )
......
......@@ -341,7 +341,9 @@ endif()
set(GRN_WITH_LZ4 "auto"
CACHE STRING "Support data compression by LZ4.")
if(NOT ${GRN_WITH_LZ4} STREQUAL "no")
if(NOT DEFINED LIBLZ4_FOUND)
pkg_check_modules(LIBLZ4 liblz4)
endif()
if(LIBLZ4_FOUND)
set(GRN_WITH_LZ4 TRUE)
else()
......@@ -392,7 +394,9 @@ endif()
set(GRN_WITH_KYTEA "auto"
CACHE STRING "use KyTea for morphological analysis")
if(NOT ${GRN_WITH_KYTEA} STREQUAL "no")
if(NOT DEFINED KYTEA_FOUND)
pkg_check_modules(KYTEA kytea)
endif()
if(KYTEA_FOUND)
set(GRN_WITH_KYTEA TRUE)
else()
......@@ -440,7 +444,9 @@ endif()
set(GRN_WITH_ZEROMQ "auto"
CACHE STRING "use ZeroMQ for suggestion")
if(NOT ${GRN_WITH_ZEROMQ} STREQUAL "no")
if(NOT DEFINED ZEROMQ_FOUND)
pkg_check_modules(ZEROMQ libzmq)
endif()
if(ZEROMQ_FOUND)
set(GRN_WITH_ZEROMQ TRUE)
else()
......@@ -483,7 +489,9 @@ endif()
set(GRN_WITH_MESSAGE_PACK "auto"
CACHE STRING "use MessagePack for suggestion")
if(NOT ${GRN_WITH_MESSAGE_PACK} STREQUAL "no")
if(NOT DEFINED MESSAGE_PACK_FOUND)
pkg_check_modules(MESSAGE_PACK msgpack)
endif()
if(MESSAGE_PACK_FOUND)
set(GRN_WITH_MESSAGE_PACK TRUE)
else()
......
......@@ -5,6 +5,7 @@ MESSAGE(STATUS "Configuring OQGraph")
FIND_PACKAGE(Boost 1.40.0)
IF(NOT Boost_FOUND)
MESSAGE(STATUS "Boost not found. OQGraph will not be compiled")
SET(OQGRAPH_OK 0 CACHE INTERNAL "")
RETURN()
ENDIF()
INCLUDE_DIRECTORIES(BEFORE ${Boost_INCLUDE_DIRS})
......@@ -12,6 +13,7 @@ INCLUDE_DIRECTORIES(BEFORE ${Boost_INCLUDE_DIRS})
FIND_PACKAGE(Judy)
IF(NOT Judy_FOUND)
MESSAGE(STATUS "Judy not found. OQGraph will not be compiled")
SET(OQGRAPH_OK 0 CACHE INTERNAL "")
RETURN()
ENDIF()
INCLUDE_DIRECTORIES(${Judy_INCLUDE_DIR})
......@@ -19,9 +21,9 @@ INCLUDE_DIRECTORIES(${Judy_INCLUDE_DIR})
IF(MSVC)
# # lp:756966 OQGRAPH on Win64 does not compile
# IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
# SET(BOOST_OK 0)
# SET(OQGRAPH_OK 0 CACHE INTERNAL "")
# ELSE()
SET(BOOST_OK 1)
SET(OQGRAPH_OK 1 CACHE INTERNAL "")
# ENDIF()
ELSE()
# See if that works. On old gcc it'll fail because of -fno-rtti
......@@ -33,10 +35,10 @@ CHECK_CXX_SOURCE_COMPILES(
#include <boost/config.hpp>
#include <boost/property_map/property_map.hpp>
int main() { return 0; }
" BOOST_OK)
" OQGRAPH_OK)
ENDIF()
IF(BOOST_OK)
IF(OQGRAPH_OK)
ADD_DEFINITIONS(-DHAVE_OQGRAPH)
IF(MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc" PARENT_SCOPE)
......@@ -50,7 +52,6 @@ IF(BOOST_OK)
ENDIF(MSVC)
ADD_DEFINITIONS(-DBOOST_NO_RTTI=1 -DBOOST_NO_TYPEID=1 -DBOOST_DISABLE_ASSERTS=1)
MESSAGE(STATUS "OQGraph OK")
MYSQL_ADD_PLUGIN(oqgraph ha_oqgraph.cc graphcore.cc graphcore-graph.cc
oqgraph_shim.cc oqgraph_thunk.cc oqgraph_judy.cc
STORAGE_ENGINE
......@@ -58,9 +59,11 @@ IF(BOOST_OK)
RECOMPILE_FOR_EMBEDDED
COMPONENT oqgraph-engine
LINK_LIBRARIES ${Judy_LIBRARIES})
ELSE(BOOST_OK)
ELSE(OQGRAPH_OK)
MESSAGE(STATUS "Requisites for OQGraph not met. OQGraph will not be compiled")
ENDIF(BOOST_OK)
ENDIF(OQGRAPH_OK)
ENDFUNCTION()
CHECK_OQGRAPH()
IF(NOT DEFINED OQGRAPH_OK)
CHECK_OQGRAPH()
ENDIF()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment