QtMobilityGitBranch1.0-patch.cmake.in 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # the patch step is run before the update step
  2. # so we need to checkout the 1.0 branch here
  3. set(work_dir @ep_source_dir@)
  4. set(proj_dir ${work_dir}/@proj@)
  5. execute_process(
  6. COMMAND @Git_EXECUTABLE@ checkout -b branch_1.0 origin/1.0 -t
  7. WORKING_DIRECTORY ${proj_dir}
  8. ERROR_VARIABLE error_output
  9. RESULT_VARIABLE error_code
  10. )
  11. if(error_code)
  12. if(NOT ${error_output} MATCHES "branch branch_1.0 already exists")
  13. message(FATAL_ERROR "${error_output}")
  14. endif()
  15. endif()
  16. INCLUDE(@CTK_SOURCE_DIR@/CMake/ctkFunctionLFtoCRLF.cmake)
  17. INCLUDE(@CTK_SOURCE_DIR@/CMake/ctkFunctionApplyPatches.cmake)
  18. SET(patch_dir @qtmobility_patch_dir@)
  19. SET(configured_patch_dir @qtmobility_configured_patch_dir@)
  20. # Variable required to properly configured the patch files
  21. SET(QT_BINARY_DIR @QT_BINARY_DIR@)
  22. SET(patch_files
  23. )
  24. IF(WIN32)
  25. CONFIGURE_FILE(${patch_dir}/QtMobilityGitBranch1.0-win32.patch.in
  26. ${configured_patch_dir}/QtMobilityGitBranch1.0-win32.patch @ONLY)
  27. LIST(APPEND patch_files
  28. ${configured_patch_dir}/QtMobilityGitBranch1.0-win32.patch
  29. )
  30. ENDIF()
  31. IF(UNIX)
  32. IF(APPLE)
  33. LIST(APPEND patch_files ${patch_dir}/QtMobilityGitBranch1.0-apple.patch)
  34. ENDIF()
  35. ENDIF()
  36. # Apply patches
  37. ctkFunctionApplyPatches("@CTK_PATCH_EXECUTABLE@" "@qtmobility_src_dir@" "${patch_files}")
  38. IF(UNIX)
  39. # replace all occurences of 'qmake' with the aboslute path to the
  40. # qmake executable found by CMake.
  41. # This is neccessary for custom Qt builds and for Unix/Linux systems
  42. # which use another name for the Qt4 qmake program (e.g. qmake-qt4)
  43. EXECUTE_PROCESS(
  44. COMMAND sed -i "s+qmake +@QT_QMAKE_EXECUTABLE@ +g" configure
  45. WORKING_DIRECTORY ${proj_dir}
  46. RESULT_VARIABLE error_code
  47. )
  48. IF(error_code)
  49. MESSAGE(FATAL_ERROR "Patching ${proj_dir}/configure file failed.")
  50. ENDIF()
  51. ENDIF()