QtTesting.cmake 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #
  2. # QtTesting
  3. #
  4. superbuild_include_once()
  5. set(proj QtTesting)
  6. set(${proj}_DEPENDS)
  7. set(${proj}_DEPENDENCIES "")
  8. superbuild_include_dependencies(PROJECT_VAR proj)
  9. if(${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
  10. message(FATAL_ERROR "Enabling ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj} is not supported !")
  11. endif()
  12. # Sanity checks
  13. if(DEFINED QtTesting_DIR AND NOT EXISTS ${QtTesting_DIR})
  14. message(FATAL_ERROR "QtTesting_DIR variable is defined but corresponds to non-existing directory")
  15. endif()
  16. if(NOT DEFINED QtTesting_DIR)
  17. set(revision_tag 7dbef1003157941e7315220f53cf4e17d78b5e28)
  18. if(${proj}_REVISION_TAG)
  19. set(revision_tag ${${proj}_REVISION_TAG})
  20. endif()
  21. set(location_args )
  22. if(${proj}_URL)
  23. set(location_args URL ${${proj}_URL})
  24. elseif(${proj}_GIT_REPOSITORY)
  25. set(location_args GIT_REPOSITORY ${${proj}_GIT_REPOSITORY}
  26. GIT_TAG ${revision_tag})
  27. else()
  28. set(location_args GIT_REPOSITORY "${git_protocol}://paraview.org/QtTesting.git"
  29. GIT_TAG ${revision_tag})
  30. endif()
  31. # Set CMake OSX variable to pass down the external project
  32. set(CMAKE_OSX_EXTERNAL_PROJECT_ARGS)
  33. if(APPLE)
  34. list(APPEND CMAKE_OSX_EXTERNAL_PROJECT_ARGS
  35. -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
  36. -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT}
  37. -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET})
  38. endif()
  39. message(STATUS "Adding project:${proj}")
  40. ExternalProject_Add(${proj}
  41. ${${proj}_EXTERNAL_PROJECT_ARGS}
  42. SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
  43. BINARY_DIR ${proj}-build
  44. PREFIX ${proj}${ep_suffix}
  45. ${location_args}
  46. CMAKE_GENERATOR ${gen}
  47. UPDATE_COMMAND ""
  48. LIST_SEPARATOR ${sep}
  49. CMAKE_CACHE_ARGS
  50. ${ep_common_cache_args}
  51. -DBUILD_SHARED_LIBS:BOOL=ON
  52. -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
  53. DEPENDS
  54. ${${proj}_DEPENDENCIES}
  55. )
  56. set(QtTesting_INSTALL_DIR ${ep_install_dir})
  57. set(QtTesting_DIR ${CMAKE_BINARY_DIR}/${proj}-build)
  58. # Since QtTesting is statically build, there is not need to add its corresponding
  59. # library output directory to CTK_EXTERNAL_LIBRARY_DIRS
  60. else()
  61. superbuild_add_empty_external_project(${proj} "${${proj}_DEPENDENCIES}")
  62. endif()
  63. mark_as_superbuild(
  64. VARS
  65. QtTesting_INSTALL_DIR:PATH
  66. QtTesting_DIR:PATH
  67. LABELS "FIND_PACKAGE"
  68. )