[CMake] Inconsistency with INSTALL(TARGETS) destinations...

Petr Kmoch petr.kmoch at gmail.com
Wed Mar 11 03:47:21 EDT 2015


Do you even *have* any LIBRARY targets on Windows? Quoting the docs (
http://www.cmake.org/cmake/help/v3.2/command/install.html#installing-targets
):

"Static libraries are always treated as ARCHIVE targets. Module libraries
are always treated as LIBRARY targets. For non-DLL platforms shared
libraries are treated as LIBRARY targets, except that those marked with the
FRAMEWORK property are treated as FRAMEWORK targets on OS X. For DLL
platforms the DLL part of a shared library is treated as a RUNTIME target
and the corresponding import library is treated as an ARCHIVE target. All
Windows-based systems including Cygwin are DLL platforms."

Unless you're building MODULE libraries, you'll normally only have RUNTIME
(.dll) and ARCHIVE (.lib) targets on Windows, and LIBRARY (.so) and ARCHIVE
(.a) targets on Unixes.

Petr

On Wed, Mar 11, 2015 at 8:32 AM, Rolf Eike Beer <eike at sf-mail.de> wrote:

> Am Dienstag, 10. März 2015, 17:48:48 schrieb J Decker:
> > > And it's mostly wrong, e.g. lib64 is not correct for many systems. If
> you
> > > want Unix like subdirectories, use the GnuIntallDirs module.
> >
> > Better?
> >
> > if( WIN32 )
> >    install( TARGETS MatrixSSL RUNTIME DESTINATION bin LIBRARY DESTINATION
> > bin ARCHIVE DESTINATION lib )
> > else( WIN32 )
> >    include( GNUInstallDirs )
> >    install( TARGETS MatrixSSL DESTINATION ${CMAKE_INSTALL_LIBDIR ) )
> > endif( WIN32 )
>
> You don't even need the if(), the module will handle that alone. Just
> specify
> all 3 flavors since they only overlap for the static lib for the different
> platforms.
>
> Greetings,
>
> Eike
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150311/839a4446/attachment.html>


More information about the CMake mailing list