[CMake] install( TARGETS module ...)

Mathieu Malaterre mathieu.malaterre at gmail.com
Fri Jul 1 09:32:30 EDT 2011


Dear all,

  I am trying to change the default behavior of cmake which installs
MODULE to the LIBRARY destination. For example:

...
add_library(test MODULE test.c)
install(TARGETS test
  RUNTIME DESTINATION bin
  LIBRARY DESTINATION lib
  ARCHIVE DESTINATION lib/static
  )
...

  Will install test.dll to lib, while a SHARED target would have been
installed to bin. Is there an easy work around ? I cannot change
MODULE to SHARED in add_library().
  I would also like to keep installation to lib, in case of UNIX
system (basically I want the SHARED behavior for install() but with
MODULE).

Thanks for suggestion,
-- 
Mathieu


More information about the CMake mailing list