File tree Expand file tree Collapse file tree 2 files changed +27
-5
lines changed
Expand file tree Collapse file tree 2 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -3,14 +3,26 @@ set(BLAS_ROOT "" CACHE STRING "Root directory of BLAS or OpenBLAS")
33message (STATUS "BLAS_ROOT is " ${BLAS_ROOT} )
44
55if (WIN32 )
6- find_package (OpenBLAS CONFIG REQUIRED)
6+ if (NOT (BLAS_ROOT STREQUAL "" ))
7+ message (STATUS "Looking for blas in " ${BLAS_ROOT} )
8+ set (OpenBLAS_ROOT ${BLAS_ROOT} )
9+ find_package (OpenBLAS CONFIG NO_DEFAULT_PATH)
10+
11+ if (OpenBLAS_FOUND)
12+ message (STATUS "OpenBLAS CMake config path: ${metis_DIR} " )
13+ else ()
14+ find_package (OpenBLAS CONFIG REQUIRED)
15+ if (OpenBLAS_FOUND)
16+ message (STATUS "OpenBLAS CMake config path: ${metis_DIR} " )
17+ endif ()
18+ endif ()
719 message (STATUS "OpenBLAS CMake config path: ${OpenBLAS_DIR} " )
820elseif (NOT APPLE )
921 # LINUX
1022
1123 # If a BLAS install was specified try to use it first.
1224 if (NOT (BLAS_ROOT STREQUAL "" ))
13- message (STATUS "Looking for blas CMake targets file in " ${BLAS_ROOT} )
25+ message (STATUS "Looking for blas in " ${BLAS_ROOT} )
1426
1527 find_library (OPENBLAS_LIB
1628 NAMES openblas
Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ else()
179179 # Optional HIPO
180180 if (HIPO)
181181
182- target_include_directories (highs PRIVATE
182+ target_include_directories (highs PRIVATE
183183 $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR} /highs/hipo>
184184 $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR} /highs/hipo/auxiliary>
185185 $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR} /highs/hipo/factorhighs>
@@ -190,8 +190,18 @@ else()
190190 target_link_libraries (highs "-framework Accelerate" )
191191 target_compile_definitions (highs PRIVATE HIPO_USES_APPLE_BLAS)
192192 elseif (WIN32 )
193- target_link_libraries (highs OpenBLAS::OpenBLAS)
194- target_compile_definitions (highs PRIVATE HIPO_USES_OPENBLAS)
193+
194+ if (TARGET OpenBLAS::OpenBLAS)
195+ target_link_libraries (highs PRIVATE OpenBLAS::OpenBLAS)
196+ elseif (DEFINED OPENBLAS_LIB)
197+ message (STATUS "Linking against OpenBLAS via raw library: ${OPENBLAS_LIB} " )
198+ target_link_libraries (highs PRIVATE ${OPENBLAS_LIB} )
199+ target_include_directories (highs PRIVATE ${OPENBLAS_INCLUDE_DIR} )
200+ else ()
201+ message (FATAL_ERROR "OpenBLAS not found on Windows." )
202+ endif ()
203+
204+ target_compile_definitions (highs PRIVATE HIPO_USES_OPENBLAS)
195205 else ()
196206 # LINUX
197207 if (BLAS_LIB)
You can’t perform that action at this time.
0 commit comments