CMakeLists.txt 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # The VTK external project for CMake
  2. # ---------------------------------------------------------------------------
  3. cmake_minimum_required(VERSION 2.8)
  4. project(VTK)
  5. include(ExternalProject)
  6. # find "HOME". VTK will be downloaded & built within a subdirectory.
  7. if(NOT DEFINED HOME)
  8. if(DEFINED ENV{CTEST_REAL_HOME})
  9. set(HOME "$ENV{CTEST_REAL_HOME}")
  10. else()
  11. set(HOME "$ENV{HOME}")
  12. endif()
  13. if(NOT HOME AND WIN32)
  14. # Try for USERPROFILE as HOME equivalent:
  15. string(REPLACE "\\" "/" HOME "$ENV{USERPROFILE}")
  16. # But just use root of SystemDrive if USERPROFILE contains any spaces:
  17. # (Default on XP and earlier...)
  18. if(HOME MATCHES " ")
  19. string(REPLACE "\\" "/" HOME "$ENV{SystemDrive}")
  20. endif()
  21. endif()
  22. endif()
  23. set(base_dir "${HOME}/.cmake/Contracts/VTK")
  24. if(NOT DEFINED SITE)
  25. site_name(SITE)
  26. endif()
  27. # configure our dashboard script
  28. configure_file(
  29. ${CMAKE_CURRENT_SOURCE_DIR}/Dashboard.cmake.in
  30. ${base_dir}/Dashboard.cmake
  31. @ONLY)
  32. # build & test VTK's release branch
  33. ExternalProject_Add(${PROJECT_NAME}
  34. GIT_REPOSITORY "git://vtk.org/VTK.git"
  35. GIT_TAG "release"
  36. PREFIX ${base_dir}
  37. CONFIGURE_COMMAND ""
  38. BUILD_COMMAND ${CMAKE_CTEST_COMMAND} -S "${base_dir}/Dashboard.cmake"
  39. INSTALL_COMMAND ""
  40. )