CTKData.cmake 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #
  2. # CTKData
  3. #
  4. set(proj CTKData)
  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 CTKData_DIR AND NOT EXISTS ${CTKData_DIR})
  17. message(FATAL_ERROR "CTKData_DIR variable is defined but corresponds to non-existing directory")
  18. endif()
  19. if(NOT DEFINED CTKData_DIR)
  20. set(revision_tag cc07f1ff391b7828459c)
  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 "${EP_GIT_PROTOCOL}://github.com/commontk/CTKData.git"
  32. GIT_TAG ${revision_tag})
  33. endif()
  34. ExternalProject_Add(${proj}
  35. ${${proj}_EXTERNAL_PROJECT_ARGS}
  36. SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
  37. BINARY_DIR ${proj}-build
  38. PREFIX ${proj}${ep_suffix}
  39. ${location_args}
  40. CONFIGURE_COMMAND ""
  41. BUILD_COMMAND ""
  42. INSTALL_COMMAND ""
  43. DEPENDS
  44. ${${proj}_DEPENDENCIES}
  45. )
  46. set(CTKData_DIR ${CMAKE_BINARY_DIR}/${proj})
  47. else()
  48. ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES})
  49. endif()
  50. mark_as_superbuild(
  51. VARS CTKData_DIR:PATH
  52. )