[CMake] OS X, embedding Frameworks and generator problems

Francisco Requena the.adx at gmail.com
Fri Mar 5 06:58:52 EST 2010


Yes, I tried, but without success.

My resulting file is:

cmake_minimum_required(VERSION 2.8)

project(openvolt)

set(APP_NAME "OpenVolt")

include(FindSDL)
string(REPLACE "-framework Cocoa" "" SDL_LIBRARY ${SDL_LIBRARY})
include(FindOpenGL)
include(BundleUtilities)

include_directories(${SDL_INCLUDE_DIR})

add_executable(${APP_NAME} MACOSX_BUNDLE main.cpp)

target_link_libraries(${APP_NAME} ${SDL_LIBRARY} SDLmain)

if(APPLE)
  install(DIRECTORY ${SDL_LIBRARY} DESTINATION
${APP_NAME}.app/Contents/Frameworks)
endif(APPLE)

However, it doesn't copies the framework. It just does nothing.

2010/3/5 Michael Wild <themiwi at gmail.com>

> As Werner Smekal already mentioned (
> http://www.cmake.org/pipermail/cmake/2010-March/035636.html), for SDL it
> is apparently not necessary to use BundleUtilities. Have you tried this?
>
> Michael
>
>
> On 5. Mar, 2010, at 12:50 , Francisco Requena wrote:
>
> > However, I can't get it working. My aim is to make an standalone .app
> > bundle, distributable with SDL embedded. How should I use BundleUtilities
> to
> > get rid of this?
> >
> > Thanks.
> >
> > 2010/3/5 Michael Wild <themiwi at gmail.com>
> >
> >> http://www.cmake.org/Wiki/BundleUtilitiesExample
> >>
> >> Michael
> >>
> >> On 5. Mar, 2010, at 9:40 , Francisco Requena wrote:
> >>
> >>> So how do I embeed a framework on an OS X bundle?
> >>> Jjgod Jiang has the same problem here:
> >>> http://www.cmake.org/pipermail/cmake/2009-September/031713.html
> >>>
> >>> 2010/3/5 David Cole <david.cole at kitware.com>
> >>>
> >>>> SDL_library is not a source file, so don't call:
> >>>> set_source_files_properties
> >>>> on it...
> >>>>
> >>>> That should eliminate the spurious content copy attempt...
> >>>>
> >>>>
> >>>> On Thu, Mar 4, 2010 at 6:17 PM, Francisco Requena <the.adx at gmail.com
> >>> wrote:
> >>>>
> >>>>> Hi,
> >>>>>
> >>>>> I'm trying to develop a simple application using SDL on OS X. Here's
> my
> >>>>> CMakeLists.txt:
> >>>>>
> >>>>> cmake_minimum_required(VERSION 2.8)
> >>>>>
> >>>>> project(newapp)
> >>>>>
> >>>>> include(FindSDL)
> >>>>> include(FindOpenGL)
> >>>>>
> >>>>> include_directories(${SDL_INCLUDE_DIR})
> >>>>>
> >>>>> string(REPLACE "-framework Cocoa" "" SDL_LIBRARY ${SDL_LIBRARY})
> >>>>>
> >>>>> set_source_files_properties(${SDL_LIBRARY} PROPERTIES
> >>>>> MACOSX_PACKAGE_LOCATION Frameworks)
> >>>>>
> >>>>> add_executable(myapp MACOSX_BUNDLE main.cpp ${SDL_LIBRARY})
> >>>>>
> >>>>> target_link_libraries(myapp ${SDL_LIBRARY} SDLmain "-framework
> Cocoa")
> >>>>>
> >>>>> Then I do:
> >>>>> cmake
> >>>>> make
> >>>>>
> >>>>> And that's what I get:
> >>>>> Error copying file "/Library/Frameworks/SDL.framework" to
> >>>>> "myapp.app/Contents/Frameworks/SDL.framework".
> >>>>> make[2]: *** [myapp.app/Contents/Frameworks/SDL.framework] Error 1
> >>>>> make[1]: *** [CMakeFiles/myapp.dir/all] Error 2
> >>>>> make: *** [all] Error 2
> >>>>>
> >>>>> However, if I do:
> >>>>> cmake -G Xcode
> >>>>>
> >>>>> And then I open the generated Xcode project and do compile, all is
> >> working
> >>>>> properly.
> >>>>> What should I do?
> >>>>> It's just a bug?
> >>>>>
> >>>>> Thanks,
> >>>>> Franciso Requena.
> >>>>>
> >>>>>
> >>>>> I use the lastest CMake version (git cloned). It's 2.9.20100304.
> >>>>> _______________________________________________
> >>>>> 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
> >>
> >>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100305/5755773a/attachment-0001.htm>


More information about the CMake mailing list