diff options
author | Brad King <brad.king@kitware.com> | 2017-05-10 13:25:03 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-05-10 13:25:07 (GMT) |
commit | 07e30f082c73fe9fbeadafb97ca479e03f46c9bb (patch) | |
tree | 9e13e324104df2d1eb1bb02c5075295a3346f973 | |
parent | 8a19ce47679580445a5ae291ecfbb3e88c8c6aeb (diff) | |
parent | 32400110fe7ea1b624d19625b5ae606f5f47814d (diff) | |
download | CMake-07e30f082c73fe9fbeadafb97ca479e03f46c9bb.zip CMake-07e30f082c73fe9fbeadafb97ca479e03f46c9bb.tar.gz CMake-07e30f082c73fe9fbeadafb97ca479e03f46c9bb.tar.bz2 |
Merge topic 'doc-HEADER_FILE_ONLY-use-case'
32400110 Help: Document HEADER_FILE_ONLY use case
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !812
-rw-r--r-- | Help/command/add_executable.rst | 3 | ||||
-rw-r--r-- | Help/command/add_library.rst | 4 | ||||
-rw-r--r-- | Help/prop_sf/HEADER_FILE_ONLY.rst | 15 |
3 files changed, 22 insertions, 0 deletions
diff --git a/Help/command/add_executable.rst b/Help/command/add_executable.rst index 19ca658..c088796 100644 --- a/Help/command/add_executable.rst +++ b/Help/command/add_executable.rst @@ -40,6 +40,9 @@ the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for available expressions. See the :manual:`cmake-buildsystem(7)` manual for more on defining buildsystem properties. +See also :prop_sf:`HEADER_FILE_ONLY` on what to do if some sources are +pre-processed, and you want to have the original sources reachable from +within IDE. -------------------------------------------------------------------------- diff --git a/Help/command/add_library.rst b/Help/command/add_library.rst index 3a76040..02788e3 100644 --- a/Help/command/add_library.rst +++ b/Help/command/add_library.rst @@ -59,6 +59,10 @@ the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for available expressions. See the :manual:`cmake-buildsystem(7)` manual for more on defining buildsystem properties. +See also :prop_sf:`HEADER_FILE_ONLY` on what to do if some sources are +pre-processed, and you want to have the original sources reachable from +within IDE. + Imported Libraries ^^^^^^^^^^^^^^^^^^ diff --git a/Help/prop_sf/HEADER_FILE_ONLY.rst b/Help/prop_sf/HEADER_FILE_ONLY.rst index b4fb2db..71d62ae 100644 --- a/Help/prop_sf/HEADER_FILE_ONLY.rst +++ b/Help/prop_sf/HEADER_FILE_ONLY.rst @@ -7,3 +7,18 @@ A property on a source file that indicates if the source file is a header file with no associated implementation. This is set automatically based on the file extension and is used by CMake to determine if certain dependency information should be computed. + +By setting this property to ``ON``, you can disable compilation of +the given source file, even if it should be compiled because it is +part of the library's/executable's sources. + +This is useful if you have some source files which you somehow +pre-process, and then add these pre-processed sources via +:command:`add_library` or :command:`add_executable`. Normally, in IDE, +there would be no reference of the original sources, only of these +pre-processed sources. So by setting this property for all the original +source files to ``ON``, and then either calling :command:`add_library` +or :command:`add_executable` while passing both the pre-processed +sources and the original sources, or by using :command:`target_sources` +to add original source files will do exactly what would one expect, i.e. +the original source files would be visible in IDE, and will not be built. |