From dcb0e5add25505e583c4c3a6d6fb5e4404d96e8a Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 18 Feb 2013 11:39:29 -0800 Subject: [PATCH] copy resources to OS X application bundle --- interface/CMakeLists.txt | 17 +++++++++++------ interface/src/main.cpp | 8 ++------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index c75f77cbec..30bbfa56ec 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -23,14 +23,19 @@ configure_file(InterfaceConfig.h.in ${PROJECT_BINARY_DIR}/includes/InterfaceConf # grab the implementation and header files from src dir file(GLOB INTERFACE_SRCS src/*.cpp src/*.h) -IF(APPLE) +if (APPLE) # set how the icon shows up in the Info.plist file SET(MACOSX_BUNDLE_ICON_FILE interface.icns) - # set where in the bundle to put the icns file - SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/interface.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources) - # include the icns file in the target - SET(INTERFACE_SRCS ${INTERFACE_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/interface.icns) -ENDIF(APPLE) + + # grab the image and audio files + FILE(GLOB INTERFACE_RES_DIRS resources/*) + set(INTERFACE_RSRCS ${INTERFACE_RES_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/interface.icns) + + # set where in the bundle to put the resources file + SET_SOURCE_FILES_PROPERTIES(${INTERFACE_RSRCS} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) + # include the icns file and resource files in the target + SET(INTERFACE_SRCS ${INTERFACE_SRCS} ${INTERFACE_RSRCS}) +endif (APPLE) # create the executable, make it a bundle on OS X add_executable(interface MACOSX_BUNDLE ${INTERFACE_SRCS}) diff --git a/interface/src/main.cpp b/interface/src/main.cpp index ef875a3d5a..7986de9423 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -184,11 +184,7 @@ double elapsedTime; // Particles -// To add a new texture: -// 1. Add to the XCode project in the Resources/images group -// (ensure "Copy file" is checked -// 2. Add to the "Copy files" build phase in the project -char texture_filename[] = "./int-texture256-v4.png"; +char texture_filename[] = "images/int-texture256-v4.png"; unsigned int texture_width = 256; unsigned int texture_height = 256; @@ -311,7 +307,7 @@ void initDisplay(void) glEnable(GL_LIGHT0); glEnable(GL_DEPTH_TEST); - //load_png_as_texture(texture_filename); +// load_png_as_texture(texture_filename); if (fullscreen) glutFullScreen(); }