Skip to content

Commit

Permalink
new CMake structure
Browse files Browse the repository at this point in the history
  • Loading branch information
HollowSun0 committed Nov 27, 2019
1 parent 3329c59 commit 75e8424
Show file tree
Hide file tree
Showing 15 changed files with 552 additions and 526 deletions.
46 changes: 0 additions & 46 deletions CGAL3DPolyhedralMesher/CMakeLists.txt

This file was deleted.

4 changes: 0 additions & 4 deletions CGAL3DPolyhedralMesher/plugin.cmake

This file was deleted.

46 changes: 0 additions & 46 deletions CGALBoolean/CMakeLists.txt

This file was deleted.

4 changes: 0 additions & 4 deletions CGALBoolean/plugin.cmake

This file was deleted.

60 changes: 0 additions & 60 deletions CGALBoolean/vtkCGALBoolean.xml

This file was deleted.

49 changes: 49 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(CGAL-Community-Plugins)

if (NOT ParaView_BINARY_DIR)
find_package(ParaView REQUIRED)
endif()

include(GNUInstallDirs)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")

if(PARAVIEW_USE_FILE)
# ParaView 5.6
# ------------
#If the plugin is used internally we don't need to include.
if (NOT ParaView_BINARY_DIR)
include(${PARAVIEW_USE_FILE})
endif(NOT ParaView_BINARY_DIR)
add_subdirectory(Plugins/CGAL)
else()
# ParaView 6 or later
# --------------------
# `paraview_plugin_build` uses `add_subdirectory` so it has to be in a sub-directory
paraview_plugin_scan(
PLUGIN_FILES "${CMAKE_CURRENT_SOURCE_DIR}/Plugins/CGAL/CGAL.plugin"
ENABLE_BY_DEFAULT ON
HIDE_PLUGINS_FROM_CACHE ON
PROVIDES_PLUGINS plugins
REQUIRES_MODULES required_modules
)

foreach (module IN LISTS required_modules)
if (NOT TARGET "${module}")
message("Missing required module: ${module}")
return ()
endif ()
endforeach ()

#Message("CMAKE_INSTALL_BINDIR" "${CMAKE_INSTALL_BINDIR}")
#Message("CMAKE_INSTALL_LIBDIR" "${CMAKE_INSTALL_LIBDIR}")
#Message("PARAVIEW_PLUGIN_SUBDIR" "${PARAVIEW_PLUGIN_SUBDIR}")

paraview_plugin_build(
RUNTIME_DESTINATION "${CMAKE_INSTALL_BINDIR}"
LIBRARY_DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY_SUBDIRECTORY "${PARAVIEW_PLUGIN_SUBDIR}"
PLUGINS ${plugins})
endif()
8 changes: 8 additions & 0 deletions Plugins/CGAL/CGAL.plugin
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
NAME
CGALFilter
DESCRIPTION
Set of CGAL plugins
CONDITION
REQUIRES_MODULES
VTK::FiltersCore
VTK::CommonExecutionModel
33 changes: 33 additions & 0 deletions Plugins/CGAL/CGALFilters/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
find_package(CGAL REQUIRED)
if(CGAL_FOUND)
include( ${CGAL_USE_FILE} )
endif(CGAL_FOUND)

#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_paraview_plugin(CGALFilter "1.0"
SERVER_MANAGER_XML vtkCGALFilters.xml
SERVER_MANAGER_SOURCES vtkCGAL3DPolyhedralMesher.cxx
vtkCGALBoolean.cxx)

target_link_libraries(CGALFilter PRIVATE CGAL::CGAL)

else()
## ParaView 6.0 or later
set(classes
vtkCGAL3DPolyhedralMesher
vtkCGALBoolean)

vtk_module_add_module(CGALFilters
CLASSES ${classes})

paraview_add_server_manager_xmls(
XMLS vtkCGALFilters.xml)

# Link with CGAL
target_link_libraries(CGALFilters PRIVATE CGAL::CGAL)

endif()
8 changes: 8 additions & 0 deletions Plugins/CGAL/CGALFilters/vtk.module
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
NAME
CGALFilters
DEPENDS
VTK::FiltersCore
VTK::FiltersGeometry
VTK::CommonSystem
PRIVATE_DEPENDS
VTK::CommonCore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
#define vtkCGAL3DPolyhedralMesher_h

#include "vtkPolyDataAlgorithm.h"
#include <CGALFiltersModule.h>

class vtkPointSet;

class vtkCGAL3DPolyhedralMesher : public vtkPolyDataAlgorithm
class CGALFILTERS_EXPORT vtkCGAL3DPolyhedralMesher : public vtkPolyDataAlgorithm
{
public:
static vtkCGAL3DPolyhedralMesher* New();
Expand Down
Loading

0 comments on commit 75e8424

Please sign in to comment.