QtMobility-1.0.0-patch.cmake.in 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. INCLUDE(@CTK_SOURCE_DIR@/CMake/ctkFunctionLFtoCRLF.cmake)
  6. INCLUDE(@CTK_SOURCE_DIR@/CMake/ctkFunctionApplyPatches.cmake)
  7. SET(patch_dir @qtmobility_patch_dir@)
  8. SET(configured_patch_dir @qtmobility_configured_patch_dir@)
  9. # Variable required to properly configured the patch files
  10. SET(QT_BINARY_DIR @QT_BINARY_DIR@)
  11. CONFIGURE_FILE(${patch_dir}/QtMobility-1.0.0.patch.in
  12. ${configured_patch_dir}/QtMobility-1.0.0.patch @ONLY)
  13. SET(patch_files
  14. ${configured_patch_dir}/QtMobility-1.0.0.patch
  15. )
  16. IF(WIN32)
  17. CONFIGURE_FILE(${patch_dir}/QtMobility-1.0.0-win32.patch.in
  18. ${configured_patch_dir}/QtMobility-1.0.0-win32.patch @ONLY)
  19. LIST(APPEND patch_files
  20. ${configured_patch_dir}/QtMobility-1.0.0-win32.patch
  21. )
  22. ENDIF()
  23. IF(UNIX)
  24. IF(APPLE)
  25. LIST(APPEND patch_files ${patch_dir}/QtMobility-1.0.0-apple.patch)
  26. ENDIF()
  27. ENDIF()
  28. # Apply patches
  29. ctkFunctionApplyPatches("@CTK_PATCH_EXECUTABLE@" "@qtmobility_src_dir@" "${patch_files}")
  30. IF(UNIX)
  31. # replace all occurences of 'qmake' with the aboslute path to the
  32. # qmake executable found by CMake.
  33. # This is neccessary for custom Qt builds and for Unix/Linux systems
  34. # which use another name for the Qt4 qmake program (e.g. qmake-qt4)
  35. EXECUTE_PROCESS(
  36. COMMAND sed -i -e "s+qmake +@QT_QMAKE_EXECUTABLE@ +g" configure
  37. WORKING_DIRECTORY ${proj_dir}
  38. RESULT_VARIABLE error_code
  39. )
  40. IF(error_code)
  41. MESSAGE(FATAL_ERROR "Patching ${proj_dir}/configure file failed.")
  42. ENDIF()
  43. ENDIF()