--- a/CMakeLists.txt Fri Apr 24 16:53:38 2009 +0000
+++ b/CMakeLists.txt Sun Apr 26 15:45:06 2009 +0000
@@ -12,6 +12,19 @@
set(CPACK_PACKAGE_VERSION_MINOR "9")
set(CPACK_PACKAGE_VERSION_PATCH "11-dev")
+set(universal_build "0")
+
+if(APPLE)
+set(CMAKE_INSTALL_PREFIX "Hedgewars.app/Contents/MacOS/")
+set(DATA_INSTALL_DIR "../Resources/")
+
+if(CMAKE_OSX_ARCHITECTURES MATCHES "i386;ppc7400" OR CMAKE_OSX_ARCHITECTURES MATCHES "ppc7400;i386" OR CMAKE_OSX_ARCHITECTURES MATCHES "i386;ppc" OR CMAKE_OSX_ARCHITECTURES MATCHES "ppc;i386")
+ set(universal_build "1")
+ message("-- Building a Universal Application")
+endif(CMAKE_OSX_ARCHITECTURES MATCHES "i386;ppc7400" OR CMAKE_OSX_ARCHITECTURES MATCHES "ppc7400;i386" OR CMAKE_OSX_ARCHITECTURES MATCHES "i386;ppc" OR CMAKE_OSX_ARCHITECTURES MATCHES "ppc;i386")
+
+endif(APPLE)
+
if(DEFINED DATA_INSTALL_DIR)
set(SHAREPATH ${DATA_INSTALL_DIR}/hedgewars/)
else(DEFINED DATA_INSTALL_DIR)
--- a/QTfrontend/CMakeLists.txt Fri Apr 24 16:53:38 2009 +0000
+++ b/QTfrontend/CMakeLists.txt Sun Apr 26 15:45:06 2009 +0000
@@ -28,7 +28,7 @@
# Done
include_directories(.)
-set(CMAKE_CXX_FLAGS "-Wall")
+set(CMAKE_CXX_FLAGS "-Wall ${CMAKE_CXX_FLAGS}")
if(WIN32 AND NOT UNIX)
set(HEDGEWARS_BINDIR ".")
@@ -192,4 +192,11 @@
target_link_libraries(hedgewars
${HW_LINK_LIBS})
-install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin)
+
+if(APPLE)
+ set (target_dir ".")
+else(APPLE)
+ set (target_dir "bin")
+endif(APPLE)
+
+install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir})
--- a/gameServer/CMakeLists.txt Fri Apr 24 16:53:38 2009 +0000
+++ b/gameServer/CMakeLists.txt Sun Apr 26 15:45:06 2009 +0000
@@ -38,4 +38,11 @@
add_custom_target(hedgewars-server ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}")
-install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin)
+
+if(APPLE)
+ set (target_dir ".")
+else(APPLE)
+ set (target_dir "bin")
+endif(APPLE)
+
+install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir})
--- a/hedgewars/CMakeLists.txt Fri Apr 24 16:53:38 2009 +0000
+++ b/hedgewars/CMakeLists.txt Sun Apr 26 15:45:06 2009 +0000
@@ -104,7 +104,7 @@
endif (NOT pascal_compiler)
-IF(NOT CMAKE_OSX_ARCHITECTURES)
+IF(NOT APPLE OR NOT universal_build MATCHES "1")
#here is the standard command for any system
add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}"
COMMAND "${pascal_compiler}"
@@ -113,9 +113,9 @@
DEPENDS ${engine_sources}
)
-ELSE(NOT CMAKE_OSX_ARCHITECTURES)
+ELSE(NOT APPLE OR NOT universal_build MATCHES "1")
+
#these are the two dependencies for building a universal binary on Mac OS X
-
add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}.386"
COMMAND "ppc386"
ARGS ${pascal_compiler_flags} -ohwengine.386
@@ -138,10 +138,17 @@
ARGS ${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}.386 ${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}.ppc -create -output ${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}
DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}.386" "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}.ppc"
)
-ENDIF(NOT CMAKE_OSX_ARCHITECTURES)
+ENDIF(NOT APPLE OR NOT universal_build MATCHES "1")
add_custom_target(hwengine ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}")
-install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin)
+if(APPLE)
+ set (target_dir ".")
+else(APPLE)
+ set (target_dir "bin")
+endif(APPLE)
+
+install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir})
+
--- a/hedgewars/hwengine.dpr Fri Apr 24 16:53:38 2009 +0000
+++ b/hedgewars/hwengine.dpr Sun Apr 26 15:45:06 2009 +0000
@@ -20,14 +20,6 @@
WriteLn('Only Freepascal supported');
{$ENDIF}
-// Add all your Pascal units to the "uses" clause below to add them to the program.
-
-// Mark all Pascal procedures/functions that you wish to call from C/C++/Objective-C code using
-// "cdecl; export;" (see the fpclogo.pas unit for an example), and then add C-declarations for
-// these procedures/functions to the PascalImports.h file (also in the "Pascal Sources" group)
-// to make these functions available in the C/C++/Objective-C source files
-// (add "#include PascalImports.h" near the top of these files if it is not there yet)
-
program hwengine;
uses
SDLh in 'SDLh.pas',
@@ -200,7 +192,8 @@
WriteLn(' --set-multimedia [screen height] [screen width] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen]');
WriteLn(' --set-everything [screen height] [screen width] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen] [show FPS] [alternate damage] [timer value] [reduced quality]');
WriteLn();
- WriteLn('Read documentation online at http://www.hedgewars.org/ for more information');
+ WriteLn('Read documentation online at http://www.hedgewars.org/node/1465 for more information');
+ halt(1);
end;
////////////////////
--- a/share/CMakeLists.txt Fri Apr 24 16:53:38 2009 +0000
+++ b/share/CMakeLists.txt Sun Apr 26 15:45:06 2009 +0000
@@ -2,4 +2,8 @@
IF(APPLE)
configure_file(${hedgewars_SOURCE_DIR}/share/Info.plist.in
${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
+ install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/Info.plist"
+ DESTINATION ../)
+ install(PROGRAMS "${hedgewars_SOURCE_DIR}/misc/Icon.icns"
+ DESTINATION ../Resources/)
ENDIF(APPLE)