[CMake] c++ and static initalizations

Aleix Pol aleixpol at kde.org
Sat Jan 24 10:00:45 EST 2009


hi list,
I'm having a little problem involving c++ static initializations using
static libraries libraries. The problem is that if I link this code to the
executable as a static library the code is never run, but if it is a SHARED
library it is, but I need it to be static (if possible).

The code looks like this:
struct AClass {
    static Object* registration() {...}
    static int Aregistered=something("A", AClass::registration);
};

Any hint on what should I do so that it is called as i expect?

Thanks,
aleix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090124/a2b3829e/attachment.htm>


More information about the CMake mailing list