use the modern install(SCRIPT ...) command instead of legacy POST_BUILD_SCRIPT
authorkoda
Tue, 09 Jul 2013 04:23:48 +0200
changeset 9345 bb9bf1efd0d2
parent 9343 67552b2e20ca
child 9347 5b582d49358c
use the modern install(SCRIPT ...) command instead of legacy POST_BUILD_SCRIPT
tools/CMakeLists.txt
tools/CreateMacBundle.cmake.in
--- a/tools/CMakeLists.txt	Tue Jul 09 04:16:21 2013 +0200
+++ b/tools/CMakeLists.txt	Tue Jul 09 04:23:48 2013 +0200
@@ -50,10 +50,10 @@
         message(FATAL_ERROR "The utility macdeployqt is required to create the bundle (seached: ${qt_base_dir})")
     endif()
 
-    #dummy target, we're interested in the postscript file
-    add_custom_target(bundle)
-    set_target_properties(bundle PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake)
+    #create the .app bundle
+    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CreateMacBundle.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake)
+    install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake
+            CODE "message(STATUS \"Your app bundle is ready\")")
 
-    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CreateMacBundle.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake)
 endif()
 
--- a/tools/CreateMacBundle.cmake.in	Tue Jul 09 04:16:21 2013 +0200
+++ b/tools/CreateMacBundle.cmake.in	Tue Jul 09 04:23:48 2013 +0200
@@ -1,6 +1,5 @@
-message(STATUS "Performing standalone bundle creation...")
 
-execute_process(COMMAND stat ${frameworks_dir} RESULT_VARIABLE doBundle OUTPUT_QUIET ERROR_QUIET)
+execute_process(COMMAND stat ${frameworks_dir}/SDL.framework 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)
@@ -31,7 +30,7 @@
     if(${SPARKLE_FOUND})
         execute_process(COMMAND cp -pPR ${SPARKLE_LIBRARY} ${frameworks_dir}/Sparkle.framework)
     endif()
-    message(STATUS "Bundle frameworks added")
+    message(STATUS "Frameworks and libraries successfully copied...")
 else()
-    message(STATUS "Bundle frameworks already present; skipping...")
+    message(STATUS "Frameworks already present, skipping...")
 endif()