[Cmake] Two (related) questions

Geoffrey Cross geoff at cross . lu
Sun, 25 Aug 2002 18:23:14 +0100


1) 

In order to build a shared library under Windows, I have a set of
CMakeLists along the following lines:

ADD_LIBRARY(alibrary SHARED my_sources)

SOURCE_FILES(mysources
   Entrypoint.cxx
   Something.def
)

The .def fine is necessary in order to define the entry point for the
shared library under Windows.  However, under unix this doesn't work
because whilst the build stage ignores the .def file, the link stage
seems to assume that something.def has been compiled to something.o.
The make output looks like this:

c++ -o Entrypoint.o
c++ -o alibrary.so Entrypoint.o Something.o
c++: Something.o: No such file or directory

2)

I'd like to build a shared library under unix with something other than
a .so extension (I actually want a .mexgl extension because that's what
matlab expects).  How do I change the target build name for a shared
library?