Skip to content

Commit

Permalink
Mac build changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Darrell Blake committed Feb 25, 2013
1 parent f9c3bd6 commit 03f1a53
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 28 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
* text=auto !eol
AnimView/AnimView.ico -text
AnimView/Icon.icns -text
CorsixTH/Bitmap/aux_ui.dat -text svneol=unset#unset
CorsixTH/Bitmap/aux_ui.tab -text
CorsixTH/Bitmap/bootstrap_font.bmp -text
Expand Down Expand Up @@ -52,9 +53,12 @@ CorsixTH/Levels/avatar.map -text
CorsixTH/Levels/confined_v5.map -text
CorsixTH/Levels/finisham.map -text
CorsixTH/Lua/languages/hungarian.lua -text
CorsixTH/RequiredResources.txt -text
CorsixTH/__MACOSX/SDLMain/._SDLMain.m -text
LDocGen/output/corner_right.gif -text
LDocGen/output/logo.png -text
LPEG/lpeg-128.gif -text
MapEdit/Icon.icns -text
MapEdit/MapEdit.ico -text
MapEdit/RequiredResources.txt -text
WindowsInstaller/welcome.bmp -text
4 changes: 3 additions & 1 deletion AnimView/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SET(animview_source_files
# Declaration of the executable
IF(APPLE)

set(corsixth_icon_file ${CMAKE_SOURCE_DIR}/CorsixTH/Icon.icns)
set(corsixth_icon_file ${CMAKE_SOURCE_DIR}/AnimView/Icon.icns)
set_source_files_properties(
${corsixth_icon_file}
PROPERTIES
Expand All @@ -42,6 +42,8 @@ IF(APPLE)
)

set_target_properties(AnimView PROPERTIES LINK_FLAGS_MINSIZEREL "-dead_strip")
set_target_properties(AnimView PROPERTIES XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../Frameworks")

ELSE()
add_executable(
AnimView
Expand Down
Binary file added AnimView/Icon.icns
Binary file not shown.
20 changes: 6 additions & 14 deletions CorsixTH/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,12 @@ IF(APPLE)
add_executable(CorsixTH MACOSX_BUNDLE ${corsixth_source_files} ${corsixth_icon_file})

set_target_properties(CorsixTH PROPERTIES LINK_FLAGS_MINSIZEREL "-dead_strip")
set_target_properties(CorsixTH PROPERTIES XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../Frameworks")

#Add an extra step at the end of the build process to copy the resources into the
#bundle. I haven't yet found a way to keep the folder structure when adding resources
#into XCode. I would have thought we could use source_group but apparently not.
set(corsixth_bundle_resources
${CMAKE_SOURCE_DIR}/CorsixTH/CorsixTH.lua
${CMAKE_SOURCE_DIR}/CorsixTH/Bitmap
${CMAKE_SOURCE_DIR}/CorsixTH/Lua
${CMAKE_SOURCE_DIR}/CorsixTH/Levels
)
add_custom_command(TARGET CorsixTH
POST_BUILD
COMMAND /Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp -exclude .DS_Store -exclude CVS -exclude .svn -exclude *.bmp -exclude *.png -resolve-src-symlinks ${corsixth_bundle_resources} \${TARGET_BUILD_DIR}/\${FULL_PRODUCT_NAME}/Contents/Resources
)
#Add an extra step at the end of the build process to copy the resources into the bundle.
add_custom_command(TARGET CorsixTH
POST_BUILD
COMMAND rsync -rv --include-from ${CMAKE_SOURCE_DIR}/CorsixTH/RequiredResources.txt ${CMAKE_SOURCE_DIR}/CorsixTH/ \${TARGET_BUILD_DIR}/\${FULL_PRODUCT_NAME}/Contents/Resources)

target_link_libraries(CorsixTH SDLmain)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/CorsixTH/SDLMain/)
Expand Down Expand Up @@ -221,7 +213,7 @@ IF(APPLE)
install(DIRECTORY ${LUA_LIBRARY} DESTINATION CorsixTH.app/Contents/Frameworks)
ENDIF()
ENDIF()

ELSE()
install(TARGETS CorsixTH RUNTIME DESTINATION CorsixTH)
install(DIRECTORY Lua Levels DESTINATION CorsixTH PATTERN "*.svn" EXCLUDE)
Expand Down
Binary file modified CorsixTH/Icon.icns
Binary file not shown.
18 changes: 18 additions & 0 deletions CorsixTH/RequiredResources.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# rsync compatible filter file which is used post-build
# to help with copying the required resources into the
# bundles for the Mac build.

- .svn
- .DS_Store
- CVS
+ CorsixTH.lua
+ Lua/
+ Lua/**
+ Levels/
+ Levels/*
+ Bitmap/
+ Bitmap/aux_ui.*
+ Bitmap/tree_ctrl.*
+ Bitmap/mainmenu1080.dat
+ Bitmap/mainmenu1080.pal
- *
19 changes: 6 additions & 13 deletions MapEdit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ FILE(GLOB_RECURSE mapedit_source_files
IF(APPLE)
add_definitions(-DIS_MAPEDIT_APP)

set(corsixth_icon_file ${CMAKE_SOURCE_DIR}/CorsixTH/Icon.icns)
set(corsixth_icon_file ${CMAKE_SOURCE_DIR}/MapEdit/Icon.icns)
set_source_files_properties(
${corsixth_icon_file}
PROPERTIES
Expand All @@ -39,19 +39,12 @@ IF(APPLE)
)

set_target_properties(MapEdit PROPERTIES LINK_FLAGS_MINSIZEREL "-dead_strip")
set_target_properties(MapEdit PROPERTIES XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../Frameworks")

#Add an extra step at the end of the build process to copy the resources into the
#bundle. I haven't yet found a way to keep the folder structure when adding resources
#into XCode. I would have thought we could use source_group but apparently not.
set(corsixth_bundle_resources
${CMAKE_SOURCE_DIR}/CorsixTH/CorsixTH.lua
${CMAKE_SOURCE_DIR}/CorsixTH/Bitmap
${CMAKE_SOURCE_DIR}/CorsixTH/Lua
)
add_custom_command(TARGET MapEdit
POST_BUILD
COMMAND /Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp -exclude .DS_Store -exclude CVS -exclude .svn -resolve-src-symlinks ${corsixth_bundle_resources} \${TARGET_BUILD_DIR}/\${FULL_PRODUCT_NAME}/Contents/Resources
)
#Add an extra step at the end of the build process to copy the resources into the bundle.
add_custom_command(TARGET MapEdit
POST_BUILD
COMMAND rsync -rv --include-from ${CMAKE_SOURCE_DIR}/MapEdit/RequiredResources.txt ${CMAKE_SOURCE_DIR}/CorsixTH/ \${TARGET_BUILD_DIR}/\${FULL_PRODUCT_NAME}/Contents/Resources)

ELSE()
add_executable(MapEdit
Expand Down
Binary file added MapEdit/Icon.icns
Binary file not shown.
14 changes: 14 additions & 0 deletions MapEdit/RequiredResources.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# rsync compatible filter file which is used post-build
# to help with copying the required resources into the
# bundles for the Mac build.

- .svn
- .DS_Store
- CVS
+ CorsixTH.lua
+ Lua/
+ Lua/**
+ Bitmap/
+ Bitmap/*.png
+ Bitmap/aux_ui.*
- *

0 comments on commit 03f1a53

Please sign in to comment.