瀏覽代碼

ENH: QtMobility: Using the QtMobility git repository

The official git repository for QtMobility is now cloned. The patch
script checks out the 1.0 branch.

Additionally, the Unix patch for setting the PATH variable to
QT_BINARY_DIR has been removed. This lead to problems on systems which
use another name for qmake (e.g. qmake-qt4 on Fedora 12) and don't have
their Qt binary dir in the PATH variable (then the make step fails,
because the path was only set for the configure step). Now sed is used
in the patch script to replace qmake with the absolue path
(QT_QMAKE_EXECUTABLE) in the QtMobility configure script. This should
work also for custom Qt builds.
Sascha Zelzer 15 年之前
父節點
當前提交
f5e7c3d668

+ 10 - 5
SuperBuild.cmake

@@ -40,6 +40,11 @@ ENDIF()
 # Use this value where semi-colons are needed in ep_add args:
 set(sep "^^")
 
+# Find the git executable, used for custom git commands for external projects
+# (e.g. for QtMobility)
+find_program(Git_EXECUTABLE git DOC "git command line client")
+mark_as_advanced(Git_EXECUTABLE)
+
 #-----------------------------------------------------------------------------
 # Update CMake module path
 #
@@ -163,9 +168,9 @@ IF(${add_project})
   SET(qtmobility_patch_dir ${CTK_SOURCE_DIR}/Utilities/QtMobility/)
   SET(qtmobility_configured_patch_dir ${CTK_BINARY_DIR}/Utilities/QtMobility/)
   SET(qtmobility_patchscript
-    ${CTK_BINARY_DIR}/Utilities/QtMobility/QtMobilityBeta1-patch.cmake)
+    ${CTK_BINARY_DIR}/Utilities/QtMobility/QtMobilityGitBranch1.0-patch.cmake)
   CONFIGURE_FILE(
-    ${CTK_SOURCE_DIR}/Utilities/QtMobility/QtMobilityBeta1-patch.cmake.in
+    ${CTK_SOURCE_DIR}/Utilities/QtMobility/QtMobilityGitBranch1.0-patch.cmake.in
     ${qtmobility_patchscript} @ONLY)
 
   # Define configure options
@@ -180,9 +185,10 @@ IF(${add_project})
   ENDIf()
 
   ExternalProject_Add(${proj}
-    URL "http://get.qt.nokia.com/qt/solutions/qt-mobility-src-1.0.0-beta1.tar.gz"
-    CONFIGURE_COMMAND <SOURCE_DIR>/configure -${qtmobility_build_type} -libdir ${CMAKE_BINARY_DIR}/CTK-build/bin -no-docs -modules ${qtmobility_modules}
+    GIT_REPOSITORY git://gitorious.org/qt-mobility/qt-mobility.git
+    # the patch command is also used to checkout the 1.0 branch    
     PATCH_COMMAND ${CMAKE_COMMAND} -P ${qtmobility_patchscript}
+    CONFIGURE_COMMAND <SOURCE_DIR>/configure -${qtmobility_build_type} -libdir ${CMAKE_BINARY_DIR}/CTK-build/bin -no-docs -modules ${qtmobility_modules}
     BUILD_IN_SOURCE 1
     )
 ENDIF()
@@ -344,4 +350,3 @@ ADD_CUSTOM_TARGET(CTK
   COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/CTK-build
   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CTK-build
   )
- 

+ 44 - 0
Utilities/QtMobility/QtMobilityGitBranch1.0-apple.patch

@@ -0,0 +1,44 @@
+*** ../qt-mobility-src-1.0.0-beta1/configure	2010-02-12 03:54:12.000000000 -0500
+--- configure	2010-03-24 18:51:06.000000000 -0400
+***************
+*** 413,423 ****
+  }
+  
+  #compile tests
+! compileTest QMF qmf
+! compileTest NetworkManager networkmanager
+! compileTest "CoreWLAN (MacOS 10.6)" corewlan
+! compileTest "Maemo ICD" maemo-icd
+! compileTest "Maemo ICD WLAN" maemo-icd-network-wlan
+  
+  # Now module selection
+  # using 'expr match ....' should help a bit
+--- 413,423 ----
+  }
+  
+  #compile tests
+! #compileTest QMF qmf
+! #compileTest NetworkManager networkmanager
+! #compileTest "CoreWLAN (MacOS 10.6)" corewlan
+! #compileTest "Maemo ICD" maemo-icd
+! #compileTest "Maemo ICD WLAN" maemo-icd-network-wlan
+  
+  # Now module selection
+  # using 'expr match ....' should help a bit
+***************
+*** 493,499 ****
+  fi
+  
+  echo "Running qmake..."
+! if qmake -recursive "$relpath/qtmobility.pro"; then
+      echo ""
+      echo "configure has finished. You may run make or gmake to build the project now."
+  else
+--- 493,499 ----
+  fi
+  
+  echo "Running qmake..."
+! if qmake -spec macx-g++ -recursive "$relpath/qtmobility.pro"; then
+      echo ""
+      echo "configure has finished. You may run make or gmake to build the project now."
+  else

+ 64 - 0
Utilities/QtMobility/QtMobilityGitBranch1.0-patch.cmake.in

@@ -0,0 +1,64 @@
+# the patch step is run before the update step
+# so we need to checkout the 1.0 branch here
+
+set(work_dir @ep_source_dir@)
+set(proj_dir ${work_dir}/@proj@)
+
+execute_process(
+  COMMAND @Git_EXECUTABLE@ checkout origin/1.0 -t
+  WORKING_DIRECTORY ${proj_dir}
+  ERROR_VARIABLE error_output
+  RESULT_VARIABLE error_code
+  )
+if(error_code)
+  if(NOT ${error_output} MATCHES "branch 1.0 already exists")
+    message(FATAL_ERROR "${error_output}")
+  endif()
+endif()
+
+
+INCLUDE(@CTK_SOURCE_DIR@/CMake/ctkMacroApplyPatches.cmake)
+
+SET(patch_dir @qtmobility_patch_dir@)
+SET(configured_patch_dir @qtmobility_configured_patch_dir@)
+
+# Variable required to properly configured the patch files
+SET(QT_BINARY_DIR @QT_BINARY_DIR@)
+
+SET(patch_files
+)
+
+IF(WIN32)
+  CONFIGURE_FILE(${patch_dir}/QtMobilityGitBranch1.0-win32.patch.in
+    ${configured_patch_dir}/QtMobilityGitBranch1.0-win32.patch @ONLY)
+  LIST(APPEND patch_files
+    ${configured_patch_dir}/QtMobilityGitBranch1.0-win32.patch
+    )
+ENDIF()
+
+IF(UNIX)
+  IF(APPLE)
+    LIST(APPEND patch_files ${patch_dir}/QtMobilityGitBranch1.0-apple.patch)
+  ENDIF()
+ENDIF()
+
+# Apply patches
+ctkMacroApplyPatches(@CTK_PATCH_EXECUTABLE@ @qtmobility_src_dir@ "${patch_files}")
+
+IF(UNIX)
+
+  # replace all occurences of 'qmake' with the aboslute path to the
+  # qmake executable found by CMake.
+  # This is neccessary for custom Qt builds and for Unix/Linux systems
+  # which use another name for the Qt4 qmake program (e.g. qmake-qt4)
+
+  EXECUTE_PROCESS(
+    COMMAND sed -i "s+qmake +@QT_QMAKE_EXECUTABLE@ +g" configure
+    WORKING_DIRECTORY ${proj_dir}
+    RESULT_VARIABLE error_code
+  )
+
+  IF(error_code)
+    MESSAGE(FATAL_ERROR "Patching ${proj_dir}/configure file failed.")
+  ENDIF()
+ENDIF()

+ 20 - 0
Utilities/QtMobility/QtMobilityGitBranch1.0-win32.patch.in

@@ -0,0 +1,20 @@
+diff -crB ../qt-mobility-src-1.0.0-beta1/configure.bat configure.bat
+*** ./qt-mobility-src-1.0.0-beta1/configure.bat	2010-02-12 03:54:12.000000000 -0500
+--- configure.bat	2010-03-18 13:19:42.000000000 -0400
+***************
+*** 60,66 ****
+  set MOBILITY_MODULES=bearer location contacts multimedia publishsubscribe versit messaging systeminfo serviceframework sensors
+  set MOBILITY_MODULES_UNPARSED=
+  set VC_TEMPLATE_OPTION=
+! set QT_PATH=
+  set QMAKE_CACHE=%BUILD_PATH%\.qmake.cache
+  
+  if exist "%QMAKE_CACHE%" del %QMAKE_CACHE%
+--- 60,66 ----
+  set MOBILITY_MODULES=bearer location contacts multimedia publishsubscribe versit messaging systeminfo serviceframework sensors
+  set MOBILITY_MODULES_UNPARSED=
+  set VC_TEMPLATE_OPTION=
+! set QT_PATH=@QT_BINARY_DIR@/
+  set QMAKE_CACHE=%BUILD_PATH%\.qmake.cache
+  
+  if exist "%QMAKE_CACHE%" del %QMAKE_CACHE%