cloudflare/ClickHouse
Publicmirrored fromhttps://github.com/cloudflare/ClickHouse
cmake/contrib_finder.cmake
21lines · modecode
unknown
| 1 | macro(find_contrib_lib LIB_NAME) |
| 2 | |
| 3 | string(TOLOWER ${LIB_NAME} LIB_NAME_LC) |
| 4 | string(TOUPPER ${LIB_NAME} LIB_NAME_UC) |
| 5 | string(REPLACE "-" "_" LIB_NAME_UC ${LIB_NAME_UC}) |
| 6 | |
| 7 | option (USE_INTERNAL_${LIB_NAME_UC}_LIBRARY "Use bundled library ${LIB_NAME} instead of system" ${NOT_UNBUNDLED}) |
| 8 | |
| 9 | if (NOT USE_INTERNAL_${LIB_NAME_UC}_LIBRARY) |
| 10 | find_package ("${LIB_NAME}") |
| 11 | endif () |
| 12 | |
| 13 | if (NOT ${LIB_NAME_UC}_FOUND) |
| 14 | set (USE_INTERNAL_${LIB_NAME_UC}_LIBRARY 1) |
| 15 | set (${LIB_NAME_UC}_LIBRARIES ${LIB_NAME_LC}) |
| 16 | set (${LIB_NAME_UC}_INCLUDE_DIR ${${LIB_NAME_UC}_CONTRIB_INCLUDE_DIR}) |
| 17 | endif () |
| 18 | |
| 19 | message (STATUS "Using ${LIB_NAME}: ${${LIB_NAME_UC}_INCLUDE_DIR} : ${${LIB_NAME_UC}_LIBRARIES}") |
| 20 | |
| 21 | endmacro() |