remove the CROSSAPPLE option until a better solution is found
authorkoda
Thu, 20 Dec 2012 23:14:54 +0100
changeset 8317 ec9f94ab2737
parent 8316 89232b2fa1d6
child 8318 e2c01fbf36c0
remove the CROSSAPPLE option until a better solution is found
CMakeLists.txt
QTfrontend/CMakeLists.txt
share/CMakeLists.txt
tools/CMakeLists.txt
tools/CreateMacBundle.cmake.in
--- a/CMakeLists.txt	Thu Dec 20 23:12:18 2012 +0100
+++ b/CMakeLists.txt	Thu Dec 20 23:14:54 2012 +0100
@@ -22,7 +22,6 @@
 option(BUILD_ENGINE_LIBRARY "Enable hwengine library [default: off]" OFF)
 option(ANDROID "Enable Android build [default: off]" OFF)
 option(NOAUTOUPDATE "Disable OS X Sparkle update checking" OFF)
-option(CROSSAPPLE "Enable OSX when not on OSX [default: off]" OFF)
 option(MINIMAL_FLAGS "Respect system flags as much as possible [default: off]" OFF)
 set(FPFLAGS "" CACHE STRING "Additional Freepascal flags" FORCE)
 set(GHFLAGS "" CACHE STRING "Additional Haskell flags" FORCE)
@@ -81,10 +80,10 @@
 else()
     set(target_binary_install_dir "./")
 
-    if(APPLE OR ${CROSSAPPLE})
-        set(target_library_install_dir "Hedgewars.app/Contents/Frameworks/")
+    if(APPLE)
         set(CMAKE_INSTALL_PREFIX "Hedgewars.app/Contents/MacOS/")
         set(SHAREPATH "../Resources/")
+        set(target_library_install_dir "../Frameworks/")
     else()
         if(WIN32)
             set(target_library_install_dir "./")
--- a/QTfrontend/CMakeLists.txt	Thu Dec 20 23:12:18 2012 +0100
+++ b/QTfrontend/CMakeLists.txt	Thu Dec 20 23:14:54 2012 +0100
@@ -11,9 +11,7 @@
 set(QT_USE_QTMAIN TRUE)
 
 find_package(Qt4 REQUIRED)
-if (NOT CROSSAPPLE)
-    include(${QT_USE_FILE})
-endif()
+include(${QT_USE_FILE})
 
 find_package(SDL REQUIRED)       #video in SDLInteraction
 find_package(SDL_mixer REQUIRED) #audio in SDLInteraction
@@ -144,7 +142,7 @@
 qt4_wrap_cpp(hwfr_moc_srcs ${hwfr_moc_hdrs})
 
 
-if(APPLE OR CROSSAPPLE)
+if(APPLE)
     find_library(iokit_framework NAMES IOKit)
     set(HW_LINK_LIBS ${iokit_framework} ${HW_LINK_LIBS})
     set(hwfr_src ${hwfr_src} CocoaInitializer.mm
@@ -203,10 +201,7 @@
         )
 endif()
 
-
-if (NOT CROSSAPPLE)
-    target_link_libraries(hedgewars ${HW_LINK_LIBS})
-endif()
+target_link_libraries(hedgewars ${HW_LINK_LIBS})
 
 
 install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_binary_install_dir})
--- a/share/CMakeLists.txt	Thu Dec 20 23:12:18 2012 +0100
+++ b/share/CMakeLists.txt	Thu Dec 20 23:14:54 2012 +0100
@@ -1,6 +1,6 @@
 add_subdirectory(hedgewars)
 
-if(APPLE OR CROSSAPPLE)
+if(APPLE)
     #needed for CFBundleVersion and CFBundleShortVersionString
         #should reuse the variables set in main CMakeLists.txt
     if(HGCOMMAND AND (EXISTS ${CMAKE_SOURCE_DIR}/.hg))
@@ -29,4 +29,4 @@
             DESTINATION ../Resources/)
     install(PROGRAMS "${hedgewars_SOURCE_DIR}/share/dsa_pub.pem"
             DESTINATION ../Resources/)
-endif(APPLE OR CROSSAPPLE)
+endif(APPLE)
--- a/tools/CMakeLists.txt	Thu Dec 20 23:12:18 2012 +0100
+++ b/tools/CMakeLists.txt	Thu Dec 20 23:14:54 2012 +0100
@@ -36,6 +36,8 @@
         string(REGEX REPLACE ".*/(.*)$" "\\1" PNG_LIBNAME "${PNG_LIBRARY}")
     endif()
 
+    set(frameworks_dir ${CMAKE_INSTALL_PREFIX}/${target_library_install_dir})
+
     #this tool is present in qt 4.5 but only if you compile from sources
     #from qt 4.6 is present also in the binary version
     find_program(macdeployqt_executable NAMES macdeployqt macdeployqt-mac PATHS ${qt_base_dir}/bin)
--- a/tools/CreateMacBundle.cmake.in	Thu Dec 20 23:12:18 2012 +0100
+++ b/tools/CreateMacBundle.cmake.in	Thu Dec 20 23:14:54 2012 +0100
@@ -1,7 +1,7 @@
 message(STATUS "Performing standalone bundle creation...")
 
-execute_process(COMMAND stat ${target_library_install_dir} RESULT_VARIABLE doBundle OUTPUT_QUIET ERROR_QUIET)
-execute_process(COMMAND mkdir -p ${target_library_install_dir})
+execute_process(COMMAND stat ${frameworks_dir} RESULT_VARIABLE doBundle OUTPUT_QUIET ERROR_QUIET)
+execute_process(COMMAND mkdir -p ${frameworks_dir})
 # macdeployqt will convert safely any absolute path library for 'hedgewars'
 execute_process(COMMAND ${macdeployqt_executable} ${CMAKE_BINARY_DIR}/Hedgewars.app OUTPUT_QUIET ERROR_QUIET)
 
@@ -19,16 +19,16 @@
 endif()
 
 if(doBundle EQUAL 1)
-    execute_process(COMMAND cp -pPR ${sdl_library_only} ${target_library_install_dir}/SDL.framework)
-    execute_process(COMMAND cp -pPR ${SDLIMAGE_LIBRARY} ${target_library_install_dir}/SDL_image.framework)
-    execute_process(COMMAND cp -pPR ${SDLNET_LIBRARY}   ${target_library_install_dir}/SDL_net.framework)
-    execute_process(COMMAND cp -pPR ${SDLTTF_LIBRARY}   ${target_library_install_dir}/SDL_ttf.framework)
-    execute_process(COMMAND cp -pPR ${SDLMIXER_LIBRARY} ${target_library_install_dir}/SDL_mixer.framework)
-    execute_process(COMMAND cp -pPR ${OGG_LIBRARY}      ${target_library_install_dir}/Ogg.framework)
-    execute_process(COMMAND cp -pPR ${VORBIS_LIBRARY}   ${target_library_install_dir}/Vorbis.framework)
+    execute_process(COMMAND cp -pPR ${sdl_library_only} ${frameworks_dir}/SDL.framework)
+    execute_process(COMMAND cp -pPR ${SDLIMAGE_LIBRARY} ${frameworks_dir}/SDL_image.framework)
+    execute_process(COMMAND cp -pPR ${SDLNET_LIBRARY}   ${frameworks_dir}/SDL_net.framework)
+    execute_process(COMMAND cp -pPR ${SDLTTF_LIBRARY}   ${frameworks_dir}/SDL_ttf.framework)
+    execute_process(COMMAND cp -pPR ${SDLMIXER_LIBRARY} ${frameworks_dir}/SDL_mixer.framework)
+    execute_process(COMMAND cp -pPR ${OGG_LIBRARY}      ${frameworks_dir}/Ogg.framework)
+    execute_process(COMMAND cp -pPR ${VORBIS_LIBRARY}   ${frameworks_dir}/Vorbis.framework)
 
     if(${SPARKLE_FOUND})
-        execute_process(COMMAND cp -pPR ${SPARKLE_LIBRARY} ${CMAKE_BINARY_DIR}/${frameworks_dir}/Sparkle.framework)
+        execute_process(COMMAND cp -pPR ${SPARKLE_LIBRARY} ${frameworks_dir}/Sparkle.framework)
     endif()
     message(STATUS "Bundle frameworks added")
 else()