cmake: CheckLib allow to search only include

Some libraries doesn't have any .so file
This commit is contained in:
Gregory Hainaut 2015-05-11 11:28:09 +02:00
parent 30e3956ea7
commit 797e3d81da
1 changed files with 21 additions and 11 deletions

View File

@ -17,7 +17,7 @@ macro(check_lib var lib)
# Make sure include directories for headers found using find_path below
# are re-added when reconfiguring
include_directories(${${var}_INCLUDE})
_internal_message("-- ${lib} found")
_internal_message("-- ${var} found")
else()
find_library(${var}_LIBRARIES ${lib})
if(_arg_list)
@ -25,16 +25,26 @@ macro(check_lib var lib)
else()
set(${var}_INCLUDE FALSE)
endif()
if(${var}_LIBRARIES AND ${var}_INCLUDE)
include_directories(${${var}_INCLUDE})
_internal_message("-- ${lib} found")
set(${var}_FOUND 1 CACHE INTERNAL "")
elseif(${var}_LIBRARIES)
_internal_message("-- ${lib} not found (miss include)")
elseif(${var}_INCLUDE)
_internal_message("-- ${lib} not found (miss lib)")
if (${lib})
if(${var}_LIBRARIES AND ${var}_INCLUDE)
include_directories(${${var}_INCLUDE})
_internal_message("-- ${var} found")
set(${var}_FOUND 1 CACHE INTERNAL "")
elseif(${var}_LIBRARIES)
_internal_message("-- ${var} not found (miss include)")
elseif(${var}_INCLUDE)
_internal_message("-- ${var} not found (miss lib)")
else()
_internal_message("-- ${var} not found")
endif()
else()
_internal_message("-- ${lib} not found")
endif()
if(${var}_INCLUDE)
include_directories(${${var}_INCLUDE})
_internal_message("-- ${var} found")
set(${var}_FOUND 1 CACHE INTERNAL "")
else()
_internal_message("-- ${var} not found")
endif()
endif()
endif()
endmacro()