-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
139 lines (119 loc) · 5.43 KB
/
CMakeLists.txt
File metadata and controls
139 lines (119 loc) · 5.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# Copyright (C) 2023-2026 CEA/DES, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
CMAKE_MINIMUM_REQUIRED(VERSION 3.0 FATAL_ERROR)
INCLUDE(CMakeDependentOption)
PROJECT(BooleanMeshOperation)
STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
# Options
# - SAT: use SALOME Tool to build and install this plugin
OPTION(USE_SAT "Use SALOME Tool (SAT) to build boolean mesh operation" OFF)
# =======================
# - CGAL: Computational Geometry Algorithms Library
# - MCUT: library for detecting and resolving intersections between two surface meshes
# - IRMB: Interactive And Robust Mesh Booleans
# - CORK: 3D Boolean / CSG Library
# - IGL : A simple C++ geometry processing library
OPTION(BUILD_CGAL "Build CGAL engine" ON )
OPTION(BUILD_MCUT "Build MCUT engine" OFF)
OPTION(BUILD_IRMB "Build IRMB engine" ON )
OPTION(BUILD_CORK "Build Cork engine" OFF)
OPTION(BUILD_IGL "Build IGL engine" OFF)
IF (NOT USE_SAT)
IF (BUILD_CGAL)
ADD_SUBDIRECTORY(cgal)
ENDIF()
IF (BUILD_MCUT)
ADD_SUBDIRECTORY(mcut)
ENDIF()
IF (BUILD_IRMB)
ADD_SUBDIRECTORY(irmb)
ENDIF()
IF (BUILD_CORK)
ADD_SUBDIRECTORY(cork)
ENDIF()
IF (BUILD_IGL)
ADD_SUBDIRECTORY(libigl)
ENDIF()
ELSE ()
MESSAGE(STATUS "Using SALOME TOOL standard and recommended approach")
# Check for CONFIGURATION package. Configuration provides a set of useful CMake macros
# ====================================================================================
SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake configuration files")
IF (EXISTS ${CONFIGURATION_ROOT_DIR})
LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake")
INCLUDE(SalomeMacros NO_POLICY_SCOPE)
ELSE()
MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
ENDIF()
# Set Version
# ===========
SALOME_SETUP_VERSION(1.0)
# Use PySide2/Shiboken2 or PyQt5/SIP5
# ===================================
SET (SALOME_USE_PYSIDE $ENV{SALOME_USE_PYSIDE} CACHE BOOL "Use PySide or PyQt")
SET(SMESH_ROOT_DIR $ENV{SMESH_ROOT_DIR} CACHE PATH "Path to SMESH")
IF (NOT EXISTS ${SMESH_ROOT_DIR})
MESSAGE(FATAL_ERROR "SMESH_ROOT_DIR environment variable is missing, please define SMESH_ROOT_DIR")
ENDIF()
# Python
# ===========
FIND_PACKAGE(SalomePythonInterp REQUIRED)
FIND_PACKAGE(SalomePythonLibs REQUIRED)
# Python Qt
# ===========
INCLUDE(SalomeQtPythonBindings)
SALOME_SETUP_QT_PYTHON_BINDINGS()
SET(_plugin_SCRIPTS
mesh_boolean_plugin.py
mesh_boolean_dialog.py
mesh_boolean_utils.py
MyPlugDialog.ui
)
SET(_pyuic_FILES
MyPlugDialog.ui
)
# scripts / pyuic wrappings
SALOME_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_FILES} TARGET_NAME _target_name_pyuic)
# Installation
SET(Mesh_Boolean_INSTALL_PLUGIN "plugins/meshbooleanplugin")
#SET(Mesh_Boolean_INSTALL_TESTS ".")
SET(Mesh_Boolean_INSTALL_MISC "misc" )
SET(Mesh_Boolean_INSTALL_DOC "doc" )
SALOME_INSTALL_SCRIPTS("${_plugin_SCRIPTS}" "${Mesh_Boolean_INSTALL_PLUGIN}")
SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" "${Mesh_Boolean_INSTALL_PLUGIN}" TARGET_NAME _target_name_pyuic_py)
# add dependency toi compiled py files on uic files in order
# to avoid races problems when compiling in parallel
ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic})
# Install the files
INSTALL(FILES "${PROJECT_SOURCE_DIR}/README.md" DESTINATION "${Mesh_Boolean_INSTALL_DOC}" )
INSTALL(DIRECTORY "${PROJECT_SOURCE_DIR}/tests" DESTINATION "${Mesh_Boolean_INSTALL_PLUGIN}" )
SALOME_CONFIGURE_FILE(__init__.py __init__.py INSTALL "${Mesh_Boolean_INSTALL_PLUGIN}")
# Install all engines scripts
SET(Mesh_Boolean_Engines vtk cgal cork irmb libigl mcut)
FOREACH(Mesh_Boolean_Engine ${Mesh_Boolean_Engines})
MESSAGE(status "hello ${PROJECT_SOURCE_DIR}/${Mesh_Boolean_Engine}/exec_${Mesh_Boolean_Engine}.py")
INSTALL(FILES "${PROJECT_SOURCE_DIR}/${Mesh_Boolean_Engine}/exec_${Mesh_Boolean_Engine}.py" DESTINATION "${Mesh_Boolean_INSTALL_PLUGIN}/${Mesh_Boolean_Engine}" )
ENDFOREACH()
#Copy additional script needed for the VTK engine
INSTALL(FILES "${PROJECT_SOURCE_DIR}/vtk/run_vtk.py" DESTINATION "${Mesh_Boolean_INSTALL_PLUGIN}/vtk")
#Copy the API in INSTALL
INSTALL(FILES "${PROJECT_SOURCE_DIR}/mesh_boolean_api.py" DESTINATION "${Mesh_Boolean_INSTALL_PLUGIN}")
#Copy the testing file in INSTALL
INSTALL(FILES "${PROJECT_SOURCE_DIR}/test_meshboolean_api.py" DESTINATION "${Mesh_Boolean_INSTALL_PLUGIN}")
ENDIF()