mirror of https://github.com/microsoft/vcpkg.git
171 lines
6.1 KiB
Diff
171 lines
6.1 KiB
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 498caee..f3ba717 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -166,7 +166,11 @@ if(LIBIGL_INSTALL)
|
|
set(version_config_file "${CMAKE_CURRENT_BINARY_DIR}/LibiglConfigVersion.cmake")
|
|
set(export_dest_dir "${CMAKE_INSTALL_LIBDIR}/cmake/igl")
|
|
|
|
- foreach(suffix IN ITEMS "") #"_restricted" "_copyleft")
|
|
+ get_directory_property(targets BUILDSYSTEM_TARGETS)
|
|
+ foreach(suffix IN ITEMS "" "_restricted" "_copyleft")
|
|
+ if(NOT targets MATCHES "igl${suffix}")
|
|
+ continue()
|
|
+ endif()
|
|
install(EXPORT LibiglTargets${suffix}
|
|
DESTINATION ${export_dest_dir}
|
|
NAMESPACE igl${suffix}::
|
|
diff --git a/cmake/igl/libigl-config.cmake.in b/cmake/igl/libigl-config.cmake.in
|
|
index d3ff19f..df11bf5 100644
|
|
--- a/cmake/igl/libigl-config.cmake.in
|
|
+++ b/cmake/igl/libigl-config.cmake.in
|
|
@@ -3,5 +3,30 @@
|
|
include(CMakeFindDependencyMacro)
|
|
find_dependency(Eigen3 REQUIRED)
|
|
find_dependency(Threads REQUIRED)
|
|
+if("@LIBIGL_EMBREE@")
|
|
+ find_dependency(embree CONFIG)
|
|
+endif()
|
|
+if("@LIBIGL_GLFW@")
|
|
+ find_dependency(glfw3)
|
|
+endif()
|
|
+if("@LIBIGL_IMGUI@")
|
|
+ find_dependency(imgui)
|
|
+ find_dependency(imguizmo)
|
|
+endif()
|
|
+if("@LIBIGL_OPENGL@")
|
|
+ find_dependency(OpenGL)
|
|
+ find_dependency(glad)
|
|
+endif()
|
|
+if("@LIBIGL_XML@")
|
|
+ find_dependency(tinyxml2)
|
|
+endif()
|
|
+if("@LIBIGL_COPYLEFT_CGAL@")
|
|
+ # cf. cmake/recipes/external/cgal.cmake
|
|
+ set(CGAL_CMAKE_EXACT_NT_BACKEND "BOOST_BACKEND" CACHE STRING "CGAL exact NT backend")
|
|
+ set(CGAL_DISABLE_GMP ON CACHE BOOL "Disable GMP")
|
|
+ find_dependency(CGAL CONFIG COMPONENTS Core)
|
|
+endif()
|
|
+
|
|
include("${CMAKE_CURRENT_LIST_DIR}/LibiglConfigTargets.cmake")
|
|
+include("${CMAKE_CURRENT_LIST_DIR}/LibiglConfigTargets_copyleft.cmake" OPTIONAL)
|
|
check_required_components(Libigl)
|
|
diff --git a/cmake/igl/modules/copyleft/cgal.cmake b/cmake/igl/modules/copyleft/cgal.cmake
|
|
index e3aa831..371dc7a 100644
|
|
--- a/cmake/igl/modules/copyleft/cgal.cmake
|
|
+++ b/cmake/igl/modules/copyleft/cgal.cmake
|
|
@@ -10,6 +10,7 @@ target_include_directories(igl_copyleft_cgal ${IGL_SCOPE}
|
|
|
|
# 3. Target sources
|
|
file(GLOB INC_FILES "${libigl_SOURCE_DIR}/include/igl/copyleft/cgal/*.h")
|
|
+list(APPEND INC_FILES "${libigl_SOURCE_DIR}/include/igl/copyleft/cgal/CGAL_includes.hpp")
|
|
file(GLOB SRC_FILES "${libigl_SOURCE_DIR}/include/igl/copyleft/cgal/*.cpp")
|
|
igl_target_sources(igl_copyleft_cgal ${INC_FILES} ${SRC_FILES})
|
|
|
|
@@ -28,6 +29,9 @@ target_link_libraries(igl_copyleft_cgal ${IGL_SCOPE}
|
|
CGAL::CGAL_Core
|
|
)
|
|
|
|
+# n. Install target & headers
|
|
+igl_install(igl_copyleft_cgal ${INC_FILES} ${SRC_FILES})
|
|
+
|
|
# 5. Unit tests
|
|
file(GLOB SRC_FILES
|
|
"${libigl_SOURCE_DIR}/tests/include/igl/copyleft/boolean/*.cpp"
|
|
diff --git a/cmake/igl/modules/copyleft/core.cmake b/cmake/igl/modules/copyleft/core.cmake
|
|
index 8d03a90..24eb6e5 100644
|
|
--- a/cmake/igl/modules/copyleft/core.cmake
|
|
+++ b/cmake/igl/modules/copyleft/core.cmake
|
|
@@ -17,3 +17,6 @@ igl_target_sources(igl_copyleft_core ${INC_FILES} ${SRC_FILES})
|
|
target_link_libraries(igl_copyleft_core ${IGL_SCOPE}
|
|
igl::core
|
|
)
|
|
+
|
|
+# n. Install target & headers
|
|
+igl_install(igl_copyleft_core ${INC_FILES} ${SRC_FILES})
|
|
diff --git a/cmake/igl/modules/core.cmake b/cmake/igl/modules/core.cmake
|
|
index 137d30b..187a3ec 100644
|
|
--- a/cmake/igl/modules/core.cmake
|
|
+++ b/cmake/igl/modules/core.cmake
|
|
@@ -12,7 +12,7 @@ target_include_directories(igl_core ${IGL_SCOPE}
|
|
)
|
|
|
|
# 3. Target sources
|
|
-file(GLOB INC_FILES "${libigl_SOURCE_DIR}/include/igl/*.h")
|
|
+file(GLOB INC_FILES "${libigl_SOURCE_DIR}/include/igl/*.h" "${libigl_SOURCE_DIR}/include/igl/*.hpp")
|
|
file(GLOB SRC_FILES "${libigl_SOURCE_DIR}/include/igl/*.cpp")
|
|
igl_target_sources(igl_core ${INC_FILES} ${SRC_FILES})
|
|
|
|
diff --git a/cmake/igl/modules/embree.cmake b/cmake/igl/modules/embree.cmake
|
|
index 7f333b0..5fbabe7 100644
|
|
--- a/cmake/igl/modules/embree.cmake
|
|
+++ b/cmake/igl/modules/embree.cmake
|
|
@@ -21,6 +21,9 @@ target_link_libraries(igl_embree ${IGL_SCOPE}
|
|
embree::embree
|
|
)
|
|
|
|
+# n. Install target & headers
|
|
+igl_install(igl_embree ${INC_FILES} ${SRC_FILES})
|
|
+
|
|
# 5. Unit tests
|
|
file(GLOB SRC_FILES "${libigl_SOURCE_DIR}/tests/include/igl/embree/*.cpp")
|
|
igl_add_test(igl_embree ${SRC_FILES})
|
|
diff --git a/cmake/igl/modules/glfw.cmake b/cmake/igl/modules/glfw.cmake
|
|
index 2da8b0a..853759f 100644
|
|
--- a/cmake/igl/modules/glfw.cmake
|
|
+++ b/cmake/igl/modules/glfw.cmake
|
|
@@ -23,6 +23,9 @@ target_link_libraries(igl_glfw ${IGL_SCOPE}
|
|
glfw::glfw
|
|
)
|
|
|
|
+# n. Install target & headers
|
|
+igl_install(igl_glfw ${INC_FILES} ${SRC_FILES})
|
|
+
|
|
# 5. Unit tests
|
|
if(LIBIGL_GLFW_TESTS)
|
|
file(GLOB SRC_FILES "${libigl_SOURCE_DIR}/tests/include/igl/opengl/glfw/*.cpp")
|
|
diff --git a/cmake/igl/modules/imgui.cmake b/cmake/igl/modules/imgui.cmake
|
|
index f331854..37fe9c3 100644
|
|
--- a/cmake/igl/modules/imgui.cmake
|
|
+++ b/cmake/igl/modules/imgui.cmake
|
|
@@ -23,3 +23,6 @@ target_link_libraries(igl_imgui ${IGL_SCOPE}
|
|
imgui::imgui
|
|
imguizmo::imguizmo
|
|
)
|
|
+
|
|
+# n. Install target & headers
|
|
+igl_install(igl_imgui ${INC_FILES} ${SRC_FILES})
|
|
diff --git a/cmake/igl/modules/opengl.cmake b/cmake/igl/modules/opengl.cmake
|
|
index dfadb38..89ba687 100644
|
|
--- a/cmake/igl/modules/opengl.cmake
|
|
+++ b/cmake/igl/modules/opengl.cmake
|
|
@@ -22,3 +22,6 @@ target_link_libraries(igl_opengl ${IGL_SCOPE}
|
|
# Link against OpenGL::OpenGL if available, or fallback to OpenGL::GL
|
|
$<IF:$<TARGET_EXISTS:OpenGL::OpenGL>,OpenGL::OpenGL,OpenGL::GL>
|
|
)
|
|
+
|
|
+# n. Install target & headers
|
|
+igl_install(igl_opengl ${INC_FILES} ${SRC_FILES})
|
|
diff --git a/cmake/igl/modules/stb.cmake b/cmake/igl/modules/stb.cmake
|
|
index 14db8cf..23c5c66 100644
|
|
--- a/cmake/igl/modules/stb.cmake
|
|
+++ b/cmake/igl/modules/stb.cmake
|
|
@@ -33,3 +33,6 @@ if(LIBIGL_OPENGL)
|
|
igl::opengl
|
|
)
|
|
endif()
|
|
+
|
|
+# n. Install target & headers
|
|
+igl_install(igl_stb ${INC_FILES} ${SRC_FILES})
|
|
diff --git a/cmake/igl/modules/xml.cmake b/cmake/igl/modules/xml.cmake
|
|
index 31ab979..20c2139 100644
|
|
--- a/cmake/igl/modules/xml.cmake
|
|
+++ b/cmake/igl/modules/xml.cmake
|
|
@@ -19,3 +19,6 @@ target_link_libraries(igl_xml ${IGL_SCOPE}
|
|
igl::core
|
|
tinyxml2::tinyxml2
|
|
)
|
|
+
|
|
+# n. Install target & headers
|
|
+igl_install(igl_xml ${INC_FILES} ${SRC_FILES})
|