[CMake] Add sources to a target library after add_library()?

Mathias Gaunard mathias.gaunard at ens-lyon.org
Wed Sep 5 21:34:23 EDT 2012


On 06/09/2012 00:30, Loaden wrote:
> Hi, I look this ML:
> http://www.cmake.org/pipermail/cmake/2010-January/034437.html
> Does CMake still can't support how to add sources to a target library
> after add_library()?
> I wan't support Precompiled Header for both MSVC / GCC(MinGW).
> In MSVC case, it need a source, e.g. StdAfx.cpp to support PCH.
> But in GCC case, it only need a header, e.g. pch.h
> Any help or comments or tips are best welcome!
> See: https://codereview.qt-project.org/#change,34052

I don't see what this feature would have to do with precompiled headers.

To use a precompiled header with GCC, just add -include 
path/to/precompiled/header.hpp to your compilation flags, and make sure 
you've built path/to/precompiled/header.hpp.gch before that.


More information about the CMake mailing list