Debian Codegraph @

src/c-blosc2/cmake/FindIPP.cmake

raw
1 # Find the Intel IPP (Integrated Performance Primitives)
2 #
3 # IPP_FOUND - System has IPP
4 # IPP_INCLUDE_DIRS - IPP include files directories
5 # IPP_LIBRARIES - The IPP libraries
6 #
7 # The environment variable IPPROOT is used to find the installation location.
8 # If the environment variable is not set we'll look for it in the default installation locations.
9 #
10 # Usage:
11 #
12 # find_package(IPP)
13 # if(IPP_FOUND)
14 # target_link_libraries(TARGET ${IPP_LIBRARIES})
15 # endif()
16
17 find_path(IPP_ROOT_DIR
18 include/ipp.h
19 PATHS
20 $ENV{IPPROOT}
21 /opt/intel/compilers_and_libraries/linux/ipp
22 /opt/intel/compilers_and_libraries/mac/ipp
23 "C:/IntelSWTools/compilers_and_libraries/windows/ipp/"
24 "C:/Program Files (x86)/IntelSWTools/compilers_and_libraries/windows/ipp"
25 $ENV{HOME}/intel/ipp
26 $ENV{HOME}/miniconda3
27 $ENV{USERPROFILE}/miniconda3/Library
28 "C:/Miniconda37-x64/Library" # Making AppVeyor happy
29 )
30
31 find_path(IPP_INCLUDE_DIR
32 ipp.h
33 PATHS
34 ${IPP_ROOT_DIR}/include
35 )
36
37 if(WIN32)
38 set(IPP_SEARCH_LIB ippcoremt.lib)
39 set(IPP_LIBS ippcoremt.lib ippsmt.lib ippdcmt.lib)
40 elseif(APPLE)
41 set(IPP_SEARCH_LIB libippcore.a)
42 set(IPP_LIBS libipps.a libippdc.a libippcore.a)
43 else() # Linux
44 set(IPP_SEARCH_LIB libippcore.so)
45 set(IPP_LIBS ipps ippdc ippcore)
46 endif()
47
48
49 find_path(IPP_LIB_SEARCHPATH
50 ${IPP_SEARCH_LIB}
51 PATHS
52 ${IPP_ROOT_DIR}/lib/intel64
53 ${IPP_ROOT_DIR}/lib
54 )
55
56 foreach(LIB ${IPP_LIBS})
57 find_library(${LIB}_PATH ${LIB} PATHS ${IPP_LIB_SEARCHPATH})
58 if(${LIB}_PATH)
59 set(IPP_LIBRARIES ${IPP_LIBRARIES} ${${LIB}_PATH})
60 set(IPP_FOUND TRUE)
61 else()
62 # message(STATUS "Could not find ${LIB}: disabling IPP")
63 set(IPP_NOTFOUND TRUE)
64 endif()
65 endforeach()
66
67 if(IPP_FOUND AND NOT IPP_NOTFOUND)
68 set(IPP_INCLUDE_DIRS ${IPP_INCLUDE_DIR})
69 include_directories(${IPP_INCLUDE_DIRS})
70 message(STATUS "Found IPP libraries in: ${IPP_LIBRARIES}")
71 else()
72 message(STATUS "No IPP libraries found.")
73 set(IPP_FOUND FALSE)
74 endif()