From c2be82e5d6b846de0da61525d288df9dfeca1be9 Mon Sep 17 00:00:00 2001 From: Micke Prag Date: Tue, 28 Feb 2012 14:28:55 +0100 Subject: [PATCH] Copy the plugin to the destination folder after build instead of the combination using LIBRARY_OUTPUT_DIRECTORY and PREFIX. This allows us to build the plugins as universal binaries. Closes #121 --- telldus-gui/Plugins/TelldusCenterPlugin.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/telldus-gui/Plugins/TelldusCenterPlugin.cmake b/telldus-gui/Plugins/TelldusCenterPlugin.cmake index 33ab90e9..4516856b 100644 --- a/telldus-gui/Plugins/TelldusCenterPlugin.cmake +++ b/telldus-gui/Plugins/TelldusCenterPlugin.cmake @@ -94,9 +94,14 @@ IF(Plugin_SRCS) TARGET_LINK_LIBRARIES( ${Plugin_NAME} ${Plugin_LIBRARIES} ) IF (APPLE) + ADD_CUSTOM_COMMAND(TARGET ${Plugin_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${Plugin_NAME}.dylib + ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/TelldusCenter.app/Contents/Plugins/script + COMMENT "Copy plugin ${Plugin_NAME} to destination bundle" + ) SET_TARGET_PROPERTIES(${Plugin_NAME} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/TelldusCenter.app/Contents/Plugins/script - PREFIX "../" + PREFIX "" ) INSTALL(CODE " GET_FILENAME_COMPONENT(DESTDIR \$ENV{DESTDIR} ABSOLUTE)