会挽雕弓如满月,西北望,射天狼
全部博文(14)
分类: LINUX
2015-06-29 10:36:23
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修饰对路径,链接时先转换成绝对路径再进行链接。*********************************************************************************************************
CMAKE_CURRENT_SOURCE_DIR:
The path to the source directory currently being processed.
This the full path to the source directory that is currently being processed by cmake.
大意是此值代表源文件路径, 即当前路径/source路径This the full path to the build directory that is currently being processed by cmake. Each directory added by add_subdirectory will create a binary directory in the build tree, and as it is being processed this variable will be set. For in-source builds this is the current source directory being processed.
大意是此值代表源文件路径, 每一个由add_subdirectory 添加的路径在编译树上创建一个二进制文件路径, 同时这个变量将被设置. 对于in-source 编译此值是当前源文件路径,对于out-source此值为 当前路径/编译路径