cmake: Minor improvement. [#METR-23701]

This commit is contained in:
Vladimir Chebotarev 2016-12-06 16:42:53 +03:00
parent 0380927f28
commit 58b2b6b6a6
4 changed files with 29 additions and 35 deletions

View File

@ -170,42 +170,10 @@ include_directories (/usr/local/include/)
link_directories (/usr/local/lib) link_directories (/usr/local/lib)
# External libraries include (cmake/find_openssl.cmake)
include (cmake/find_icu4c.cmake)
# 1. openssl
set (OPENSSL_USE_STATIC_LIBS ${USE_STATIC_LIBRARIES})
if (APPLE)
set (OPENSSL_ROOT_DIR "/usr/local/opt/openssl")
endif ()
find_package (OpenSSL)
if (NOT OPENSSL_FOUND)
message (SEND_ERROR "OpenSSL is required")
endif ()
# 2. icu4c
include_directories ("/usr/local/opt/icu4c/include")
set (ICU_HINTS "/usr/local/opt/icu4c/lib")
if (USE_STATIC_LIBRARIES)
find_library (ICUI18N libicui18n.a HINTS ${ICU_HINTS})
find_library (ICUUC libicuuc.a HINTS ${ICU_HINTS})
find_library (ICUDATA libicudata.a HINTS ${ICU_HINTS})
else ()
find_library (ICUI18N icui18n HINTS ${ICU_HINTS})
find_library (ICUUC icuuc HINTS ${ICU_HINTS})
find_library (ICUDATA icudata HINTS ${ICU_HINTS})
endif ()
set (ICU_LIBS ${ICUI18N} ${ICUUC} ${ICUDATA})
# 3. boost
include (cmake/find_boost.cmake) include (cmake/find_boost.cmake)
include (cmake/find_libtool.cmake)
# 4. ltdl
set (LTDL_HINTS "/usr/local/opt/libtool/lib")
if (USE_STATIC_LIBRARIES)
find_library (LTDL_LIB libltdl.a HINTS ${LTDL_HINTS})
else ()
find_library (LTDL_LIB ltdl HINTS ${LTDL_HINTS})
endif ()
# Directory for Yandex specific files # Directory for Yandex specific files
set (CLICKHOUSE_PRIVATE_DIR ${ClickHouse_SOURCE_DIR}/private/) set (CLICKHOUSE_PRIVATE_DIR ${ClickHouse_SOURCE_DIR}/private/)

12
cmake/find_icu4c.cmake Normal file
View File

@ -0,0 +1,12 @@
include_directories ("/usr/local/opt/icu4c/include")
set (ICU_HINTS "/usr/local/opt/icu4c/lib")
if (USE_STATIC_LIBRARIES)
find_library (ICUI18N libicui18n.a HINTS ${ICU_HINTS})
find_library (ICUUC libicuuc.a HINTS ${ICU_HINTS})
find_library (ICUDATA libicudata.a HINTS ${ICU_HINTS})
else ()
find_library (ICUI18N icui18n HINTS ${ICU_HINTS})
find_library (ICUUC icuuc HINTS ${ICU_HINTS})
find_library (ICUDATA icudata HINTS ${ICU_HINTS})
endif ()
set (ICU_LIBS ${ICUI18N} ${ICUUC} ${ICUDATA})

6
cmake/find_libtool.cmake Normal file
View File

@ -0,0 +1,6 @@
set (LTDL_HINTS "/usr/local/opt/libtool/lib")
if (USE_STATIC_LIBRARIES)
find_library (LTDL_LIB libltdl.a HINTS ${LTDL_HINTS})
else ()
find_library (LTDL_LIB ltdl HINTS ${LTDL_HINTS})
endif ()

8
cmake/find_openssl.cmake Normal file
View File

@ -0,0 +1,8 @@
set (OPENSSL_USE_STATIC_LIBS ${USE_STATIC_LIBRARIES})
if (APPLE)
set (OPENSSL_ROOT_DIR "/usr/local/opt/openssl")
endif ()
find_package (OpenSSL)
if (NOT OPENSSL_FOUND)
message (SEND_ERROR "OpenSSL is required")
endif ()