Much thanks,
could this command be done with the BundleUtilities too? ADD_CUSTOM_COMMAND(TARGET Custom1 POST_BUILD COMMAND /usr/bin/macdeployqt ${PROJECT_NAME}.app WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMENT Prepare for deployment VERBATIM) Thanks in advance Best Regards -----Ursprüngliche Nachricht----- Von: David Cole [mailto:david.c...@kitware.com] Gesendet: Dienstag, 29. November 2011 23:44 An: NoRulez Cc: CMake MailingList Betreff: Re: [CMake] Get errors when executing shell scripts in post_build process as custom targets The double quoting is wrong. Do this (no quotes necessary): COMMAND /usr/bin/macdeployqt ${BUNDLE_IDENTIFIER} Not this: COMMAND "/usr/bin/macdeployqt ${BUNDLE_IDENTIFIER}" HTH, David On Tue, Nov 29, 2011 at 5:37 PM, NoRulez < <mailto:noru...@me.com> noru...@me.com> wrote: > Hi, > > > > I want to do something after the bundle is created (POST_BUILD). For > this I tried the following: > > > > ADD_EXECUTABLE(...) > > TARGET_LINK_LIBRARIES(...) > > ADD_DEPENDECIES(...) > > > > IF (APPLE) > > SET(BUNDLE_IDENTIFIER > "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.app") > > > > ADD_CUSTOM_TARGET(Custom1 ALL DEPENDS ${BUNDLE_IDENTIFIER}) > > > > ADD_CUSTOM_COMMAND(TARGET Custom1 POST_BUILD > > COMMAND "/usr/bin/macdeployqt > ${PROJECT_NAME}.app" > > #COMMAND "/usr/bin/macdeployqt > ${BUNDLE_IDENTIFIER}" > > WORKING_DIRECTORY > "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" > > COMMENT Prepare for deployment > > VERBATIM) > > ADD_CUSTOM_COMMAND(TARGET Custom1 POST_BUILD > > COMMAND /usr/bin/security > $ENV{HOME}/Library/Keychains/login.keychain" > > COMMENT Unlock the keychain > > VERBATIM) > > ADD_CUSTOM_COMMAND(TARGET Custom1 POST_BUILD > > COMMAND /usr/bin/codesign --force --verbose > --verify --sign \"${APPLICATION_CERTIFICATE}\" ${BUNDLE_IDENTIFIER}" > > COMMENT Sign the application bundle > > VERBATIM) > > ADD_CUSTOM_COMMAND(TARGET Custom1 POST_BUILD > > COMMAND /usr/bin/productbuild --component > \"${BUNDLE_IDENTIFIER}\" /Applications --sign \"${INSTALLER_CERTIFICATE}\" > --product \"${BUNDLE_IDENTIFIER}/Contents/Info.plist\" ${PROJECT_NAME}.pkg" > > WORKING_DIRECTORY > "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" > > COMMENT Build package > > VERBATIM) > > ENDIF(APPLE) > > > > But I get the the following error: > > /bin/sh: /usr/bin/macdeployqt MyApp.app: No such file or directory > > make[2]: *** [Custom1] Error 127 > > make[1]: *** [app/CMakeFiles/Custom1.dir/all] Error 2 > > make: *** [all] Error 2 > > > > I also tried to use the full path to the bundle but I get the same error. > > > > Does anyone know where could be the problem? > > Maybe this can also be done with the BundleUtilities? > > > > Thanks in advance > > > > Best Regards > > NoRulez > > > -- > > Powered by <http://www.kitware.com> www.kitware.com > > Visit other Kitware open-source projects at > <http://www.kitware.com/opensource/opensource.html> 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> http://www.cmake.org/Wiki/CMake_FAQ > > Follow this link to subscribe/unsubscribe: > <http://www.cmake.org/mailman/listinfo/cmake> http://www.cmake.org/mailman/listinfo/cmake
-- 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