[CMake] Problem with library prefix/suffix when cross compiling.

Peter Visser pervulgo at gmail.com
Thu Nov 16 11:31:17 EST 2006


 Hi,

I have a working build under win32 with MSYS/MINGW, now I would like to
cross-compile code for win32 with mingw from linux with by using the same
CMakelists.txt files. It almost works, the problem is that the shared
libraries are not named "myex.dll" but "libmyex.so". By using the following
command for all the libraries it can be solved:

SET_TARGET_PROPERTIES(ex1
                                                  PROPERTIES PREFIX ""
                                                  SUFFIX ".dll"
                                                 )

However, now I have to change the CMakelist.txt in all the subdirectories
and lose the ability to compile natively for linux (without adding an
IF(UNIX) around the SET_TARGET_PROPERTIES).

Is there a global option to set the PREFIX and SUFFIX, set the BUILD_TARGET
to win32 or something alike?

I tried setting:

SET(UNIX FALSE)
SET(MINGW TRUE)
SET(WIN32 TRUE)

But that doesn't help.

Any help is appreciated,

Peter.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20061116/3bf0c9b2/attachment.html


More information about the CMake mailing list