LibiglDownloadExternal.cmake 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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 d60aa4759fba76b0b793b1efb090b7a771dd7c56
  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.3.7 CACHE STRING "Default version of Eigen used by libigl.")
  58. function(igl_download_eigen)
  59. igl_download_project(eigen
  60. GIT_REPOSITORY https://gitlab.com/libeigen/eigen.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.12.1
  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 3327050ca66ad34426a82c217c2d60ced61526b7
  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 61b19489f1ba35934d9114c034b24eb5bff149e7 # 1.81 + patch for #1669
  93. ${LIBIGL_BRANCH_OPTIONS}
  94. )
  95. igl_download_project(libigl-imgui
  96. GIT_REPOSITORY https://github.com/libigl/libigl-imgui.git
  97. GIT_TAG 7e1053e750b0f4c129b046f4e455243cb7f804f3
  98. )
  99. endfunction()
  100. ## ImGuizmo
  101. function(igl_download_imguizmo)
  102. igl_download_project(imguizmo
  103. GIT_REPOSITORY https://github.com/CedricGuillemet/ImGuizmo.git
  104. GIT_TAG a23567269f6617342bcc112394bdad937b54b2d7
  105. ${LIBIGL_BRANCH_OPTIONS}
  106. )
  107. endfunction()
  108. ## pybind11
  109. function(igl_download_pybind11)
  110. igl_download_project(pybind11
  111. GIT_REPOSITORY https://github.com/pybind/pybind11.git
  112. GIT_TAG 2d0507db43cd5a117f7843e053b17dffca114107
  113. )
  114. endfunction()
  115. ## stb_image
  116. function(igl_download_stb)
  117. igl_download_project(stb
  118. GIT_REPOSITORY https://github.com/libigl/libigl-stb.git
  119. GIT_TAG cd0fa3fcd90325c83be4d697b00214e029f94ca3
  120. )
  121. endfunction()
  122. ## TetGen
  123. function(igl_download_tetgen)
  124. igl_download_project(tetgen
  125. GIT_REPOSITORY https://github.com/libigl/tetgen.git
  126. GIT_TAG 4f3bfba3997f20aa1f96cfaff604313a8c2c85b6
  127. )
  128. endfunction()
  129. ## TinyXML
  130. function(igl_download_tinyxml2)
  131. igl_download_project(tinyxml2
  132. GIT_REPOSITORY https://github.com/leethomason/tinyxml2.git
  133. GIT_TAG d175e9de0be0d4db75d0a8cf065599a435a87eb6
  134. )
  135. endfunction()
  136. ## Triangle
  137. function(igl_download_triangle)
  138. igl_download_project(triangle
  139. GIT_REPOSITORY https://github.com/libigl/triangle.git
  140. GIT_TAG 3ee6cac2230f0fe1413879574f741c7b6da11221
  141. )
  142. endfunction()
  143. ## Catch2
  144. function(igl_download_catch2)
  145. igl_download_project(catch2
  146. GIT_REPOSITORY https://github.com/catchorg/Catch2.git
  147. GIT_TAG v2.11.0
  148. )
  149. endfunction()
  150. ## Predicates
  151. function(igl_download_predicates)
  152. igl_download_project(predicates
  153. GIT_REPOSITORY https://github.com/libigl/libigl-predicates.git
  154. GIT_TAG 488242fa2b1f98a9c5bd1441297fb4a99a6a9ae4
  155. )
  156. endfunction()
  157. ################################################################################
  158. ## Test data
  159. function(igl_download_test_data)
  160. igl_download_project_aux(test_data
  161. "${LIBIGL_EXTERNAL}/../tests/data"
  162. GIT_REPOSITORY https://github.com/libigl/libigl-tests-data
  163. GIT_TAG 19cedf96d70702d8b3a83eb27934780c542356fe
  164. )
  165. endfunction()
  166. ## Tutorial data
  167. function(igl_download_tutorial_data)
  168. igl_download_project_aux(tutorial_data
  169. "${LIBIGL_EXTERNAL}/../tutorial/data"
  170. GIT_REPOSITORY https://github.com/libigl/libigl-tutorial-data
  171. GIT_TAG c1f9ede366d02e3531ecbaec5e3769312f31cccd
  172. )
  173. endfunction()