fix finding the lensfun library for the LENSFUN_HAS_LOAD_DIRECTORY test
This commit is contained in:
parent
a4ecae03b5
commit
33867a4bf2
@ -450,7 +450,17 @@ include(CheckCXXSourceCompiles)
|
|||||||
set(CMAKE_REQUIRED_INCLUDES ${LENSFUN_INCLUDE_DIRS})
|
set(CMAKE_REQUIRED_INCLUDES ${LENSFUN_INCLUDE_DIRS})
|
||||||
set(CMAKE_REQUIRED_LIBRARIES)
|
set(CMAKE_REQUIRED_LIBRARIES)
|
||||||
foreach(l ${LENSFUN_LIBRARIES})
|
foreach(l ${LENSFUN_LIBRARIES})
|
||||||
find_library(_l ${l} PATHS ${LENSFUN_LIBRARY_DIRS} NO_DEFAULT_PATH)
|
if(LENSFUN_LIBRARY_DIRS)
|
||||||
|
# the NO_DEFAULT_PATH is to make sure we find the lensfun version we
|
||||||
|
# want, and not the system's one (e.g. if we have a custom version
|
||||||
|
# installed in a non-standard location)
|
||||||
|
find_library(_l ${l} PATHS ${LENSFUN_LIBRARY_DIRS} NO_DEFAULT_PATH)
|
||||||
|
else()
|
||||||
|
# LENSFUN_LIBRARY_DIRS can be empty if lensfun is installed in the
|
||||||
|
# default path. In this case, adding NO_DEFAULT_PATH would make
|
||||||
|
# find_library fail...
|
||||||
|
find_library(_l ${l})
|
||||||
|
endif()
|
||||||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${_l})
|
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${_l})
|
||||||
endforeach()
|
endforeach()
|
||||||
check_cxx_source_compiles(
|
check_cxx_source_compiles(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user