# 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})
我的FindIpp.cmake脚本如上所示。在窗户上,我明白了
-- Could NOT find IPP (missing: IPP_INCLUDE_DIR IPP_LIBRARY).
我已经在Linux下对此进行了测试,但它没有任何问题。在这两种情况下,我都尝试使用QNX Momentics工具链进行交叉编译。
set(IPP_ROOT_DIR C:/libs/intel/linux/intel_ipp)
,尝试在路径周围添加引号,将CACHE PATH "Description"
附加到set
调用。这些都不起作用。我试过-GNinja,-G" MinGW Makefiles"和-G" Unix Makefiles"。仍然提出:
-- 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)
将FindIpp.cmake等单个文件中的内容复制并粘贴到主CMakeLists.txt文件中可查找库,但不会找到包含的路径。现在我还添加了list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SRC_DIR}/CMake/Modules)
来查找我的模块文件。如果我删除该行,则cmake会在include(FindIpp)
处抛出错误。
有什么明显的我做错了吗?另外,这是编写find_library还是find_path的方法?感谢
答案 0 :(得分:2)
所以从Windows和Linux交叉编译到QNX的正确方法是:
cmake -DCMAKE_SYSTEM_NAME="QNX" -DCMAKE_SYSTEM_VERSION="660" -DCMAKE_SYSTEM_PROCESSOR="x86" -GNinja path_to_project
其中660是QNX版本6.6.0。我使用自己的工具链文件进行QNX。这不是必需的。在share / cmake- / Modules / Platform下已经提供了一个。所以只要我们在某处定义上面的CMAKE变量,你就应该好了。