--- a/CMakeLists.txt Sun Jun 17 14:13:19 2012 +0400
+++ b/CMakeLists.txt Sun Jun 17 16:32:44 2012 +0200
@@ -52,17 +52,19 @@
ENDIF(NOT BUILD_ENGINE_LIBRARY)
set(target_dir "bin")
-
#bundle .app setup
-if(APPLE)
- set(CMAKE_FIND_FRAMEWORK "FIRST")
-
+if(APPLE OR CROSSAPPLE)
#paths for creating the bundle
set(bundle_name Hedgewars.app)
set(frameworks_dir ${bundle_name}/Contents/Frameworks/)
set(CMAKE_INSTALL_PREFIX ${bundle_name}/Contents/MacOS/)
set(DATA_INSTALL_DIR "../Resources/")
set(target_dir ".")
+ set(minimum_macosx_version "10.6")
+endif()
+
+if(APPLE)
+ set(CMAKE_FIND_FRAMEWORK "FIRST")
#what system are we building for
set(minimum_macosx_version $ENV{MACOSX_DEPLOYMENT_TARGET})
--- a/QTfrontend/CMakeLists.txt Sun Jun 17 14:13:19 2012 +0400
+++ b/QTfrontend/CMakeLists.txt Sun Jun 17 16:32:44 2012 +0200
@@ -11,7 +11,9 @@
set(QT_USE_QTMAIN TRUE)
find_package(Qt4 REQUIRED)
-include(${QT_USE_FILE})
+if (NOT CROSSAPPLE)
+ include(${QT_USE_FILE})
+endif()
# Check if we need zlib
check_library_exists("${QT_QTCORE_LIBRARY}" inflateInit2_ ${QT_LIBRARY_DIR} QT_PROVIDES_ZLIB_FUNCTIONS)
@@ -140,7 +142,7 @@
qt4_wrap_cpp(hwfr_moc_srcs ${hwfr_moc_hdrs})
-if(APPLE)
+if(APPLE OR CROSSAPPLE)
set(hwfr_src ${hwfr_src} InstallController.cpp CocoaInitializer.mm M3Panel.mm M3InstallController.m NSWorkspace_RBAdditions.m)
set(HW_LINK_LIBS IOKit ${HW_LINK_LIBS})
@@ -186,7 +188,11 @@
endif()
-target_link_libraries(hedgewars ${HW_LINK_LIBS})
+if (CROSSAPPLE)
+ add_dependencies(hedgewars quazip)
+else()
+ target_link_libraries(hedgewars ${HW_LINK_LIBS})
+endif()
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir})
--- a/misc/quazip/CMakeLists.txt Sun Jun 17 14:13:19 2012 +0400
+++ b/misc/quazip/CMakeLists.txt Sun Jun 17 16:32:44 2012 +0200
@@ -1,7 +1,9 @@
set(QT_USE_QTCORE TRUE)
find_package(Qt4 REQUIRED)
-include(${QT_USE_FILE})
+if(NOT CROSSAPPLE)
+ include(${QT_USE_FILE})
+endif()
file(GLOB SRCS "*.c" "*.cpp")
--- a/share/CMakeLists.txt Sun Jun 17 14:13:19 2012 +0400
+++ b/share/CMakeLists.txt Sun Jun 17 16:32:44 2012 +0200
@@ -1,6 +1,6 @@
add_subdirectory(hedgewars)
-IF(APPLE)
+IF(APPLE OR CROSSAPPLE)
#needed for CFBundleVersion and CFBundleShortVersionString
FIND_PROGRAM(HGCOMMAND hg)
IF (HGCOMMAND AND (EXISTS ${hedgewars_SOURCE_DIR}/.hg))
@@ -24,4 +24,4 @@
DESTINATION ../Resources/)
install(PROGRAMS "${hedgewars_SOURCE_DIR}/share/dsa_pub.pem"
DESTINATION ../Resources/)
-ENDIF(APPLE)
+ENDIF(APPLE OR CROSSAPPLE)