zoukankan      html  css  js  c++  java
  • CMake 文件 link_directories() 使用相对路径失败的问题

    今天再编译工程时,遇到了这个问题:

    Policy CMP0015 is not set: link_directories() treats paths relative to the source dir.

    看到了这一篇 博客
    解决了这个问题,核心如下:

    In CMake 2.8.0 and lower the link_directories() command passed relative paths unchanged to the linker. In CMake 2.8.1 and above the link_directories() command prefers to interpret relative paths with respect to CMAKE_CURRENT_SOURCE_DIR, which is consistent with include_directories() and other commands. The OLD behavior for this policy is to use relative paths verbatim in the linker command. The NEW behavior for this policy is to convert relative paths to absolute paths by appending the relative path to CMAKE_CURRENT_SOURCE_DIR.

    CMake 2.8.0 以下的版本,加载动态链接库link_directories()时使用相对路径,链接时也使用相对路径;CMake 2.8.1 及以上版本加载动态链接库link_directories()时使用CMAKE_CURRENT_SOURCE_DIR修饰对路径,链接时先转换成绝对路径再进行链接。

  • 相关阅读:
    实验任务四
    java语言基础第二讲 课程作业02 总结
    java 计算精度处理
    构建之法阅读笔记02
    周活动总结表
    周进度条
    构建之法阅读笔记01
    四则运算软件需求规格说明书
    四则运算2
    周进度条
  • 原文地址:https://www.cnblogs.com/walnuttree/p/11595206.html
Copyright © 2011-2022 走看看