CMakePCHCompiler
CMakePCHCompiler copied to clipboard
target_precompiled_header(Foo bar.h) creates both CMakeFiles/Foo.pch.dir/Bar.h.gch and CMakeFiles/Foo.dir/Bar.h.gch targets
I am trying to use this package under Ubuntu with gcc, and somehow I get the following:
- The make rules for creating and using CMakeFiles/Foo.pch.dir/Bar.h.gch are done correctly - everything works
- But there is also a make rule for creating CMakeFiles/Foo.dir/Bar.h.gch by compiling CMakeFiles/Foo.pch.dir/Bar.h (which fails as there is no such .h)... I could not figure out where it is coming from...
Can you please provide me exact GCC and CMake version you are using. This issue may be specific to some recent CMake versions.
Are you are including H files in your project? From my experience, this basically cannot work with this module (maybe a note should be added to the README file.) The purpose of including H is to make the headers visible in project trees like Visual Studio's, however in general, CMake doesn't do anything else with them.
CMake conflates the H files with a GCH/PCH's input. It's just a guess. (I really can't say what's happening here.) Unfortunately, you must choose between PCH benefits and seeing H files in your project editor.
I have seen this issue with cmake 2.8.12.2 and gcc 4.9.4 on Ubuntu 14.04.1, possibly in other configurations as well (this was obviuously a while ago).
Please provide minimal CMakeLists.txt example with exact configuration, so I can try to replicate this in Docker for example.
I no longer have access to that example, sorry.