cmake - find_library找不到库?

时间:2017-11-16 16:26:19

标签: c++ cmake

我正在尝试让OpenEXR在Visual Studio 2015中运行。

OpenEXR已成功安装且安装路径为

C:\Program Files\openexr\

其中有两个子目录:IlmBaseopenexr

FindOpenEXR.cmake

    FIND_PATH(OPENEXR_INCLUDE_DIR ImfRgbaFile.h PATH_SUFFIXES OpenEXR PATHS $ENV{OPENEXR_PATH}/include $ENV{CPATH})
    FIND_LIBRARY(OPENEXR_HALF_LIBRARY NAMES Half PATHS $ENV{OPENEXR_PATH}/lib $ENV{LIBRARY_PATH})
    FIND_LIBRARY(OPENEXR_IEX_LIBRARY NAMES Iex PATHS $ENV{OPENEXR_PATH}/lib $ENV{LIBRARY_PATH})
    FIND_LIBRARY(OPENEXR_IMATH_LIBRARY NAMES Imath PATHS $ENV{OPENEXR_PATH}/lib $ENV{LIBRARY_PATH})
    FIND_LIBRARY(OPENEXR_ILMIMF_LIBRARY NAMES IlmImf PATHS $ENV{OPENEXR_PATH}/lib $ENV{LIBRARY_PATH})
    FIND_LIBRARY(OPENEXR_ILMTHREAD_LIBRARY NAMES IlmThread PATHS $ENV{OPENEXR_PATH}/lib $ENV{LIBRARY_PATH})

所以我创建了一个名为OPENEXR_PATH的环境变量,其值为

C:\Program Files\openexr\IlmBase;C:\Program Files\openexr\openexr;

C:\Program Files\openexr\IlmBase\lib下,有Half.libIex-2_2.libIexMath-2_2.libIlmThread-2_2.libImath-2_2.lib,以及相应的{{1}文件。

.dll下,有C:\Program Files\openexr\openexr\libIlmImf-2_2.lib以及IlmImfUtil-2_2.lib

我不知道为什么cmake找不到这些库?

.dll文件的版本号是否重要?路径中的.lib/

0 个答案:

没有答案