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修饰对路径,链接时先转换成绝对路径再进行链接。

  • 相关阅读:
    杭电2007
    杭电 2004
    杭电2005
    杭电2001
    杭电 2000
    Section One
    杭电oj 1002
    杭电oj 1001
    JavaScript高级程序设计第14章表单脚本 (学习笔记)
    JavaScript高级程序设计(学习笔记)
  • 原文地址:https://www.cnblogs.com/walnuttree/p/11595206.html
Copyright © 2011-2022 走看看