Merge topic 'find-package-mode-fix-multiarch'

48984958 CMakeFindPackageMode: Fix Debian multiarch default guess (#15250)
This commit is contained in:
Brad King 2015-01-20 09:20:07 -05:00 committed by CMake Topic Stage
commit 86b6cbeaad
1 changed files with 5 additions and 2 deletions

View File

@ -102,15 +102,18 @@ if(UNIX)
# guess Debian multiarch if it has not been set:
if(EXISTS /etc/debian_version)
if(NOT CMAKE_${LANGUAGE}_LANGUAGE_ARCHITECTURE )
if(NOT CMAKE_${LANGUAGE}_LIBRARY_ARCHITECTURE )
file(GLOB filesInLib RELATIVE /lib /lib/*-linux-gnu* )
foreach(file ${filesInLib})
if("${file}" MATCHES "${CMAKE_LIBRARY_ARCHITECTURE_REGEX}")
set(CMAKE_${LANGUAGE}_LANGUAGE_ARCHITECTURE ${file})
set(CMAKE_${LANGUAGE}_LIBRARY_ARCHITECTURE ${file})
break()
endif()
endforeach()
endif()
if(NOT CMAKE_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE ${CMAKE_${LANGUAGE}_LIBRARY_ARCHITECTURE})
endif()
endif()
endif()