On 07/01/2011 03:32 PM, Mathieu Malaterre wrote: > 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,
The only solution I'm aware of is a Windows-selective destination, e.g.: ADD_LIBRARY(test MODULE ...) IF(WIN32) SET(MODDST bin CACHE STRING "...") ELSE() SET(MODDST lib CACHE STRING "...") ENDIF() INSTALL(TARGETS test RUNTIME DESTINATION bin LIBRARY DESTINATION ${MODDST} ARCHIVE DESTINATION lib/static ... ) Regards, Michael _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake