QtMobility-1.0.0-patch.cmake.in 1.4 KB

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