LibiglDownloadExternal.cmake 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. ################################################################################
  2. include(DownloadProject)
  3. # With CMake 3.8 and above, we can hide warnings about git being in a
  4. # detached head by passing an extra GIT_CONFIG option.
  5. set(LIBIGL_EXTRA_OPTIONS TLS_VERIFY OFF)
  6. if(NOT (${CMAKE_VERSION} VERSION_LESS "3.8.0"))
  7. list(APPEND LIBIGL_EXTRA_OPTIONS GIT_CONFIG advice.detachedHead=false)
  8. endif()
  9. # On CMake 3.6.3 and above, there is an option to use shallow clones of git repositories.
  10. # The shallow clone option only works with real tags, not SHA1, so we use a separate option.
  11. set(LIBIGL_BRANCH_OPTIONS)
  12. if(NOT (${CMAKE_VERSION} VERSION_LESS "3.6.3"))
  13. # Disabled for now until we can make sure that it has no adverse effects
  14. # (Downside is that the eigen mirror is huge again)
  15. # list(APPEND LIBIGL_BRANCH_OPTIONS GIT_SHALLOW 1)
  16. endif()
  17. option(LIBIGL_SKIP_DOWNLOAD "Skip downloading external libraries" OFF)
  18. # Shortcut functions
  19. function(igl_download_project_aux name source)
  20. if(NOT LIBIGL_SKIP_DOWNLOAD)
  21. download_project(
  22. PROJ ${name}
  23. SOURCE_DIR "${source}"
  24. DOWNLOAD_DIR "${LIBIGL_EXTERNAL}/.cache/${name}"
  25. QUIET
  26. ${LIBIGL_EXTRA_OPTIONS}
  27. ${ARGN}
  28. )
  29. endif()
  30. endfunction()
  31. function(igl_download_project name)
  32. igl_download_project_aux(${name} "${LIBIGL_EXTERNAL}/${name}" ${ARGN})
  33. endfunction()
  34. ################################################################################
  35. ## CGAL
  36. function(igl_download_cgal)
  37. igl_download_project(cgal
  38. GIT_REPOSITORY https://github.com/CGAL/cgal.git
  39. GIT_TAG f7c3c8212b56c0d6dae63787efc99093f4383415
  40. )
  41. endfunction()
  42. ## CoMISo
  43. function(igl_download_comiso)
  44. igl_download_project(CoMISo
  45. GIT_REPOSITORY https://github.com/libigl/CoMISo.git
  46. GIT_TAG 1f9618cf9b7bd77370d817976470d59091928606
  47. )
  48. endfunction()
  49. ## Cork
  50. function(igl_download_cork)
  51. igl_download_project(cork
  52. GIT_REPOSITORY https://github.com/libigl/cork.git
  53. GIT_TAG 27ad8a285838f5a480d856429e39d3d56d4338f9
  54. )
  55. endfunction()
  56. ## Eigen
  57. set(LIBIGL_EIGEN_VERSION 3.2.10 CACHE STRING "Default version of Eigen used by libigl.")
  58. function(igl_download_eigen)
  59. igl_download_project(eigen
  60. GIT_REPOSITORY https://github.com/eigenteam/eigen-git-mirror.git
  61. GIT_TAG ${LIBIGL_EIGEN_VERSION}
  62. ${LIBIGL_BRANCH_OPTIONS}
  63. )
  64. endfunction()
  65. ## Embree
  66. function(igl_download_embree)
  67. igl_download_project(embree
  68. GIT_REPOSITORY https://github.com/embree/embree.git
  69. GIT_TAG v3.5.2
  70. ${LIBIGL_BRANCH_OPTIONS}
  71. )
  72. endfunction()
  73. ## glad
  74. function(igl_download_glad)
  75. igl_download_project(glad
  76. GIT_REPOSITORY https://github.com/libigl/libigl-glad.git
  77. GIT_TAG 09b4969c56779f7ddf8e6176ec1873184aec890f
  78. )
  79. endfunction()
  80. ## GLFW
  81. function(igl_download_glfw)
  82. igl_download_project(glfw
  83. GIT_REPOSITORY https://github.com/glfw/glfw.git
  84. GIT_TAG 3.3
  85. ${LIBIGL_BRANCH_OPTIONS}
  86. )
  87. endfunction()
  88. ## ImGui
  89. function(igl_download_imgui)
  90. igl_download_project(imgui
  91. GIT_REPOSITORY https://github.com/ocornut/imgui.git
  92. GIT_TAG v1.69
  93. ${LIBIGL_BRANCH_OPTIONS}
  94. )
  95. igl_download_project(libigl-imgui
  96. GIT_REPOSITORY https://github.com/libigl/libigl-imgui.git
  97. GIT_TAG 07ecd3858acc71e70f0f9b2dea20a139bdddf8ae
  98. )
  99. endfunction()
  100. ## pybind11
  101. function(igl_download_pybind11)
  102. igl_download_project(pybind11
  103. GIT_REPOSITORY https://github.com/pybind/pybind11.git
  104. GIT_TAG 2d0507db43cd5a117f7843e053b17dffca114107
  105. )
  106. endfunction()
  107. ## stb_image
  108. function(igl_download_stb)
  109. igl_download_project(stb
  110. GIT_REPOSITORY https://github.com/libigl/libigl-stb.git
  111. GIT_TAG cd0fa3fcd90325c83be4d697b00214e029f94ca3
  112. )
  113. endfunction()
  114. ## TetGen
  115. function(igl_download_tetgen)
  116. igl_download_project(tetgen
  117. GIT_REPOSITORY https://github.com/jdumas/tetgen.git
  118. GIT_TAG c63e7a6434652b8a2065c835bd9d6d298db1a0bc
  119. )
  120. endfunction()
  121. ## TinyXML
  122. function(igl_download_tinyxml2)
  123. igl_download_project(tinyxml2
  124. GIT_REPOSITORY https://github.com/leethomason/tinyxml2.git
  125. GIT_TAG d175e9de0be0d4db75d0a8cf065599a435a87eb6
  126. )
  127. endfunction()
  128. ## Triangle
  129. function(igl_download_triangle)
  130. igl_download_project(triangle
  131. GIT_REPOSITORY https://github.com/libigl/triangle.git
  132. GIT_TAG d284c4a843efac043c310f5fa640b17cf7d96170
  133. )
  134. endfunction()
  135. ## Catch2
  136. function(igl_download_catch2)
  137. igl_download_project(catch2
  138. GIT_REPOSITORY https://github.com/catchorg/Catch2.git
  139. GIT_TAG 03d122a35c3f5c398c43095a87bc82ed44642516
  140. )
  141. endfunction()
  142. ## Predicates
  143. function(igl_download_predicates)
  144. igl_download_project(predicates
  145. GIT_REPOSITORY https://github.com/libigl/libigl-predicates.git
  146. GIT_TAG 4c57c1d3f31646b010d1d58bfbe201e75c2b2ad8
  147. )
  148. endfunction()
  149. ################################################################################
  150. ## Test data
  151. function(igl_download_test_data)
  152. igl_download_project_aux(test_data
  153. "${LIBIGL_EXTERNAL}/../tests/data"
  154. GIT_REPOSITORY https://github.com/libigl/libigl-tests-data
  155. GIT_TAG adc66cabf712a0bd68ac182b4e7f8b5ba009c3dd
  156. )
  157. endfunction()
  158. ## Tutorial data
  159. function(igl_download_tutorial_data)
  160. igl_download_project_aux(tutorial_data
  161. "${LIBIGL_EXTERNAL}/../tutorial/data"
  162. GIT_REPOSITORY https://github.com/libigl/libigl-tutorial-data
  163. GIT_TAG 5c6a1ea809c043d71e5595775709c15325a7158c
  164. )
  165. endfunction()