[CMake] Install path problem on MinGW

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Sat Sep 6 08:18:48 EDT 2008


Jussi Pakkanen schrieb:
> Hi
> 
> I'm using CMake for Cuneiform (https://launchpad.net/cuneiform-linux). In my root CMakeLists.txt I have effectively the following:
> 
> set(LIBDIR "lib")
> 
> And then in source subdirectories I build shared libraries and install them with
> 
> install(TARGETS [library name] LIBRARY DESTINATION ${LIBDIR})
> 
> This works perfectly on Linux, OSX and FreeBSD. Recently a user tried to build Cuneiform with MinGW. He reports that the install command mentioned above gives the following kinds of errors (one for each library):
> 
> CMake Error at cuneiform_src/Kern/ccom/CMakeLists.txt:7 (install):
>   install Library TARGETS given no DESTINATION!
> 
> CMake then stops without generating makefiles. I asked him to add 
> message(STATUS "Lib subpath in ccom is ${LIBDIR}.") above the install command. CMake prints the correct value for LIBDIR so it should be set properly.
> 
> What could be causing this? I have no Windows machines so I can't debug this myself, nor do I have all that much MinGW experience.
> 
> Thanks for your help.
> 
> 
You only install the LIBRARY but not the ARCHIVE (the static import lib 
automatically created when you export functions from a lib on windows). 
A static library is also treated as ARCHIVE by cmake on windows.
So either remove LIBRARY or add a destination for ARCHIVE.
Another thing which comes to my mind is that a library is treated as 
RUNTIME - but I'm unsure atm :)

So best is - remove 'LIBRARY' and you'll be fine.


HTH
Christian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080906/c0bdb07e/attachment.pgp>


More information about the CMake mailing list