2010-11-12 05:05:27 +00:00
|
|
|
macro(check_lib var lib required)
|
|
|
|
pkg_search_module(${var} ${lib})
|
|
|
|
if(${var}_FOUND)
|
|
|
|
message("${lib} found")
|
|
|
|
else()
|
|
|
|
find_library(${var} ${lib})
|
|
|
|
if(${var})
|
|
|
|
message("${lib} found")
|
|
|
|
set(${var}_FOUND 1 CACHE INTERNAL "")
|
|
|
|
else()
|
2010-11-13 22:07:27 +00:00
|
|
|
if(${required} STREQUAL "REQUIRED")
|
2010-11-12 05:05:27 +00:00
|
|
|
message(FATAL_ERROR "${lib} is required but not found")
|
|
|
|
else()
|
|
|
|
message("${lib} not found")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endmacro()
|
|
|
|
|
2010-11-18 23:27:27 +00:00
|
|
|
macro(check_lib_and_header var lib header required)
|
|
|
|
find_library(${var} ${lib})
|
|
|
|
find_path(${var}_INCLUDE ${header})
|
|
|
|
if(${var} AND ${var}_INCLUDE)
|
|
|
|
message("${lib} found")
|
|
|
|
set(${var}_FOUND 1 CACHE INTERNAL "")
|
|
|
|
else()
|
|
|
|
if(${required} STREQUAL "REQUIRED")
|
|
|
|
message(FATAL_ERROR "${lib} is required but not found")
|
|
|
|
else()
|
|
|
|
message("${lib} not found")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endmacro()
|
|
|
|
|