mirror of
https://github.com/clangen/musikcube.git
synced 2024-12-27 21:14:08 +00:00
Add find_library_and_header() macro for cmake scripts to further
validate installed dependencies.
This commit is contained in:
parent
974864470e
commit
9965708858
@ -1,4 +1,17 @@
|
||||
macro(find_vendor_library target_var library_name)
|
||||
find_library(${target_var} NAMES ${library_name} PATHS ${VENDOR_LINK_DIRECTORIES} NO_DEFAULT_PATH)
|
||||
message(STATUS "[find-vendor-library] '${library_name}' resolved to '${${target_var}}'")
|
||||
find_library(${target_var} NAMES ${library_name} PATHS ${VENDOR_LINK_DIRECTORIES} NO_DEFAULT_PATH NO_CACHE)
|
||||
message(STATUS "[find-vendor-library] ${BoldBlue}'${library_name}' library resolved to '${${target_var}}'${ColorReset}")
|
||||
endmacro(find_vendor_library)
|
||||
|
||||
macro(find_library_and_header target_var library_name header_name)
|
||||
find_library(${target_var} NAMES ${library_name} NO_CACHE)
|
||||
message(STATUS "[find-library-and-header] ${BoldBlue}'${library_name}' library resolved to '${${target_var}}'${ColorReset}")
|
||||
|
||||
find_path(TEMP ${header_name} REQUIRED NO_CACHE)
|
||||
if (${TEMP} MATCHES "TEMP-NOTFOUND")
|
||||
message(STATUS "[find-library-and-header] ${BoldRed}'${header_name}' COULD NOT BE FOUND!${ColorReset}")
|
||||
else()
|
||||
message(STATUS "[find-library-and-header] ${BoldBlue}'${header_name}' resolved to '${TEMP}'${ColorReset}")
|
||||
endif()
|
||||
unset(TEMP)
|
||||
endmacro(find_library_and_header)
|
||||
|
@ -89,8 +89,8 @@ else()
|
||||
find_library(LIBCRYPTO NAMES crypto PATHS ${VENDOR_LINK_DIRECTORIES})
|
||||
endif()
|
||||
|
||||
find_library(LIBZ NAMES z)
|
||||
find_library(PTHREAD NAMES pthread)
|
||||
find_library_and_header(LIBZ z zlib.h)
|
||||
find_library_and_header(PTHREAD pthread pthread.h)
|
||||
|
||||
set(musikcube_LINK_LIBS ${DEFAULT_OS_SYSTEM_LIBS} ${LIBCURL} ${LIBSSL} ${LIBCRYPTO} ${LIBZ} ${PTHREAD})
|
||||
|
||||
|
@ -20,7 +20,7 @@ else()
|
||||
find_library(LIBGNUTLS NAMES gnutls)
|
||||
set(EXTRA_LIBS "${LIBGNUTLS}")
|
||||
endif()
|
||||
find_library(LIBMICROHTTPD NAMES microhttpd)
|
||||
find_library_and_header(LIBMICROHTTPD microhttpd microhttpd.h)
|
||||
endif()
|
||||
|
||||
find_library(LIBZ NAMES z)
|
||||
|
Loading…
Reference in New Issue
Block a user