CGAL.cmake 1.4 KB

12345678910111213141516171819202122232425262728293031
  1. prusaslicer_add_cmake_project(
  2. CGAL
  3. # GIT_REPOSITORY https://github.com/CGAL/cgal.git
  4. # GIT_TAG bec70a6d52d8aacb0b3d82a7b4edc3caa899184b # releases/CGAL-5.0
  5. # For whatever reason, this keeps downloading forever (repeats downloads if finished)
  6. URL https://github.com/CGAL/cgal/archive/releases/CGAL-5.0.zip
  7. URL_HASH SHA256=c2b035bd078687b6d8c0fb6371a7443adcdb647856af9969532c4050cd5f48e5
  8. DEPENDS dep_Boost dep_GMP dep_MPFR
  9. )
  10. include(GNUInstallDirs)
  11. # CGAL, for whatever reason, makes itself non-relocatable by writing the build directory into
  12. # CGALConfig-installation-dirs.cmake and including it in configure time.
  13. # If this file is not present, it will not consider the stored absolute path
  14. ExternalProject_Add_Step(dep_CGAL dep_CGAL_relocation_fix
  15. DEPENDEES install
  16. COMMAND ${CMAKE_COMMAND} -E remove CGALConfig-installation-dirs.cmake
  17. WORKING_DIRECTORY "${DESTDIR}/usr/local/${CMAKE_INSTALL_LIBDIR}/cmake/CGAL"
  18. )
  19. # Again, for whatever reason, CGAL thinks that its version is not relevant if
  20. # configured as a header only library. Fixing it by placing a cmake version file
  21. # besides the installed config file.
  22. ExternalProject_Add_Step(dep_CGAL dep_CGAL_version_fix
  23. DEPENDEES install
  24. COMMAND ${CMAKE_COMMAND} -E copy cgal/CGALConfigVersion.cmake "${DESTDIR}/usr/local/${CMAKE_INSTALL_LIBDIR}/cmake/CGAL/CGALConfigVersion.cmake"
  25. WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}"
  26. )