Сmake: more info in message about libreadline (#376)

* Cmake: more info in message about libreadline

* icu cmake

* cmake: glib message
This commit is contained in:
proller 2017-01-20 22:57:30 +03:00 committed by alexey-milovidov
parent 2688f4563f
commit 38040f5323
7 changed files with 50 additions and 43 deletions

View File

@ -172,7 +172,6 @@ else ()
endif () endif ()
include (cmake/find_openssl.cmake) include (cmake/find_openssl.cmake)
include (cmake/find_icu4c.cmake)
include (cmake/find_boost.cmake) include (cmake/find_boost.cmake)
include (cmake/find_poco.cmake) include (cmake/find_poco.cmake)
include (cmake/find_libtool.cmake) include (cmake/find_libtool.cmake)

View File

@ -1,53 +1,55 @@
set (GLIB_HINTS "/usr/local/opt/glib/lib") set (GLIB_PATHS "/usr/local/opt/glib/lib")
set (GLIB_INCLUDE_HINTS set (GLIB_INCLUDE_PATHS
"/usr/local/include/glib-2.0/" "/usr/local/include/glib-2.0/"
"/usr/local/lib/glib-2.0/include/" "/usr/local/lib/glib-2.0/include/"
"/usr/include/glib-2.0/" "/usr/include/glib-2.0/"
"/usr/lib64/glib-2.0/include/") "/usr/lib64/glib-2.0/include/")
if (AARCH64) if (AARCH64)
set (GLIB_INCLUDE_HINTS ${GLIB_INCLUDE_HINTS} "/usr/lib/aarch64-linux-gnu/glib-2.0/include/") set (GLIB_INCLUDE_PATHS ${GLIB_INCLUDE_PATHS} "/usr/lib/aarch64-linux-gnu/glib-2.0/include/")
else () else ()
set (GLIB_INCLUDE_HINTS ${GLIB_INCLUDE_HINTS} "/usr/lib/x86_64-linux-gnu/glib-2.0/include/") set (GLIB_INCLUDE_PATHS ${GLIB_INCLUDE_PATHS} "/usr/lib/x86_64-linux-gnu/glib-2.0/include/")
endif () endif ()
if (USE_STATIC_LIBRARIES) if (USE_STATIC_LIBRARIES)
find_library (GLIB_LIB libglib-2.0.a HINTS ${GLIB_HINTS}) find_library (GLIB_LIB libglib-2.0.a PATHS ${GLIB_PATHS})
else () else ()
find_library (GLIB_LIB glib-2.0 HINTS ${GLIB_HINTS}) find_library (GLIB_LIB glib-2.0 PATHS ${GLIB_PATHS})
endif () endif ()
find_path (GLIB_INCLUDE_DIR NAMES glib.h HINTS ${GLIB_INCLUDE_HINTS}) find_path (GLIB_INCLUDE_DIR NAMES glib.h PATHS ${GLIB_INCLUDE_PATHS})
find_path (GLIB_CONFIG_INCLUDE_DIR NAMES glibconfig.h HINTS ${GLIB_INCLUDE_HINTS}) find_path (GLIB_CONFIG_INCLUDE_DIR NAMES glibconfig.h PATHS ${GLIB_INCLUDE_PATHS})
include_directories (${GLIB_INCLUDE_DIR}) include_directories (${GLIB_INCLUDE_DIR})
include_directories (${GLIB_CONFIG_INCLUDE_DIR}) include_directories (${GLIB_CONFIG_INCLUDE_DIR})
if (APPLE) if (APPLE)
set (INTL_HINTS "/usr/local/opt/gettext/lib") set (INTL_PATHS "/usr/local/opt/gettext/lib")
if (USE_STATIC_LIBRARIES) if (USE_STATIC_LIBRARIES)
find_library (INTL_LIB libintl.a HINTS ${INTL_HINTS}) find_library (INTL_LIB libintl.a PATHS ${INTL_PATHS})
else () else ()
find_library (INTL_LIB intl HINTS ${INTL_HINTS}) find_library (INTL_LIB intl PATHS ${INTL_PATHS})
endif () endif ()
set (ICONV_HINTS "/usr/local/opt/libiconv/lib") set (ICONV_PATHS "/usr/local/opt/libiconv/lib")
if (USE_STATIC_LIBRARIES) if (USE_STATIC_LIBRARIES)
find_library (ICONV_LIB libiconv.a HINTS ${ICONV_HINTS}) find_library (ICONV_LIB libiconv.a PATHS ${ICONV_PATHS})
else () else ()
find_library (ICONV_LIB iconv HINTS ${ICONV_HINTS}) find_library (ICONV_LIB iconv PATHS ${ICONV_PATHS})
endif () endif ()
find_library (CORE_FOUNDATION_LIB CoreFoundation) find_library (CORE_FOUNDATION_LIB CoreFoundation)
find_library (CARBON_LIB Carbon) find_library (CARBON_LIB Carbon)
set (GLIB_LIBS ${GLIB_LIB} ${INTL_LIB} ${ICONV_LIB} ${CORE_FOUNDATION_LIB} ${CARBON_LIB}) set (GLIB_LIBS ${GLIB_LIB} ${INTL_LIB} ${ICONV_LIB} ${CORE_FOUNDATION_LIB} ${CARBON_LIB})
elseif (CMAKE_SYSTEM MATCHES "FreeBSD") elseif (CMAKE_SYSTEM MATCHES "FreeBSD")
set (ICONV_HINTS "") set (ICONV_PATHS "")
set (INTL_HINTS "") set (INTL_PATHS "")
if (USE_STATIC_LIBRARIES) if (USE_STATIC_LIBRARIES)
find_library (ICONV_LIB libiconv.a HINTS ${ICONV_HINTS}) find_library (ICONV_LIB libiconv.a PATHS ${ICONV_PATHS})
find_library (INTL_LIB libintl.a HINTS ${INTL_HINTS}) find_library (INTL_LIB libintl.a PATHS ${INTL_PATHS})
else () else ()
find_library (ICONV_LIB iconv HINTS ${ICONV_HINTS}) find_library (ICONV_LIB iconv PATHS ${ICONV_PATHS})
find_library (INTL_LIB intl HINTS ${INTL_HINTS}) find_library (INTL_LIB intl PATHS ${INTL_PATHS})
endif () endif ()
set (GLIB_LIBS ${GLIB_LIB} ${INTL_LIB} ${ICONV_LIB}) set (GLIB_LIBS ${GLIB_LIB} ${INTL_LIB} ${ICONV_LIB})
else () else ()
set (GLIB_LIBS ${GLIB_LIB}) set (GLIB_LIBS ${GLIB_LIB})
endif () endif ()
message(STATUS "Using glib: ${GLIB_INCLUDE_DIR};${GLIB_CONFIG_INCLUDE_DIR} : ${GLIB_LIBS}")

View File

@ -8,4 +8,3 @@ else ()
endif () endif ()
message(STATUS "Using gperftools: ${GPERFTOOLS_INCLUDE_DIR} : ${GPERFTOOLS_TCMALLOC}") message(STATUS "Using gperftools: ${GPERFTOOLS_INCLUDE_DIR} : ${GPERFTOOLS_TCMALLOC}")

View File

@ -1,12 +1,16 @@
include_directories ("/usr/local/opt/icu4c/include") set (ICU_PATHS "/usr/local/opt/icu4c/lib")
set (ICU_HINTS "/usr/local/opt/icu4c/lib") set (ICU_INCLUDE_PATHS "/usr/local/opt/icu4c/include")
if (USE_STATIC_LIBRARIES) if (USE_STATIC_LIBRARIES)
find_library (ICUI18N libicui18n.a HINTS ${ICU_HINTS}) find_library (ICUI18N libicui18n.a PATHS ${ICU_PATHS})
find_library (ICUUC libicuuc.a HINTS ${ICU_HINTS}) find_library (ICUUC libicuuc.a PATHS ${ICU_PATHS})
find_library (ICUDATA libicudata.a HINTS ${ICU_HINTS}) find_library (ICUDATA libicudata.a PATHS ${ICU_PATHS})
else () else ()
find_library (ICUI18N icui18n HINTS ${ICU_HINTS}) find_library (ICUI18N icui18n PATHS ${ICU_PATHS})
find_library (ICUUC icuuc HINTS ${ICU_HINTS}) find_library (ICUUC icuuc PATHS ${ICU_PATHS})
find_library (ICUDATA icudata HINTS ${ICU_HINTS}) find_library (ICUDATA icudata PATHS ${ICU_PATHS})
endif () endif ()
set (ICU_LIBS ${ICUI18N} ${ICUUC} ${ICUDATA}) set (ICU_LIBS ${ICUI18N} ${ICUUC} ${ICUDATA})
find_path (ICU_INCLUDE_DIR NAMES unistr.h PATH_SUFFIXES unicode PATHS ${ICU_INCLUDE_PATHS})
message(STATUS "Using icu: ${ICU_INCLUDE_DIR} : ${ICU_LIBS}")
include_directories (${ICU_INCLUDE_DIR})

View File

@ -17,27 +17,28 @@ if (NOT READLINE_PATHS)
else () else ()
find_library (EDIT_LIB NAMES edit) find_library (EDIT_LIB NAMES edit)
endif () endif ()
set(READLINE_INCLUDE_PATHS "/usr/local/opt/readline/include")
if (READLINE_LIB)
find_path (READLINE_INCLUDE_DIR NAMES readline.h PATH_SUFFIXES readline PATHS ${READLINE_INCLUDE_PATHS})
add_definitions (-D USE_READLINE)
set (LINE_EDITING_LIBS ${READLINE_LIB} ${TERMCAP_LIB})
message (STATUS "Using line editing libraries (readline): ${READLINE_INCLUDE_DIR} : ${LINE_EDITING_LIBS}")
elseif (EDIT_LIB)
if (USE_STATIC_LIBRARIES) if (USE_STATIC_LIBRARIES)
find_library (CURSES_LIB NAMES libcurses.a) find_library (CURSES_LIB NAMES libcurses.a)
else () else ()
find_library (CURSES_LIB NAMES curses) find_library (CURSES_LIB NAMES curses)
endif () endif ()
if (READLINE_LIB)
set(READLINE_INCLUDE_PATHS "/usr/local/opt/readline/include")
find_path (READLINE_INCLUDE_DIR NAMES readline.h PATH_SUFFIXES readline PATHS ${READLINE_INCLUDE_PATHS})
if (INE_INCLUDE_DIR)
include_directories (${READLINE_INCLUDE_DIR})
endif ()
add_definitions (-D USE_READLINE)
set (LINE_EDITING_LIBS ${READLINE_LIB} ${TERMCAP_LIB})
message (STATUS "Using line editing libraries: ${LINE_EDITING_LIBS}")
elseif (EDIT_LIB)
add_definitions (-D USE_LIBEDIT) add_definitions (-D USE_LIBEDIT)
find_path (READLINE_INCLUDE_DIR NAMES readline.h PATH_SUFFIXES editline PATHS ${READLINE_INCLUDE_PATHS})
set (LINE_EDITING_LIBS ${EDIT_LIB} ${CURSES_LIB} ${TERMCAP_LIB}) set (LINE_EDITING_LIBS ${EDIT_LIB} ${CURSES_LIB} ${TERMCAP_LIB})
message (STATUS "Using line editing libraries: ${LINE_EDITING_LIBS}") message (STATUS "Using line editing libraries (edit): ${READLINE_INCLUDE_DIR} : ${LINE_EDITING_LIBS}")
else () else ()
message (STATUS "Not using any library for line editing.") message (STATUS "Not using any library for line editing.")
endif () endif ()
if (READLINE_INCLUDE_DIR)
include_directories (${READLINE_INCLUDE_DIR})
endif ()
endif () endif ()

View File

@ -1,3 +1,5 @@
include (${CMAKE_SOURCE_DIR}/cmake/find_icu4c.cmake)
SET(CONFIG_VERSION ${CMAKE_CURRENT_BINARY_DIR}/include/common/config_version.h) SET(CONFIG_VERSION ${CMAKE_CURRENT_BINARY_DIR}/include/common/config_version.h)
SET(CONFIG_COMMON ${CMAKE_CURRENT_BINARY_DIR}/include/common/config_common.h) SET(CONFIG_COMMON ${CMAKE_CURRENT_BINARY_DIR}/include/common/config_common.h)

View File

@ -28,4 +28,4 @@ endif ()
include_directories (${MYSQL_INCLUDE_DIR}) include_directories (${MYSQL_INCLUDE_DIR})
message (STATUS "mysqlclient found: ${MYSQL_INCLUDE_DIR}; ${MYSQLCLIENT_LIB}; static=${STATIC_MYSQLCLIENT_LIB}") message (STATUS "Using mysqlclient: ${MYSQL_INCLUDE_DIR} : ${MYSQLCLIENT_LIB}; static=${STATIC_MYSQLCLIENT_LIB}")