summaryrefslogtreecommitdiffstats
path: root/Modules/InstallRequiredSystemLibraries.cmake
diff options
context:
space:
mode:
authorAlexander Grund <Flamefire@users.noreply.github.com>2021-07-30 14:24:53 (GMT)
committerBrad King <brad.king@kitware.com>2021-08-02 19:34:19 (GMT)
commitf4c194398d079ab5be3e693eae73774431d232f2 (patch)
treee7b640ba65e5fdf97df64e11133665c50727e7b5 /Modules/InstallRequiredSystemLibraries.cmake
parent2adc45c7f68d6b0904109bd16bf45105dcee5992 (diff)
downloadCMake-f4c194398d079ab5be3e693eae73774431d232f2.zip
CMake-f4c194398d079ab5be3e693eae73774431d232f2.tar.gz
CMake-f4c194398d079ab5be3e693eae73774431d232f2.tar.bz2
IRSL: Avoid duplication of Intel redist lib folder paths
Diffstat (limited to 'Modules/InstallRequiredSystemLibraries.cmake')
-rw-r--r--Modules/InstallRequiredSystemLibraries.cmake33
1 files changed, 24 insertions, 9 deletions
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index 348b3a9..b2af6c9 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -80,19 +80,34 @@ foreach(LANG IN ITEMS C CXX Fortran)
set(_Intel_archdir ia32)
endif()
set(_Intel_compiler_ver ${CMAKE_${LANG}_COMPILER_VERSION})
- if(WIN32 AND EXISTS "${_Intel_basedir}/../redist/${_Intel_archdir}_win/compiler")
- get_filename_component(_Intel_redistdir "${_Intel_basedir}/../redist/${_Intel_archdir}_win/compiler" ABSOLUTE)
- elseif(WIN32)
- get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../redist/${_Intel_archdir}/compiler" ABSOLUTE)
+ if(WIN32)
+ set(_Intel_possible_redistdirs
+ "${_Intel_basedir}/../redist/${_Intel_archdir}_win/compiler"
+ "${_Intel_basedir}/../../redist/${_Intel_archdir}/compiler"
+ )
elseif(APPLE)
- get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../compiler/lib" ABSOLUTE)
+ set(_Intel_possible_redistdirs
+ "${_Intel_basedir}/../../compiler/lib"
+ )
else()
- if(EXISTS "${_Intel_basedir}/../lib/${_Intel_archdir}")
- get_filename_component(_Intel_redistdir "${_Intel_basedir}/../lib/${_Intel_archdir}" ABSOLUTE)
- else()
- get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../compiler/lib/${_Intel_archdir}_lin" ABSOLUTE)
+ set(_Intel_possible_redistdirs
+ "${_Intel_basedir}/../lib/${_Intel_archdir}"
+ "${_Intel_basedir}/../../compiler/lib/${_Intel_archdir}_lin"
+ )
+ endif()
+
+ set(_Intel_redistdir NOT-FOUND)
+ foreach(dir IN LISTS _Intel_possible_redistdirs)
+ if(EXISTS "${dir}")
+ set(_Intel_redistdir "${dir}")
+ break()
endif()
+ endforeach()
+ # Fall back to last dir
+ if(NOT _Intel_redistdir)
+ list(POP_BACK _Intel_possible_redistdirs _Intel_redistdir)
endif()
+ unset(_Intel_possible_redistdirs)
set(_IRSL_HAVE_Intel TRUE)
endif()
elseif("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "MSVC")