|
@@ -21,6 +21,8 @@ set (SRCS ${SRCS} ViewVolume.cpp)
|
21
|
21
|
set (SRCS ${SRCS} World.cpp)
|
22
|
22
|
set (SRCS ${SRCS} tga.cpp)
|
23
|
23
|
|
|
24
|
+#################################################################
|
|
25
|
+
|
24
|
26
|
# Apple specific bundling
|
25
|
27
|
if (APPLE)
|
26
|
28
|
# Mac Bundle Data
|
|
@@ -46,9 +48,42 @@ if (APPLE)
|
46
|
48
|
set (SRCS ${SRCS} ${MAC_DATA})
|
47
|
49
|
endif (APPLE)
|
48
|
50
|
|
|
51
|
+#################################################################
|
|
52
|
+
|
49
|
53
|
# Add Executable
|
50
|
54
|
add_executable (OpenRaider MACOSX_BUNDLE ${SRCS})
|
51
|
55
|
|
|
56
|
+#################################################################
|
|
57
|
+
|
|
58
|
+if (APPLE)
|
|
59
|
+ # Copy setup script
|
|
60
|
+ add_custom_command (TARGET OpenRaider POST_BUILD
|
|
61
|
+ COMMAND echo "Injecting setup script..."
|
|
62
|
+ COMMAND cp "${PROJECT_SOURCE_DIR}/cmake/setup_mac.sh" "${PROJECT_BINARY_DIR}/src/OpenRaider.app/Contents/MacOS/OpenRaider.sh"
|
|
63
|
+ )
|
|
64
|
+
|
|
65
|
+ # Fix executable name, so setup script will be called
|
|
66
|
+ add_custom_command (TARGET OpenRaider POST_BUILD
|
|
67
|
+ COMMAND echo "Changing executable name..."
|
|
68
|
+ COMMAND /usr/libexec/PlistBuddy -c "Set :CFBundleExecutable OpenRaider.sh" Info.plist
|
|
69
|
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/src/OpenRaider.app/Contents
|
|
70
|
+ )
|
|
71
|
+
|
|
72
|
+ # Preparing the bundle on install
|
|
73
|
+ # http://www.cmake.org/Wiki/BundleUtilitiesExample
|
|
74
|
+ set (plugin_dest_dir OpenRaider.app/Contents/MacOS)
|
|
75
|
+ set (APPS "${PROJECT_BINARY_DIR}/src/OpenRaider.app")
|
|
76
|
+ install (CODE "
|
|
77
|
+ file(GLOB_RECURSE PLUGINS
|
|
78
|
+ \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/plugins/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
|
|
79
|
+ include(BundleUtilities)
|
|
80
|
+ fixup_bundle(\"${APPS}\" \"\${PLUGINS}\" \"\")
|
|
81
|
+ " COMPONENT Runtime
|
|
82
|
+ )
|
|
83
|
+endif (APPLE)
|
|
84
|
+
|
|
85
|
+#################################################################
|
|
86
|
+
|
52
|
87
|
# Debug build warnings
|
53
|
88
|
set (WARNINGS "${WARNINGS} -Weverything -Wno-padded -Wno-packed")
|
54
|
89
|
set (WARNINGS "${WARNINGS} -Wno-global-constructors -Wno-exit-time-destructors")
|
|
@@ -82,6 +117,8 @@ include_directories ("${PROJECT_SOURCE_DIR}/include")
|
82
|
117
|
# Include External Modules
|
83
|
118
|
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
|
84
|
119
|
|
|
120
|
+#################################################################
|
|
121
|
+
|
85
|
122
|
# Add Math Library
|
86
|
123
|
set (LIBS ${LIBS} m)
|
87
|
124
|
|
|
@@ -122,5 +159,7 @@ set (LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
122
|
159
|
# Link to all found libs
|
123
|
160
|
target_link_libraries (OpenRaider ${LIBS})
|
124
|
161
|
|
|
162
|
+#################################################################
|
|
163
|
+
|
125
|
164
|
# Add target to run executable
|
126
|
165
|
add_custom_target(run COMMAND OpenRaider DEPENDS OpenRaider WORKING_DIRECTORY ${CMAKE_PROJECT_DIR})
|