summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMario Emmenlauer <mario@emmenlauer.de>2020-01-24 09:08:37 (GMT)
committerMario Emmenlauer <mario@emmenlauer.de>2020-01-28 09:27:22 (GMT)
commit4d7c69208e6bfc9c59a6a5086218516d18a2498a (patch)
tree59e1131cf9453b2ae924e77eaf1d9042fdf50818 /Modules
parentfde5fcbc711fd7d8ae08da8928894d2c8b3092bc (diff)
downloadCMake-4d7c69208e6bfc9c59a6a5086218516d18a2498a.zip
CMake-4d7c69208e6bfc9c59a6a5086218516d18a2498a.tar.gz
CMake-4d7c69208e6bfc9c59a6a5086218516d18a2498a.tar.bz2
Find{BLAS,LAPACK}: Search always in dynamic linker paths
Previously the search in the dynamic linker paths 'LIB', 'LD_LIBRARY_PATH' and 'DYLD_LIBRARY_PATH' was dependent on the value of the environment variable 'MKLROOT'. If MKLROOT was given, the dynamic linker paths where not searched. This seems slightly counter-intuitive. This PR changes the behavior so that MKLROOT is searched first, but if unsuccesful, the dynamic linker paths are tried as well.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindBLAS.cmake14
-rw-r--r--Modules/FindLAPACK.cmake14
2 files changed, 12 insertions, 16 deletions
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index 5d11511..ed11364 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -161,14 +161,12 @@ macro(CHECK_BLAS_LIBRARIES LIBRARIES _prefix _name _flags _list _threadlibs _add
set(${LIBRARIES})
set(_combined_name)
- if(NOT _addlibdir)
- if(WIN32)
- set(_addlibdir ENV LIB)
- elseif(APPLE)
- set(_addlibdir ENV DYLD_LIBRARY_PATH)
- else()
- set(_addlibdir ENV LD_LIBRARY_PATH)
- endif()
+ if(WIN32)
+ list(APPEND _addlibdir ENV LIB)
+ elseif(APPLE)
+ list(APPEND _addlibdir ENV DYLD_LIBRARY_PATH)
+ else()
+ list(APPEND _addlibdir ENV LD_LIBRARY_PATH)
endif()
list(APPEND _addlibdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index bd7bacc..8ade0b1 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -131,14 +131,12 @@ macro(CHECK_LAPACK_LIBRARIES LIBRARIES _prefix _name _flags _list _threadlibs _a
set(${LIBRARIES})
set(_combined_name)
- if(NOT _addlibdir)
- if(WIN32)
- set(_addlibdir ENV LIB)
- elseif(APPLE)
- set(_addlibdir ENV DYLD_LIBRARY_PATH)
- else()
- set(_addlibdir ENV LD_LIBRARY_PATH)
- endif()
+ if(WIN32)
+ list(APPEND _addlibdir ENV LIB)
+ elseif(APPLE)
+ list(APPEND _addlibdir ENV DYLD_LIBRARY_PATH)
+ else()
+ list(APPEND _addlibdir ENV LD_LIBRARY_PATH)
endif()
list(APPEND _addlibdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")