Dear CMake developers, I wish to raise up the subject about native precompiled header support in CMake. There are obvious reasons to use precompiled headers with big source code bases, and there were several requests on the list for precompiled header support and several 3rd party implementations.
Now I wish to share mine: https://github.com/nanoant/CMakePCHCompiler The main goal is to solve shortcomings on all solutions using custom commands, that simply are not able to catch all compiler defines or flags, like these added via add_definitions, simply because these flags are accessible via any variable back to custom function. My solution uses a CXX meta-compiler (CXXPCH) that simply defines patched compiler run template. This ensures that all defines and flags also apply to precompiled header. I also want to suggest to put native precompiled header support somewhere high on the TODO list and I propose this simple API for specifying precompiled header for given target: target_precompiled_header(<target> <path/to/precompiled_header.h>) target_precompiled_header(<target> <path/to/precompiled_header.h> SHARED <other_target_to_share_precompiled_header_with>) Regards, -- Adam -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers