Re: [CMake] Running OSX Bundle via open after creation with CMake/CPack
Le 23 juin 2014 à 03:11, Scott Klum scott.k...@gmail.com a écrit : I'm trying to make an OSX bundle using CMake/CPack on OSX that involves OpenCV and Qt (although I don't think those dependencies matter at this point). Everything compiles and the bundle is created fine, and I have a script that modifies the necessary library paths such the executable I'm making works if I run it from the Terminal within the bundle. The problem I'm having is if I try to run the MyApp.app file via the open command or by simply double clicking the app it gives me the error: LSOpenURLsWithRole() failed with error -10810 for the file /Applications/MyApp I've seen other solutions to other LSOpenURLsWithRole() errors involving modifying permissions, but that hasn't helped me. Also, this error code is an unknown error so I'm not sure how to proceed. -- Scott Klum Hello Scott, Does anything get printed in the terminal if you type and enter: /Applications/MyApp.app/Contents/MacOS/MyApp ?-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Running OSX Bundle via open after creation with CMake/CPack
Well, there's this information about unknown error -10810: http://www.thexlab.com/faqs/error-10810.html Does your app launch a lot of sub-processes at startup? Are you saying that you *can* run the app from the terminal window, but that you cannot run the app by double-clicking or by using open? (And that it's the exact same executable...?) What command line do you use if you're not using open? Is there an environment difference (maybe LD_LIBRARY_PATH or DYLD_LIBRARY_PATH?) between your Terminal, and your overall environment? Can you launch a debug build in a debugger? -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Running OSX Bundle via open after creation with CMake/CPack
Also, you may find extra hints about what's going wrong in the output of the Console application. (Usually found in /Applications/Utilities) -- see if there's anything in the system.log in there, or poke around and see if it has a crash report related to your app. HTH, David C. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Running OSX Bundle via open after creation with CMake/CPack
Lucas and David, Thank you for your responses. *Does anything get printed in the terminal if you type and enter: * */Applications/MyApp.app/Contents/MacOS/MyApp**?* This is what I mean when I say I can run it through the terminal. If I enter the above command the app starts properly. *Does your app launch a lot of sub-processes at startup?* Nope - and as far as I can tell the code in my main.cpp isn't even reached. *Are you saying that you *can* run the app from the terminal window, but that you cannot run the app by double-clicking or by using open? (And that it's the exact same executable...?) What command line do you use if you're not using open?* That's correct. I use the command described in the first response. *Is there an environment difference (maybe LD_LIBRARY_PATH or DYLD_LIBRARY_PATH?) between your Terminal, and your overall environment?* Not that I can tell. *Can you launch a debug build in a debugger?* Building in debug mode doesn't seem to make any difference. The fundamental problem seems to be whatever the open command does in the background, I haven't set things up properly in terms of open knowing that the when I run open MyApp.app, it should run MyApp.app/Contents/MacOS/MyApp. I've got CFBundleExecutable set to MyApp... in fact my .plist looks like this: ?xml version=1.0 encoding=UTF-8? !DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd; plist version=1.0 dict keyCFBundleDevelopmentRegion/key stringEnglish/string keyCFBundleExecutable/key stringMyApp/string keyCFBundleIdentifier/key stringcom.MyApp/string keyCFBundleInfoDictionaryVersion/key string6.0/string keyCFBundleName/key string MyApp/string keyCFBundleIconFile/key string MyApp/string keyCFBundlePackageType/key stringAPPL/string keyCFBundleShortVersionString/key string2.1.0/string keyCFBundleVersion/key string2.1.0/string keyCSResourcesFileMapped/key true/ keyLSRequiresCarbon/key true/ keyNSHighResolutionCapable/key true/ /dict /plist Again, not sure how to proceed. But, I really appreciate the help. Regards, Scott On Mon, Jun 23, 2014 at 6:13 AM, David Cole dlrd...@aol.com wrote: Also, you may find extra hints about what's going wrong in the output of the Console application. (Usually found in /Applications/Utilities) -- see if there's anything in the system.log in there, or poke around and see if it has a crash report related to your app. HTH, David C. -- Scott Klum B.S. in Computer Science, Michigan State University 2012 M.S. in Computer Science, Michigan State University 2014 -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Running OSX Bundle via open after creation with CMake/CPack
Also, I forgot to mention that using the Console Utility gives nondescript errors: it just says MyApp exited with code 127. On Mon, Jun 23, 2014 at 8:56 AM, Scott Klum scott.k...@gmail.com wrote: Lucas and David, Thank you for your responses. *Does anything get printed in the terminal if you type and enter: * */Applications/MyApp.app/Contents/MacOS/MyApp**?* This is what I mean when I say I can run it through the terminal. If I enter the above command the app starts properly. *Does your app launch a lot of sub-processes at startup?* Nope - and as far as I can tell the code in my main.cpp isn't even reached. *Are you saying that you *can* run the app from the terminal window, but that you cannot run the app by double-clicking or by using open? (And that it's the exact same executable...?) What command line do you use if you're not using open? * That's correct. I use the command described in the first response. *Is there an environment difference (maybe LD_LIBRARY_PATH or DYLD_LIBRARY_PATH?) between your Terminal, and your overall environment?* Not that I can tell. *Can you launch a debug build in a debugger?* Building in debug mode doesn't seem to make any difference. The fundamental problem seems to be whatever the open command does in the background, I haven't set things up properly in terms of open knowing that the when I run open MyApp.app, it should run MyApp.app/Contents/MacOS/MyApp. I've got CFBundleExecutable set to MyApp... in fact my .plist looks like this: ?xml version=1.0 encoding=UTF-8? !DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd; plist version=1.0 dict keyCFBundleDevelopmentRegion/key stringEnglish/string keyCFBundleExecutable/key stringMyApp/string keyCFBundleIdentifier/key stringcom.MyApp/string keyCFBundleInfoDictionaryVersion/key string6.0/string keyCFBundleName/key string MyApp/string keyCFBundleIconFile/key string MyApp/string keyCFBundlePackageType/key stringAPPL/string keyCFBundleShortVersionString/key string2.1.0/string keyCFBundleVersion/key string2.1.0/string keyCSResourcesFileMapped/key true/ keyLSRequiresCarbon/key true/ keyNSHighResolutionCapable/key true/ /dict /plist Again, not sure how to proceed. But, I really appreciate the help. Regards, Scott On Mon, Jun 23, 2014 at 6:13 AM, David Cole dlrd...@aol.com wrote: Also, you may find extra hints about what's going wrong in the output of the Console application. (Usually found in /Applications/Utilities) -- see if there's anything in the system.log in there, or poke around and see if it has a crash report related to your app. HTH, David C. -- Scott Klum B.S. in Computer Science, Michigan State University 2012 M.S. in Computer Science, Michigan State University 2014 -- Scott Klum B.S. in Computer Science, Michigan State University 2012 M.S. in Computer Science, Michigan State University 2014 -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Running OSX Bundle via open after creation with CMake/CPack
I figured out the issue. I have CPACK_BUNDLE_STARTUP_COMMAND to my startup bash script. This script modifies a bunch of library paths via install_name_tool. I cd into the directory containing the actual executable (MyApp.app/Contents/Resources/bin/) and work from there. This is pretty darn inefficient doing this every time the app starts, but I couldn't find a way to do it AFTER the package (I looked into execute_process, add_custom_command, etc. and nothing seemed to work after the myapp executable was put in the bin directory), so if anyone has a suggestion there it would be appreciated. After modifying the paths, I have a ./myapp command at the end of the script. I expected this to work because I had cd'd into the directory which contained myapp. However, switching this command to one with an absolute path (/Applications/MyApp.app/Contents/Resources/bin/myapp) resulted in everything working. I'm not sure if it's because this isn't the standard structure for a bundle or what but there you have it. Thanks for the suggestions. Regards, Scott On Mon, Jun 23, 2014 at 9:04 AM, Scott Klum scott.k...@gmail.com wrote: Also, I forgot to mention that using the Console Utility gives nondescript errors: it just says MyApp exited with code 127. On Mon, Jun 23, 2014 at 8:56 AM, Scott Klum scott.k...@gmail.com wrote: Lucas and David, Thank you for your responses. *Does anything get printed in the terminal if you type and enter: * */Applications/MyApp.app/Contents/MacOS/MyApp**?* This is what I mean when I say I can run it through the terminal. If I enter the above command the app starts properly. *Does your app launch a lot of sub-processes at startup?* Nope - and as far as I can tell the code in my main.cpp isn't even reached. *Are you saying that you *can* run the app from the terminal window, but that you cannot run the app by double-clicking or by using open? (And that it's the exact same executable...?) What command line do you use if you're not using open? * That's correct. I use the command described in the first response. *Is there an environment difference (maybe LD_LIBRARY_PATH or DYLD_LIBRARY_PATH?) between your Terminal, and your overall environment?* Not that I can tell. *Can you launch a debug build in a debugger?* Building in debug mode doesn't seem to make any difference. The fundamental problem seems to be whatever the open command does in the background, I haven't set things up properly in terms of open knowing that the when I run open MyApp.app, it should run MyApp.app/Contents/MacOS/MyApp. I've got CFBundleExecutable set to MyApp... in fact my .plist looks like this: ?xml version=1.0 encoding=UTF-8? !DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd; plist version=1.0 dict keyCFBundleDevelopmentRegion/key stringEnglish/string keyCFBundleExecutable/key stringMyApp/string keyCFBundleIdentifier/key stringcom.MyApp/string keyCFBundleInfoDictionaryVersion/key string6.0/string keyCFBundleName/key string MyApp/string keyCFBundleIconFile/key string MyApp/string keyCFBundlePackageType/key stringAPPL/string keyCFBundleShortVersionString/key string2.1.0/string keyCFBundleVersion/key string2.1.0/string keyCSResourcesFileMapped/key true/ keyLSRequiresCarbon/key true/ keyNSHighResolutionCapable/key true/ /dict /plist Again, not sure how to proceed. But, I really appreciate the help. Regards, Scott On Mon, Jun 23, 2014 at 6:13 AM, David Cole dlrd...@aol.com wrote: Also, you may find extra hints about what's going wrong in the output of the Console application. (Usually found in /Applications/Utilities) -- see if there's anything in the system.log in there, or poke around and see if it has a crash report related to your app. HTH, David C. -- Scott Klum B.S. in Computer Science, Michigan State University 2012 M.S. in Computer Science, Michigan State University 2014 -- Scott Klum B.S. in Computer Science, Michigan State University 2012 M.S. in Computer Science, Michigan State University 2014 -- Scott Klum B.S. in Computer Science, Michigan State University 2012 M.S. in Computer Science, Michigan State University 2014 -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake