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