diff --git a/Module/CMakeLists.txt b/Module/CMakeLists.txt index f5d5d88..8038ce2 100644 --- a/Module/CMakeLists.txt +++ b/Module/CMakeLists.txt @@ -1 +1,57 @@ -add_subdirectory (../src ./bin/) +if(NOT Eigen3_FOUND) + vtk_module_find_package(PACKAGE Eigen3 VERSION 3.3 CONFIG_MODE PRIVATE) +endif() + +vtk_module_find_package(PACKAGE CGAL VERSION 5.1.1 CONFIG_MODE PRIVATE) + +if(NOT DEFINED LIBIGL_DIR) + message(FATAL_ERROR "The CMake variable LIBIGL_DIR is undefined.") +endif() + +if(${LIBIGL_DIR} STREQUAL "") + message(FATAL_ERROR "The CMake variable LIBIGL_DIR is an empty string.") +endif() + +if(NOT TARGET igl::core) + include(LibiglOptions) + add_subdirectory(${LIBIGL_DIR} ${CMAKE_BINARY_DIR}/bin/libigl) +endif() + +# Define content +set(classes + stkLibiglBoolean3DMesher +) + +vtk_module_add_module(ParaView::stkLibiglCopyleft + CLASSES ${classes} + PRIVATE_HEADERS ${private_headers} +) + +if(CGAL_FOUND) + include(${CGAL_USE_FILE}) + + # Activate concurrency ? (turned ON by default) + option(CGAL_ACTIVATE_CONCURRENCY + "Enable concurrency" + ON) + + vtk_module_definitions(ParaView::stkLibiglCopyleft PRIVATE NOMINMAX) + + # Link with CGAL + vtk_module_link(ParaView::stkLibiglCopyleft PUBLIC CGAL::CGAL) + + if(CGAL_ACTIVATE_CONCURRENCY) + if (NOT TARGET TBB::tbb) + find_package(TBB REQUIRED) + endif () + + if(TBB_FOUND) + vtk_module_definitions(ParaView::stkLibiglCopyleft PRIVATE CGAL_LINKED_WITH_TBB) + vtk_module_link(ParaView::stkLibiglCopyleft PRIVATE TBB::tbbmalloc TBB::tbb) + endif(TBB_FOUND) + endif(CGAL_ACTIVATE_CONCURRENCY) +endif(CGAL_FOUND) + +vtk_module_include(ParaView::stkLibiglCopyleft PRIVATE ${LIBIGL_DIR}/include) + +vtk_module_link(ParaView::stkLibiglCopyleft PUBLIC Eigen3::Eigen) \ No newline at end of file diff --git a/src/stkLibiglBoolean3DMesher.cxx b/Module/stkLibiglBoolean3DMesher.cxx similarity index 100% rename from src/stkLibiglBoolean3DMesher.cxx rename to Module/stkLibiglBoolean3DMesher.cxx diff --git a/src/stkLibiglBoolean3DMesher.h b/Module/stkLibiglBoolean3DMesher.h similarity index 100% rename from src/stkLibiglBoolean3DMesher.h rename to Module/stkLibiglBoolean3DMesher.h diff --git a/Plugins/Libigl/CMakeLists.txt b/Plugins/Libigl/CMakeLists.txt deleted file mode 100644 index 1f8206e..0000000 --- a/Plugins/Libigl/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -set(BUILD_SHARED_LIBS TRUE) - -#Paraview's macro to add the plugin. It takes care of all the vtk -#and paraview parts of the process, like link and integration -#in the UI -if(ParaView_FOUND AND PARAVIEW_USE_FILE) - ## ParaView 5.6 - add_subdirectory(stkLibiglCopyleft) -else() - ## ParaView 5.7.x - paraview_add_plugin(LibiglCopyleftPlugins - VERSION "1.0" - MODULE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/stkLibiglCopyleft/vtk.module" - MODULES Libigl::stkLibiglCopyleft - XML_DOCUMENTATION OFF - -) -endif() \ No newline at end of file diff --git a/Plugins/Libigl/paraview.plugin b/Plugins/Libigl/paraview.plugin deleted file mode 100644 index 7250070..0000000 --- a/Plugins/Libigl/paraview.plugin +++ /dev/null @@ -1,9 +0,0 @@ -NAME - LibiglCopyleftPlugins -DESCRIPTION - Set of Libigl Copyleft plugins -CONDITION -REQUIRES_MODULES - VTK::FiltersCore - VTK::CommonDataModel - VTK::CommonExecutionModel diff --git a/Plugins/Libigl/stkLibiglCopyleft/CMakeLists.txt b/Plugins/Libigl/stkLibiglCopyleft/CMakeLists.txt deleted file mode 100644 index 7395672..0000000 --- a/Plugins/Libigl/stkLibiglCopyleft/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory (../../../src ./bin/) diff --git a/Plugins/Libigl/stkLibiglCopyleft/vtk.module b/Plugins/Libigl/stkLibiglCopyleft/vtk.module deleted file mode 100644 index 724999a..0000000 --- a/Plugins/Libigl/stkLibiglCopyleft/vtk.module +++ /dev/null @@ -1,12 +0,0 @@ -NAME - Libigl::stkLibiglCopyleft -LIBRARY_NAME - stkLibiglCopyleft -DEPENDS - VTK::FiltersCore - VTK::FiltersGeometry - ParaView::stkLibiglCopyleftInterface -PRIVATE_DEPENDS - VTK::CommonCore - VTK::CommonSystem - VTK::FiltersGeneral diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index cf91503..0000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -1,68 +0,0 @@ -if(NOT Eigen3_FOUND) - vtk_module_find_package(PACKAGE Eigen3 VERSION 3.3 CONFIG_MODE PRIVATE) -endif() - -vtk_module_find_package(PACKAGE CGAL VERSION 5.1.1 CONFIG_MODE PRIVATE) - -if(NOT DEFINED LIBIGL_DIR) - message(FATAL_ERROR "The CMake variable LIBIGL_DIR is undefined.") -endif() - -if(${LIBIGL_DIR} STREQUAL "") - message(FATAL_ERROR "The CMake variable LIBIGL_DIR is an empty string.") -endif() - -if(NOT TARGET igl::core) - include(LibiglOptions) - add_subdirectory(${LIBIGL_DIR} ${CMAKE_BINARY_DIR}/bin/libigl) -endif() - -# Namespace adaptive to how the module is built (as a pure module or as plugins) -SET(NAMESPACE "") - -if(ENABLE_NONFREE_MODULES) - SET(NAMESPACE "ParaView") -endif(ENABLE_NONFREE_MODULES) - -if(ENABLE_NONFREE_PLUGINS) - SET(NAMESPACE "Libigl") -endif(ENABLE_NONFREE_PLUGINS) - -# Define content -set(classes - stkLibiglBoolean3DMesher -) - -vtk_module_add_module(${NAMESPACE}::stkLibiglCopyleft - CLASSES ${classes} - PRIVATE_HEADERS ${private_headers} -) - -if(CGAL_FOUND) - include(${CGAL_USE_FILE}) - - # Activate concurrency ? (turned ON by default) - option(CGAL_ACTIVATE_CONCURRENCY - "Enable concurrency" - ON) - - vtk_module_definitions(${NAMESPACE}::stkLibiglCopyleft PRIVATE NOMINMAX) - - # Link with CGAL - vtk_module_link(${NAMESPACE}::stkLibiglCopyleft PUBLIC CGAL::CGAL) - - if(CGAL_ACTIVATE_CONCURRENCY) - if (NOT TARGET TBB::tbb) - find_package(TBB REQUIRED) - endif () - - if(TBB_FOUND) - vtk_module_definitions(${NAMESPACE}::stkLibiglCopyleft PRIVATE CGAL_LINKED_WITH_TBB) - vtk_module_link(${NAMESPACE}::stkLibiglCopyleft PRIVATE TBB::tbbmalloc TBB::tbb) - endif(TBB_FOUND) - endif(CGAL_ACTIVATE_CONCURRENCY) -endif(CGAL_FOUND) - -vtk_module_include(${NAMESPACE}::stkLibiglCopyleft PRIVATE ${LIBIGL_DIR}/include) - -vtk_module_link(${NAMESPACE}::stkLibiglCopyleft PUBLIC Eigen3::Eigen) \ No newline at end of file