[CMake] Linking my lib to a static lib

Eric Noulard eric.noulard at gmail.com
Mon Nov 3 09:53:02 EST 2008

2008/11/3 Daniel Blankensteiner <db at trunet.dk>:
> On Mon, 3 Nov 2008 15:39:15 +0100, "Eric Noulard" <eric.noulard at gmail.com>
> wrote:
>>> 1. The dependencies to the static libs are not included in my
>> VS-solution file.
>> I do not understand that question without an example,
>> do you mean that your lib is not rebuilt when "vendord.lib" is changed?
> No, vendord.lib is not mentioned in the solution file.

The 1) problem may directly related to the 2) problem,
if there is no lib there is not need for dependencies...

First fix 2) then go back to 1).

>>> set (SRC_FILES
>>>        mylib/channel.hpp
>>>        mylib/net/IP.hpp
>>> )
>> So CMake has nothing to compile thus nothing to build.
>> Try add at one "to-be-compiled" file to your lib.
> It should compile my header files, I have no .cpp files.
>> Are channel.hpp IP.hpp headers or not?
> Yes they are, but they also contain the implementations.

Pre-compiling header or compiling code is not the same job,
I don't know if pre-compiled headers may be put inside a lib.
Are you able to do that "by hand" (i.e. not with CMake) with Visual Studio?

For pre-compiled header support in CMake you may browse
the following tracker item
or ask other people.

I'm not using pre-compiled header at all so won't give you any advice
in this area.


More information about the CMake mailing list