usePCH C File Option

Syntax: Default:
file(usePCH[, yes])
file(usePCH, fileName)
file(usePCH, no)
file(usePCH, no)

This option determines whether the C compiler uses a precompiled header file, if it exists and is current.

By default, the C compiler does not use precompiled header files.

If you do not supply a name, the precompiled header file is named csetc.pch. If you do not supply an absolute path, the file name is relative to the current working directory.

To create a precompiled header file, use file(genPCH). Specify both file(genPCH) and file(usePCH) to keep precompiled header files up to date and to use them whenever possible. If you specify different file names with the two options, the name specified last is used for both options.

This option is implicitly set to no when any of the following options are in effect:

list(expAllInc)
list(expUserInc)
pp(preprocessOnly)

You can also use #pragma hdrfile in your source, to request precompiled headers. The file name in the pragma overrides the file name specified with this option.



C Compilation
Configuration Files
Precompiled C Headers
Organizing Your C Source for Precompiled Headers


Set Build Options
Build


C File Options