libigl.cmake 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. cmake_minimum_required(VERSION 3.1)
  2. # https://github.com/libigl/libigl/issues/751
  3. # http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160425/351643.html
  4. if(APPLE)
  5. if(NOT CMAKE_LIBTOOL)
  6. find_program(CMAKE_LIBTOOL NAMES libtool)
  7. endif()
  8. if(CMAKE_LIBTOOL)
  9. set(CMAKE_LIBTOOL ${CMAKE_LIBTOOL} CACHE PATH "libtool executable")
  10. message(STATUS "Found libtool - ${CMAKE_LIBTOOL}")
  11. get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES)
  12. foreach(lang ${languages})
  13. # Added -c
  14. set(CMAKE_${lang}_CREATE_STATIC_LIBRARY
  15. "${CMAKE_LIBTOOL} -c -static -o <TARGET> <LINK_FLAGS> <OBJECTS> ")
  16. endforeach()
  17. endif()
  18. endif()
  19. ### Available options ###
  20. option(LIBIGL_USE_STATIC_LIBRARY "Use libigl as static library" OFF)
  21. option(LIBIGL_WITH_CGAL "Use CGAL" OFF)
  22. option(LIBIGL_WITH_COMISO "Use CoMiso" OFF)
  23. option(LIBIGL_WITH_CORK "Use Cork" OFF)
  24. option(LIBIGL_WITH_EMBREE "Use Embree" OFF)
  25. option(LIBIGL_WITH_MATLAB "Use Matlab" OFF)
  26. option(LIBIGL_WITH_MOSEK "Use MOSEK" OFF)
  27. option(LIBIGL_WITH_OPENGL "Use OpenGL" OFF)
  28. option(LIBIGL_WITH_OPENGL_GLFW "Use GLFW" OFF)
  29. option(LIBIGL_WITH_OPENGL_GLFW_IMGUI "Use ImGui" OFF)
  30. option(LIBIGL_WITH_PNG "Use PNG" OFF)
  31. option(LIBIGL_WITH_TETGEN "Use Tetgen" OFF)
  32. option(LIBIGL_WITH_TRIANGLE "Use Triangle" OFF)
  33. option(LIBIGL_WITH_XML "Use XML" OFF)
  34. option(LIBIGL_WITH_PYTHON "Use Python" OFF)
  35. option(LIBIGL_WITHOUT_COPYLEFT "Disable Copyleft libraries" OFF)
  36. ################################################################################
  37. ### Configuration
  38. set(LIBIGL_ROOT "${CMAKE_CURRENT_LIST_DIR}/..")
  39. set(LIBIGL_SOURCE_DIR "${LIBIGL_ROOT}/include")
  40. set(LIBIGL_EXTERNAL "${LIBIGL_ROOT}/external")
  41. # Dependencies are linked as INTERFACE targets unless libigl is compiled as a static library
  42. if(LIBIGL_USE_STATIC_LIBRARY)
  43. set(IGL_SCOPE PUBLIC)
  44. else()
  45. set(IGL_SCOPE INTERFACE)
  46. endif()
  47. # Download and update 3rdparty libraries
  48. list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
  49. include(LibiglDownloadExternal)
  50. ################################################################################
  51. ### IGL Common
  52. ################################################################################
  53. add_library(igl_common INTERFACE)
  54. target_include_directories(igl_common SYSTEM INTERFACE
  55. $<BUILD_INTERFACE:${LIBIGL_SOURCE_DIR}>
  56. $<INSTALL_INTERFACE:include>
  57. )
  58. # Export igl_common as igl::common
  59. set_property(TARGET igl_common PROPERTY EXPORT_NAME igl::common)
  60. if(LIBIGL_USE_STATIC_LIBRARY)
  61. target_compile_definitions(igl_common INTERFACE -DIGL_STATIC_LIBRARY)
  62. endif()
  63. # Transitive C++11 flags
  64. include(CXXFeatures)
  65. target_compile_features(igl_common INTERFACE ${CXX11_FEATURES})
  66. # Other compilation flags
  67. if(MSVC)
  68. # Enable parallel compilation for Visual Studio
  69. target_compile_options(igl_common INTERFACE /MP /bigobj)
  70. if(LIBIGL_WITH_CGAL)
  71. target_compile_options(igl_common INTERFACE "/MD$<$<CONFIG:Debug>:d>")
  72. endif()
  73. endif()
  74. if(BUILD_SHARED_LIBS)
  75. # Generate position independent code
  76. set_target_properties(igl_common PROPERTIES INTERFACE_POSITION_INDEPENDENT_CODE ON)
  77. endif()
  78. if(UNIX)
  79. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
  80. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
  81. endif()
  82. # Eigen
  83. if(TARGET Eigen3::Eigen)
  84. # If an imported target already exists, use it
  85. target_link_libraries(igl_common INTERFACE Eigen3::Eigen)
  86. else()
  87. igl_download_eigen()
  88. target_include_directories(igl_common SYSTEM INTERFACE
  89. $<BUILD_INTERFACE:${LIBIGL_EXTERNAL}/eigen>
  90. $<INSTALL_INTERFACE:include>
  91. )
  92. endif()
  93. # C++11 Thread library
  94. find_package(Threads REQUIRED)
  95. target_link_libraries(igl_common INTERFACE ${CMAKE_THREAD_LIBS_INIT})
  96. ################################################################################
  97. ## CGAL dependencies on Windows: GMP & MPFR
  98. function(igl_download_cgal_deps)
  99. if(WIN32)
  100. igl_download_project(gmp
  101. URL https://cgal.geometryfactory.com/CGAL/precompiled_libs/auxiliary/x64/GMP/5.0.1/gmp-all-CGAL-3.9.zip
  102. URL_MD5 508c1292319c832609329116a8234c9f
  103. )
  104. igl_download_project(mpfr
  105. URL https://cgal.geometryfactory.com/CGAL/precompiled_libs/auxiliary/x64/MPFR/3.0.0/mpfr-all-CGAL-3.9.zip
  106. URL_MD5 48840454eef0ff18730050c05028734b
  107. )
  108. set(ENV{GMP_DIR} "${LIBIGL_EXTERNAL}/gmp")
  109. set(ENV{MPFR_DIR} "${LIBIGL_EXTERNAL}/mpfr")
  110. endif()
  111. endfunction()
  112. ################################################################################
  113. function(compile_igl_module module_dir)
  114. string(REPLACE "/" "_" module_name "${module_dir}")
  115. if(module_name STREQUAL "core")
  116. set(module_libname "igl")
  117. else()
  118. set(module_libname "igl_${module_name}")
  119. endif()
  120. if(LIBIGL_USE_STATIC_LIBRARY)
  121. file(GLOB SOURCES_IGL_${module_name}
  122. "${LIBIGL_SOURCE_DIR}/igl/${module_dir}/*.cpp")
  123. if(NOT LIBIGL_WITHOUT_COPYLEFT)
  124. file(GLOB COPYLEFT_SOURCES_IGL_${module_name}
  125. "${LIBIGL_SOURCE_DIR}/igl/copyleft/${module_dir}/*.cpp")
  126. list(APPEND SOURCES_IGL_${module_name} ${COPYLEFT_SOURCES_IGL_${module_name}})
  127. endif()
  128. add_library(${module_libname} STATIC ${SOURCES_IGL_${module_name}} ${ARGN})
  129. if(MSVC)
  130. target_compile_options(${module_libname} PRIVATE /w) # disable all warnings (not ideal but...)
  131. else()
  132. #target_compile_options(${module_libname} PRIVATE -w) # disable all warnings (not ideal but...)
  133. endif()
  134. else()
  135. add_library(${module_libname} INTERFACE)
  136. endif()
  137. target_link_libraries(${module_libname} ${IGL_SCOPE} igl_common)
  138. if(NOT module_name STREQUAL "core")
  139. target_link_libraries(${module_libname} ${IGL_SCOPE} igl)
  140. endif()
  141. # Alias target because it looks nicer
  142. message(STATUS "Creating target: igl::${module_name} (${module_libname})")
  143. add_library(igl::${module_name} ALIAS ${module_libname})
  144. # Export as igl::${module_name}
  145. set_property(TARGET ${module_libname} PROPERTY EXPORT_NAME igl::${module_name})
  146. endfunction()
  147. ################################################################################
  148. ### IGL Core
  149. ################################################################################
  150. if(LIBIGL_USE_STATIC_LIBRARY)
  151. file(GLOB SOURCES_IGL
  152. "${LIBIGL_SOURCE_DIR}/igl/*.cpp"
  153. "${LIBIGL_SOURCE_DIR}/igl/copyleft/*.cpp")
  154. endif()
  155. compile_igl_module("core" ${SOURCES_IGL})
  156. ################################################################################
  157. ### Download the python part ###
  158. if(LIBIGL_WITH_PYTHON)
  159. igl_download_pybind11()
  160. endif()
  161. ################################################################################
  162. ### Compile the CGAL part ###
  163. if(LIBIGL_WITH_CGAL)
  164. # Try to find the CGAL library
  165. # CGAL Core is needed for
  166. # `Exact_predicates_exact_constructions_kernel_with_sqrt`
  167. if(NOT TARGET CGAL::CGAL)
  168. set(CGAL_DIR "${LIBIGL_EXTERNAL}/cgal")
  169. igl_download_cgal()
  170. igl_download_cgal_deps()
  171. if(EXISTS ${LIBIGL_EXTERNAL}/boost)
  172. set(BOOST_ROOT "${LIBIGL_EXTERNAL}/boost")
  173. endif()
  174. option(CGAL_Boost_USE_STATIC_LIBS "Use static Boost libs with CGAL" ON)
  175. find_package(CGAL CONFIG COMPONENTS Core PATHS ${CGAL_DIR} NO_DEFAULT_PATH)
  176. endif()
  177. # If CGAL has been found, then build the libigl module
  178. if(TARGET CGAL::CGAL AND TARGET CGAL::CGAL_Core)
  179. compile_igl_module("cgal")
  180. target_link_libraries(igl_cgal ${IGL_SCOPE} CGAL::CGAL CGAL::CGAL_Core)
  181. else()
  182. set(LIBIGL_WITH_CGAL OFF CACHE BOOL "" FORCE)
  183. endif()
  184. endif()
  185. # Helper function for `igl_copy_cgal_dll()`
  186. function(igl_copy_imported_dll src_target dst_target)
  187. get_target_property(other_libs ${src_target} INTERFACE_LINK_LIBRARIES)
  188. set(locations)
  189. list(APPEND locations ${main_lib} ${other_libs})
  190. foreach(location ${locations})
  191. string(REGEX MATCH "^(.*)\\.[^.]*$" dummy ${location})
  192. set(location "${CMAKE_MATCH_1}.dll")
  193. if(EXISTS "${location}" AND location MATCHES "^.*\\.dll$")
  194. add_custom_command(TARGET ${dst_target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${location}" $<TARGET_FILE_DIR:${dst_target}>)
  195. endif()
  196. endforeach()
  197. endfunction()
  198. # Convenient functions to copy CGAL dlls into a target (executable) destination folder (for Windows)
  199. function(igl_copy_cgal_dll target)
  200. if(WIN32 AND LIBIGL_WITH_CGAL)
  201. igl_copy_imported_dll(CGAL::CGAL ${target})
  202. igl_copy_imported_dll(CGAL::CGAL_Core ${target})
  203. endif()
  204. endfunction()
  205. ################################################################################
  206. ### Compile the CoMISo part ###
  207. # NOTE: this cmakefile works only with the
  208. # comiso available here: https://github.com/libigl/CoMISo
  209. if(LIBIGL_WITH_COMISO)
  210. compile_igl_module("comiso")
  211. if(NOT TARGET CoMISo)
  212. igl_download_comiso()
  213. add_subdirectory("${LIBIGL_EXTERNAL}/CoMISo" CoMISo)
  214. endif()
  215. target_link_libraries(igl_comiso ${IGL_SCOPE} CoMISo)
  216. endif()
  217. ################################################################################
  218. ### Compile the cork part ###
  219. if(LIBIGL_WITH_CORK)
  220. set(CORK_DIR "${LIBIGL_EXTERNAL}/cork")
  221. if(NOT TARGET cork)
  222. # call this "lib-cork" instead of "cork", otherwise cmake gets confused about
  223. # "cork" executable
  224. igl_download_cork()
  225. add_subdirectory("${CORK_DIR}" "lib-cork")
  226. endif()
  227. compile_igl_module("cork")
  228. target_include_directories(igl_cork ${IGL_SCOPE} cork)
  229. target_include_directories(igl_cork ${IGL_SCOPE} "${CORK_DIR}/src")
  230. target_link_libraries(igl_cork ${IGL_SCOPE} cork)
  231. endif()
  232. ################################################################################
  233. ### Compile the embree part ###
  234. if(LIBIGL_WITH_EMBREE)
  235. set(EMBREE_DIR "${LIBIGL_EXTERNAL}/embree")
  236. set(EMBREE_ISPC_SUPPORT OFF CACHE BOOL " " FORCE)
  237. set(EMBREE_TASKING_SYSTEM "INTERNAL" CACHE BOOL " " FORCE)
  238. set(EMBREE_TUTORIALS OFF CACHE BOOL " " FORCE)
  239. set(EMBREE_MAX_ISA NONE CACHE STRINGS " " FORCE)
  240. set(BUILD_TESTING OFF CACHE BOOL " " FORCE)
  241. # set(ENABLE_INSTALLER OFF CACHE BOOL " " FORCE)
  242. if(MSVC)
  243. # set(EMBREE_STATIC_RUNTIME OFF CACHE BOOL " " FORCE)
  244. set(EMBREE_STATIC_LIB OFF CACHE BOOL " " FORCE)
  245. else()
  246. set(EMBREE_STATIC_LIB ON CACHE BOOL " " FORCE)
  247. endif()
  248. if(NOT TARGET embree)
  249. igl_download_embree()
  250. add_subdirectory("${EMBREE_DIR}" "embree")
  251. endif()
  252. if(MSVC)
  253. add_custom_target(Copy-Embree-DLL ALL # Adds a post-build event
  254. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E
  255. $<TARGET_FILE:embree> # <--this is in-file
  256. "${CMAKE_BINARY_DIR}" # <--this is out-file path
  257. DEPENDS embree) # Execute after embree target has been built
  258. endif()
  259. compile_igl_module("embree")
  260. target_link_libraries(igl_embree ${IGL_SCOPE} embree)
  261. target_include_directories(igl_embree ${IGL_SCOPE} ${EMBREE_DIR}/include)
  262. if(NOT MSVC)
  263. target_compile_definitions(igl_embree ${IGL_SCOPE} -DENABLE_STATIC_LIB)
  264. endif()
  265. endif()
  266. ################################################################################
  267. ### Compile the matlab part ###
  268. if(LIBIGL_WITH_MATLAB)
  269. find_package(Matlab REQUIRED COMPONENTS MEX_COMPILER MX_LIBRARY ENG_LIBRARY)
  270. compile_igl_module("matlab")
  271. target_link_libraries(igl_matlab ${IGL_SCOPE} ${Matlab_LIBRARIES})
  272. target_include_directories(igl_matlab ${IGL_SCOPE} ${Matlab_INCLUDE_DIRS})
  273. endif()
  274. ################################################################################
  275. ### Compile the mosek part ###
  276. if(LIBIGL_WITH_MOSEK)
  277. find_package(MOSEK REQUIRED)
  278. compile_igl_module("mosek")
  279. target_link_libraries(igl_mosek ${IGL_SCOPE} ${MOSEK_LIBRARIES})
  280. target_include_directories(igl_mosek ${IGL_SCOPE} ${MOSEK_INCLUDE_DIRS})
  281. target_compile_definitions(igl_mosek ${IGL_SCOPE} -DLIBIGL_WITH_MOSEK)
  282. endif()
  283. ################################################################################
  284. ### Compile the opengl part ###
  285. if(LIBIGL_WITH_OPENGL)
  286. # OpenGL module
  287. find_package(OpenGL REQUIRED)
  288. compile_igl_module("opengl")
  289. target_link_libraries(igl_opengl ${IGL_SCOPE} ${OPENGL_gl_LIBRARY})
  290. target_include_directories(igl_opengl SYSTEM ${IGL_SCOPE} ${OPENGL_INCLUDE_DIR})
  291. # glad module
  292. if(NOT TARGET glad)
  293. igl_download_glad()
  294. add_subdirectory(${LIBIGL_EXTERNAL}/glad glad)
  295. endif()
  296. target_link_libraries(igl_opengl ${IGL_SCOPE} glad)
  297. endif()
  298. ################################################################################
  299. ### Compile the GLFW part ###
  300. if(LIBIGL_WITH_OPENGL_GLFW)
  301. if(TARGET igl::opengl)
  302. # GLFW module
  303. compile_igl_module("opengl/glfw")
  304. if(NOT TARGET glfw)
  305. set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL " " FORCE)
  306. set(GLFW_BUILD_TESTS OFF CACHE BOOL " " FORCE)
  307. set(GLFW_BUILD_DOCS OFF CACHE BOOL " " FORCE)
  308. set(GLFW_INSTALL OFF CACHE BOOL " " FORCE)
  309. igl_download_glfw()
  310. add_subdirectory(${LIBIGL_EXTERNAL}/glfw glfw)
  311. endif()
  312. target_link_libraries(igl_opengl_glfw ${IGL_SCOPE} igl_opengl glfw)
  313. endif()
  314. endif()
  315. ################################################################################
  316. ### Compile the ImGui part ###
  317. if(LIBIGL_WITH_OPENGL_GLFW_IMGUI)
  318. if(TARGET igl::opengl_glfw)
  319. # ImGui module
  320. compile_igl_module("opengl/glfw/imgui")
  321. if(NOT TARGET imgui)
  322. igl_download_imgui()
  323. add_subdirectory(${LIBIGL_EXTERNAL}/libigl-imgui imgui)
  324. endif()
  325. target_link_libraries(igl_opengl_glfw_imgui ${IGL_SCOPE} igl_opengl_glfw imgui)
  326. endif()
  327. endif()
  328. ################################################################################
  329. ### Compile the png part ###
  330. if(LIBIGL_WITH_PNG)
  331. # png/ module is anomalous because it also depends on opengl it really should
  332. # be moved into the opengl/ directory and namespace ...
  333. if(TARGET igl_opengl)
  334. if(NOT TARGET stb_image)
  335. igl_download_stb()
  336. add_subdirectory(${LIBIGL_EXTERNAL}/stb stb_image)
  337. endif()
  338. compile_igl_module("png" "")
  339. target_link_libraries(igl_png ${IGL_SCOPE} igl_stb_image igl_opengl)
  340. endif()
  341. endif()
  342. ################################################################################
  343. ### Compile the tetgen part ###
  344. if(LIBIGL_WITH_TETGEN)
  345. set(TETGEN_DIR "${LIBIGL_EXTERNAL}/tetgen")
  346. if(NOT TARGET tetgen)
  347. igl_download_tetgen()
  348. add_subdirectory("${TETGEN_DIR}" "tetgen")
  349. endif()
  350. compile_igl_module("tetgen")
  351. target_link_libraries(igl_tetgen ${IGL_SCOPE} tetgen)
  352. target_include_directories(igl_tetgen ${IGL_SCOPE} ${TETGEN_DIR})
  353. endif()
  354. ################################################################################
  355. ### Compile the triangle part ###
  356. if(LIBIGL_WITH_TRIANGLE)
  357. set(TRIANGLE_DIR "${LIBIGL_EXTERNAL}/triangle")
  358. if(NOT TARGET triangle)
  359. igl_download_triangle()
  360. add_subdirectory("${TRIANGLE_DIR}" "triangle")
  361. endif()
  362. compile_igl_module("triangle")
  363. target_link_libraries(igl_triangle ${IGL_SCOPE} triangle)
  364. target_include_directories(igl_triangle ${IGL_SCOPE} ${TRIANGLE_DIR})
  365. endif()
  366. ################################################################################
  367. ### Compile the xml part ###
  368. if(LIBIGL_WITH_XML)
  369. set(TINYXML2_DIR "${LIBIGL_EXTERNAL}/tinyxml2")
  370. if(NOT TARGET tinyxml2)
  371. igl_download_tinyxml2()
  372. add_library(tinyxml2 STATIC ${TINYXML2_DIR}/tinyxml2.cpp ${TINYXML2_DIR}/tinyxml2.h)
  373. target_include_directories(tinyxml2 PUBLIC ${TINYXML2_DIR})
  374. set_target_properties(tinyxml2 PROPERTIES
  375. COMPILE_DEFINITIONS "TINYXML2_EXPORT"
  376. VERSION "3.0.0"
  377. SOVERSION "3")
  378. endif()
  379. compile_igl_module("xml")
  380. target_link_libraries(igl_xml ${IGL_SCOPE} tinyxml2)
  381. target_include_directories(igl_xml ${IGL_SCOPE} ${TINYXML2_DIR})
  382. endif()
  383. ################################################################################
  384. ### Install and export all modules
  385. function(install_dir_files dir_name)
  386. if (dir_name STREQUAL "core")
  387. set(subpath "")
  388. else()
  389. set(subpath "/${dir_name}")
  390. endif()
  391. file(GLOB public_headers
  392. ${CMAKE_CURRENT_SOURCE_DIR}/include/igl${subpath}/*.h
  393. )
  394. set(files_to_install ${public_headers})
  395. if(NOT LIBIGL_USE_STATIC_LIBRARY)
  396. file(GLOB public_sources
  397. ${CMAKE_CURRENT_SOURCE_DIR}/include/igl${subpath}/*.cpp
  398. )
  399. endif()
  400. list(APPEND files_to_install ${public_sources})
  401. install(
  402. FILES ${files_to_install}
  403. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/igl${subpath}
  404. )
  405. endfunction()
  406. ################################################################################
  407. include(GNUInstallDirs)
  408. include(CMakePackageConfigHelpers)
  409. # Install and export core library
  410. install(
  411. TARGETS
  412. igl
  413. igl_common
  414. EXPORT igl-export
  415. PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
  416. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  417. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  418. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  419. )
  420. export(
  421. TARGETS
  422. igl
  423. igl_common
  424. FILE libigl-export.cmake
  425. )
  426. # Install headers for core library
  427. install_dir_files(core)
  428. install_dir_files(copyleft)
  429. # Write package configuration file
  430. configure_package_config_file(
  431. ${CMAKE_CURRENT_LIST_DIR}/libigl-config.cmake.in
  432. ${CMAKE_BINARY_DIR}/libigl-config.cmake
  433. INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/libigl/cmake
  434. )
  435. install(
  436. FILES
  437. ${CMAKE_BINARY_DIR}/libigl-config.cmake
  438. DESTINATION
  439. ${CMAKE_INSTALL_DATADIR}/libigl/cmake
  440. )
  441. # Write export file
  442. export(EXPORT igl-export
  443. FILE "${CMAKE_BINARY_DIR}/libigl-export.cmake"
  444. )
  445. install(EXPORT igl-export DESTINATION ${CMAKE_INSTALL_DATADIR}/libigl/cmake FILE libigl-export.cmake)
  446. export(PACKAGE libigl)