CMAKE_POLICY(SET CMP0003 NEW)
# Versioning
-# ===========
+# ==========
# Project name, upper case
STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
# Find KERNEL
# ===========
-SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
+SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the SALOME KERNEL")
IF(EXISTS ${KERNEL_ROOT_DIR})
LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
INCLUDE(SalomeMacros)
FIND_PACKAGE(SalomeKERNEL REQUIRED)
- KERNEL_WITH_CORBA() #check whether KERNEL builded with CORBA
+ KERNEL_WITH_CORBA() #check whether KERNEL is built with CORBA
ADD_DEFINITIONS(${KERNEL_DEFINITIONS})
INCLUDE_DIRECTORIES(${KERNEL_INCLUDE_DIRS})
ELSE(EXISTS ${KERNEL_ROOT_DIR})
- MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR")
+ MESSAGE(FATAL_ERROR "We absolutely need a SALOME KERNEL, please define KERNEL_ROOT_DIR")
ENDIF(EXISTS ${KERNEL_ROOT_DIR})
# Platform setup
LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files")
# Find GEOM
-# ===========
-SET(GEOM_ROOT_DIR $ENV{GEOM_ROOT_DIR} CACHE PATH "Path to the Salome GEOM")
+# =========
+SET(GEOM_ROOT_DIR $ENV{GEOM_ROOT_DIR} CACHE PATH "Path to the SALOME Geometry")
IF(EXISTS ${GEOM_ROOT_DIR})
LIST(APPEND CMAKE_MODULE_PATH "${GEOM_ROOT_DIR}/adm_local/cmake_files")
FIND_PACKAGE(SalomeGEOM REQUIRED)
ADD_DEFINITIONS(${GEOM_DEFINITIONS})
INCLUDE_DIRECTORIES(${GEOM_INCLUDE_DIRS})
ELSE(EXISTS ${GEOM_ROOT_DIR})
- MESSAGE(FATAL_ERROR "We absolutely need a Salome GEOM, please define GEOM_ROOT_DIR")
+ MESSAGE(FATAL_ERROR "We absolutely need a SALOME Geometry, please define GEOM_ROOT_DIR")
ENDIF(EXISTS ${GEOM_ROOT_DIR})
-SET(SALOME_BUILD_GUI ${SALOME_GEOM_BUILD_GUI})
+# User options
+# ============
+OPTION(SALOME_BUILD_GUI "Enable GUI" ${SALOME_GEOM_BUILD_GUI})
+OPTION(SALOME_BUILD_DOC "Generate SALOME XTPLUGIN documentation" ON)
+OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON)
+OPTION(XT_READ_LICENSE "OCCT Parasolid read license key" "")
-# Find GUI(optional)
+# Find GUI (optional)
+# ===================
IF(SALOME_BUILD_GUI)
- SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR} CACHE PATH "Path to the Salome GUI")
+ SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR} CACHE PATH "Path to the SALOME GUI")
IF(EXISTS ${GUI_ROOT_DIR})
LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files")
FIND_PACKAGE(SalomeGUI)
- FULL_GUI(FALSE) #check whether GUI builded in full mode and with CORBA
+ FULL_GUI(FALSE)
ADD_DEFINITIONS(${GUI_DEFINITIONS})
INCLUDE_DIRECTORIES(${GUI_INCLUDE_DIRS})
ELSE(EXISTS ${GUI_ROOT_DIR})
- MESSAGE(STATUS "GUI_ROOT_DIR is not well defined, XTPLUGIN will be built without GUI!!!")
+ MESSAGE(FATAL_ERROR "We absolutely need a SALOME GUI, please define GUI_ROOT_DIR")
ENDIF(EXISTS ${GUI_ROOT_DIR})
+ IF(NOT SALOME_GEOM_BUILD_GUI)
+ MESSAGE(FATAL_ERROR "SALOME Geometry module is built without GUI")
+ ENDIF(NOT SALOME_GEOM_BUILD_GUI)
SALOME_LOG_OPTIONAL_PACKAGE(SalomeGUI SALOME_BUILD_GUI)
ENDIF(SALOME_BUILD_GUI)
-# User options
-# ============
-OPTION(SALOME_BUILD_DOC "Generate SALOME XTPLUGIN documentation" ON)
-OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON)
-
IF(SALOME_BUILD_TESTS)
ENABLE_TESTING()
-ENDIF()
-
-OPTION(XT_READ_LICENSE "XT read license key" "")
+ENDIF(SALOME_BUILD_TESTS)
IF(XT_READ_LICENSE)
ADD_DEFINITIONS(-DXT_HASLICENSE)
-ELSE()
- MESSAGE(WARNING "XT read license key is not specified! Runtime license will be required!")
-ENDIF()
-
-##
-## XTPLUGIN specifics
-##
+ELSE(XT_READ_LICENSE)
+ MESSAGE(WARNING "OCCT Parasolid read license key is not specified! Runtime license will be required!")
+ENDIF(XT_READ_LICENSE)
+# Pre-requisites
+# ==============
FIND_PACKAGE(SalomePython REQUIRED)
FIND_PACKAGE(SalomeCAS REQUIRED)
FIND_PACKAGE(SalomeXT REQUIRED)
FIND_PACKAGE(SalomeOmniORBPy REQUIRED)
IF(SALOME_BUILD_GUI)
FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui)
-ENDIF()
+ENDIF(SALOME_BUILD_GUI)
IF(SALOME_BUILD_DOC)
FIND_PACKAGE(SalomeDoxygen)
SALOME_LOG_OPTIONAL_PACKAGE(Doxygen SALOME_BUILD_DOC)
-ENDIF()
+ENDIF(SALOME_BUILD_DOC)
+
+# Detection summary:
+SALOME_PACKAGE_REPORT_AND_CHECK()
# Directories
# ===========
SET(SALOME_INSTALL_BINS bin/salome CACHE PATH "Install path: SALOME binaries")
SET(SALOME_INSTALL_LIBS lib/salome CACHE PATH "Install path: SALOME libs")
+SET(SALOME_INSTALL_IDLS idl/salome CACHE PATH "Install path: SALOME IDL files")
SET(SALOME_INSTALL_HEADERS include/salome CACHE PATH "Install path: SALOME headers")
SET(SALOME_INSTALL_CMAKE_LOCAL adm_local/cmake_files CACHE PATH
"Install path: local SALOME CMake files")
SET(SALOME_XTPLUGIN_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/xtplugin" CACHE PATH.
"Install path: SALOME XTPLUGIN specific data")
-MARK_AS_ADVANCED(SALOME_INSTALL_BINS SALOME_INSTALL_LIBS SALOME_INSTALL_HEADERS)
+MARK_AS_ADVANCED(SALOME_INSTALL_BINS SALOME_INSTALL_LIBS SALOME_INSTALL_IDLS SALOME_INSTALL_HEADERS)
MARK_AS_ADVANCED(SALOME_INSTALL_CMAKE_LOCAL SALOME_INSTALL_RES SALOME_INSTALL_DOC)
+MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_XTPLUGIN_INSTALL_RES_DATA)
# Accumulate environment variables for XTPLUGIN module
SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON})
SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS})
# Sources
-# ========
+# =======
ADD_SUBDIRECTORY(idl)
ADD_SUBDIRECTORY(adm_local)
ADD_SUBDIRECTORY(resources)
ADD_SUBDIRECTORY(src)
IF(SALOME_BUILD_DOC)
ADD_SUBDIRECTORY(doc)
-ENDIF()
+ENDIF(SALOME_BUILD_DOC)
# Header configuration
# ====================
LIST(APPEND _${PROJECT_NAME}_exposed_targets
XTPluginGUI
)
-ENDIF()
+ENDIF(SALOME_BUILD_GUI)
# Add all targets to the build-tree export set
EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets}
WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
VERSION ${${PROJECT_NAME_UC}_VERSION}
COMPATIBILITY AnyNewerVersion)
-
+
# Install the CMake configuration files:
INSTALL(FILES
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
XT plugin for SALOME Geometry module requires:
-- SALOME, at least KERNEL module (http://www.salome-platform.org).
+- SALOME, at least KERNEL and GEOM modules (http://www.salome-platform.org).
- Open CASCADE Technology and OCCT Parasolid Import XDE product
(http://www.opencascade.org).
+- Other pre-requisite products, according to the SALOME pre-requisites list.
==================
Basic Installation
- for csh:
- % setenv OCCLICENSE_ROOT_DIR /path/to/the/OCCLicense-6.7.0
+ % setenv OCCLICENSE_ROOT_DIR /path/to/the/OCCLicense-6.9.0
% setenv LD_LIBRARY_PATH ${OCCLICENSE_ROOT_DIR}/lib:${LD_LIBRARY_PATH}
- for bash:
- % export OCCLICENSE_ROOT_DIR=/path/to/the/OCCLicense-6.7.0
+ % export OCCLICENSE_ROOT_DIR=/path/to/the/OCCLicense-6.9.0
% export LD_LIBRARY_PATH=${OCCLICENSE_ROOT_DIR}/lib:${LD_LIBRARY_PATH}
2. Create a build directory (in the example below, it is assumed
- for csh:
- % setenv OCCLICENSE_ROOT_DIR /path/to/the/OCCLicense-6.7.0
+ % setenv OCCLICENSE_ROOT_DIR /path/to/the/OCCLicense-6.9.0
% setenv LD_LIBRARY_PATH ${OCCLICENSE_ROOT_DIR}/lib:${LD_LIBRARY_PATH}
- for bash:
- % export OCCLICENSE_ROOT_DIR=/path/to/the/OCCLicense-6.7.0
+ % export OCCLICENSE_ROOT_DIR=/path/to/the/OCCLicense-6.9.0
% export LD_LIBRARY_PATH=${OCCLICENSE_ROOT_DIR}/lib:${LD_LIBRARY_PATH}
-2. Using in SALOME
+2. Usage in SALOME
* Run SALOME and activate Geometry module.
# Config file for the @PROJECT_NAME@ package
# It defines the following variables:
+# Specific to the pacakge @PROJECT_NAME@ itself:
# @PROJECT_NAME_UC@_ROOT_DIR_EXP - the root path of the installation providing this CMake file
#
# Include directories
SET_AND_CHECK(XTPLUGIN_INCLUDE_DIRS "${XTPLUGIN_ROOT_DIR_EXP}/@SALOME_INSTALL_HEADERS@")
SET(XTPLUGIN_INCLUDE_DIRS "${XTPLUGIN_INCLUDE_DIRS};@_SalomeXTPLUGIN_EXTRA_HEADERS@")
-SET(XTPLUGIN_DEFINITIONS)
# Package specific environment variables
@_SalomeXTPLUGIN_EXTRA_ENV_FULL@
# Options exported by the package:
SET(SALOME_XTPLUGIN_BUILD_DOC @SALOME_BUILD_DOC@)
SET(SALOME_XTPLUGIN_BUILD_TESTS @SALOME_BUILD_TESTS@)
+SET(SALOME_XTPLUGIN_BUILD_GUI @SALOME_BUILD_GUI@)
# Level 1 prerequisites:
SET_AND_CHECK(KERNEL_ROOT_DIR_EXP "@PACKAGE_KERNEL_ROOT_DIR@")
# Installation directories
SET(SALOME_INSTALL_BINS "@SALOME_INSTALL_BINS@")
SET(SALOME_INSTALL_LIBS "@SALOME_INSTALL_LIBS@")
+SET(SALOME_INSTALL_IDLS "@SALOME_INSTALL_IDLS@")
SET(SALOME_INSTALL_HEADERS "@SALOME_INSTALL_HEADERS@")
SET(SALOME_INSTALL_CMAKE_LOCAL "@SALOME_INSTALL_CMAKE_LOCAL@")
SET(SALOME_INSTALL_RES "@SALOME_INSTALL_RES@")
SET(SALOME_INSTALL_DOC "@SALOME_INSTALL_DOC@")
+SET(SALOME_INSTALL_PYTHON "@SALOME_INSTALL_PYTHON@")
+
+# Include GEOM targets if they were not already loaded:
+IF(NOT (TARGET GEOMEngine))
+ INCLUDE("${GEOM_ROOT_DIR_EXP}/${SALOME_INSTALL_CMAKE}/SalomeGEOMTargets.cmake")
+ENDIF()
# Exposed XTPLUGIN targets:
SET(XTPLUGIN_SalomeIDLXTPlugin SalomeIDLXTPlugin)
# - Find OCCT Parasolid XDE product
# Sets the following variables:
-# XT_INCLUDE_DIRS - path to the XT include directory
-# XT_LIBRARIES - path to the XT libraries to be linked against
+# XT_INCLUDE_DIRS - path to the OCCT Parasolid XDE include directory
+# XT_LIBRARIES - OCCT Parasolid XDE libraries to be linked against
#
#########################################################################
#---------------------------------------------------------------------------
#Input related options
#---------------------------------------------------------------------------
-INPUT = tmp @CMAKE_SOURCE_DIR@/idl/XTPlugin_Gen.idl
+INPUT = tmp @CMAKE_SOURCE_DIR@/idl/XTPlugin.idl
FILE_PATTERNS =
IMAGE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/images
RECURSIVE = NO
- Run SALOME and activate Geometry module.
-- Import the XT file from menu <b>File/Import/XT</b>.
+- Import the XT file from menu \b File - \b Import - \b XT.
\image html import_xt.png
will appear in the SALOME object browser.
\note It is possible to re-load a previously imported shape from the initial file if
- the file has been changed on disk. For this, select <b>Reload From Disk</b> item
+ the file has been changed on disk. To do this, select <b>Reload From Disk</b> item
in the Object browser's context menu of the imported shape. The reloaded shape will
have the same representation parameters as before this operation.
Python package XTPluginBuilder defines a function that allows
importing CAD models in Parasolid format (*.x_t and *.xt files).
-XTPLUGIN dynamically adds several methods to the geomBuilder.
+XTPLUGIN dynamically adds this method to the geomBuilder.
Below you can see an example of usage of the XTPluginBuilder package for
importing CAD models:
\anchor example_XTPlugin
-<h2>Example of importing of CAD model stored in Parasolid format (*.x_t and *.xt files) with XTPLUGIN:</h2>
+<h2>Example: importing CAD model stored in Parasolid format (*.x_t and *.xt files) with XTPLUGIN:</h2>
\tui_script{XTPlugindemo.py}
*/
-
-
.navpath li.footer {
line-height:15px;
text-align: right;
-}
\ No newline at end of file
+}
SET(IDL_INCLUDE_DIRS
${KERNEL_ROOT_DIR}/idl/salome
${GEOM_ROOT_DIR}/idl/salome
- ${CMAKE_CURRENT_SOURCE_DIR}
)
SET(IDL_LINK_FLAGS
${KERNEL_SalomeIDLKernel}
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.
+ 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
${CAS_INCLUDE_DIRS}
${XT_INCLUDE_DIRS}
${KERNEL_INCLUDE_DIRS}
+ ${GEOM_INCLUDE_DIRS}
${PROJECT_BINARY_DIR}
${PROJECT_BINARY_DIR}/idl
+ ${CMAKE_CURRENT_BINARY_DIR}
)
IF(SALOME_BUILD_GUI)
INCLUDE_DIRECTORIES(
${QT_INCLUDE_DIRS}
${GUI_INCLUDE_DIRS}
- ${GEOM_INCLUDE_DIRS}
)
ENDIF()
extern "C"
{
#ifdef WIN32
- __declspec( dllexport )
+ __declspec( dllexport )
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
XTPlugin_IOperations* aPluginOperations = XTPlugin_OperationsCreator::get( GetEngine(), theDocId );
return aPluginOperations->ImportXT( theFileName );
}
-
#include <XtTopoDS_Topology.hxx>
#include <StdFail_NotDone.hxx>
+#include <Standard_Version.hxx>
#ifdef XT_HASLICENSE
#include "XTPlugin_license.h"
OCCLicense_Activate( "XT-R-"OCC_VERSION_STRING, XT_READ_LICENSE);
}
catch (Standard_LicenseError) {
- return aResShape;
+ return 0;
}
#endif // XT_HASLICENSE
<translation>Importer XT</translation>
</message>
</context>
-</TS>
\ No newline at end of file
+</TS>
<translation type="unfinished">Import XT</translation>
</message>
</context>
-</TS>
\ No newline at end of file
+</TS>