[CMake] OS X, embedding Frameworks and generator problems

Francisco Requena the.adx at gmail.com
Thu Mar 4 18:17:01 EST 2010


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100305/c7cdda99/attachment.htm>


More information about the CMake mailing list