QtSOAP.cmake 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #
  2. # QtSOAP
  3. #
  4. set(proj QtSOAP)
  5. set(${proj}_DEPENDENCIES "")
  6. ExternalProject_Include_Dependencies(${proj}
  7. PROJECT_VAR proj
  8. DEPENDS_VAR ${proj}_DEPENDENCIES
  9. EP_ARGS_VAR ${proj}_EXTERNAL_PROJECT_ARGS
  10. USE_SYSTEM_VAR ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj}
  11. )
  12. if(${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
  13. message(FATAL_ERROR "Enabling ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj} is not supported !")
  14. endif()
  15. # Sanity checks
  16. if(DEFINED QtSOAP_DIR AND NOT EXISTS ${QtSOAP_DIR})
  17. message(FATAL_ERROR "QtSOAP_DIR variable is defined but corresponds to non-existing directory")
  18. endif()
  19. if(NOT DEFINED QtSOAP_DIR)
  20. set(revision_tag 914c72959412bfcbaaf0ea9836b0f34258145600)
  21. if(${proj}_REVISION_TAG)
  22. set(revision_tag ${${proj}_REVISION_TAG})
  23. endif()
  24. set(location_args )
  25. if(${proj}_URL)
  26. set(location_args URL ${${proj}_URL})
  27. elseif(${proj}_GIT_REPOSITORY)
  28. set(location_args GIT_REPOSITORY ${${proj}_GIT_REPOSITORY}
  29. GIT_TAG ${revision_tag})
  30. else()
  31. set(location_args GIT_REPOSITORY "${git_protocol}://github.com/commontk/QtSOAP.git"
  32. GIT_TAG ${revision_tag})
  33. endif()
  34. set(ep_cache_args)
  35. if(CTK_QT_VERSION VERSION_LESS "5")
  36. list(APPEND ep_cache_args
  37. -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
  38. )
  39. else()
  40. list(APPEND ep_cache_args
  41. -DQt5_DIR:PATH=${Qt5_DIR}
  42. )
  43. endif()
  44. ExternalProject_Add(${proj}
  45. ${${proj}_EXTERNAL_PROJECT_ARGS}
  46. SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
  47. BINARY_DIR ${proj}-build
  48. PREFIX ${proj}${ep_suffix}
  49. ${location_args}
  50. INSTALL_COMMAND ""
  51. CMAKE_CACHE_ARGS
  52. ${ep_common_cache_args}
  53. -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:STRING=${CTK_CMAKE_RUNTIME_OUTPUT_DIRECTORY}
  54. -DQtSOAP_QT_VERSION:STRING=${CTK_QT_VERSION}
  55. ${ep_cache_args}
  56. DEPENDS
  57. ${${proj}_DEPENDENCIES}
  58. )
  59. set(QtSOAP_DIR "${CMAKE_BINARY_DIR}/${proj}-build")
  60. else()
  61. ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES})
  62. endif()
  63. mark_as_superbuild(
  64. VARS QtSOAP_DIR:PATH
  65. LABELS "FIND_PACKAGE"
  66. )