copy resources to OS X application bundle

This commit is contained in:
Stephen Birarda 2013-02-18 11:39:29 -08:00
parent 8c8309c1f4
commit dcb0e5add2
2 changed files with 13 additions and 12 deletions

View file

@ -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})

View file

@ -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();
}