Re: Problem of building gtkmm program with CMake under Windows



On Fri, 2009-03-20 at 17:41 +1100, Dancefire wrote:
> Hi,
> 
> Has anyone successfully build gtkmm program with CMake under Windows?
> I have tried, but got many problem, one is inside the cmake script of
> finding gtkmm. The problem is that it use pkg-config for finding
> gtkmm. It's ok to find the location of the library, however, it's fail
> to get the correct library name. The script trying to link my simple
> gtkmm program with "gtkmm-2.4.lib":

I don't know CMake at all. Where does the "gtkmm-2.4.lib", which does
not exist, come from?

> LINK : fatal error LNK1104: cannot open file 'gtkmm-2.4.lib' 
> 
> however, there is only:
> 
> gtkmm-vc80-2_4.lib
> gtkmm-vc80-d-2_4.lib
> gtkmm-vc90-2_4.lib
> gtkmm-vc90-d-2_4.lib
> 
> Is there anything we can do to make my gtkmm program build with CMake
> automatically?

> The name format of .lib file is similar to the Boost library. In
> Boost, it use autolink technology to handle the link problem under
> different compile setting. Can gtkmm use autolink to replace the
> settings in MSVC property sheet? I think it is better way for MSVC.

If I understand this correctly, then auto-linking would basically
require some #pragma lib(gtkmm-vc80-2_4.lib) lines in a header file.
However, how does that header file know what version of the library to
link with?

A way I could think of would be to add a "gtkmm_link.h" file or
something into special subdirectories, one for each version of the
library we provide, such as gtkmm-vc80-2_4. Then, the property sheet
could add the path corresponding to its version to the include search
path.

Finally, we would need to make sure that "gtkmm_link.h" is included
whenever including a gtkmm header file. So we'd basically need to add it
to every gtkmm header. Plus every libxml++ and libglademm header. I'm
not sure we want this.

Is there a better approach to do the auto-linking?

Armin




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]