CodeCommitsIssuesPull requestsActionsInsightsSecurity
8e2b1b3d8a430d5e52b453b712dacceaf43b1db0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

cmake/contrib_finder.cmake

21lines · modecode

1macro(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
21endmacro()