在cmake的所有cpp文件中包含c ++标头[duplicate]

时间:2022-04-21 15:03:06

This question already has an answer here:

这个问题在这里已有答案:

Is there any way to include a header (.hpp) in all cpp files from a project (automatic)?

有没有办法在项目的所有cpp文件中包含一个标题(.hpp)(自动)?

The project is compiled using cmake.

该项目使用cmake编译。

1 个解决方案

#1


0  

You can use pre-compiled headers to that. Cross-compile implementation of that for CMake is not very easy, so, I recommend 3rd party module for that, for example CMakePCHCompiler

您可以使用预编译的标头。用于CMake的交叉编译实现并不是很容易,因此,我推荐使用第三方模块,例如CMakePCHCompiler

#1


0  

You can use pre-compiled headers to that. Cross-compile implementation of that for CMake is not very easy, so, I recommend 3rd party module for that, for example CMakePCHCompiler

您可以使用预编译的标头。用于CMake的交叉编译实现并不是很容易,因此,我推荐使用第三方模块,例如CMakePCHCompiler