[CMake] OS X, SDL, Frameworks and Libraries
Francisco Requena
the.adx at gmail.com
Fri Mar 5 08:39:25 EST 2010
As on my previous my post, I got a bundle with SDL.framework embeeded.
On OS X, you can either use .framework and .dylib binaries. So, I got to use
the BundleUtilities macro.
If CMake doesn't find the .framework, all works ok: I get 3 libraries
(libSDL..) on Content/MacOS folder.
If CMake finds the .framework, it just doesn't know (or it seems) how to
handle it. What can I do?
Here's the CMakeLists.txt:
cmake_minimum_required(VERSION 2.8)
project(openvolt)
set(APP_NAME OpenVolt)
include(FindSDL)
include(FindOpenGL)
include_directories(${SDL_INCLUDE_DIR})
add_executable(${APP_NAME} MACOSX_BUNDLE main.cpp)
target_link_libraries(${APP_NAME} ${SDL_LIBRARY} ${OPENGL_LIBRARIES})
string(REPLACE "-framework Cocoa" "" DIRS ${SDL_LIBRARY})
install(CODE "
include(BundleUtilities)
fixup_bundle(\"${openvolt_BINARY_DIR}/${APP_NAME}.app\" \"\" \"${DIRS}\")
" COMPONENT Runtime)
And here's the output when I do 'make install':
[100%] Built target OpenVolt
Install the project...
-- Install configuration: ""
-- fixup_bundle
-- app='/Users/frarees/openvolt/build/OpenVolt.app'
-- libs=''
-- dirs='/Library/Frameworks/SDL.framework'
-- fixup_bundle: preparing...
-- warning: embedded item does not exist
'/Users/frarees/openvolt/build/OpenVolt.app/Contents/Frameworks/SDL.framework/Versions/1.3/SDL'
--
warning: cannot resolve item
'@executable_path/../Frameworks/SDL.framework/Versions/1.3/SDL'
possible problems:
need more directories?
need to use InstallRequiredSystemLibraries?
run in install tree instead of build tree?
-- warning: embedded item does not exist
'/Users/frarees/openvolt/build/OpenVolt.app/Contents/Frameworks/SDL.framework/Versions/1.3/SDL'
--
warning: cannot resolve item
'@executable_path/../Frameworks/SDL.framework/Versions/1.3/SDL'
possible problems:
need more directories?
need to use InstallRequiredSystemLibraries?
run in install tree instead of build tree?
-- fixup_bundle: copying...
-- 1/4: *NOT* copying
'/Users/frarees/openvolt/build/OpenVolt.app/Contents/MacOS/OpenVolt'
-- 2/4: copying
'@executable_path/../Frameworks/SDL.framework/Versions/1.3/SDL'
-- fixup_bundle: fixing...
-- 3/4: fixing up
'/Users/frarees/openvolt/build/OpenVolt.app/Contents/MacOS/OpenVolt'
-- 4/4: fixing up
'/Users/frarees/openvolt/build/OpenVolt.app/Contents/Frameworks/SDL.framework/Versions/1.3/SDL'
-- fixup_bundle: cleaning up...
-- fixup_bundle: verifying...
--
===========================================================================
-- Analyzing app='/Users/frarees/openvolt/build/OpenVolt.app'
-- bundle='/Users/frarees/openvolt/build/OpenVolt.app'
--
executable='/Users/frarees/openvolt/build/OpenVolt.app/Contents/MacOS/OpenVolt'
-- valid='1'
-- executable file 1:
/Users/frarees/openvolt/build/OpenVolt.app/Contents/MacOS/OpenVolt
-- warning: embedded item does not exist
'/Users/frarees/openvolt/build/OpenVolt.app/Contents/Frameworks/SDL.framework/Versions/1.3/SDL'
--
warning: cannot resolve item
'@executable_path/../Frameworks/SDL.framework/Versions/1.3/SDL'
possible problems:
need more directories?
need to use InstallRequiredSystemLibraries?
run in install tree instead of build tree?
-- verified='1'
-- info='Verified 1 executable files in
'/Users/frarees/openvolt/build/OpenVolt.app''
--
-- verified='1'
-- info=''
--
-- fixup_bundle: done
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100305/f5362767/attachment.htm>
More information about the CMake
mailing list