Excellent approach. Thank you.
KC Jones
[email protected]
SkypeId: bernalkc
On Jan 6, 2011, at 5:55 AM, Ryan Pavlik wrote:
> You'll need something closer to this:
>
>
> add_executable(myapp MACOSX_BUNDLE [...])
>
> find_file(helperpath [...])
> if(NOT helperpath)
> message(FATAL_ERROR "Need helper app!")
> endif()
>
> install(TARGETS myapp
> BUNDLE DESTINATION .
> RUNTIME DESTINATION bin
> )
>
> if(APPLE)
> install(PROGRAMS ${helperpath}
> DESTINATION ./myapp.app/Contents/MacOS
> )
> else()
> install(PROGRAMS ${helperpath}
> DESTINATION bin
> )
> endif()
> On Wed, Jan 5, 2011 at 9:22 PM, Michael Jackson <[email protected]>
> wrote:
> Can you use "Find_File()" to get the path to the file. Then use the
> install(FILES ... ) command to place the file in your app bundle. Not tried
> any of that but it might work.
> ___________________________________________________________
> Mike Jackson www.bluequartz.net
> Principal Software Engineer [email protected]
> BlueQuartz Software Dayton, Ohio
>
> On Jan 5, 2011, at 9:13 PM, KC Jones wrote:
>
> > I'm building an app on Mac, Linux, and Win.
> >
> > My application requires that a helper application, built outside of my
> > project, be installed along with it. On Linux and Win, its sufficient to
> > copy the helper app to the same directory as my app. On Mac, it needs to
> > be copied into the bundle in the same location as my runtime, in the
> > Contents/Macos/ bundle directory.
> >
> > I can't get the helper app to be packaged correctly on Mac. I've tried two
> > approaches that have come close but failed.
> >
> > First I tried adding the helper as a target, then using install(TARGETS...):
> > ----------------------------------------
> > ADD_EXECUTABLE(myapp MACOSX_BUNDLE [...])
> >
> > SET(helperpath [...])
> > SET(IMPORTED_LOCATION ${helperpath})
> > ADD_EXECUTABLE(myhelper IMPORTED)
> >
> > INSTALL(TARGETS myapp
> > BUNDLE DESTINATION .
> > RUNTIME DESTINATION bin
> > )
> >
> > INSTALL(TARGETS myhelper
> > BUNDLE DESTINATION .
> > RUNTIME DESTINATION bin
> > )
> > ----------------------------------------
> >
> > This fails in cmake with a message: "install TARGETS given target
> > "myhelper" which does not exist in this directory."
> >
> > If I alter the INSTALL with a fully qualified path to myhelper I get the
> > same message, with the fully qualified myhelper path.
> >
> > Next, I tried using INSTALL(PROGRAMS...) with something like:
> > ----------------------------------------
> > ADD_EXECUTABLE(myapp MACOSX_BUNDLE [...])
> >
> > SET(helperpath [...])
> >
> > INSTALL(TARGETS myapp
> > BUNDLE DESTINATION .
> > RUNTIME DESTINATION bin
> > )
> >
> > INSTALL(PROGRAMS ${helperpath}/myhelper
> > DESTINATION .
> > )
> > ----------------------------------------
> >
> > But this form PROGRAMS does not support the kind-of qualifiers (BUNDLE,
> > RUNTIME), so helperapp gets copied next to the bundle on Mac, not into it
> > where it needs to be.
> >
> > What am I doing wrong?
> >
> > KC Jones
> > [email protected]
> > SkypeId: bernalkc
> >
> > _______________________________________________
> > 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
>
> _______________________________________________
> 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
>
>
>
> --
> Ryan Pavlik
> HCI Graduate Student
> Virtual Reality Applications Center
> Iowa State University
>
> [email protected]
> http://academic.cleardefinition.com
> Internal VRAC/HCI Site: http://tinyurl.com/rpavlik
> _______________________________________________
> 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
_______________________________________________
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