cmake include_directories分析

自动化编译这几天快把我折磨透了,好烦,但是还要加班来搞,现在静下来慢慢分析:

看官方文档解释:

  • include_directories: 编译时加到包含目录
  •   include_directories([AFTER|BEFORE] [SYSTEM] dir1 dir2 ...)
    

    Add the given directories to those the compiler uses to search for include files. These directories are added to the directory property INCLUDE_DIRECTORIES for the current CMakeLists file. They are also added to the target property INCLUDE_DIRECTORIES for each target in the current CMakeLists file. The target property values are the ones used by the generators.

    By default the directories are appended onto the current list of directories. This default behavior can be changed by setting CMAKE_INCLUDE_DIRECTORIES_BEFORE to ON. By using AFTER or BEFORE explicitly, you can select between appending and prepending, independent of the default. If the SYSTEM option is given, the compiler will be told the directories are meant as system include directories on some platforms.

  • 增加指定目录给指定编译器去搜索包含文件。这些目录被当前CMakeLists文件以INCLUDE_DIRECTORIES 来加进文件属性。他们也被


你可能感兴趣的:(cmake include_directories分析)