Fix more failing searches with _ROOT variables set

(cherry picked from commit fc2a38f0cd7ec186f479b71ba63c23cb5bc156d1)
core4
kaetemi 3 years ago
parent 2f1ce0af64
commit 8f9429a03d
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -273,9 +273,14 @@ MACRO(FIND_PACKAGE_HELPER NAME INCLUDE)
ENDIF()
# Append environment variables XXX_DIR
LIST(APPEND _LIBRARY_PATHS
$ENV{${_UPNAME}_DIR}/lib${LIB_SUFFIX}
$ENV{${_UPNAME_FIXED}_DIR}/lib${LIB_SUFFIX})
IF(DEFINED ENV{${_UPNAME}_DIR})
LIST(APPEND _LIBRARY_PATHS
$ENV{${_UPNAME}_DIR}/lib${LIB_SUFFIX})
ENDIF()
IF(DEFINED ENV{${_UPNAME_FIXED}_DIR})
LIST(APPEND _LIBRARY_PATHS
$ENV{${_UPNAME_FIXED}_DIR}/lib${LIB_SUFFIX})
ENDIF()
IF(UNIX AND NOT DEFINED ENV{${_UPNAME_FIXED}_ROOT})
SET(_UNIX_LIBRARY_PATHS)
@ -322,15 +327,30 @@ MACRO(FIND_PACKAGE_HELPER NAME INCLUDE)
LIST(REMOVE_DUPLICATES _DEBUG_LIBRARIES)
# Search for release library
FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_RELEASE
NAMES
${_RELEASE_LIBRARIES}
HINTS ${PKG_${_NAME_FIXED}_LIBRARY_DIRS}
PATHS
${_LIBRARY_PATHS}
${_UNIX_LIBRARY_PATHS}
NO_CMAKE_SYSTEM_PATH
)
IF(DEFINED ENV{${_UPNAME_FIXED}_ROOT})
FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_RELEASE
NAMES
${_RELEASE_LIBRARIES}
HINTS ${PKG_${_NAME_FIXED}_LIBRARY_DIRS}
PATHS
${_LIBRARY_PATHS}
${_UNIX_LIBRARY_PATHS}
NO_CMAKE_PATH
NO_CMAKE_SYSTEM_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
)
ELSE()
FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_RELEASE
NAMES
${_RELEASE_LIBRARIES}
HINTS ${PKG_${_NAME_FIXED}_LIBRARY_DIRS}
PATHS
${_LIBRARY_PATHS}
${_UNIX_LIBRARY_PATHS}
NO_CMAKE_SYSTEM_PATH
)
ENDIF()
IF(_IS_VERBOSE)
IF(${_UPNAME_FIXED}_LIBRARY_RELEASE)
@ -341,15 +361,30 @@ MACRO(FIND_PACKAGE_HELPER NAME INCLUDE)
ENDIF()
# Search for debug library
FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_DEBUG
NAMES
${_DEBUG_LIBRARIES}
HINTS ${PKG_${_NAME_FIXED}_LIBRARY_DIRS}
PATHS
${_LIBRARY_PATHS}
${_UNIX_LIBRARY_PATHS}
NO_CMAKE_SYSTEM_PATH
)
IF(DEFINED ENV{${_UPNAME_FIXED}_ROOT})
FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_DEBUG
NAMES
${_DEBUG_LIBRARIES}
HINTS ${PKG_${_NAME_FIXED}_LIBRARY_DIRS}
PATHS
${_LIBRARY_PATHS}
${_UNIX_LIBRARY_PATHS}
NO_CMAKE_PATH
NO_CMAKE_SYSTEM_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
)
ELSE()
FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_DEBUG
NAMES
${_DEBUG_LIBRARIES}
HINTS ${PKG_${_NAME_FIXED}_LIBRARY_DIRS}
PATHS
${_LIBRARY_PATHS}
${_UNIX_LIBRARY_PATHS}
NO_CMAKE_SYSTEM_PATH
)
ENDIF()
IF(_IS_VERBOSE)
IF(${_UPNAME_FIXED}_LIBRARY_DEBUG)

Loading…
Cancel
Save