CTKData.cmake 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #
  2. # CTKData
  3. #
  4. superbuild_include_once()
  5. set(proj CTKData)
  6. set(${proj}_DEPENDENCIES "")
  7. superbuild_include_dependencies(PROJECT_VAR proj)
  8. if(${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
  9. message(FATAL_ERROR "Enabling ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj} is not supported !")
  10. endif()
  11. # Sanity checks
  12. if(DEFINED CTKData_DIR AND NOT EXISTS ${CTKData_DIR})
  13. message(FATAL_ERROR "CTKData_DIR variable is defined but corresponds to non-existing directory")
  14. endif()
  15. if(NOT DEFINED CTKData_DIR)
  16. set(revision_tag cc07f1ff391b7828459c)
  17. if(${proj}_REVISION_TAG)
  18. set(revision_tag ${${proj}_REVISION_TAG})
  19. endif()
  20. set(location_args )
  21. if(${proj}_URL)
  22. set(location_args URL ${${proj}_URL})
  23. elseif(${proj}_GIT_REPOSITORY)
  24. set(location_args GIT_REPOSITORY ${${proj}_GIT_REPOSITORY}
  25. GIT_TAG ${revision_tag})
  26. else()
  27. set(location_args GIT_REPOSITORY "${git_protocol}://github.com/commontk/CTKData.git"
  28. GIT_TAG ${revision_tag})
  29. endif()
  30. ExternalProject_Add(${proj}
  31. ${${proj}_EXTERNAL_PROJECT_ARGS}
  32. SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
  33. BINARY_DIR ${proj}-build
  34. PREFIX ${proj}${ep_suffix}
  35. LIST_SEPARATOR ${sep}
  36. ${location_args}
  37. UPDATE_COMMAND ""
  38. CONFIGURE_COMMAND ""
  39. BUILD_COMMAND ""
  40. INSTALL_COMMAND ""
  41. DEPENDS
  42. ${${proj}_DEPENDENCIES}
  43. )
  44. set(CTKData_DIR ${CMAKE_BINARY_DIR}/${proj})
  45. else()
  46. superbuild_add_empty_external_project(${proj} "${${proj}_DEPENDENCIES}")
  47. endif()
  48. mark_as_superbuild(
  49. VARS CTKData_DIR:PATH
  50. LABELS "FIND_PACKAGE"
  51. )