Skip to content

Instantly share code, notes, and snippets.

@HansNewbie
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HansNewbie/b83da758ae199d5b73bc to your computer and use it in GitHub Desktop.
Save HansNewbie/b83da758ae199d5b73bc to your computer and use it in GitHub Desktop.
CMAKE Note

====

INSTALL( TARGETS [library name]
         LIBRARY DESTINATION $(LIBDIR)] )

In Windows, this will give error install Library Targets given no DESTINATION. http://www.cmake.org/pipermail/cmake/2008-September/023876.html

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

====

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment