Fix for the "23284: EDF 13077 GEOM: Build GEOM without GUI and without VTK" issue.

This commit is contained in:
ana 2016-07-28 17:45:59 +03:00
parent 6d27d7bc86
commit 8ee487fe3f
10 changed files with 74 additions and 15 deletions

View File

@ -70,7 +70,9 @@ OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON)
OPTION(SALOME_BUILD_GUI "Enable GUI" ON) OPTION(SALOME_BUILD_GUI "Enable GUI" ON)
CMAKE_DEPENDENT_OPTION(SALOME_GEOM_USE_OPENCV "Enable shape recognition from picture" OFF CMAKE_DEPENDENT_OPTION(SALOME_GEOM_USE_OPENCV "Enable shape recognition from picture" OFF
"SALOME_BUILD_GUI" 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 # Prerequisites
# ============= # =============
@ -146,7 +148,11 @@ ENDIF(SALOME_BUILD_GUI)
## ##
FIND_PACKAGE(SalomeCAS REQUIRED) 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 # OpenCV
IF(SALOME_GEOM_USE_OPENCV) IF(SALOME_GEOM_USE_OPENCV)
@ -231,9 +237,9 @@ INCLUDE(CMakePackageConfigHelpers)
SET(_${PROJECT_NAME}_exposed_targets SET(_${PROJECT_NAME}_exposed_targets
GEOMArchimede BlockFix GEOMbasic GEOMAlgo GEOMClient GEOMImpl GEOMArchimede BlockFix GEOMbasic GEOMAlgo GEOMClient GEOMImpl
GEOMUtils GEOMEngine GEOM_SupervEngine GEOMSketcher GEOMUtils GEOMEngine GEOM_SupervEngine GEOMSketcher
SalomeIDLGEOM SalomeIDLGEOMSuperv SalomeIDLAdvancedGEOM ShHealOper XAO AdvancedEngine OCC2VTK SalomeIDLGEOM SalomeIDLGEOMSuperv SalomeIDLAdvancedGEOM ShHealOper XAO AdvancedEngine
SalomeIDLSTLPlugin SalomeIDLBREPPlugin SalomeIDLSTEPPlugin SalomeIDLIGESPlugin SalomeIDLXAOPlugin SalomeIDLVTKPlugin SalomeIDLSTLPlugin SalomeIDLBREPPlugin SalomeIDLSTEPPlugin SalomeIDLIGESPlugin SalomeIDLXAOPlugin
STLPluginEngine BREPPluginEngine STEPPluginEngine IGESPluginEngine XAOPluginEngine VTKPluginEngine STLPluginEngine BREPPluginEngine STEPPluginEngine IGESPluginEngine XAOPluginEngine
) )
IF(SALOME_BUILD_GUI) IF(SALOME_BUILD_GUI)
LIST(APPEND _${PROJECT_NAME}_exposed_targets LIST(APPEND _${PROJECT_NAME}_exposed_targets
@ -247,6 +253,14 @@ IF(SALOME_BUILD_GUI)
ENDIF(SALOME_USE_GRAPHICSVIEW) ENDIF(SALOME_USE_GRAPHICSVIEW)
ENDIF(SALOME_BUILD_GUI) 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) IF(SALOME_GEOM_USE_OPENCV)
LIST(APPEND _${PROJECT_NAME}_exposed_targets LIST(APPEND _${PROJECT_NAME}_exposed_targets
GEOMShapeRec GEOMShapeRec

View File

@ -53,11 +53,11 @@ SET(SALOME_GEOM_BUILD_TESTS @SALOME_BUILD_TESTS@)
# Advanced options # Advanced options
SET(SALOME_GEOM_BUILD_GUI @SALOME_BUILD_GUI@) SET(SALOME_GEOM_BUILD_GUI @SALOME_BUILD_GUI@)
SET(SALOME_GEOM_USE_OPENCV @SALOME_GEOM_USE_OPENCV@) SET(SALOME_GEOM_USE_OPENCV @SALOME_GEOM_USE_OPENCV@)
SET(SALOME_GEOM_USE_VTK @SALOME_GEOM_USE_VTK@)
# Level 1 prerequisites: # Level 1 prerequisites:
SET_AND_CHECK(KERNEL_ROOT_DIR_EXP "@PACKAGE_KERNEL_ROOT_DIR@") 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(CAS_ROOT_DIR_EXP "@PACKAGE_CAS_ROOT_DIR@")
SET_AND_CHECK(VTK_ROOT_DIR_EXP "@PACKAGE_VTK_ROOT_DIR@")
# Optional level 1 prerequisites: # Optional level 1 prerequisites:
IF(SALOME_GEOM_BUILD_GUI) 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@") SET_AND_CHECK(OPENCV_ROOT_DIR_EXP "@PACKAGE_OPENCV_ROOT_DIR@")
LIST(APPEND GEOM_DEFINITIONS "-DWITH_OPENCV") LIST(APPEND GEOM_DEFINITIONS "-DWITH_OPENCV")
ENDIF() 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 # For all prerequisites, load the corresponding targets if the package was used
# in CONFIG mode. This ensures dependent projects link correctly # in CONFIG mode. This ensures dependent projects link correctly

View File

@ -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 # Generate a temporary python file, needed for the genaration of the documentation
# of the built-in Geometry plugins. # 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}) SALOME_ACCUMULATE_ENVIRONMENT(GEOM_PluginsList NOCHECK ${DOC_GEOM_PluginsList})
SET(geom_file "${CMAKE_CURRENT_SOURCE_DIR}/collect_geom_methods.py") SET(geom_file "${CMAKE_CURRENT_SOURCE_DIR}/collect_geom_methods.py")
SET(plugins_cmd_options ${geom_file} -o tmp1/geomBuilder.py ${DOC_GEOM_PluginsList}) SET(plugins_cmd_options ${geom_file} -o tmp1/geomBuilder.py ${DOC_GEOM_PluginsList})

View File

@ -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}") OMNIORB_ADD_MODULE(SalomeIDLXAOPlugin "${SalomeIDLXAOPlugin_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_PLUGIN_FLAGS}")
INSTALL(TARGETS SalomeIDLXAOPlugin EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) INSTALL(TARGETS SalomeIDLXAOPlugin EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
OMNIORB_ADD_MODULE(SalomeIDLVTKPlugin "${SalomeIDLVTKPlugin_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_PLUGIN_FLAGS}") IF(SALOME_GEOM_USE_VTK)
INSTALL(TARGETS SalomeIDLVTKPlugin 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})
ENDIF(SALOME_GEOM_USE_VTK)
OMNIORB_ADD_MODULE(SalomeIDLGEOMSuperv "${SalomeIDLGEOMSuperv_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_SUPERV_FLAGS}") OMNIORB_ADD_MODULE(SalomeIDLGEOMSuperv "${SalomeIDLGEOMSuperv_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_SUPERV_FLAGS}")
INSTALL(TARGETS SalomeIDLGEOMSuperv EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) INSTALL(TARGETS SalomeIDLGEOMSuperv EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})

View File

@ -29,7 +29,6 @@ SET( _res_files
STEPPlugin.xml STEPPlugin.xml
IGESPlugin.xml IGESPlugin.xml
XAOPlugin.xml XAOPlugin.xml
VTKPlugin.xml
GEOM_en.xml GEOM_en.xml
GEOM_fr.xml GEOM_fr.xml
GEOM.config GEOM.config
@ -300,6 +299,13 @@ SET( _res_files
exportxao.png importxao.png exportxao.png importxao.png
##@@ insert new functions before this line @@ do not remove this line @@## ##@@ 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}) INSTALL(FILES ${_res_files} DESTINATION ${SALOME_GEOM_INSTALL_RES_DATA})
SET( _texture_files SET( _texture_files

View File

@ -23,8 +23,8 @@
SET(SUBDIRS_COMMON SET(SUBDIRS_COMMON
ARCHIMEDE BlockFix GEOMAlgo SKETCHER GEOM ShHealOper GEOMUtils XAO XAO_Swig ARCHIMEDE BlockFix GEOMAlgo SKETCHER GEOM ShHealOper GEOMUtils XAO XAO_Swig
GEOMImpl GEOM_I GEOMClient GEOM_I_Superv GEOM_SWIG GEOM_PY GEOMImpl GEOM_I GEOMClient GEOM_I_Superv GEOM_SWIG GEOM_PY
AdvancedEngine OCC2VTK AdvancedEngine
STLPlugin BREPPlugin STEPPlugin IGESPlugin XAOPlugin VTKPlugin Tools STLPlugin BREPPlugin STEPPlugin IGESPlugin XAOPlugin Tools
) )
## ##
@ -36,6 +36,16 @@ IF(SALOME_GEOM_USE_OPENCV)
) )
ENDIF() ENDIF()
##
# VTK
##
IF(SALOME_GEOM_USE_VTK)
SET(SUBDIRS_VTK
OCC2VTK
VTKPlugin
)
ENDIF()
## ##
# GUI # GUI
## ##
@ -55,6 +65,7 @@ ENDIF()
SET(SUBDIRS SET(SUBDIRS
${SUBDIRS_COMMON} ${SUBDIRS_COMMON}
${SUBDIRS_OPENCV} ${SUBDIRS_OPENCV}
${SUBDIRS_VTK}
${SUBDIRS_CC} ${SUBDIRS_CC}
${SUBDIRS_GUI} ${SUBDIRS_GUI}
) )

View File

@ -43,7 +43,6 @@ SET(_link_LIBRARIES
SalomeIDLIGESPlugin SalomeIDLIGESPlugin
SalomeIDLSTEPPlugin SalomeIDLSTEPPlugin
SalomeIDLSTLPlugin SalomeIDLSTLPlugin
SalomeIDLVTKPlugin
SalomeIDLXAOPlugin SalomeIDLXAOPlugin
${KERNEL_SALOMELocalTrace} ${KERNEL_SALOMELocalTrace}
${KERNEL_SalomeDSClient} ${KERNEL_SalomeDSClient}
@ -52,6 +51,10 @@ SET(_link_LIBRARIES
${KERNEL_SalomeNS} ${KERNEL_SalomeNS}
) )
IF(SALOME_GEOM_USE_VTK)
SET(_link_LIBRARIES ${_link_LIBRARIES}
SalomeIDLVTKPlugin)
ENDIF(SALOME_GEOM_USE_VTK)
# --- headers --- # --- headers ---
SET(GEOM_SupervEngine_HEADERS SET(GEOM_SupervEngine_HEADERS

View File

@ -22,6 +22,7 @@
#include "GEOM_Superv_i.hh" #include "GEOM_Superv_i.hh"
#include "SALOME_LifeCycleCORBA.hxx" #include "SALOME_LifeCycleCORBA.hxx"
#include "Utils_CorbaException.hxx"
#include CORBA_SERVER_HEADER(SALOME_Session) #include CORBA_SERVER_HEADER(SALOME_Session)
#include "SALOMEDSClient_ClientFactory.hxx" #include "SALOMEDSClient_ClientFactory.hxx"
@ -483,6 +484,7 @@ void GEOM_Superv_i::getXAOPluginOp()
} }
} }
#ifdef WITH_VTK
//============================================================================= //=============================================================================
// getVTKPluginOp: // getVTKPluginOp:
//============================================================================= //=============================================================================
@ -498,6 +500,7 @@ void GEOM_Superv_i::getVTKPluginOp()
myVTKOp = GEOM::IVTKOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "VTKPluginEngine")); myVTKOp = GEOM::IVTKOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "VTKPluginEngine"));
} }
} }
#endif
//============================================================================= //=============================================================================
// GetServant: // GetServant:
@ -3652,6 +3655,7 @@ CORBA::Boolean GEOM_Superv_i::ImportXAO( const char* fileName,
return false; return false;
} }
//============================================================================= //=============================================================================
// Export VTK // Export VTK
//============================================================================= //=============================================================================
@ -3659,11 +3663,16 @@ void GEOM_Superv_i::ExportVTK( GEOM::GEOM_Object_ptr theObject,
const char* theFileName, const char* theFileName,
CORBA::Double theDeflection ) CORBA::Double theDeflection )
{ {
#ifdef WITH_VTK
beginService( " GEOM_Superv_i::ExportVTK" ); beginService( " GEOM_Superv_i::ExportVTK" );
MESSAGE("GEOM_Superv_i::ExportVTK"); MESSAGE("GEOM_Superv_i::ExportVTK");
getVTKPluginOp(); getVTKPluginOp();
myVTKOp->ExportVTK( theObject, theFileName, theDeflection ); myVTKOp->ExportVTK( theObject, theFileName, theDeflection );
endService( " GEOM_Superv_i::ExportVTK" ); 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 ============================= //=============================== Advanced Operations =============================

View File

@ -34,7 +34,9 @@
#include CORBA_CLIENT_HEADER(STEPPlugin) #include CORBA_CLIENT_HEADER(STEPPlugin)
#include CORBA_CLIENT_HEADER(IGESPlugin) #include CORBA_CLIENT_HEADER(IGESPlugin)
#include CORBA_CLIENT_HEADER(XAOPlugin) #include CORBA_CLIENT_HEADER(XAOPlugin)
#ifdef WITH_VTK
#include CORBA_CLIENT_HEADER(VTKPlugin) #include CORBA_CLIENT_HEADER(VTKPlugin)
#endif
#include CORBA_SERVER_HEADER(GEOM_Superv) #include CORBA_SERVER_HEADER(GEOM_Superv)
#include "SALOME_Component_i.hxx" #include "SALOME_Component_i.hxx"
@ -73,8 +75,9 @@ public:
void getSTEPPluginOp(); void getSTEPPluginOp();
void getIGESPluginOp(); void getIGESPluginOp();
void getXAOPluginOp(); void getXAOPluginOp();
#ifdef WITH_VTK
void getVTKPluginOp(); void getVTKPluginOp();
#endif
PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject, PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject,
PortableServer::POA_ptr thePOA); PortableServer::POA_ptr thePOA);
@ -807,7 +810,9 @@ private:
GEOM::ISTEPOperations_var mySTEPOp; GEOM::ISTEPOperations_var mySTEPOp;
GEOM::IIGESOperations_var myIGESOp; GEOM::IIGESOperations_var myIGESOp;
GEOM::IXAOOperations_var myXAOOp; GEOM::IXAOOperations_var myXAOOp;
#ifdef WITH_VTK
GEOM::IVTKOperations_var myVTKOp; GEOM::IVTKOperations_var myVTKOp;
#endif
}; };
#endif #endif

View File

@ -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_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_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_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)