CTKData.cmake 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #
  2. # CTKData
  3. #
  4. superbuild_include_once()
  5. set(CTKData_DEPENDENCIES "")
  6. ctkMacroCheckExternalProjectDependency(CTKData)
  7. set(proj CTKData)
  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. SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
  32. BINARY_DIR ${proj}-build
  33. PREFIX ${proj}${ep_suffix}
  34. LIST_SEPARATOR ${sep}
  35. ${location_args}
  36. UPDATE_COMMAND ""
  37. CONFIGURE_COMMAND ""
  38. BUILD_COMMAND ""
  39. INSTALL_COMMAND ""
  40. DEPENDS
  41. ${${proj}_DEPENDENCIES}
  42. )
  43. set(CTKData_DIR ${CMAKE_BINARY_DIR}/${proj})
  44. else()
  45. ctkMacroEmptyExternalproject(${proj} "${${proj}_DEPENDENCIES}")
  46. endif()
  47. list(APPEND CTK_SUPERBUILD_EP_VARS CTKData_DIR:PATH)