mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-25 00:30:34 +05:00
Fix for the "23284: EDF 13077 GEOM: Build GEOM without GUI and without VTK" issue.
This commit is contained in:
parent
6d27d7bc86
commit
8ee487fe3f
@ -70,7 +70,9 @@ OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON)
|
||||
OPTION(SALOME_BUILD_GUI "Enable GUI" ON)
|
||||
CMAKE_DEPENDENT_OPTION(SALOME_GEOM_USE_OPENCV "Enable shape recognition from picture" OFF
|
||||
"SALOME_BUILD_GUI" OFF)
|
||||
MARK_AS_ADVANCED(SALOME_BUILD_GUI SALOME_GEOM_USE_OPENCV)
|
||||
CMAKE_DEPENDENT_OPTION(SALOME_GEOM_USE_VTK "Enable VTK-dependent functionality" ON
|
||||
"NOT SALOME_BUILD_GUI" ON)
|
||||
MARK_AS_ADVANCED(SALOME_BUILD_GUI SALOME_GEOM_USE_OPENCV SALOME_GEOM_USE_VTK)
|
||||
|
||||
# Prerequisites
|
||||
# =============
|
||||
@ -146,7 +148,11 @@ ENDIF(SALOME_BUILD_GUI)
|
||||
##
|
||||
|
||||
FIND_PACKAGE(SalomeCAS REQUIRED)
|
||||
FIND_PACKAGE(SalomeVTK REQUIRED)
|
||||
|
||||
IF(SALOME_GEOM_USE_VTK)
|
||||
FIND_PACKAGE(SalomeVTK REQUIRED)
|
||||
ADD_DEFINITIONS(-DWITH_VTK)
|
||||
ENDIF(SALOME_GEOM_USE_VTK)
|
||||
|
||||
# OpenCV
|
||||
IF(SALOME_GEOM_USE_OPENCV)
|
||||
@ -231,9 +237,9 @@ INCLUDE(CMakePackageConfigHelpers)
|
||||
SET(_${PROJECT_NAME}_exposed_targets
|
||||
GEOMArchimede BlockFix GEOMbasic GEOMAlgo GEOMClient GEOMImpl
|
||||
GEOMUtils GEOMEngine GEOM_SupervEngine GEOMSketcher
|
||||
SalomeIDLGEOM SalomeIDLGEOMSuperv SalomeIDLAdvancedGEOM ShHealOper XAO AdvancedEngine OCC2VTK
|
||||
SalomeIDLSTLPlugin SalomeIDLBREPPlugin SalomeIDLSTEPPlugin SalomeIDLIGESPlugin SalomeIDLXAOPlugin SalomeIDLVTKPlugin
|
||||
STLPluginEngine BREPPluginEngine STEPPluginEngine IGESPluginEngine XAOPluginEngine VTKPluginEngine
|
||||
SalomeIDLGEOM SalomeIDLGEOMSuperv SalomeIDLAdvancedGEOM ShHealOper XAO AdvancedEngine
|
||||
SalomeIDLSTLPlugin SalomeIDLBREPPlugin SalomeIDLSTEPPlugin SalomeIDLIGESPlugin SalomeIDLXAOPlugin
|
||||
STLPluginEngine BREPPluginEngine STEPPluginEngine IGESPluginEngine XAOPluginEngine
|
||||
)
|
||||
IF(SALOME_BUILD_GUI)
|
||||
LIST(APPEND _${PROJECT_NAME}_exposed_targets
|
||||
@ -247,6 +253,14 @@ IF(SALOME_BUILD_GUI)
|
||||
ENDIF(SALOME_USE_GRAPHICSVIEW)
|
||||
ENDIF(SALOME_BUILD_GUI)
|
||||
|
||||
IF(SALOME_GEOM_USE_VTK)
|
||||
LIST(APPEND _${PROJECT_NAME}_exposed_targets
|
||||
OCC2VTK
|
||||
VTKPluginEngine
|
||||
SalomeIDLVTKPlugin
|
||||
)
|
||||
ENDIF(SALOME_GEOM_USE_VTK)
|
||||
|
||||
IF(SALOME_GEOM_USE_OPENCV)
|
||||
LIST(APPEND _${PROJECT_NAME}_exposed_targets
|
||||
GEOMShapeRec
|
||||
|
@ -53,11 +53,11 @@ SET(SALOME_GEOM_BUILD_TESTS @SALOME_BUILD_TESTS@)
|
||||
# Advanced options
|
||||
SET(SALOME_GEOM_BUILD_GUI @SALOME_BUILD_GUI@)
|
||||
SET(SALOME_GEOM_USE_OPENCV @SALOME_GEOM_USE_OPENCV@)
|
||||
SET(SALOME_GEOM_USE_VTK @SALOME_GEOM_USE_VTK@)
|
||||
|
||||
# Level 1 prerequisites:
|
||||
SET_AND_CHECK(KERNEL_ROOT_DIR_EXP "@PACKAGE_KERNEL_ROOT_DIR@")
|
||||
SET_AND_CHECK(CAS_ROOT_DIR_EXP "@PACKAGE_CAS_ROOT_DIR@")
|
||||
SET_AND_CHECK(VTK_ROOT_DIR_EXP "@PACKAGE_VTK_ROOT_DIR@")
|
||||
|
||||
# Optional level 1 prerequisites:
|
||||
IF(SALOME_GEOM_BUILD_GUI)
|
||||
@ -68,6 +68,10 @@ IF(SALOME_GEOM_USE_OPENCV)
|
||||
SET_AND_CHECK(OPENCV_ROOT_DIR_EXP "@PACKAGE_OPENCV_ROOT_DIR@")
|
||||
LIST(APPEND GEOM_DEFINITIONS "-DWITH_OPENCV")
|
||||
ENDIF()
|
||||
IF(SALOME_GEOM_USE_VTK)
|
||||
SET_AND_CHECK(VTK_ROOT_DIR_EXP "@PACKAGE_VTK_ROOT_DIR@")
|
||||
LIST(APPEND GEOM_DEFINITIONS "-DWITH_VTK")
|
||||
ENDIF()
|
||||
|
||||
# For all prerequisites, load the corresponding targets if the package was used
|
||||
# in CONFIG mode. This ensures dependent projects link correctly
|
||||
|
@ -27,7 +27,10 @@ SALOME_CONFIGURE_FILE(static/header_py.html.in ${CMAKE_CURRENT_BINARY_DIR}/stati
|
||||
|
||||
# Generate a temporary python file, needed for the genaration of the documentation
|
||||
# of the built-in Geometry plugins.
|
||||
SET(DOC_GEOM_PluginsList AdvancedGEOM STLPlugin BREPPlugin STEPPlugin IGESPlugin XAOPlugin VTKPlugin)
|
||||
SET(DOC_GEOM_PluginsList AdvancedGEOM STLPlugin BREPPlugin STEPPlugin IGESPlugin XAOPlugin)
|
||||
IF(SALOME_GEOM_USE_VTK)
|
||||
SET(DOC_GEOM_PluginsList ${DOC_GEOM_PluginsList} VTKPlugin)
|
||||
ENDIF()
|
||||
SALOME_ACCUMULATE_ENVIRONMENT(GEOM_PluginsList NOCHECK ${DOC_GEOM_PluginsList})
|
||||
SET(geom_file "${CMAKE_CURRENT_SOURCE_DIR}/collect_geom_methods.py")
|
||||
SET(plugins_cmd_options ${geom_file} -o tmp1/geomBuilder.py ${DOC_GEOM_PluginsList})
|
||||
|
@ -107,8 +107,10 @@ INSTALL(TARGETS SalomeIDLIGESPlugin EXPORT ${PROJECT_NAME}TargetGroup DESTINATIO
|
||||
OMNIORB_ADD_MODULE(SalomeIDLXAOPlugin "${SalomeIDLXAOPlugin_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_PLUGIN_FLAGS}")
|
||||
INSTALL(TARGETS SalomeIDLXAOPlugin EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
|
||||
|
||||
OMNIORB_ADD_MODULE(SalomeIDLVTKPlugin "${SalomeIDLVTKPlugin_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_PLUGIN_FLAGS}")
|
||||
INSTALL(TARGETS SalomeIDLVTKPlugin EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
|
||||
IF(SALOME_GEOM_USE_VTK)
|
||||
OMNIORB_ADD_MODULE(SalomeIDLVTKPlugin "${SalomeIDLVTKPlugin_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_PLUGIN_FLAGS}")
|
||||
INSTALL(TARGETS SalomeIDLVTKPlugin EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
|
||||
ENDIF(SALOME_GEOM_USE_VTK)
|
||||
|
||||
OMNIORB_ADD_MODULE(SalomeIDLGEOMSuperv "${SalomeIDLGEOMSuperv_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_SUPERV_FLAGS}")
|
||||
INSTALL(TARGETS SalomeIDLGEOMSuperv EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
|
||||
|
@ -29,7 +29,6 @@ SET( _res_files
|
||||
STEPPlugin.xml
|
||||
IGESPlugin.xml
|
||||
XAOPlugin.xml
|
||||
VTKPlugin.xml
|
||||
GEOM_en.xml
|
||||
GEOM_fr.xml
|
||||
GEOM.config
|
||||
@ -300,6 +299,13 @@ SET( _res_files
|
||||
exportxao.png importxao.png
|
||||
##@@ insert new functions before this line @@ do not remove this line @@##
|
||||
)
|
||||
IF(SALOME_GEOM_USE_VTK)
|
||||
SET(_res_files
|
||||
VTKPlugin.xml
|
||||
${_res_files}
|
||||
)
|
||||
ENDIF(SALOME_GEOM_USE_VTK)
|
||||
|
||||
INSTALL(FILES ${_res_files} DESTINATION ${SALOME_GEOM_INSTALL_RES_DATA})
|
||||
|
||||
SET( _texture_files
|
||||
|
@ -23,8 +23,8 @@
|
||||
SET(SUBDIRS_COMMON
|
||||
ARCHIMEDE BlockFix GEOMAlgo SKETCHER GEOM ShHealOper GEOMUtils XAO XAO_Swig
|
||||
GEOMImpl GEOM_I GEOMClient GEOM_I_Superv GEOM_SWIG GEOM_PY
|
||||
AdvancedEngine OCC2VTK
|
||||
STLPlugin BREPPlugin STEPPlugin IGESPlugin XAOPlugin VTKPlugin Tools
|
||||
AdvancedEngine
|
||||
STLPlugin BREPPlugin STEPPlugin IGESPlugin XAOPlugin Tools
|
||||
)
|
||||
|
||||
##
|
||||
@ -36,6 +36,16 @@ IF(SALOME_GEOM_USE_OPENCV)
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
##
|
||||
# VTK
|
||||
##
|
||||
IF(SALOME_GEOM_USE_VTK)
|
||||
SET(SUBDIRS_VTK
|
||||
OCC2VTK
|
||||
VTKPlugin
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
##
|
||||
# GUI
|
||||
##
|
||||
@ -55,6 +65,7 @@ ENDIF()
|
||||
SET(SUBDIRS
|
||||
${SUBDIRS_COMMON}
|
||||
${SUBDIRS_OPENCV}
|
||||
${SUBDIRS_VTK}
|
||||
${SUBDIRS_CC}
|
||||
${SUBDIRS_GUI}
|
||||
)
|
||||
|
@ -43,7 +43,6 @@ SET(_link_LIBRARIES
|
||||
SalomeIDLIGESPlugin
|
||||
SalomeIDLSTEPPlugin
|
||||
SalomeIDLSTLPlugin
|
||||
SalomeIDLVTKPlugin
|
||||
SalomeIDLXAOPlugin
|
||||
${KERNEL_SALOMELocalTrace}
|
||||
${KERNEL_SalomeDSClient}
|
||||
@ -52,6 +51,10 @@ SET(_link_LIBRARIES
|
||||
${KERNEL_SalomeNS}
|
||||
)
|
||||
|
||||
IF(SALOME_GEOM_USE_VTK)
|
||||
SET(_link_LIBRARIES ${_link_LIBRARIES}
|
||||
SalomeIDLVTKPlugin)
|
||||
ENDIF(SALOME_GEOM_USE_VTK)
|
||||
# --- headers ---
|
||||
|
||||
SET(GEOM_SupervEngine_HEADERS
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include "GEOM_Superv_i.hh"
|
||||
#include "SALOME_LifeCycleCORBA.hxx"
|
||||
#include "Utils_CorbaException.hxx"
|
||||
|
||||
#include CORBA_SERVER_HEADER(SALOME_Session)
|
||||
#include "SALOMEDSClient_ClientFactory.hxx"
|
||||
@ -483,6 +484,7 @@ void GEOM_Superv_i::getXAOPluginOp()
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WITH_VTK
|
||||
//=============================================================================
|
||||
// getVTKPluginOp:
|
||||
//=============================================================================
|
||||
@ -498,6 +500,7 @@ void GEOM_Superv_i::getVTKPluginOp()
|
||||
myVTKOp = GEOM::IVTKOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "VTKPluginEngine"));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//=============================================================================
|
||||
// GetServant:
|
||||
@ -3652,6 +3655,7 @@ CORBA::Boolean GEOM_Superv_i::ImportXAO( const char* fileName,
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// Export VTK
|
||||
//=============================================================================
|
||||
@ -3659,11 +3663,16 @@ void GEOM_Superv_i::ExportVTK( GEOM::GEOM_Object_ptr theObject,
|
||||
const char* theFileName,
|
||||
CORBA::Double theDeflection )
|
||||
{
|
||||
#ifdef WITH_VTK
|
||||
beginService( " GEOM_Superv_i::ExportVTK" );
|
||||
MESSAGE("GEOM_Superv_i::ExportVTK");
|
||||
getVTKPluginOp();
|
||||
myVTKOp->ExportVTK( theObject, theFileName, theDeflection );
|
||||
endService( " GEOM_Superv_i::ExportVTK" );
|
||||
#else
|
||||
std::string message("GEOM_Superv_i::ExportVTK functionality is unavailable");
|
||||
THROW_SALOME_CORBA_EXCEPTION(message.c_str(), SALOME::INTERNAL_ERROR);
|
||||
#endif
|
||||
}
|
||||
|
||||
//=============================== Advanced Operations =============================
|
||||
|
@ -34,7 +34,9 @@
|
||||
#include CORBA_CLIENT_HEADER(STEPPlugin)
|
||||
#include CORBA_CLIENT_HEADER(IGESPlugin)
|
||||
#include CORBA_CLIENT_HEADER(XAOPlugin)
|
||||
#ifdef WITH_VTK
|
||||
#include CORBA_CLIENT_HEADER(VTKPlugin)
|
||||
#endif
|
||||
#include CORBA_SERVER_HEADER(GEOM_Superv)
|
||||
|
||||
#include "SALOME_Component_i.hxx"
|
||||
@ -73,8 +75,9 @@ public:
|
||||
void getSTEPPluginOp();
|
||||
void getIGESPluginOp();
|
||||
void getXAOPluginOp();
|
||||
#ifdef WITH_VTK
|
||||
void getVTKPluginOp();
|
||||
|
||||
#endif
|
||||
PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject,
|
||||
PortableServer::POA_ptr thePOA);
|
||||
|
||||
@ -807,7 +810,9 @@ private:
|
||||
GEOM::ISTEPOperations_var mySTEPOp;
|
||||
GEOM::IIGESOperations_var myIGESOp;
|
||||
GEOM::IXAOOperations_var myXAOOp;
|
||||
#ifdef WITH_VTK
|
||||
GEOM::IVTKOperations_var myVTKOp;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -132,4 +132,6 @@ SALOME_INSTALL_SCRIPTS("${_python_BREP_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome
|
||||
SALOME_INSTALL_SCRIPTS("${_python_STEP_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/STEPPlugin DEF_PERMS)
|
||||
SALOME_INSTALL_SCRIPTS("${_python_IGES_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/IGESPlugin DEF_PERMS)
|
||||
SALOME_INSTALL_SCRIPTS("${_python_XAO_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/XAOPlugin DEF_PERMS)
|
||||
SALOME_INSTALL_SCRIPTS("${_python_VTK_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/VTKPlugin DEF_PERMS)
|
||||
IF(SALOME_GEOM_USE_VTK)
|
||||
SALOME_INSTALL_SCRIPTS("${_python_VTK_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/VTKPlugin DEF_PERMS)
|
||||
ENDIF(SALOME_GEOM_USE_VTK)
|
||||
|
Loading…
Reference in New Issue
Block a user