# Try to find IntelIPP
# Once done, this will define
#
# Ipp_FOUND - system has IntelIPP
# Ipp_INCLUDE_DIR - the IntelIPP include directories
# Ipp_LIBRARY - link these to use IntelIPP
include(LibFindMacros)
set(IPP_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../libs/intel/linux/intel_ipp)
# Include dir
find_path(Ipp_INCLUDE_DIR
NAMES ipp.h
PATHS ${IPP_ROOT_DIR}/include
)
find_library(Ipp_IRC_LIB
NAMES irc
PATHS ${IPP_ROOT_DIR}/lib/ia32
)
find_library(Ipp_MAT_LIB
NAMES ippm
PATHS ${IPP_ROOT_DIR}/lib/ia32
)
list(APPEND Ipp_LIBRARY ${Ipp_IRC_LIB} ${Ipp_MAT_LIB} )
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set Ipp_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(Ipp DEFAULT_MSG
Ipp_LIBRARY Ipp_INCLUDE_DIR)
# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library
set(Ipp_INCLUDE_DIRS ${Ipp_INCLUDE_DIR})
set(Ipp_LIBRARIES ${Ipp_LIBRARY})
My FindIpp.cmake script is shown above. On windows, I get
-- Could NOT find IPP (missing: IPP_INCLUDE_DIR IPP_LIBRARY).
I've tested this under Linux and it works without any issues. In both cases, I'm trying to cross-compile using the QNX Momentics toolchain.
- The ${CMAKE_CURRENT_SOURCE_DIR} is the location of the 'root' script which does include(FindIpp).
- I've looked at the output of ${CMAKE_CURRENT_SOURCE_DIR} and the output of the relative paths to make sure that the files and folders exist in the reported paths. ${CMAKE_CURRENT_SOURCE_DIR}/../libs/intel shows up as C:/../libs/intel.
- I use CMake 3.5 on Linux and CMake 3.6.1 on Windows 7.
- From a cmd prompt, I could type in 'cd c:/libs/intel' without any issues.
- I tried hardcoding the IPP_ROOT_DIR path to
set(IPP_ROOT_DIR C:/libs/intel/linux/intel_ipp)
, tried adding quotes around the path, appendedCACHE PATH "Description"
to theset
call. None of these worked. I tried -GNinja, -G "MinGW Makefiles" and -G "Unix Makefiles". Still came up with:
-- Could NOT find IPP (missing: IPP_INCLUDE_DIR IPP_LIBRARY) -- Could NOT find Mkl (missing: Mkl_LIBRARY Mkl_INCLUDE_DIR) -- Could NOT find Boost (missing: Boost_LIBRARY Boost_INCLUDE_DIR) -- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_MAIN_LIBRARY)
Copying and pasting contents from individual files like FindIpp.cmake into the main CMakeLists.txt file finds the libraries, but not the path to includes. Now I've also added
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SRC_DIR}/CMake/Modules)
to find my module files. If I remove that line, cmake throws an error atinclude(FindIpp)
. Is there anything obvious that I'm doing wrong? Also, is this the way to write a find_library or find_path? Thanks