cmake工程中常用到的变量

参考:https://cmake.org/cmake/help/v3.0/index.html

CMAKE_PREFIX_PATH:

Path used for searching by FIND_XXX(), with appropriate suffixes added.

Specifies a path which will be used by the FIND_XXX() commands. It contains the “base” directories, the FIND_XXX() commands append appropriate subdirectories to the base directories. So FIND_PROGRAM() adds /bin to each of the directories in the path, FIND_LIBRARY() appends /lib to each of the directories, and FIND_PATH() and FIND_FILE() append /include . By default it is empty, it is intended to be set by the project. See also CMAKE_SYSTEM_PREFIX_PATH, CMAKE_INCLUDE_PATH, CMAKE_LIBRARY_PATH, CMAKE_PROGRAM_PATH.

CMAKE_MODULE_PATH

List of directories to search for CMake modules.

Commands like include() and find_package() search for files in directories listed by this variable before checking the default modules that come with CMake.

LIBRARY_PATH

在编译找动态库的路径

LD_LIBRARY_PATH

在运行时找动态库的路径

C_INCLUDE_PATH

编译C文件时找的头文件地址

CPLUS_INCLUDE_PATH

编译C++文件时找的头文件地址

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容