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() ENDIF()
# Append environment variables XXX_DIR # Append environment variables XXX_DIR
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 LIST(APPEND _LIBRARY_PATHS
$ENV{${_UPNAME}_DIR}/lib${LIB_SUFFIX}
$ENV{${_UPNAME_FIXED}_DIR}/lib${LIB_SUFFIX}) $ENV{${_UPNAME_FIXED}_DIR}/lib${LIB_SUFFIX})
ENDIF()
IF(UNIX AND NOT DEFINED ENV{${_UPNAME_FIXED}_ROOT}) IF(UNIX AND NOT DEFINED ENV{${_UPNAME_FIXED}_ROOT})
SET(_UNIX_LIBRARY_PATHS) SET(_UNIX_LIBRARY_PATHS)
@ -322,6 +327,20 @@ MACRO(FIND_PACKAGE_HELPER NAME INCLUDE)
LIST(REMOVE_DUPLICATES _DEBUG_LIBRARIES) LIST(REMOVE_DUPLICATES _DEBUG_LIBRARIES)
# Search for release library # Search for release library
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 FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_RELEASE
NAMES NAMES
${_RELEASE_LIBRARIES} ${_RELEASE_LIBRARIES}
@ -331,6 +350,7 @@ MACRO(FIND_PACKAGE_HELPER NAME INCLUDE)
${_UNIX_LIBRARY_PATHS} ${_UNIX_LIBRARY_PATHS}
NO_CMAKE_SYSTEM_PATH NO_CMAKE_SYSTEM_PATH
) )
ENDIF()
IF(_IS_VERBOSE) IF(_IS_VERBOSE)
IF(${_UPNAME_FIXED}_LIBRARY_RELEASE) IF(${_UPNAME_FIXED}_LIBRARY_RELEASE)
@ -341,6 +361,20 @@ MACRO(FIND_PACKAGE_HELPER NAME INCLUDE)
ENDIF() ENDIF()
# Search for debug library # Search for debug library
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 FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_DEBUG
NAMES NAMES
${_DEBUG_LIBRARIES} ${_DEBUG_LIBRARIES}
@ -350,6 +384,7 @@ MACRO(FIND_PACKAGE_HELPER NAME INCLUDE)
${_UNIX_LIBRARY_PATHS} ${_UNIX_LIBRARY_PATHS}
NO_CMAKE_SYSTEM_PATH NO_CMAKE_SYSTEM_PATH
) )
ENDIF()
IF(_IS_VERBOSE) IF(_IS_VERBOSE)
IF(${_UPNAME_FIXED}_LIBRARY_DEBUG) IF(${_UPNAME_FIXED}_LIBRARY_DEBUG)

Loading…
Cancel
Save