libigl.cmake 17 KB

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