7
7
#
8
8
# On return this will define:
9
9
#
10
- # HAVE_MKL - True if Intel IPP found
11
- # MKL_ROOT_DIR - root of IPP installation
12
- # MKL_INCLUDE_DIRS - IPP include folder
13
- # MKL_LIBRARIES - IPP libraries that are used by OpenCV
10
+ # HAVE_MKL - True if Intel MKL found
11
+ # MKL_ROOT_DIR - root of MKL installation
12
+ # MKL_INCLUDE_DIRS - MKL include folder
13
+ # MKL_LIBRARIES - MKL libraries that are used by OpenCV
14
14
#
15
15
16
16
macro (mkl_find_lib VAR NAME DIRS )
@@ -21,7 +21,7 @@ endmacro()
21
21
22
22
macro (mkl_fail )
23
23
set (HAVE_MKL OFF )
24
- set (MKL_ROOT_DIR ${MKL_ROOT_DIR} CACHE PATH "Path to MKL directory" )
24
+ set (MKL_ROOT_DIR " ${MKL_ROOT_DIR} " CACHE PATH "Path to MKL directory" )
25
25
return ()
26
26
endmacro ()
27
27
@@ -46,23 +46,26 @@ if(NOT DEFINED MKL_USE_MULTITHREAD)
46
46
endif ()
47
47
48
48
#check current MKL_ROOT_DIR
49
- if (NOT MKL_ROOT_DIR OR NOT EXISTS ${MKL_ROOT_DIR} /include/mkl.h )
50
- set (mkl_root_paths ${MKL_ROOT_DIR} )
49
+ if (NOT MKL_ROOT_DIR OR NOT EXISTS " ${MKL_ROOT_DIR} /include/mkl.h" )
50
+ set (mkl_root_paths " ${MKL_ROOT_DIR} " )
51
51
if (DEFINED ENV{MKLROOT} )
52
- list (APPEND mkl_root_paths $ENV{MKLROOT} )
52
+ list (APPEND mkl_root_paths " $ENV{MKLROOT} " )
53
53
endif ()
54
- if (WIN32 )
54
+
55
+ if (WITH_MKL AND NOT mkl_root_paths )
56
+ if (WIN32 )
55
57
set (ProgramFilesx86 "ProgramFiles(x86)" )
56
58
list (APPEND mkl_root_paths $ENV{${ProgramFilesx86}}/IntelSWTools/compilers_and_libraries/windows/mkl )
57
- endif ()
58
- if (UNIX )
59
+ endif ()
60
+ if (UNIX )
59
61
list (APPEND mkl_root_paths "/opt/intel/mkl" )
62
+ endif ()
60
63
endif ()
61
64
62
65
find_path (MKL_ROOT_DIR include /mkl.h PATHS ${mkl_root_paths} )
63
66
endif ()
64
67
65
- set (MKL_INCLUDE_DIRS ${MKL_ROOT_DIR} /include CACHE PATH "Path to MKL include directory" )
68
+ set (MKL_INCLUDE_DIRS " ${MKL_ROOT_DIR} /include" CACHE PATH "Path to MKL include directory" )
66
69
67
70
if (NOT MKL_ROOT_DIR
68
71
OR NOT EXISTS "${MKL_ROOT_DIR} "
@@ -128,9 +131,9 @@ endforeach()
128
131
129
132
message (STATUS "Found MKL ${MKL_VERSION_STR} at: ${MKL_ROOT_DIR} " )
130
133
set (HAVE_MKL ON )
131
- set (MKL_ROOT_DIR ${MKL_ROOT_DIR} CACHE PATH "Path to MKL directory" )
132
- set (MKL_INCLUDE_DIRS ${MKL_INCLUDE_DIRS} CACHE PATH "Path to MKL include directory" )
133
- set (MKL_LIBRARIES ${MKL_LIBRARIES} CACHE STRING "MKL libarries" )
134
+ set (MKL_ROOT_DIR " ${MKL_ROOT_DIR} " CACHE PATH "Path to MKL directory" )
135
+ set (MKL_INCLUDE_DIRS " ${MKL_INCLUDE_DIRS} " CACHE PATH "Path to MKL include directory" )
136
+ set (MKL_LIBRARIES " ${MKL_LIBRARIES} " CACHE STRING "MKL libarries" )
134
137
if (UNIX AND NOT MKL_LIBRARIES_DONT_HACK )
135
138
#it's ugly but helps to avoid cyclic lib problem
136
139
set (MKL_LIBRARIES ${MKL_LIBRARIES} ${MKL_LIBRARIES} ${MKL_LIBRARIES} "-lpthread" "-lm" "-ldl" )
0 commit comments