浏览代码

Help: configure_file doc example use `target_include_directories`

Fixes #24351
Robert Maynard 2 年之前
父节点
当前提交
c89d467bf2
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Help/command/configure_file.rst

+ 2 - 2
Help/command/configure_file.rst

@@ -174,12 +174,12 @@ Otherwise it will contain:
   /* #undef FOO_ENABLE */
   /* #undef FOO_ENABLE */
   /* #undef FOO_STRING */
   /* #undef FOO_STRING */
 
 
-One may then use the :command:`include_directories` command to
+One may then use the :command:`target_include_directories` command to
 specify the output directory as an include directory:
 specify the output directory as an include directory:
 
 
 .. code-block:: cmake
 .. code-block:: cmake
 
 
-  include_directories(${CMAKE_CURRENT_BINARY_DIR})
+  target_include_directories(<target> [SYSTEM] <INTERFACE|PUBLIC|PRIVATE> "${CMAKE_CURRENT_BINARY_DIR}")
 
 
 so that sources may include the header as ``#include <foo.h>``.
 so that sources may include the header as ``#include <foo.h>``.