From: vsr Date: Thu, 14 May 2020 15:12:26 +0000 (+0300) Subject: Clean-up build procedure X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=defd1b7ae95471db79526e39c76ee644d13edb6d;p=modules%2Fkernel.git Clean-up build procedure --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bd7da095..40451c732 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,7 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR) INCLUDE(CMakeDependentOption) @@ -176,28 +177,32 @@ SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOM SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS}) # For salome test -SET(KERNEL_TEST_DIR ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test) -SET(KERNEL_TEST_LIB ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/lib) -CONFIGURE_FILE(CTestTestfileInstall.cmake.in CTestTestfileInstall.cmake @ONLY) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfileInstall.cmake - DESTINATION ${KERNEL_TEST_DIR} - RENAME CTestTestfile.cmake) - -# Sources -# ======== +IF(SALOME_BUILD_TESTS) + SET(KERNEL_TEST_DIR ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test) + SET(KERNEL_TEST_LIB ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/lib) + CONFIGURE_FILE(CTestTestfileInstall.cmake.in CTestTestfileInstall.cmake @ONLY) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfileInstall.cmake + DESTINATION ${KERNEL_TEST_DIR} + RENAME CTestTestfile.cmake) +ENDIF() + +# Process subdirs +# =============== IF(NOT SALOME_LIGHT_ONLY) ADD_SUBDIRECTORY(idl) ENDIF() ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(resources) -ADD_SUBDIRECTORY(bin) +IF(NOT SALOME_LIGHT_ONLY) + ADD_SUBDIRECTORY(bin) +ENDIF() ADD_SUBDIRECTORY(salome_adm) IF(SALOME_BUILD_DOC) ADD_SUBDIRECTORY(doc) ENDIF() -# Header configuration -# ==================== +# Configure and install version header file +# ========================================= SALOME_XVERSION(${PROJECT_NAME}) SALOME_CONFIGURE_FILE(KERNEL_version.h.in KERNEL_version.h INSTALL ${SALOME_INSTALL_HEADERS}) @@ -205,67 +210,10 @@ SALOME_CONFIGURE_FILE(KERNEL_version.h.in KERNEL_version.h INSTALL ${SALOME_INST # ==================== INCLUDE(CMakePackageConfigHelpers) -# List of targets in this project we want to make visible to the rest of the world. -# They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup" - -SET(_${PROJECT_NAME}_exposed_targets - SALOMEBasics SALOMELocalTrace SalomeHDFPersist OpUtil) - -# CORBA specific targets: -IF(NOT SALOME_LIGHT_ONLY) - LIST(APPEND _${PROJECT_NAME}_exposed_targets - DF SalomeLoggerServer with_loggerTraceCollector SalomeNS SalomeGenericObj - Registry SalomeCatalog ResourcesManager SalomeResourcesManager - SalomeNotification SalomeContainer SalomeSDS Launcher SalomeLauncher - SalomeLifeCycleCORBA SalomeDSClient TOOLSDS SalomeKernelHelpers - SalomeDSImpl SalomeDS SalomeCommunication SalomeDSCContainer) - # Temporary solution for package src\DSC on windows - IF(NOT WIN32) - LIST(APPEND _${PROJECT_NAME}_exposed_targets - CalciumC SalomeCalcium SalomeDatastream SalomePalm SalomeDSCSupervBasic - SalomeDSCSuperv) - IF(SALOME_PACO_PARALLEL) - LIST(APPEND _${PROJECT_NAME}_exposed_targets SalomeParallelDSCContainer) - ENDIF() - ENDIF() -ENDIF() - -# MPI specific targets: -IF(SALOME_USE_MPI) - LIST(APPEND _${PROJECT_NAME}_exposed_targets - SalomeMPIContainer SalomeTestMPIComponentEngine) -ENDIF() - -# Test targets: -IF(SALOME_BUILD_TESTS) - LIST(APPEND _${PROJECT_NAME}_exposed_targets SALOMELocalTraceTest UnitTests) - IF(NOT SALOME_LIGHT_ONLY) - LIST(APPEND _${PROJECT_NAME}_exposed_targets - SALOMETraceCollectorTest UtilsTest NamingServiceTest SalomeTestComponentEngine - LifeCycleCORBATest SalomeKernelHelpersTest SALOMEDSImplTest SALOMEDSTest) - ENDIF() -ENDIF() - -# PACO specific targets: -IF(SALOME_PACO_PARALLEL) - LIST(APPEND _${PROJECT_NAME}_exposed_targets SalomeParallelContainer) -ENDIF() - -IF(NOT SALOME_LIGHT_ONLY) - LIST(APPEND _${PROJECT_NAME}_exposed_targets SalomeIDLKernel) - IF(SALOME_PACO_PARALLEL) - LIST(APPEND _${PROJECT_NAME}_exposed_targets SalomeParallelIDLKernel) - ENDIF() -ENDIF() - -# Add all targets to the build-tree export set -EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets} - FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake) - -# Create the configuration files: -# - in the build tree: +# Export targets to the build tree +EXPORT(EXPORT ${PROJECT_NAME}TargetGroup FILE ${PROJECT_NAME}Targets.cmake) -# Ensure the variables are always defined for the configure: +# Ensure the variables are always defined for the configure: SET(CPPUNIT_ROOT_DIR "${CPPUNIT_ROOT_DIR}") SET(GRAPHVIZ_ROOT_DIR "${GRAPHVIZ_ROOT_DIR}") SET(DOXYGEN_ROOT_DIR "${DOXYGEN_ROOT_DIR}") @@ -275,14 +223,15 @@ SET(OMNIORB_ROOT_DIR "${OMNIORB_ROOT_DIR}") SET(OMNIORBPY_ROOT_DIR "${OMNIORBPY_ROOT_DIR}") SET(LIBBATCH_ROOT_DIR "${LIBBATCH_ROOT_DIR}") -SET(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include") +SET(CONF_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/include" "${CMAKE_BINARY_DIR}/include") # Build variables that will be expanded when configuring SalomeConfig.cmake: SALOME_CONFIGURE_PREPARE(CppUnit Graphviz Doxygen Sphinx MPI omniORB LibBatch PThread Boost HDF5 libXml2 Python) +# Generate confifguration CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in - ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake + ${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.cmake INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE}" PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE CMAKE_INSTALL_PREFIX CPPUNIT_ROOT_DIR GRAPHVIZ_ROOT_DIR DOXYGEN_ROOT_DIR @@ -290,27 +239,15 @@ CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in PTHREAD_ROOT_DIR BOOST_ROOT_DIR HDF5_ROOT_DIR LIBXML2_ROOT_DIR PYTHON_ROOT_DIR SWIG_ROOT_DIR) -# - in the install tree (VSR 16/08/2013: TEMPORARILY COMMENT THIS - TO REMOVE?): -# Get the relative path of the include directory so -# we can register it in the generated configuration files: -#SET(CONF_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDE_DIR}") -#CONFIGURE_PACKAGE_CONFIG_FILE(salome_adm/cmake_files/${PROJECT_NAME}Config.cmake.in -# ${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake -# INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE}" -# PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE CMAKE_INSTALL_PREFIX -# CPPUNIT_ROOT_DIR GRAPHVIZ_ROOT_DIR DOXYGEN_ROOT_DIR -# SPHINX_ROOT_DIR MPI_ROOT_DIR OMNIORB_ROOT_DIR OMNIORBPY_ROOT_DIR LIBBATCH_ROOT_DIR -# PTHREAD_ROOT_DIR BOOST_ROOT_DIR HDF5_ROOT_DIR LIBXML2_ROOT_DIR -# PYTHON_ROOT_DIR SWIG_ROOT_DIR) - -WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake +# Generate project version file +WRITE_BASIC_PACKAGE_VERSION_FILE(${CMAKE_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" - "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" + "${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.cmake" + "${CMAKE_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" DESTINATION "${SALOME_INSTALL_CMAKE}") # Install the export set for use with the install-tree diff --git a/CTestTestfileInstall.cmake.in b/CTestTestfileInstall.cmake.in index a926383a1..c0721a4c0 100644 --- a/CTestTestfileInstall.cmake.in +++ b/CTestTestfileInstall.cmake.in @@ -38,6 +38,7 @@ SUBDIRS( Launcher SALOMEDSImpl SALOMESDS Utils + DF UnitTests salomeInstance salomeCommand diff --git a/SalomeKERNELConfig.cmake.in b/SalomeKERNELConfig.cmake.in index c01f6fdf9..fe36118e1 100644 --- a/SalomeKERNELConfig.cmake.in +++ b/SalomeKERNELConfig.cmake.in @@ -148,8 +148,6 @@ SET(SALOME_INSTALL_AMCONFIG_LOCAL "@SALOME_INSTALL_AMCONFIG_LOCAL@") # to be rem SET(KERNEL_CalciumC CalciumC) SET(KERNEL_DF DF) SET(KERNEL_Launcher Launcher) -SET(KERNEL_LifeCycleCORBATest LifeCycleCORBATest) -SET(KERNEL_NamingServiceTest NamingServiceTest) SET(KERNEL_OpUtil OpUtil) SET(KERNEL_Registry Registry) SET(KERNEL_ResourcesManager ResourcesManager) @@ -164,25 +162,18 @@ SET(KERNEL_SalomeDSClient SalomeDSClient) SET(KERNEL_SalomeDSCSupervBasic SalomeDSCSupervBasic) SET(KERNEL_SalomeDSCSuperv SalomeDSCSuperv) SET(KERNEL_SalomeDSImpl SalomeDSImpl) -SET(KERNEL_SALOMEDSImplTest SALOMEDSImplTest) SET(KERNEL_SalomeDS SalomeDS) -SET(KERNEL_SALOMEDSTest SALOMEDSTest) SET(KERNEL_SalomeGenericObj SalomeGenericObj) SET(KERNEL_SalomeHDFPersist SalomeHDFPersist) SET(KERNEL_SalomeIDLKernel SalomeIDLKernel) SET(KERNEL_SalomeLauncher SalomeLauncher) SET(KERNEL_SalomeLifeCycleCORBA SalomeLifeCycleCORBA) SET(KERNEL_SALOMELocalTrace SALOMELocalTrace) -SET(KERNEL_SALOMELocalTraceTest SALOMELocalTraceTest) SET(KERNEL_SalomeLoggerServer SalomeLoggerServer) SET(KERNEL_SalomeMPIContainer SalomeMPIContainer) SET(KERNEL_SalomeNotification SalomeNotification) SET(KERNEL_SalomeNS SalomeNS) SET(KERNEL_SalomeResourcesManager SalomeResourcesManager) -SET(KERNEL_SalomeTestComponentEngine SalomeTestComponentEngine) -SET(KERNEL_SalomeTestMPIComponentEngine SalomeTestMPIComponentEngine) -SET(KERNEL_SALOMETraceCollectorTest SALOMETraceCollectorTest) SET(KERNEL_TOOLSDS TOOLSDS) -SET(KERNEL_UtilsTest UtilsTest) SET(KERNEL_with_loggerTraceCollector with_loggerTraceCollector) SET(KERNEL_SalomeKernelHelpers SalomeKernelHelpers) diff --git a/bin/appliskel/CMakeLists.txt b/bin/appliskel/CMakeLists.txt index 82d293832..3506c7d96 100644 --- a/bin/appliskel/CMakeLists.txt +++ b/bin/appliskel/CMakeLists.txt @@ -18,7 +18,9 @@ # ADD_SUBDIRECTORY(salome_tester) -ADD_SUBDIRECTORY(tests) +IF(SALOME_BUILD_TESTS) + ADD_SUBDIRECTORY(tests) +ENDIF() # =============================================================== # Files to be installed diff --git a/doc/salome/gui/CMakeLists.txt b/doc/salome/gui/CMakeLists.txt index 3da0444e6..8dc4ed8dc 100644 --- a/doc/salome/gui/CMakeLists.txt +++ b/doc/salome/gui/CMakeLists.txt @@ -52,7 +52,7 @@ ADD_CUSTOM_TARGET(usr_docs ${CMAKE_COMMAND} -E make_directory tmp WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) -INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target usr_docs)") +INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${CMAKE_BINARY_DIR} --target usr_docs)") INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/KERNEL DESTINATION ${SALOME_INSTALL_DOC}/gui) INSTALL(FILES images/head.png DESTINATION ${SALOME_INSTALL_DOC}/gui/KERNEL) diff --git a/doc/salome/gui/doxyfile.in b/doc/salome/gui/doxyfile.in index fc5033f5a..c34dbae97 100644 --- a/doc/salome/gui/doxyfile.in +++ b/doc/salome/gui/doxyfile.in @@ -15,7 +15,7 @@ ABBREVIATE_BRIEF = ALWAYS_DETAILED_SEC = YES INLINE_INHERITED_MEMB = YES FULL_PATH_NAMES = YES -STRIP_FROM_PATH = @PROJECT_BINARY_DIR@ @PROJECT_SOURCE_DIR@ +STRIP_FROM_PATH = @CMAKE_BINARY_DIR@ @CMAKE_SOURCE_DIR@ STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = YES @@ -77,22 +77,22 @@ WARN_LOGFILE = log.txt #--------------------------------------------------------------------------- INPUT = \ @CMAKE_CURRENT_BINARY_DIR@/tmp \ - @PROJECT_SOURCE_DIR@/doc/salome \ - @PROJECT_SOURCE_DIR@/bin \ - @PROJECT_SOURCE_DIR@/idl \ - @PROJECT_SOURCE_DIR@/src/Container \ - @PROJECT_SOURCE_DIR@/src/LifeCycleCORBA \ - @PROJECT_SOURCE_DIR@/src/NamingService \ - @PROJECT_SOURCE_DIR@/src/Notification \ - @PROJECT_SOURCE_DIR@/src/Utils \ - @PROJECT_SOURCE_DIR@/src/DSC + @CMAKE_SOURCE_DIR@/doc/salome \ + @CMAKE_SOURCE_DIR@/bin \ + @CMAKE_SOURCE_DIR@/idl \ + @CMAKE_SOURCE_DIR@/src/Container \ + @CMAKE_SOURCE_DIR@/src/LifeCycleCORBA \ + @CMAKE_SOURCE_DIR@/src/NamingService \ + @CMAKE_SOURCE_DIR@/src/Notification \ + @CMAKE_SOURCE_DIR@/src/Utils \ + @CMAKE_SOURCE_DIR@/src/DSC FILE_PATTERNS = *.dox *.idl *.hxx *.cxx *.py RECURSIVE = YES EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = -EXAMPLE_PATH = @PROJECT_SOURCE_DIR@/doc/salome/examples +EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/doc/salome/examples EXAMPLE_PATTERNS = EXAMPLE_RECURSIVE = NO IMAGE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/images diff --git a/doc/salome/tui/doxyfile.in b/doc/salome/tui/doxyfile.in index 1e4d110b1..48e2bb909 100644 --- a/doc/salome/tui/doxyfile.in +++ b/doc/salome/tui/doxyfile.in @@ -13,7 +13,7 @@ ABBREVIATE_BRIEF = ALWAYS_DETAILED_SEC = YES INLINE_INHERITED_MEMB = YES FULL_PATH_NAMES = YES -STRIP_FROM_PATH = @PROJECT_BINARY_DIR@ @PROJECT_SOURCE_DIR@ +STRIP_FROM_PATH = @CMAKE_BINARY_DIR@ @CMAKE_SOURCE_DIR@ STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = YES @@ -75,17 +75,17 @@ WARN_LOGFILE = log.txt # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = @CMAKE_CURRENT_BINARY_DIR@/tmp \ - @PROJECT_SOURCE_DIR@/doc/salome \ - @PROJECT_SOURCE_DIR@/src \ - @PROJECT_SOURCE_DIR@/bin \ - @PROJECT_SOURCE_DIR@/idl \ - @PROJECT_BINARY_DIR@/bin \ + @CMAKE_SOURCE_DIR@/doc/salome \ + @CMAKE_SOURCE_DIR@/src \ + @CMAKE_SOURCE_DIR@/bin \ + @CMAKE_SOURCE_DIR@/idl \ + @CMAKE_BINARY_DIR@/bin \ FILE_PATTERNS = *.idl *.hxx *.cxx *.h *.c *.hh *.cc @DOXYGEN_PYTHON_EXTENSION@ *.doc *.dox RECURSIVE = YES EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = -EXAMPLE_PATH = @PROJECT_SOURCE_DIR@/doc/salome/examples +EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/doc/salome/examples EXAMPLE_PATTERNS = EXAMPLE_RECURSIVE = NO IMAGE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/images diff --git a/idl/CMakeLists.txt b/idl/CMakeLists.txt index fcd45f500..47c94683c 100644 --- a/idl/CMakeLists.txt +++ b/idl/CMakeLists.txt @@ -42,7 +42,6 @@ SET(SalomeIDLKernel_IDLSOURCES SALOME_GenericObj.idl SALOME_Types.idl SALOME_Session.idl - nstest.idl DSC_Engines.idl SALOME_Ports.idl SALOME_PyNode.idl @@ -51,15 +50,28 @@ SET(SalomeIDLKernel_IDLSOURCES SALOME_ParamPorts.idl SALOME_Parametric.idl SALOME_MPIObject.idl - SALOME_TestComponent.idl - SALOME_TestModuleCatalog.idl SALOME_CommonTypes.idl SALOME_ExternalServerLauncher.idl ${CMAKE_CURRENT_BINARY_DIR}/Calcium_Ports.idl ) +IF(SALOME_BUILD_TESTS) + LIST(APPEND SalomeIDLKernel_IDLSOURCES + nstest.idl + SALOME_TestModuleCatalog.idl + SALOME_TestComponent.idl + ) +ENDIF() + IF(SALOME_USE_MPI) - SET(SalomeIDLKernel_IDLSOURCES ${SalomeIDLKernel_IDLSOURCES} SALOME_MPIContainer.idl SALOME_TestMPIComponent.idl) + LIST(APPEND SalomeIDLKernel_IDLSOURCES + SALOME_MPIContainer.idl + ) + IF(SALOME_BUILD_TESTS) + LIST(APPEND SalomeIDLKernel_IDLSOURCES + SALOME_TestMPIComponent.idl + ) + ENDIF() ENDIF(SALOME_USE_MPI) SET(IDL_INCLUDE_DIRS diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index 03989de7d..471bd1f27 100644 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -21,14 +21,19 @@ # Files to be installed # =============================================================== -# These files are data, module or lib files -INSTALL(FILES CatalogModulePersonnel.xml_skel DESTINATION ${SALOME_KERNEL_INSTALL_RES_DATA}) - -SALOME_CONFIGURE_FILE(CatalogResources.xml.in CatalogResources.xml INSTALL ${SALOME_KERNEL_INSTALL_RES_DATA}) - -INSTALL(FILES channel.cfg SALOMEDS_Resources DESTINATION ${SALOME_KERNEL_INSTALL_RES_DATA}) -SALOME_CONFIGURE_FILE(KERNELCatalog.xml.in KERNELCatalog.xml INSTALL ${SALOME_KERNEL_INSTALL_RES_DATA}) - - - - +IF(NOT SALOME_LIGHT_ONLY) + CONFIGURE_FILE(CatalogResources.xml.in CatalogResources.xml @ONLY) + CONFIGURE_FILE(KERNELCatalog.xml.in KERNELCatalog.xml @ONLY) + + SET(_resources + CatalogModulePersonnel.xml_skel + SALOMEDS_Resources + channel.cfg + ${CMAKE_CURRENT_BINARY_DIR}/CatalogResources.xml + ${CMAKE_CURRENT_BINARY_DIR}/KERNELCatalog.xml + ) +ENDIF() + +INSTALL(FILES ${_resources} DESTINATION ${SALOME_KERNEL_INSTALL_RES_DATA}) + +UNSET(_resources) diff --git a/src/AppQuickStart/CMakeLists.txt b/src/AppQuickStart/CMakeLists.txt index 6f04b374b..991ac37d6 100644 --- a/src/AppQuickStart/CMakeLists.txt +++ b/src/AppQuickStart/CMakeLists.txt @@ -17,7 +17,7 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -ADD_SUBDIRECTORY( ressources ) +ADD_SUBDIRECTORY(resources) # =============================================================== # Files to be installed @@ -30,4 +30,6 @@ SET(SCRIPTS SALOME_INSTALL_SCRIPTS("${SCRIPTS}" ${SALOME_INSTALL_SCRIPT_SCRIPTS}) -INSTALL( DIRECTORY app-template DESTINATION ${SALOME_KERNEL_INSTALL_RES_DATA}) +INSTALL(DIRECTORY app-template DESTINATION ${SALOME_KERNEL_INSTALL_RES_DATA}) + +UNSET(SCRIPTS) diff --git a/src/AppQuickStart/resources/Anita semi square.ttf b/src/AppQuickStart/resources/Anita semi square.ttf new file mode 100644 index 000000000..17776fd89 Binary files /dev/null and b/src/AppQuickStart/resources/Anita semi square.ttf differ diff --git a/src/AppQuickStart/resources/CMakeLists.txt b/src/AppQuickStart/resources/CMakeLists.txt new file mode 100644 index 000000000..254ec8dd0 --- /dev/null +++ b/src/AppQuickStart/resources/CMakeLists.txt @@ -0,0 +1,32 @@ +# Copyright (C) 2012-2020 CEA/DEN, EDF R&D, OPEN CASCADE +# +# 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 +# + +# =============================================================== +# Files to be installed +# =============================================================== + +# These files are executable scripts +SET(APPQUICKSTART_RESOURCES_FILES + "Anita semi square.ttf" + background.png +) + +INSTALL( FILES ${APPQUICKSTART_RESOURCES_FILES} DESTINATION ${SALOME_KERNEL_INSTALL_RES_DATA} ) + +UNSET(APPQUICKSTART_RESOURCES_FILES) diff --git a/src/AppQuickStart/resources/background.png b/src/AppQuickStart/resources/background.png new file mode 100644 index 000000000..66627c859 Binary files /dev/null and b/src/AppQuickStart/resources/background.png differ diff --git a/src/AppQuickStart/ressources/Anita semi square.ttf b/src/AppQuickStart/ressources/Anita semi square.ttf deleted file mode 100644 index 17776fd89..000000000 Binary files a/src/AppQuickStart/ressources/Anita semi square.ttf and /dev/null differ diff --git a/src/AppQuickStart/ressources/CMakeLists.txt b/src/AppQuickStart/ressources/CMakeLists.txt deleted file mode 100644 index eac87402d..000000000 --- a/src/AppQuickStart/ressources/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (C) 2012-2020 CEA/DEN, EDF R&D, OPEN CASCADE -# -# 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 -# - -# =============================================================== -# Files to be installed -# =============================================================== - -# These files are executable scripts -SET(APPQUICKSTART_RESOURCES_FILES - "Anita semi square.ttf" - background.png -) - -INSTALL( FILES ${APPQUICKSTART_RESOURCES_FILES} DESTINATION ${SALOME_KERNEL_INSTALL_RES_DATA} ) diff --git a/src/AppQuickStart/ressources/background.png b/src/AppQuickStart/ressources/background.png deleted file mode 100644 index 66627c859..000000000 Binary files a/src/AppQuickStart/ressources/background.png and /dev/null differ diff --git a/src/Basics/BasicsGenericDestructor.cxx b/src/Basics/BasicsGenericDestructor.cxx deleted file mode 100644 index e2aa0dcb3..000000000 --- a/src/Basics/BasicsGenericDestructor.cxx +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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 -// - -// SALOME Basics : general SALOME definitions and tools (C++ part - no CORBA) -// File : BasicGenericDestructor.cxx -// Author : Antoine YESSAYAN, Paul RASCLE, EDF -// Module : SALOME -// $Header$ -// -#include -#include -#include - -#include "BasicsGenericDestructor.hxx" - -void HouseKeeping(); - -std::list PROTECTED_DELETE::_objList; -#ifndef WIN32 -pthread_mutex_t PROTECTED_DELETE::_listMutex; -#else -pthread_mutex_t PROTECTED_DELETE::_listMutex = - PTHREAD_MUTEX_INITIALIZER; -#endif - -std::list *GENERIC_DESTRUCTOR::Destructors = 0; -static bool atExitSingletonDone = false ; - -// ============================================================================ -/*! - * deleteInstance deletes only once the object. Only object present on the - * static list of PROTECTED_DELETE* are deleted, then removed of the list. - * The operation is protected by a mutex. - */ -// ============================================================================ - -void PROTECTED_DELETE::deleteInstance(PROTECTED_DELETE *anObject) - { - if (std::find(_objList.begin(), _objList.end(),anObject) == _objList.end()) - return; - else - { - int ret; - ret = pthread_mutex_lock(&_listMutex); // acquire lock, an check again - if (std::find(_objList.begin(), _objList.end(), anObject) - != _objList.end()) - { - DEVTRACE("PROTECTED_DELETE::deleteInstance1 " << anObject); - delete anObject; - DEVTRACE("PROTECTED_DELETE::deleteInstance2 " << &_objList); - _objList.remove(anObject); - } - ret = pthread_mutex_unlock(&_listMutex); // release lock - } - } - -// ============================================================================ -/*! - * To allow a further destruction of a PRTECTED_DELETE object, it must be added - * to the static list of PROTECTED_DELETE* - */ -// ============================================================================ - -void PROTECTED_DELETE::addObj(PROTECTED_DELETE *anObject) -{ - DEVTRACE("PROTECTED_DELETE::addObj " << anObject); - _objList.push_back(anObject); -} - -// ============================================================================ -/*! - * Herited classes have there own destructors - */ -// ============================================================================ - -PROTECTED_DELETE::~PROTECTED_DELETE() -{ - DEVTRACE("PROTECTED_DELETE::~PROTECTED_DELETE()"); -} - -// ============================================================================ -/*! - * To execute only once GENERIC_DESTRUCTOR::HouseKeeping et the end of process, - * a dedicated object is created, as a singleton: atExitSingleton. - * When the singleton is created, the HouseKeeping() function is registered in - * atExit(). - * Destructors is a list created on heap, and deleted by HouseKeeping(), with - * the list content. - */ -// ============================================================================ - -class atExitSingleton -{ -public: - atExitSingleton(bool Make_ATEXIT) - { - if (Make_ATEXIT && !atExitSingletonDone) - { - DEVTRACE("atExitSingleton(" << Make_ATEXIT << ")"); - assert(GENERIC_DESTRUCTOR::Destructors == 0); - GENERIC_DESTRUCTOR::Destructors = new std::list; -#ifndef _DEBUG_ - atexit(HouseKeeping); -#else - int cr = atexit(HouseKeeping); - assert(cr == 0); -#endif - atExitSingletonDone = true; - } - } - - ~atExitSingleton() - { - DEVTRACE("atExitSingleton::~atExitSingleton()"); - } -}; - -//! static singleton for atExitSingleton class - -static atExitSingleton HouseKeeper = atExitSingleton(false); - -// ============================================================================ -/*! - * Executes all objects of type DESTRUCTOR_OF in the Destructors list. - * Deletes all objects of type DESTRUCTOR_OF in the Destructors list. - * Deletes the list. - */ -// ============================================================================ - -void HouseKeeping( void ) -{ - DEVTRACE("HouseKeeping()"); - assert(GENERIC_DESTRUCTOR::Destructors); - if(GENERIC_DESTRUCTOR::Destructors->size()) - { - std::list::iterator it = - GENERIC_DESTRUCTOR::Destructors->end(); - - do - { - it-- ; - GENERIC_DESTRUCTOR* ptr = *it ; - DEVTRACE("HouseKeeping() " << typeid(ptr).name()); - (*ptr)(); - delete ptr ; - } - while (it != GENERIC_DESTRUCTOR::Destructors->begin()) ; - - DEVTRACE("HouseKeeping() end list "); - GENERIC_DESTRUCTOR::Destructors->clear() ; - assert(GENERIC_DESTRUCTOR::Destructors->size() == 0); - assert(GENERIC_DESTRUCTOR::Destructors->empty()); - DEVTRACE("HouseKeeping()after clear "); - } - - delete GENERIC_DESTRUCTOR::Destructors; - GENERIC_DESTRUCTOR::Destructors = 0; - atExitSingletonDone = false ; - DEVTRACE("HouseKeeping() very end "); - return ; -} - -// ============================================================================ -/*! - * Adds a destruction object to the list of actions to be performed at the end - * of the process - */ -// ============================================================================ - -const int GENERIC_DESTRUCTOR::Add(GENERIC_DESTRUCTOR &anObject) -{ - DEVTRACE("GENERIC_DESTRUCTOR::Add("<push_back(&anObject); - return Destructors->size(); -} diff --git a/src/Basics/BasicsGenericDestructor.hxx b/src/Basics/BasicsGenericDestructor.hxx deleted file mode 100644 index f5642a68f..000000000 --- a/src/Basics/BasicsGenericDestructor.hxx +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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 -// - -// SALOME Basics : general SALOME definitions and tools (C++ part - no CORBA) -// File : BasicGenericDestructor.hxx -// Author : Antoine YESSAYAN, Paul RASCLE, EDF -// Module : SALOME -// $Header$ -// -#ifndef _BASICGENERICDESTRUCTOR_HXX_ -#define _BASICGENERICDESTRUCTOR_HXX_ - -#include "SALOME_Basics.hxx" - -#include -#include -#include -#include -#include -#include -#include - -//#define _DEVDEBUG_ - -#ifdef _DEVDEBUG_ -#define MYDEVTRACE {std::cerr << __FILE__ << " [" << __LINE__ << "] : ";} -#define DEVTRACE(msg) {MYDEVTRACE; std::cerr< _objList; - -private: - static pthread_mutex_t _listMutex; -}; - -// ============================================================================ -/*! - * The GENERIC_DESTRUCTOR abstract class describes the comportement of any - * destruction object. This type is used to create a list of miscellaneous - * destruction objects. - * - * The only way to use the GENERIC_DESTRUCTOR class is inheritance: - * class SPECIFIC_DESTRUCTOR : public GENERIC_DESTRUCTOR - * - * A generic destructor provides two methods: - * -# a static method to add a destruction (object) to be performed: - * GENERIC_DESTRUCTOR::Add(GENERIC_DESTRUCTOR &anObject); - * The Destruction object is stored in a list of pointer to - * GENERIC_DESTRUCTOR objects. - * -# an object method to execute the destruction : operator()(). - */ -// ============================================================================ - -class BASICS_EXPORT GENERIC_DESTRUCTOR -{ -public : - static std::list *Destructors; - - virtual ~GENERIC_DESTRUCTOR() {}; - static const int Add(GENERIC_DESTRUCTOR &anObject); - virtual void operator()(void) = 0; -}; - -// ============================================================================ -/*! - * The DESTRUCTOR_OF class allows the user to program - at any moment - the - * destruction of an object at the end of the process. - * - * Example: the POINT ptrPoint will be destroyed at the end of the process - * (atexit). - * - * POINT *ptrPoint = new POINT ; - * - * DESTRUCTOR_OF *ptrDestruct = new DESTRUCTOR_OF(*ptrPoint); - * - * Note that neither ptrPoint, nor ptrDestruct should be destroyed by the user. - * - * The destruction object must be created dynamically because it subscribes - * itself in the list of destruction to be performed at the end of the process. - */ -// ============================================================================ - -template class DESTRUCTOR_OF : public GENERIC_DESTRUCTOR -{ -public: - /*! - Programs the destruction at the end of the process, of the object anObject. - This method records in _objectPtr the address of an object to be destroyed - at the end of the process - */ - DESTRUCTOR_OF(TYPE &anObject): - _objectPtr(&anObject) - { - DEVTRACE(" DESTRUCTOR_OF " << typeid(anObject).name() - << " " << _objectPtr << " " << this ); - PROTECTED_DELETE::addObj(_objectPtr); - assert(GENERIC_DESTRUCTOR::Add(*this) >= 0); - } - - /*! - Performs the destruction of the object. - This method really destroys the object pointed by _objectPtr. - It should be called at the end of the process (i.e. at exit). - */ - virtual void operator()(void) - { - if (_objectPtr) - { - DEVTRACE("DESTRUCTOR_OF<>::operator() " << _objectPtr); - if (_objectPtr) PROTECTED_DELETE::deleteInstance(_objectPtr); - _objectPtr = NULL; - } - } - - virtual ~DESTRUCTOR_OF() - { - DEVTRACE("~DESTRUCTOR_OF() " << this); - assert(!_objectPtr); - } - -private: - TYPE *_objectPtr; -}; - -# endif diff --git a/src/Basics/Basics_DirUtils.hxx b/src/Basics/Basics_DirUtils.hxx index 22b90bf28..29f858091 100644 --- a/src/Basics/Basics_DirUtils.hxx +++ b/src/Basics/Basics_DirUtils.hxx @@ -17,13 +17,8 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// SALOME Utils : general SALOME's definitions and tools -// File : Basics_DirUtils.hxx -// Author : Alexander A. BORODIN -// Module : SALOME -// -#ifndef _Basics_DIRUTILS_HXX_ -#define _Basics_DIRUTILS_HXX_ +#ifndef BASICS_DIRUTILS_HXX +#define BASICS_DIRUTILS_HXX #include "SALOME_Basics.hxx" @@ -75,4 +70,4 @@ namespace Kernel_Utils BASICS_EXPORT std::string HomePath(); } -#endif +#endif // BASICS_DIRUTILS_HXX diff --git a/src/Basics/Basics_GenericDestructor.cxx b/src/Basics/Basics_GenericDestructor.cxx new file mode 100644 index 000000000..c6a213969 --- /dev/null +++ b/src/Basics/Basics_GenericDestructor.cxx @@ -0,0 +1,200 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// + +// SALOME Basics : general SALOME definitions and tools (C++ part - no CORBA) +// File : BasicGenericDestructor.cxx +// Author : Antoine YESSAYAN, Paul RASCLE, EDF +// Module : SALOME +// $Header$ +// +#include +#include +#include + +#include "Basics_GenericDestructor.hxx" + +void HouseKeeping(); + +std::list PROTECTED_DELETE::_objList; +#ifndef WIN32 +pthread_mutex_t PROTECTED_DELETE::_listMutex; +#else +pthread_mutex_t PROTECTED_DELETE::_listMutex = + PTHREAD_MUTEX_INITIALIZER; +#endif + +std::list *GENERIC_DESTRUCTOR::Destructors = 0; +static bool atExitSingletonDone = false ; + +// ============================================================================ +/*! + * deleteInstance deletes only once the object. Only object present on the + * static list of PROTECTED_DELETE* are deleted, then removed of the list. + * The operation is protected by a mutex. + */ +// ============================================================================ + +void PROTECTED_DELETE::deleteInstance(PROTECTED_DELETE *anObject) + { + if (std::find(_objList.begin(), _objList.end(),anObject) == _objList.end()) + return; + else + { + int ret; + ret = pthread_mutex_lock(&_listMutex); // acquire lock, an check again + if (std::find(_objList.begin(), _objList.end(), anObject) + != _objList.end()) + { + DEVTRACE("PROTECTED_DELETE::deleteInstance1 " << anObject); + delete anObject; + DEVTRACE("PROTECTED_DELETE::deleteInstance2 " << &_objList); + _objList.remove(anObject); + } + ret = pthread_mutex_unlock(&_listMutex); // release lock + } + } + +// ============================================================================ +/*! + * To allow a further destruction of a PRTECTED_DELETE object, it must be added + * to the static list of PROTECTED_DELETE* + */ +// ============================================================================ + +void PROTECTED_DELETE::addObj(PROTECTED_DELETE *anObject) +{ + DEVTRACE("PROTECTED_DELETE::addObj " << anObject); + _objList.push_back(anObject); +} + +// ============================================================================ +/*! + * Herited classes have there own destructors + */ +// ============================================================================ + +PROTECTED_DELETE::~PROTECTED_DELETE() +{ + DEVTRACE("PROTECTED_DELETE::~PROTECTED_DELETE()"); +} + +// ============================================================================ +/*! + * To execute only once GENERIC_DESTRUCTOR::HouseKeeping et the end of process, + * a dedicated object is created, as a singleton: atExitSingleton. + * When the singleton is created, the HouseKeeping() function is registered in + * atExit(). + * Destructors is a list created on heap, and deleted by HouseKeeping(), with + * the list content. + */ +// ============================================================================ + +class atExitSingleton +{ +public: + atExitSingleton(bool Make_ATEXIT) + { + if (Make_ATEXIT && !atExitSingletonDone) + { + DEVTRACE("atExitSingleton(" << Make_ATEXIT << ")"); + assert(GENERIC_DESTRUCTOR::Destructors == 0); + GENERIC_DESTRUCTOR::Destructors = new std::list; +#ifndef _DEBUG_ + atexit(HouseKeeping); +#else + int cr = atexit(HouseKeeping); + assert(cr == 0); +#endif + atExitSingletonDone = true; + } + } + + ~atExitSingleton() + { + DEVTRACE("atExitSingleton::~atExitSingleton()"); + } +}; + +//! static singleton for atExitSingleton class + +static atExitSingleton HouseKeeper = atExitSingleton(false); + +// ============================================================================ +/*! + * Executes all objects of type DESTRUCTOR_OF in the Destructors list. + * Deletes all objects of type DESTRUCTOR_OF in the Destructors list. + * Deletes the list. + */ +// ============================================================================ + +void HouseKeeping( void ) +{ + DEVTRACE("HouseKeeping()"); + assert(GENERIC_DESTRUCTOR::Destructors); + if(GENERIC_DESTRUCTOR::Destructors->size()) + { + std::list::iterator it = + GENERIC_DESTRUCTOR::Destructors->end(); + + do + { + it-- ; + GENERIC_DESTRUCTOR* ptr = *it ; + DEVTRACE("HouseKeeping() " << typeid(ptr).name()); + (*ptr)(); + delete ptr ; + } + while (it != GENERIC_DESTRUCTOR::Destructors->begin()) ; + + DEVTRACE("HouseKeeping() end list "); + GENERIC_DESTRUCTOR::Destructors->clear() ; + assert(GENERIC_DESTRUCTOR::Destructors->size() == 0); + assert(GENERIC_DESTRUCTOR::Destructors->empty()); + DEVTRACE("HouseKeeping()after clear "); + } + + delete GENERIC_DESTRUCTOR::Destructors; + GENERIC_DESTRUCTOR::Destructors = 0; + atExitSingletonDone = false ; + DEVTRACE("HouseKeeping() very end "); + return ; +} + +// ============================================================================ +/*! + * Adds a destruction object to the list of actions to be performed at the end + * of the process + */ +// ============================================================================ + +const int GENERIC_DESTRUCTOR::Add(GENERIC_DESTRUCTOR &anObject) +{ + DEVTRACE("GENERIC_DESTRUCTOR::Add("<push_back(&anObject); + return Destructors->size(); +} diff --git a/src/Basics/Basics_GenericDestructor.hxx b/src/Basics/Basics_GenericDestructor.hxx new file mode 100644 index 000000000..20b69def0 --- /dev/null +++ b/src/Basics/Basics_GenericDestructor.hxx @@ -0,0 +1,173 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// + +#ifndef BASICS_GENERICDESTRUCTOR_HXX +#define BASICS_GENERICDESTRUCTOR_HXX + +#include "SALOME_Basics.hxx" + +#include +#include +#include +#include +#include +#include +#include + +// Uncomment for extra debug trace +// ------------------------------- +// #define _DEVDEBUG_ + +#ifdef _DEVDEBUG_ +#define MYDEVTRACE {std::cerr << __FILE__ << " [" << __LINE__ << "] : ";} +#define DEVTRACE(msg) {MYDEVTRACE; std::cerr< _objList; + +private: + static pthread_mutex_t _listMutex; +}; + +// ============================================================================ +/*! + * The GENERIC_DESTRUCTOR abstract class describes the comportement of any + * destruction object. This type is used to create a list of miscellaneous + * destruction objects. + * + * The only way to use the GENERIC_DESTRUCTOR class is inheritance: + * class SPECIFIC_DESTRUCTOR : public GENERIC_DESTRUCTOR + * + * A generic destructor provides two methods: + * -# a static method to add a destruction (object) to be performed: + * GENERIC_DESTRUCTOR::Add(GENERIC_DESTRUCTOR &anObject); + * The Destruction object is stored in a list of pointer to + * GENERIC_DESTRUCTOR objects. + * -# an object method to execute the destruction : operator()(). + */ +// ============================================================================ + +class BASICS_EXPORT GENERIC_DESTRUCTOR +{ +public : + static std::list *Destructors; + + virtual ~GENERIC_DESTRUCTOR() {}; + static const int Add(GENERIC_DESTRUCTOR &anObject); + virtual void operator()(void) = 0; +}; + +// ============================================================================ +/*! + * The DESTRUCTOR_OF class allows the user to program - at any moment - the + * destruction of an object at the end of the process. + * + * Example: the POINT ptrPoint will be destroyed at the end of the process + * (atexit). + * + * POINT *ptrPoint = new POINT ; + * + * DESTRUCTOR_OF *ptrDestruct = new DESTRUCTOR_OF(*ptrPoint); + * + * Note that neither ptrPoint, nor ptrDestruct should be destroyed by the user. + * + * The destruction object must be created dynamically because it subscribes + * itself in the list of destruction to be performed at the end of the process. + */ +// ============================================================================ + +template class DESTRUCTOR_OF : public GENERIC_DESTRUCTOR +{ +public: + /*! + Programs the destruction at the end of the process, of the object anObject. + This method records in _objectPtr the address of an object to be destroyed + at the end of the process + */ + DESTRUCTOR_OF(TYPE &anObject): + _objectPtr(&anObject) + { + DEVTRACE(" DESTRUCTOR_OF " << typeid(anObject).name() + << " " << _objectPtr << " " << this ); + PROTECTED_DELETE::addObj(_objectPtr); + assert(GENERIC_DESTRUCTOR::Add(*this) >= 0); + } + + /*! + Performs the destruction of the object. + This method really destroys the object pointed by _objectPtr. + It should be called at the end of the process (i.e. at exit). + */ + virtual void operator()(void) + { + if (_objectPtr) + { + DEVTRACE("DESTRUCTOR_OF<>::operator() " << _objectPtr); + if (_objectPtr) PROTECTED_DELETE::deleteInstance(_objectPtr); + _objectPtr = NULL; + } + } + + virtual ~DESTRUCTOR_OF() + { + DEVTRACE("~DESTRUCTOR_OF() " << this); + assert(!_objectPtr); + } + +private: + TYPE *_objectPtr; +}; + +# endif // BASICS_GENERICDESTRUCTOR_HXX diff --git a/src/Basics/Basics_OCCTVersion.hxx b/src/Basics/Basics_OCCTVersion.hxx index bc0bb2682..16d3ef890 100644 --- a/src/Basics/Basics_OCCTVersion.hxx +++ b/src/Basics/Basics_OCCTVersion.hxx @@ -20,9 +20,6 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// File : Basics_OCCTVersion.hxx -// Author : Julia DOROVSKIKH, Open CASCADE S.A.S (julia.dorovskikh@opencascade.com) - #ifndef BASICS_OCCTVERSION_HXX #define BASICS_OCCTVERSION_HXX diff --git a/src/Basics/Basics_Utils.hxx b/src/Basics/Basics_Utils.hxx index 2b2d676f4..4c2c750f9 100644 --- a/src/Basics/Basics_Utils.hxx +++ b/src/Basics/Basics_Utils.hxx @@ -17,13 +17,8 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// SALOME Utils : general SALOME's definitions and tools -// File : Basics_DirUtils.hxx -// Author : Alexander A. BORODIN -// Module : SALOME -// -#ifndef _Basics_UTILS_HXX_ -#define _Basics_UTILS_HXX_ +#ifndef BASICS_UTILS_HXX +#define BASICS_UTILS_HXX #include "SALOME_Basics.hxx" #include @@ -155,4 +150,4 @@ double ToDouble(const T &arg) { #define LOG STDLOG -#endif //_Basics_UTILS_HXX_ +#endif // BASICS_UTILS_HXX diff --git a/src/Basics/CMakeLists.txt b/src/Basics/CMakeLists.txt index c71e78f94..0bf9a05e1 100644 --- a/src/Basics/CMakeLists.txt +++ b/src/Basics/CMakeLists.txt @@ -21,20 +21,33 @@ INCLUDE_DIRECTORIES( ${PTHREAD_INCLUDE_DIR} ) +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} +) + SET(SALOMEBasics_SOURCES - BasicsGenericDestructor.cxx - Basics_Utils.cxx Basics_DirUtils.cxx - SALOME_Basics.hxx - BasicsGenericDestructor.hxx - Basics_Utils.hxx + Basics_GenericDestructor.cxx + Basics_Utils.cxx +) + +SET(SALOMEBasics_HEADERS Basics_DirUtils.hxx + Basics_GenericDestructor.hxx + Basics_OCCTVersion.hxx + Basics_Utils.hxx + SALOME_Basics.hxx ) ADD_LIBRARY(SALOMEBasics ${SALOMEBasics_SOURCES}) +TARGET_LINK_LIBRARIES(SALOMEBasics ${_link_LIBRARIES}) INSTALL(TARGETS SALOMEBasics EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -TARGET_LINK_LIBRARIES(SALOMEBasics ${PLATFORM_LIBS} ${PTHREAD_LIBRARIES}) +INSTALL(FILES ${SALOMEBasics_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +UNSET(SALOMEBasics_SOURCES) +UNSET(SALOMEBasics_HEADERS) +UNSET(_link_LIBRARIES) -FILE(GLOB SALOMEBasics_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${SALOMEBasics_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +ADD_SUBDIRECTORY(Test) diff --git a/src/Basics/SALOME_Basics.hxx b/src/Basics/SALOME_Basics.hxx index 6cfd4b8a5..85529b63f 100644 --- a/src/Basics/SALOME_Basics.hxx +++ b/src/Basics/SALOME_Basics.hxx @@ -17,24 +17,17 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// SALOME Basics : general SALOME definitions and tools (C++ part - no CORBA) -// File : SALOME_Basics.hxx -// Author : Alexander A. BORODIN -// Module : SALOME -// $Header$ -// -#ifndef _SALOME_BASICS_HXX_ -#define _SALOME_BASICS_HXX_ - +#ifndef SALOME_BASICS_HXX +#define SALOME_BASICS_HXX #ifdef WIN32 # if defined BASICS_EXPORTS || defined SALOMEBasics_EXPORTS -# define BASICS_EXPORT __declspec( dllexport ) +# define BASICS_EXPORT __declspec(dllexport) # else -# define BASICS_EXPORT __declspec( dllimport ) +# define BASICS_EXPORT __declspec(dllimport) # endif #else # define BASICS_EXPORT #endif -#endif //_SALOME_BASICS_HXX_ +#endif // SALOME_BASICS_HXX diff --git a/src/Basics/Test/CMakeLists.txt b/src/Basics/Test/CMakeLists.txt index ac88d34c3..828a913a1 100644 --- a/src/Basics/Test/CMakeLists.txt +++ b/src/Basics/Test/CMakeLists.txt @@ -17,5 +17,4 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -FILE(GLOB SALOMEBasics_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${SALOMEBasics_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +INSTALL(FILES BasicMainTest.hxx DESTINATION ${SALOME_INSTALL_HEADERS}) diff --git a/src/Basics/Test/README b/src/Basics/Test/README new file mode 100644 index 000000000..33132bfda --- /dev/null +++ b/src/Basics/Test/README @@ -0,0 +1,7 @@ +Write tests with cppunit +======================== + +BasicMainTest.hxx is the file containg main() function that configures and runs +unitary tests. + +To use it, just include this header to the test program written with the cppunit. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b8c665211..b7918b631 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -17,85 +17,54 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SET(SUBDIR_BASE - AppQuickStart - Basics - SALOMELocalTrace - HDFPersist - KERNEL_PY - Utils -) +ADD_SUBDIRECTORY(Basics) +ADD_SUBDIRECTORY(SALOMELocalTrace) +ADD_SUBDIRECTORY(HDFPersist) +ADD_SUBDIRECTORY(Utils) -SET(SUBDIR_CORBA - DF - Logger - SALOMETraceCollector - NamingService - GenericObj - Registry - ModuleCatalog - ResourcesManager - Notification - NOTIFICATION_SWIG - Container - SALOMESDS - TestContainer - Launcher - Launcher_SWIG - LifeCycleCORBA - LifeCycleCORBA_SWIG - SALOMEDSClient - TOOLSDS - KernelHelpers - SALOMEDSImpl - SALOMEDS - ModuleGenerator - Communication - Communication_SWIG - DSC -) - -SET(SUBDIR_MPI MPIContainer TestMPIContainer) -SET(SUBDIR_PARALLEL ParallelContainer) - -# CppUnit directories: -SET(SUBDIR_CPPUNIT_BASE - Basics/Test - SALOMELocalTrace/Test -) -SET(SUBDIR_CPPUNIT_CORBA - Logger/Test - SALOMETraceCollector/Test - Utils/Test - NamingService/Test - LifeCycleCORBA/Test - LifeCycleCORBA_SWIG/Test - SALOMEDSImpl/Test - SALOMEDS/Test - KernelHelpers/Test -) -SET(SUBDIR_CPPUNIT_GENERAL UnitTests) - -SET(SUBDIRS ${SUBDIR_BASE}) IF(NOT SALOME_LIGHT_ONLY) - LIST(APPEND SUBDIRS ${SUBDIR_CORBA}) -ENDIF() + ADD_SUBDIRECTORY(AppQuickStart) + ADD_SUBDIRECTORY(KERNEL_PY) + ADD_SUBDIRECTORY(DF) + ADD_SUBDIRECTORY(Logger) + ADD_SUBDIRECTORY(SALOMETraceCollector) + ADD_SUBDIRECTORY(NamingService) + ADD_SUBDIRECTORY(GenericObj) + ADD_SUBDIRECTORY(Registry) + ADD_SUBDIRECTORY(ModuleCatalog) + ADD_SUBDIRECTORY(ResourcesManager) + ADD_SUBDIRECTORY(Notification) + ADD_SUBDIRECTORY(NOTIFICATION_SWIG) + ADD_SUBDIRECTORY(Container) + ADD_SUBDIRECTORY(SALOMESDS) + ADD_SUBDIRECTORY(Launcher) + ADD_SUBDIRECTORY(Launcher_SWIG) + ADD_SUBDIRECTORY(LifeCycleCORBA) + ADD_SUBDIRECTORY(LifeCycleCORBA_SWIG) + ADD_SUBDIRECTORY(SALOMEDSClient) + ADD_SUBDIRECTORY(TOOLSDS) + ADD_SUBDIRECTORY(KernelHelpers) + ADD_SUBDIRECTORY(SALOMEDSImpl) + ADD_SUBDIRECTORY(SALOMEDS) + ADD_SUBDIRECTORY(ModuleGenerator) + ADD_SUBDIRECTORY(Communication) + ADD_SUBDIRECTORY(Communication_SWIG) + ADD_SUBDIRECTORY(DSC) -IF(SALOME_USE_MPI) - LIST(APPEND SUBDIRS ${SUBDIR_MPI}) -ENDIF(SALOME_USE_MPI) + IF(SALOME_BUILD_TESTS) + ADD_SUBDIRECTORY(TestContainer) + ENDIF() -IF(SALOME_BUILD_TESTS) - LIST(APPEND SUBDIRS ${SUBDIR_CPPUNIT_BASE} ${SUBDIR_CPPUNIT_GENERAL}) - IF(NOT SALOME_LIGHT_ONLY) - LIST(APPEND SUBDIRS ${SUBDIR_CPPUNIT_CORBA}) + IF(SALOME_USE_MPI) + ADD_SUBDIRECTORY(MPIContainer) + IF(SALOME_BUILD_TESTS) + ADD_SUBDIRECTORY(TestMPIContainer) + ENDIF() ENDIF() -ENDIF() -IF(SALOME_PACO_PARALLEL) - LIST(APPEND SUBDIRS ${SUBDIR_PARALLEL}) + IF(SALOME_PACO_PARALLEL) + ADD_SUBDIRECTORY(ParallelContainer) + ENDIF() ENDIF() -FOREACH(_dir ${SUBDIRS}) - ADD_SUBDIRECTORY(${_dir}) -ENDFOREACH() +ADD_SUBDIRECTORY(UnitTests) diff --git a/src/Communication/CMakeLists.txt b/src/Communication/CMakeLists.txt index 5bade02c0..4e2bac008 100755 --- a/src/Communication/CMakeLists.txt +++ b/src/Communication/CMakeLists.txt @@ -21,20 +21,24 @@ INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIR} ${MPI_CXX_INCLUDE_PATH} - ${PYTHON_INCLUDE_DIRS} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../Utils - ${PROJECT_BINARY_DIR}/idl + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/Utils ) -SET(COMMON_LIBS +ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${MPI_DEFINITIONS}) + +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} + ${MPI_CXX_LIBRARIES} + SALOMEBasics OpUtil SALOMELocalTrace SalomeIDLKernel - ${PYTHON_LIBRARIES} - ${MPI_CXX_LIBRARIES} ) SET(SalomeCommunication_SOURCES @@ -47,13 +51,11 @@ SET(SalomeCommunication_SOURCES MatrixClient.cxx ) -ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${MPI_DEFINITIONS}) - ADD_LIBRARY(SalomeCommunication ${SalomeCommunication_SOURCES}) -TARGET_LINK_LIBRARIES(SalomeCommunication ${COMMON_LIBS}) +TARGET_LINK_LIBRARIES(SalomeCommunication ${_link_LIBRARIES}) INSTALL(TARGETS SalomeCommunication EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -SET(COMMON_HEADERS_HXX +SET(SalomeCommunication_HEADERS MatrixClient.hxx MultiCommException.hxx Receiver.hxx @@ -66,4 +68,8 @@ SET(COMMON_HEADERS_HXX SenderFactory.hxx ) -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +INSTALL(FILES ${SalomeCommunication_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +UNSET(SalomeCommunication_SOURCES) +UNSET(SalomeCommunication_HEADERS) +UNSET(_link_LIBRARIES) diff --git a/src/Communication_SWIG/CMakeLists.txt b/src/Communication_SWIG/CMakeLists.txt index 3d244f809..5baf21823 100644 --- a/src/Communication_SWIG/CMakeLists.txt +++ b/src/Communication_SWIG/CMakeLists.txt @@ -19,48 +19,48 @@ INCLUDE(${SWIG_USE_FILE}) -SET_SOURCE_FILES_PROPERTIES(libSALOME_Comm.i PROPERTIES CPLUSPLUS ON) -SET_SOURCE_FILES_PROPERTIES(libSALOME_Comm.i PROPERTIES SWIG_FLAGS "-py3") - INCLUDE_DIRECTORIES( + ${PTHREAD_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS} ${OMNIORB_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm + ${MPI_CXX_INCLUDE_PATH} + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/../Communication - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../Utils - ${PROJECT_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Communication + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/Utils ) -ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) -SET(_libSALOME_Comm_LIBS - SalomeCommunication +ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${MPI_DEFINITIONS}) + +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} ${PYTHON_LIBRARIES} + ${MPI_CXX_LIBRARIES} + ${OMNIORB_LIBRARIES} + SalomeCommunication + SalomeIDLKernel ) -IF(SALOME_USE_MPI) - INCLUDE_DIRECTORIES(${MPI_CXX_INCLUDE_PATH}) +SET_SOURCE_FILES_PROPERTIES(libSALOME_Comm.i PROPERTIES CPLUSPLUS ON) +SET_SOURCE_FILES_PROPERTIES(libSALOME_Comm.i PROPERTIES SWIG_FLAGS "-py3") - ADD_DEFINITIONS(${MPI_DEFINITIONS}) - SET(_libSALOME_Comm_LIBS - ${_libSALOME_Comm_LIBS} - ${MPI_CXX_LIBRARIES} - ) -ENDIF(SALOME_USE_MPI) IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") SWIG_ADD_MODULE(libSALOME_Comm python libSALOME_Comm.i) ELSE() SWIG_ADD_LIBRARY(libSALOME_Comm LANGUAGE python SOURCES libSALOME_Comm.i) ENDIF() -SWIG_LINK_LIBRARIES(libSALOME_Comm ${_libSALOME_Comm_LIBS}) +SWIG_LINK_LIBRARIES(libSALOME_Comm ${_link_LIBRARIES}) -IF(${MACHINE} STREQUAL WINDOWS) +IF(WIN32) SET_TARGET_PROPERTIES(_libSALOME_Comm PROPERTIES DEBUG_OUTPUT_NAME _libSALOME_Comm_d) -ENDIF(${MACHINE} STREQUAL WINDOWS) - -ADD_DEPENDENCIES(_libSALOME_Comm SalomeIDLKernel) +ENDIF() INSTALL(TARGETS _libSALOME_Comm DESTINATION ${SALOME_INSTALL_PYTHON}) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libSALOME_Comm.py DESTINATION ${SALOME_INSTALL_PYTHON}) + +UNSET(_link_LIBRARIES) diff --git a/src/Container/CMakeLists.txt b/src/Container/CMakeLists.txt index 81de169b9..9b873e8f2 100644 --- a/src/Container/CMakeLists.txt +++ b/src/Container/CMakeLists.txt @@ -18,32 +18,34 @@ # INCLUDE_DIRECTORIES( - ${OMNIORB_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIR} + ${OMNIORB_INCLUDE_DIR} ${HDF5_INCLUDE_DIRS} + ${MPI_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../NamingService - ${CMAKE_CURRENT_SOURCE_DIR}/../Utils - ${CMAKE_CURRENT_SOURCE_DIR}/../Registry - ${CMAKE_CURRENT_SOURCE_DIR}/../Notification - ${CMAKE_CURRENT_SOURCE_DIR}/../ResourcesManager - ${CMAKE_CURRENT_SOURCE_DIR}/../HDFPersist - ${CMAKE_CURRENT_SOURCE_DIR}/../GenericObj - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMETraceCollector/Test - ${PROJECT_BINARY_DIR}/idl + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/NamingService + ${CMAKE_SOURCE_DIR}/src/Utils + ${CMAKE_SOURCE_DIR}/src/Registry + ${CMAKE_SOURCE_DIR}/src/Notification + ${CMAKE_SOURCE_DIR}/src/ResourcesManager + ${CMAKE_SOURCE_DIR}/src/HDFPersist + ${CMAKE_SOURCE_DIR}/src/GenericObj + ${CMAKE_SOURCE_DIR}/src/SALOMETraceCollector/Test ) -SET(SCRIPTS - SALOME_ComponentPy.py - SALOME_PyNode.py - SALOME_Container.py -) +ADD_DEFINITIONS(${HDF5_DEFINITIONS} ${MPI_DEFINITIONS} ${OMNIORB_DEFINITIONS}) -ADD_DEFINITIONS(${HDF5_DEFINITIONS} ${OMNIORB_DEFINITIONS}) -SET(COMMON_LIBS +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${HDF5_LIBRARIES} + ${MPI_LIBRARIES} + ${OMNIORB_LIBRARIES} + ${PYTHON_LIBRARIES} Registry SalomeNotification SalomeResourcesManager @@ -55,21 +57,12 @@ SET(COMMON_LIBS SalomeHDFPersist SalomeGenericObj SalomeIDLKernel - ${OMNIORB_LIBRARIES} - ${PYTHON_LIBRARIES} ) -IF(WITH_MPI_SEQ_CONTAINER) - ADD_DEFINITIONS(${MPI_DEFINITIONS}) - SET(COMMON_LIBS - ${MPI_CXX_LIBRARIES} - ) -ENDIF(WITH_MPI_SEQ_CONTAINER) - IF(SALOME_PACO_PARALLEL) INCLUDE_DIRECTORIES(${PACO_INCLUDE_DIRS}) ADD_DEFINITIONS(-DWITH_PACO_PARALLEL) - LIST(APPEND COMMON_LIBS ${PACO_LIBRARIES}) + LIST(APPEND _link_LIBRARIES ${PACO_LIBRARIES}) ENDIF() SET(SalomeContainer_SOURCES @@ -84,27 +77,47 @@ SET(SalomeContainer_SOURCES ) ADD_LIBRARY(SalomeContainer ${SalomeContainer_SOURCES}) -TARGET_LINK_LIBRARIES(SalomeContainer ${COMMON_LIBS} ${PTHREAD_LIBRARIES}) +TARGET_LINK_LIBRARIES(SalomeContainer ${_link_LIBRARIES}) INSTALL(TARGETS SalomeContainer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -SET(SALOME_Container_LIBS - SalomeContainer - SALOMEBasics - ${COMMON_LIBS} - ${HDF5_LIBRARIES} - ${MPI_LIBRARIES} +SET(Container_SOURCES + SALOME_Container.cxx + SALOME_Container_SignalsHandler.cxx ) -ADD_EXECUTABLE(SALOME_Container SALOME_Container.cxx SALOME_Container_SignalsHandler.cxx) -TARGET_LINK_LIBRARIES(SALOME_Container ${SALOME_Container_LIBS}) +ADD_EXECUTABLE(SALOME_Container ${Container_SOURCES}) +TARGET_LINK_LIBRARIES(SALOME_Container ${_link_LIBRARIES} SalomeContainer) +INSTALL(TARGETS SALOME_Container EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) IF(SALOME_BUILD_TESTS) ADD_EXECUTABLE(TestSalome_file TestSalome_file.cxx) - TARGET_LINK_LIBRARIES(TestSalome_file SALOMETraceCollectorTest ${SALOME_Container_LIBS}) + TARGET_LINK_LIBRARIES(TestSalome_file ${_link_LIBRARIES} SalomeContainer) ENDIF() -INSTALL(TARGETS SALOME_Container DESTINATION ${SALOME_INSTALL_BINS}) -# Executable scripts to be installed -SALOME_INSTALL_SCRIPTS("${SCRIPTS}" ${SALOME_INSTALL_SCRIPT_PYTHON}) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +SET(Container_SCRIPTS + SALOME_ComponentPy.py + SALOME_PyNode.py + SALOME_Container.py +) + +SALOME_INSTALL_SCRIPTS("${Container_SCRIPTS}" ${SALOME_INSTALL_SCRIPT_PYTHON}) + +SET(Container_HEADERS + Container_init_python.hxx + SALOME_Component_i.hxx + SALOME_Container.hxx + SALOME_Container_i.hxx + SALOME_ContainerManager.hxx + SALOME_CPythonHelper.hxx + Salome_file_i.hxx + SALOME_FileRef_i.hxx + SALOME_FileTransfer_i.hxx +) + +INSTALL(FILES ${Container_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +UNSET(SalomeContainer_SOURCES) +UNSET(Container_SOURCES) +UNSET(Container_SCRIPTS) +UNSET(Container_HEADERS) +UNSET(_link_LIBRARIES) diff --git a/src/DF/CMakeLists.txt b/src/DF/CMakeLists.txt index c56ef7cfb..66abcfc80 100644 --- a/src/DF/CMakeLists.txt +++ b/src/DF/CMakeLists.txt @@ -17,10 +17,6 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -INCLUDE_DIRECTORIES( - ${Boost_INCLUDE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics -) ADD_DEFINITIONS(${BOOST_DEFINITIONS}) SET(DF_SOURCES @@ -32,12 +28,39 @@ SET(DF_SOURCES DF_Container.cxx ) +SET(DF_HEADERS + DF_Application.hxx + DF_Attribute.hxx + DF_ChildIterator.hxx + DF_Container.hxx + DF_Document.hxx + DF_Label.hxx + DF_definitions.hxx +) + ADD_LIBRARY(DF ${DF_SOURCES}) INSTALL(TARGETS DF EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -ADD_EXECUTABLE(testDF testDF.cxx) -TARGET_LINK_LIBRARIES(testDF DF SALOMEBasics) -INSTALL(TARGETS testDF DESTINATION ${SALOME_INSTALL_BINS}) +INSTALL(FILES ${DF_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +IF(SALOME_BUILD_TESTS) + INCLUDE_DIRECTORIES( + ${CPPUNIT_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/src/Basics/Test + ) + SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/DF) + + ADD_EXECUTABLE(TestDF testDF.cxx) + TARGET_LINK_LIBRARIES(TestDF ${CPPUNIT_LIBRARIES} DF SALOMEBasics) + INSTALL(TARGETS TestDF DESTINATION ${LOCAL_TEST_DIR}) + + INSTALL(FILES TestDF.py DESTINATION ${LOCAL_TEST_DIR}) + + INSTALL(FILES CTestTestfileInstall.cmake + DESTINATION ${LOCAL_TEST_DIR} + RENAME CTestTestfile.cmake) +ENDIF() -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +UNSET(DF_SOURCES) +UNSET(DF_HEADERS) +UNSET(LOCAL_TEST_DIR) diff --git a/src/DF/CTestTestfileInstall.cmake b/src/DF/CTestTestfileInstall.cmake new file mode 100644 index 000000000..5733a520b --- /dev/null +++ b/src/DF/CTestTestfileInstall.cmake @@ -0,0 +1,27 @@ +# Copyright (C) 2015-2020 CEA/DEN, 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 +# + +IF(NOT WIN32) + SET(TEST_NAME ${COMPONENT_NAME}_DF) + ADD_TEST(${TEST_NAME} ${SALOME_TEST_DRIVER} ${TIMEOUT} TestDF.py) + SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES + LABELS "${COMPONENT_NAME}" + ENVIRONMENT "LD_LIBRARY_PATH=${KERNEL_TEST_LIB}:$ENV{LD_LIBRARY_PATH}" + ) +ENDIF() diff --git a/src/DF/TestDF.py b/src/DF/TestDF.py new file mode 100644 index 000000000..5dff1b2b2 --- /dev/null +++ b/src/DF/TestDF.py @@ -0,0 +1,40 @@ +# -*- coding: iso-8859-1 -*- +# Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +# +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# 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 +# + +import sys, signal,string,subprocess +import subprocess +import setenv + +# get SALOME environment : +# here we need KERNEL_ROOT_DIR, PATH, LD_LIBRARY_PATH + +args, modules_list, modules_root_dir = setenv.get_config() +setenv.set_env(args, modules_list, modules_root_dir) + +# execute Unit Test + +command = ['./TestDF'] +ret = subprocess.call(command) + +# no process to kill +exit(ret) diff --git a/src/DF/testDF.cxx b/src/DF/testDF.cxx index 0811fa536..081edb734 100644 --- a/src/DF/testDF.cxx +++ b/src/DF/testDF.cxx @@ -17,299 +17,131 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -//File: testDF.cxx -//Author: Sergey RUIN -// -#include -#include -#include -#include -#include +#include +#include -#include "DF_definitions.hxx" #include "DF_Application.hxx" #include "DF_Document.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include "DF_Container.hxx" -#include "DF_ChildIterator.hxx" - -#include "Basics_Utils.hxx" -#include "Basics_DirUtils.hxx" - -#ifndef WIN32 -#include -#include -#include -#include -#include -#else -#include -#include -#include -#endif - - -void printStr(const std::string& theValue) -{ - std::cout << "printStr: " << theValue << std::endl; -} -void GetSystemDate(int& year, int& month, int& day, int& hours, int& minutes, int& seconds) +class DFTest : public CppUnit::TestFixture { -#ifdef WIN32 - SYSTEMTIME st; + CPPUNIT_TEST_SUITE( DFTest ); + CPPUNIT_TEST( test1 ); + CPPUNIT_TEST( test2 ); + CPPUNIT_TEST_SUITE_END(); - GetLocalTime ( &st ); +public: + void setUp(); + void tearDown(); - month = st.wMonth; - day = st.wDay; - year = st.wYear; - hours = st.wHour; - minutes = st.wMinute; - seconds = st.wSecond; -#else - struct tm transfert; - struct timeval tval; - struct timezone tzone; - int status; + void test1(); + void test2(); +}; - status = gettimeofday( &tval, &tzone ); - memcpy(&transfert, localtime((time_t *)&tval.tv_sec), sizeof(tm)); - - month = transfert.tm_mon + 1; - day = transfert.tm_mday; - year = transfert.tm_year + 1900; - hours = transfert.tm_hour; - minutes = transfert.tm_min ; - seconds = transfert.tm_sec ; -#endif -} - -std::string GetUserName() +void DFTest::setUp() { -#ifdef WIN32 -#ifdef UNICODE - wchar_t* pBuff = new wchar_t[UNLEN + 1]; -#else - char* pBuff = new char[UNLEN + 1]; -#endif - DWORD dwSize = UNLEN + 1; - std::string retVal; - GetUserName ( pBuff, &dwSize ); -#ifdef UNICODE - std::wstring theTmpUserName(pBuff, (int)dwSize - 1); - retVal = Kernel_Utils::utf8_encode_s(theTmpUserName); -#else - std::string theTmpUserName(pBuff, (int)dwSize - 1); - retVal = theTmpUserName; -#endif - delete [] pBuff; - return retVal; -#else - struct passwd *infos; - infos = getpwuid(getuid()); - return std::string(infos->pw_name); -#endif } -std::string GetNameFromPath(const std::string& thePath) { - if (thePath.empty()) return ""; - int pos1 = thePath.rfind('/'); - int pos2 = thePath.rfind('\\'); - if(pos1 > 0) return thePath.substr(pos1+1, thePath.size()); - if(pos2 > 0) return thePath.substr(pos2+1, thePath.size()); - return thePath; -} - -std::string GetDirFromPath(const std::string& thePath) { - if (thePath.empty()) return ""; - - int pos = thePath.rfind('/'); - std::string path; - if(pos > 0) { - path = thePath.substr(0, pos+1); - } - if(path.empty()) { - pos = thePath.rfind('\\'); - if(pos > 0) path = thePath.substr(0, pos+1); - } - if(path.empty()) { - pos = thePath.rfind('|'); - if(pos > 0) path = thePath.substr(0, pos+1); - } - if(path.empty()) { - path = thePath+"/"; - } - -#ifdef WIN32 //Check if the only disk letter is given as path - if(path.size() == 2 && path[1] == ':') path +='\\'; -#endif - - for(int i = 0, len = path.size(); i splitString(const std::string& theValue, char separator) -{ - std::vector vs; - if(theValue[0] == separator && theValue.size() == 1) return vs; - int pos = theValue.find(separator); - if(pos < 0) { - vs.push_back(theValue); - return vs; - } - - std::string s = theValue; - if(s[0] == separator) s = s.substr(1, s.size()); - while((pos = s.find(separator)) >= 0) { - vs.push_back(s.substr(0, pos)); - s = s.substr(pos+1, s.size()); - } - - if(!s.empty() && s[0] != separator) vs.push_back(s); - return vs; -} - - -int main (int argc, char * argv[]) -{ - std::cout << "Test started " << std::endl; - DF_Application* appli = new DF_Application; - /* - DF_Document* doc1 = appli->NewDocument("doc_1"); + DF_Document* doc = appli->NewDocument("doc"); - DF_Label root1 = doc1->Main(); - DF_Label child = root1.FindChild(3, true); //0:1:3 - - DF_Container* attr1 = DF_Container::Set(child); - attr1->SetInt("eighteen", 18); - - - DF_Attribute* attr = NULL; - if(!(attr = child.FindAttribute(DF_Container::GetID()))) { - std::cout << "Attribute wasn't found" << std::endl; - } - else { - attr1 = dynamic_cast(attr); - std::cout << "Attribute was found " << " HasID " << attr1->HasIntID("eighteen") << " value = " << attr1->GetInt("eighteen")<< std::endl; - } - - DF_Container *attr2 = (DF_Container*)child.FindAttribute(DF_Container::GetID()); - - if(!attr2) cout << "Can't find the attribute" << endl; - - std::cout << "Change find : " << attr2->GetInt("eighteen") << std::endl; - - - std::cout << "Forgetting " << child.ForgetAttribute(DF_Container::GetID()) << std::endl; - if(!child.FindAttribute(DF_Container::GetID())) { - std::cout << "Attribute wasn't found" << std::endl; - } - - - child = root1.NewChild(); //0:1:4 - - child.NewChild();//0:1:4:1 - - child.NewChild();//0:1:4:2 - - std::cout << "Is equal " << (child == child) << std::endl; - std::cout << "Is equal " << (child == root1) << std::endl; - - child = root1.NewChild(); //0:1:5 - - child.NewChild();//0:1:5:1 - root1.NewChild();//0:1:6 + DF_Label root = doc->Main(); //0:1 + DF_Label child = root.FindChild(3, true); //0:1:3 + CPPUNIT_ASSERT(child.Entry() == "0:1:3"); + DF_Container* attr = DF_Container::Set(child); + attr->SetInt("integer_value", 18); + + DF_Attribute* result = child.FindAttribute(DF_Container::GetID()); + CPPUNIT_ASSERT(result); + attr = dynamic_cast(result); + CPPUNIT_ASSERT(attr->HasIntID("integer_value")); + CPPUNIT_ASSERT(attr->GetInt("integer_value") == 18); + + attr->SetInt("integer_value", 100); + CPPUNIT_ASSERT(attr->GetInt("integer_value") == 100); + + child.ForgetAttribute(DF_Container::GetID()); + result = child.FindAttribute(DF_Container::GetID()); + CPPUNIT_ASSERT(!result); + + child = root.NewChild(); //0:1:4 + child.NewChild(); //0:1:4:1 + child.NewChild(); //0:1:4:2 + CPPUNIT_ASSERT(child == child); + CPPUNIT_ASSERT(child != root); + + child = root.NewChild(); //0:1:5 + child.NewChild(); //0:1:5:1 + child = root.NewChild(); //0:1:6 + CPPUNIT_ASSERT(child.Entry() == "0:1:6"); + + child = DF_Label::Label(child, "0:1:4:1"); //0:1:4:1 + CPPUNIT_ASSERT(child.Entry() == "0:1:4:1"); + attr = DF_Container::Set(child); + attr->SetDouble("double_value", 1.23); + CPPUNIT_ASSERT(attr->HasDoubleID("double_value")); + attr->SetString("string_value", "custom string"); + CPPUNIT_ASSERT(attr->HasStringID("string_value")); +} - DF_ChildIterator CI(root1.Father(), true); - //root1.dump(); - for(; CI.More(); CI.Next()) { - std::cout << CI.Value().Entry() << std::endl; - //CI.Value().dump(); - } +void DFTest::test2() +{ + DF_Application* appli = new DF_Application; + DF_Document* doc = appli->NewDocument("doc"); - DF_Label L = DF_Label::Label(child, "0:1:4:1"); - std::cout << "Found Label " << L.Entry() << std::endl; + DF_Label root = doc->Main(); //0:1 + CPPUNIT_ASSERT(root.Tag() == 1); + CPPUNIT_ASSERT(root.Entry() == "0:1"); - std::string s("012-56"); - - int pos = s.find('-'); - std::cout << "First part : " << s.substr(0, pos) << std::endl; - std::cout << "Last part : " << s.substr(pos+1, s.size()) << std::endl; + DF_Label sco = root.NewChild(); //0:1:1 + CPPUNIT_ASSERT(sco.Tag() == 1); + CPPUNIT_ASSERT(sco.Entry() == "0:1:1"); - std::vector vs = splitString("/dn20/salome/srn/salome2/", '/'); - for(int i = 0; iNewDocument("doc_2"); - - DF_Label root2 = doc2->Main(); - DF_Label sco = root2.NewChild(); //0:1:1 - DF_Label so1 = sco.FindChild(3, true); //0:1:1:3 - DF_Label so5 = so1.FindChild(5, true); //0:1:1:5 - DF_Label so51 = so5.NewChild(); //0:1:1:5:1 - DF_Label so511 = so51.NewChild(); //0:1:1:5:1:1 - DF_Label so513 = so51.FindChild(3, true); //0:1:1:5:1:3 - DF_Label so5131 = so513.NewChild(); //0:1:1:5:1:3:1 - - - so51.FindChild(2, true); + DF_Label so_5_1_2 = so_5_1.FindChild(2, true); + CPPUNIT_ASSERT(so_5_1_2.Tag() == 2); + CPPUNIT_ASSERT(so_5_1_2.Entry() == "0:1:1:5:1:2"); + delete appli; +} - DF_ChildIterator CI2(so5, true); - so5.dump(); - for(; CI2.More(); CI2.Next()) { - std::cout << " ###### Found child with entry = " << CI2.Value().Entry() << std::endl; - //CI2.Value().dump(); - } +// --- Registers the fixture into the 'registry' - delete appli; +CPPUNIT_TEST_SUITE_REGISTRATION( DFTest ); - std::cout << "Test finished " << std::endl; - return 0; -} +// --- generic Main program from Basic/Test +#include "BasicMainTest.hxx" diff --git a/src/DSC/CMakeLists.txt b/src/DSC/CMakeLists.txt index 816cafe68..016a241a5 100644 --- a/src/DSC/CMakeLists.txt +++ b/src/DSC/CMakeLists.txt @@ -17,29 +17,13 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SET(SUBDIRS_COMMON - DSC_Basic -) +ADD_SUBDIRECTORY(DSC_Basic) IF(NOT WIN32) - SET(SUBDIRS_ADD - DSC_User - DSC_Python - ) + ADD_SUBDIRECTORY(DSC_User) + ADD_SUBDIRECTORY(DSC_Python) ENDIF() IF(SALOME_PACO_PARALLEL) - SET(SUBDIR_PAR - ParallelDSC - ) + ADD_SUBDIRECTORY(ParallelDSC) ENDIF() - -SET(SUBDIRS - ${SUBDIRS_COMMON} - ${SUBDIRS_ADD} - ${SUBDIR_PAR} -) - -FOREACH(DIR ${SUBDIRS}) - ADD_SUBDIRECTORY(${DIR}) -ENDFOREACH(DIR ${SUBDIRS}) diff --git a/src/DSC/DSC_Basic/CMakeLists.txt b/src/DSC/DSC_Basic/CMakeLists.txt index 877875017..808c7c3d2 100644 --- a/src/DSC/DSC_Basic/CMakeLists.txt +++ b/src/DSC/DSC_Basic/CMakeLists.txt @@ -20,15 +20,27 @@ INCLUDE_DIRECTORIES( ${PTHREAD_INCLUDE_DIR} ${OMNIORB_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${PROJECT_SOURCE_DIR}/src/Container - ${PROJECT_SOURCE_DIR}/src/GenericObj - ${PROJECT_SOURCE_DIR}/src/Notification - ${PROJECT_SOURCE_DIR}/src/SALOMELocalTrace - ${PROJECT_SOURCE_DIR}/src/Basics - ${PROJECT_SOURCE_DIR}/src/NamingService - ${PROJECT_SOURCE_DIR}/src/Utils - ${PROJECT_BINARY_DIR}/idl + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Container + ${CMAKE_SOURCE_DIR}/src/GenericObj + ${CMAKE_SOURCE_DIR}/src/Notification + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/NamingService + ${CMAKE_SOURCE_DIR}/src/Utils +) + +ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) + +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} + SALOMELocalTrace + SalomeContainer + SalomeNS + SalomeIDLKernel ) SET(SalomeDSCContainer_SOURCES @@ -37,10 +49,8 @@ SET(SalomeDSCContainer_SOURCES PortProperties_i.cxx ) -ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) - ADD_LIBRARY(SalomeDSCContainer ${SalomeDSCContainer_SOURCES}) -TARGET_LINK_LIBRARIES(SalomeDSCContainer SalomeContainer ${OMNIORB_LIBRARIES}) +TARGET_LINK_LIBRARIES(SalomeDSCContainer ${_link_LIBRARIES}) INSTALL(TARGETS SalomeDSCContainer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) SET(SALOME_ConnectionManagerServer_SOURCES @@ -48,17 +58,22 @@ SET(SALOME_ConnectionManagerServer_SOURCES ConnectionManager_i.cxx ) -SET(SALOME_ConnectionManagerServer_LIBS - SalomeIDLKernel - SalomeNS - SALOMELocalTrace - SalomeContainer - ${OMNIORB_LIBRARIES} -) - ADD_EXECUTABLE(SALOME_ConnectionManagerServer ${SALOME_ConnectionManagerServer_SOURCES}) -TARGET_LINK_LIBRARIES(SALOME_ConnectionManagerServer ${SALOME_ConnectionManagerServer_LIBS}) +TARGET_LINK_LIBRARIES(SALOME_ConnectionManagerServer ${_link_LIBRARIES}) INSTALL(TARGETS SALOME_ConnectionManagerServer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +SET(SalomeDSCContainer_HEADERS + ConnectionManager_i.hxx + DSC_Basic.hxx + DSC_Callbacks.hxx + DSC_i.hxx + DSC_interface.hxx + PortProperties_i.hxx +) + +INSTALL(FILES ${SalomeDSCContainer_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +UNSET(SalomeDSCContainer_SOURCES) +UNSET(SALOME_ConnectionManagerServer_SOURCES) +UNSET(SalomeDSCContainer_HEADERS) +UNSET(_link_LIBRARIES) diff --git a/src/DSC/DSC_Python/CMakeLists.txt b/src/DSC/DSC_Python/CMakeLists.txt index 863d3fda7..9690865c0 100644 --- a/src/DSC/DSC_Python/CMakeLists.txt +++ b/src/DSC/DSC_Python/CMakeLists.txt @@ -17,59 +17,69 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) -SET_SOURCE_FILES_PROPERTIES(calcium.i PROPERTIES CPLUSPLUS ON) -SET_SOURCE_FILES_PROPERTIES(calcium.i PROPERTIES SWIG_FLAGS "-py3") -SET(CMAKE_SWIG_FLAGS "-noexcept") -ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${BOOST_DEFINITIONS} ${PYTHON_DEFINITIONS} ${NUMPY_DEFINITIONS}) - INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS} ${NUMPY_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} - ${OMNIORBPY_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${PROJECT_SOURCE_DIR}/src/DSC/DSC_User - ${PROJECT_SOURCE_DIR}/src/DSC/DSC_User/Datastream - ${PROJECT_SOURCE_DIR}/src/DSC/DSC_User/Datastream/Palm - ${PROJECT_SOURCE_DIR}/src/DSC/DSC_User/Datastream/Calcium - ${PROJECT_BINARY_DIR}/src/DSC/DSC_User/Datastream/Calcium - ${PROJECT_SOURCE_DIR}/src/DSC/DSC_User/Basic - ${PROJECT_SOURCE_DIR}/src/DSC/DSC_Basic - ${PROJECT_SOURCE_DIR}/src/SALOMELocalTrace - ${PROJECT_SOURCE_DIR}/src/Basics - ${PROJECT_SOURCE_DIR}/src/Utils - ${PROJECT_SOURCE_DIR}/src/Container - ${PROJECT_SOURCE_DIR}/src/GenericObj - ${PROJECT_SOURCE_DIR}/src/Notification - ${PROJECT_BINARY_DIR}/idl - ) + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/DSC/DSC_User + ${CMAKE_SOURCE_DIR}/src/DSC/DSC_User/Datastream + ${CMAKE_SOURCE_DIR}/src/DSC/DSC_User/Datastream/Palm + ${CMAKE_SOURCE_DIR}/src/DSC/DSC_User/Datastream/Calcium + ${CMAKE_BINARY_DIR}/src/DSC/DSC_User/Datastream/Calcium + ${CMAKE_SOURCE_DIR}/src/DSC/DSC_User/Basic + ${CMAKE_SOURCE_DIR}/src/DSC/DSC_Basic + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/Utils + ${CMAKE_SOURCE_DIR}/src/Container + ${CMAKE_SOURCE_DIR}/src/GenericObj + ${CMAKE_SOURCE_DIR}/src/Notification +) + +ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${BOOST_DEFINITIONS} ${NUMPY_DEFINITIONS}) -SET(_calcium_LIBS +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${PYTHON_LIBRARIES} + ${OMNIORB_LIBRARIES} CalciumC SalomeDatastream SalomeDSCSupervBasic SalomeDSCSuperv SalomeDSCContainer SalomeContainer - ${OMNIORB_LIBRARIES} ) +SET_SOURCE_FILES_PROPERTIES(calcium.i PROPERTIES CPLUSPLUS ON) +SET_SOURCE_FILES_PROPERTIES(calcium.i PROPERTIES SWIG_FLAGS "-py3") +SET(CMAKE_SWIG_FLAGS "-noexcept") + IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") SWIG_ADD_MODULE(calcium python calcium.i) ELSE() SWIG_ADD_LIBRARY(calcium LANGUAGE python SOURCES calcium.i) ENDIF() +SWIG_LINK_LIBRARIES(calcium ${_link_LIBRARIES}) + +IF(WIN32) + SET_TARGET_PROPERTIES(_calcium PROPERTIES DEBUG_OUTPUT_NAME _calcium_d) +ENDIF() -SWIG_LINK_LIBRARIES(calcium ${_calcium_LIBS}) INSTALL(TARGETS _calcium DESTINATION ${SALOME_INSTALL_PYTHON}) SET(SCRIPTS dsccalcium.py ${CMAKE_CURRENT_BINARY_DIR}/calcium.py ) -SALOME_INSTALL_SCRIPTS( "${SCRIPTS}" ${SALOME_INSTALL_PYTHON} EXTRA_DPYS "${SWIG_MODULE_calcium_REAL_NAME}") + +SALOME_INSTALL_SCRIPTS("${SCRIPTS}" ${SALOME_INSTALL_PYTHON} EXTRA_DPYS "${SWIG_MODULE_calcium_REAL_NAME}") + +UNSET(SCRIPTS) +UNSET(_link_LIBRARIES) diff --git a/src/DSC/DSC_User/Basic/CMakeLists.txt b/src/DSC/DSC_User/Basic/CMakeLists.txt index 0138bc5ba..7b490c623 100644 --- a/src/DSC/DSC_User/Basic/CMakeLists.txt +++ b/src/DSC/DSC_User/Basic/CMakeLists.txt @@ -20,16 +20,25 @@ INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/idl - ${PROJECT_BINARY_DIR}/salome_adm - ${PROJECT_SOURCE_DIR}/src/DSC/DSC_Basic - ${PROJECT_SOURCE_DIR}/src/DSC/DSC_User - ${PROJECT_SOURCE_DIR}/src/Container - ${PROJECT_SOURCE_DIR}/src/GenericObj - ${PROJECT_SOURCE_DIR}/src/Notification - ${PROJECT_SOURCE_DIR}/src/SALOMELocalTrace - ${PROJECT_SOURCE_DIR}/src/Basics - ${PROJECT_SOURCE_DIR}/src/Utils) + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/DSC/DSC_Basic + ${CMAKE_SOURCE_DIR}/src/DSC/DSC_User + ${CMAKE_SOURCE_DIR}/src/Container + ${CMAKE_SOURCE_DIR}/src/GenericObj + ${CMAKE_SOURCE_DIR}/src/Notification + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/Utils) + +ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) + +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} + SalomeDSCSuperv +) SET(SalomeDSCSupervBasic_SOURCES basic_port_factory.cxx @@ -37,10 +46,18 @@ SET(SalomeDSCSupervBasic_SOURCES data_short_port_provides.cxx ) -ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) ADD_LIBRARY(SalomeDSCSupervBasic ${SalomeDSCSupervBasic_SOURCES}) -TARGET_LINK_LIBRARIES(SalomeDSCSupervBasic SalomeDSCSuperv) +TARGET_LINK_LIBRARIES(SalomeDSCSupervBasic ${_link_LIBRARIES}) INSTALL(TARGETS SalomeDSCSupervBasic EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +SET(SalomeDSCSupervBasic_HEADERS + basic_port_factory.hxx + data_short_port_provides.hxx + data_short_port_uses.hxx +) + +INSTALL(FILES ${SalomeDSCSupervBasic_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +UNSET(SalomeDSCSupervBasic_SOURCES) +SET(SalomeDSCSupervBasic_HEADERS) +UNSET(_link_LIBRARIES) diff --git a/src/DSC/DSC_User/CMakeLists.txt b/src/DSC/DSC_User/CMakeLists.txt index 5a72988ce..c2a99470a 100644 --- a/src/DSC/DSC_User/CMakeLists.txt +++ b/src/DSC/DSC_User/CMakeLists.txt @@ -17,25 +17,32 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +ADD_SUBDIRECTORY(Basic) +ADD_SUBDIRECTORY(Datastream) + INCLUDE_DIRECTORIES( - ${Boost_INCLUDE_DIRS} ${OMNIORB_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${PROJECT_SOURCE_DIR}/src/Container - ${PROJECT_SOURCE_DIR}/src/GenericObj - ${PROJECT_SOURCE_DIR}/src/Notification - ${PROJECT_SOURCE_DIR}/src/DSC/DSC_Basic - ${PROJECT_SOURCE_DIR}/src/SALOMELocalTrace - ${PROJECT_SOURCE_DIR}/src/Basics - ${PROJECT_SOURCE_DIR}/src/Utils - ${PROJECT_BINARY_DIR}/idl + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Container + ${CMAKE_SOURCE_DIR}/src/GenericObj + ${CMAKE_SOURCE_DIR}/src/Notification + ${CMAKE_SOURCE_DIR}/src/DSC/DSC_Basic + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/Utils ) -ADD_SUBDIRECTORY(Basic) -ADD_SUBDIRECTORY(Datastream) +ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) -ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${BOOST_DEFINITIONS}) +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} + OpUtil + SALOMELocalTrace +) SET(SalomeDSCSuperv_SOURCES base_port.cxx @@ -45,12 +52,25 @@ SET(SalomeDSCSuperv_SOURCES ) ADD_LIBRARY(SalomeDSCSuperv ${SalomeDSCSuperv_SOURCES}) -TARGET_LINK_LIBRARIES(SalomeDSCSuperv SalomeDSCContainer ${PLATFORM_LIBS}) +TARGET_LINK_LIBRARIES(SalomeDSCSuperv ${_link_LIBRARIES} SalomeDSCContainer) INSTALL(TARGETS SalomeDSCSuperv EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -ADD_EXECUTABLE(test_DSC_Exception test_DSC_Exception.cxx) -TARGET_LINK_LIBRARIES(test_DSC_Exception OpUtil SALOMELocalTrace - ${OMNIORB_LIBRARIES} ${PLATFORM_LIBS} ${PTHREAD_LIBRARIES}) +IF(SALOME_BUILD_TESTS) + ADD_EXECUTABLE(test_DSC_Exception test_DSC_Exception.cxx) + TARGET_LINK_LIBRARIES(test_DSC_Exception ${_link_LIBRARIES}) +ENDIF() + +SET(SalomeDSCSuperv_HEADERS + base_port.hxx + DSC_Exception.hxx + port_factory.hxx + provides_port.hxx + Superv_Component_i.hxx + uses_port.hxx +) + +INSTALL(FILES ${SalomeDSCSuperv_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +UNSET(SalomeDSCSuperv_SOURCES) +UNSET(SalomeDSCSuperv_HEADERS) +UNSET(_link_LIBRARIES) diff --git a/src/DSC/DSC_User/Datastream/CMakeLists.txt b/src/DSC/DSC_User/Datastream/CMakeLists.txt index a76518b92..0eaf17f4c 100644 --- a/src/DSC/DSC_User/Datastream/CMakeLists.txt +++ b/src/DSC/DSC_User/Datastream/CMakeLists.txt @@ -17,32 +17,33 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +ADD_SUBDIRECTORY(Palm) +ADD_SUBDIRECTORY(Calcium) + INCLUDE_DIRECTORIES( + ${PTHREAD_INCLUDE_DIR} + ${OMNIORB_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} - ${PROJECT_BINARY_DIR}/salome_adm - ${PROJECT_SOURCE_DIR}/src/DSC/DSC_User - ${PROJECT_BINARY_DIR}/src/DSC/DSC_User/Datastream/Palm - ${PROJECT_BINARY_DIR}/src/DSC/DSC_User/Datastream/Calcium - ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_SOURCE_DIR}/src/DSC/DSC_User ) -ADD_SUBDIRECTORY(Palm) -ADD_SUBDIRECTORY(Calcium) +ADD_DEFINITIONS(${BOOST_DEFINITIONS} ${OMNIORB_DEFINITIONS}) -# This local variable defines the list of dependent libraries common to all target in this package. -SET(COMMON_LIBS +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} SalomePalm SalomeCalcium SalomeDSCSuperv ) -ADD_DEFINITIONS(${BOOST_DEFINITIONS}) - ADD_LIBRARY(SalomeDatastream fake.cc) -TARGET_LINK_LIBRARIES(SalomeDatastream ${COMMON_LIBS}) +TARGET_LINK_LIBRARIES(SalomeDatastream ${_link_LIBRARIES}) INSTALL(TARGETS SalomeDatastream EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -SET(COMMON_HEADERS_HXX +SET(SalomeDatastream_HEADERS AdjacentFunctor.hxx ConstTraits.hxx CorbaTypeManipulator.hxx @@ -56,4 +57,7 @@ SET(COMMON_HEADERS_HXX IteratorTraits.hxx ) -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +INSTALL(FILES ${SalomeDatastream_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +UNSET(SalomeDatastream_HEADERS) +UNSET(_link_LIBRARIES) diff --git a/src/DSC/DSC_User/Datastream/Calcium/CMakeLists.txt b/src/DSC/DSC_User/Datastream/Calcium/CMakeLists.txt index cdc33f677..7bd155d9a 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CMakeLists.txt +++ b/src/DSC/DSC_User/Datastream/Calcium/CMakeLists.txt @@ -18,23 +18,34 @@ # INCLUDE_DIRECTORIES( + ${PTHREAD_INCLUDE_DIR} ${OMNIORB_INCLUDE_DIR} - ${PROJECT_BINARY_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${PROJECT_SOURCE_DIR}/src/DSC/DSC_User - ${PROJECT_SOURCE_DIR}/src/DSC/DSC_User/Datastream - ${PROJECT_SOURCE_DIR}/src/DSC/DSC_User/Datastream/Palm - ${PROJECT_SOURCE_DIR}/src/DSC/DSC_User/Datastream/Calcium - ${PROJECT_SOURCE_DIR}/src/DSC/DSC_User/Basic - ${PROJECT_SOURCE_DIR}/src/DSC/DSC_Basic - ${PROJECT_SOURCE_DIR}/src/SALOMELocalTrace - ${PROJECT_SOURCE_DIR}/src/Basics - ${PROJECT_SOURCE_DIR}/src/Utils - ${PROJECT_SOURCE_DIR}/src/Container - ${PROJECT_SOURCE_DIR}/src/GenericObj - ${PROJECT_SOURCE_DIR}/src/Notification - ${PROJECT_BINARY_DIR}/idl - ${PROJECT_BINARY_DIR}/src/DSC/DSC_User/Datastream/Calcium + ${Boost_INCLUDE_DIR} + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/DSC/DSC_User + ${CMAKE_SOURCE_DIR}/src/DSC/DSC_User/Datastream + ${CMAKE_SOURCE_DIR}/src/DSC/DSC_User/Datastream/Palm + ${CMAKE_SOURCE_DIR}/src/DSC/DSC_User/Datastream/Calcium + ${CMAKE_SOURCE_DIR}/src/DSC/DSC_User/Basic + ${CMAKE_SOURCE_DIR}/src/DSC/DSC_Basic + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/Utils + ${CMAKE_SOURCE_DIR}/src/Container + ${CMAKE_SOURCE_DIR}/src/GenericObj + ${CMAKE_SOURCE_DIR}/src/Notification + ${CMAKE_CURRENT_BINARY_DIR} +) + +ADD_DEFINITIONS(${BOOST_DEFINITIONS} ${OMNIORB_DEFINITIONS}) + +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} + SalomeDSCSuperv + SalomeContainer ) SET(SalomeCalcium_SOURCES @@ -52,11 +63,8 @@ SET(SalomeCalcium_SOURCES calcium_destructors_port_uses.cxx ) -ADD_DEFINITIONS(${BOOST_DEFINITIONS} ${OMNIORB_DEFINITIONS}) - ADD_LIBRARY(SalomeCalcium ${SalomeCalcium_SOURCES}) -TARGET_LINK_LIBRARIES(SalomeCalcium SalomeDSCSuperv SalomeContainer ${OMNIORB_LIBRARIES} ${PLATFORM_LIBS}) - +TARGET_LINK_LIBRARIES(SalomeCalcium ${_link_LIBRARIES}) INSTALL(TARGETS SalomeCalcium EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) SET(CalciumC_SOURCES @@ -64,19 +72,21 @@ SET(CalciumC_SOURCES Calcium.cxx calciumf.c ) -ADD_LIBRARY(CalciumC ${CalciumC_SOURCES}) -TARGET_LINK_LIBRARIES(CalciumC SalomeDSCSuperv SalomeCalcium) +ADD_LIBRARY(CalciumC ${CalciumC_SOURCES}) +TARGET_LINK_LIBRARIES(CalciumC ${_link_LIBRARIES} SalomeCalcium) INSTALL(TARGETS CalciumC EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -ADD_EXECUTABLE(test_DataIdContainer_Calcium test_DataIdContainer.cxx) -TARGET_LINK_LIBRARIES(test_DataIdContainer_Calcium SalomeDSCSuperv SalomeContainer SalomeCalcium OpUtil SALOMELocalTrace ${OMNIORB_LIBRARIES} ${PLATFORM_LIBS}) +IF(SALOME_BUILD_TESTS) + ADD_EXECUTABLE(test_DataIdContainer_Calcium test_DataIdContainer.cxx) + TARGET_LINK_LIBRARIES(test_DataIdContainer_Calcium ${_link_LIBRARIES} SalomeCalcium) +ENDIF() SALOME_CONFIGURE_FILE(calcium_integer_port_uses.hxx.in calcium_integer_port_uses.hxx) SALOME_CONFIGURE_FILE(CalciumProvidesPort.hxx.in CalciumProvidesPort.hxx) SALOME_CONFIGURE_FILE(CalciumFortranInt.h.in CalciumFortranInt.h) -SET(COMMON_HEADERS +SET(Calcium_HEADERS Calcium.hxx CalciumCInterface.hxx CalciumCouplingPolicy.hxx @@ -113,4 +123,9 @@ SET(COMMON_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/CalciumProvidesPort.hxx ${CMAKE_CURRENT_BINARY_DIR}/calcium_integer_port_uses.hxx ) -INSTALL(FILES ${COMMON_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) +INSTALL(FILES ${Calcium_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +UNSET(SalomeCalcium_SOURCES) +UNSET(CalciumC_SOURCES) +UNSET(Calcium_HEADERS) +UNSET(_link_LIBRARIES) diff --git a/src/DSC/DSC_User/Datastream/Palm/CMakeLists.txt b/src/DSC/DSC_User/Datastream/Palm/CMakeLists.txt index c27b60f2d..755b47467 100644 --- a/src/DSC/DSC_User/Datastream/Palm/CMakeLists.txt +++ b/src/DSC/DSC_User/Datastream/Palm/CMakeLists.txt @@ -18,32 +18,47 @@ # INCLUDE_DIRECTORIES( + ${PTHREAD_INCLUDE_DIR} ${OMNIORB_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${PROJECT_SOURCE_DIR}/src/DSC/DSC_User - ${PROJECT_SOURCE_DIR}/src/DSC/DSC_User/Datastream - ${PROJECT_SOURCE_DIR}/src/DSC/DSC_Basic - ${PROJECT_SOURCE_DIR}/src/Container - ${PROJECT_SOURCE_DIR}/src/GenericObj - ${PROJECT_SOURCE_DIR}/src/Notification - ${PROJECT_SOURCE_DIR}/src/SALOMELocalTrace - ${PROJECT_SOURCE_DIR}/src/Basics - ${PROJECT_SOURCE_DIR}/src/Utils - ${PROJECT_BINARY_DIR}/idl + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/DSC/DSC_User + ${CMAKE_SOURCE_DIR}/src/DSC/DSC_User/Datastream + ${CMAKE_SOURCE_DIR}/src/DSC/DSC_Basic + ${CMAKE_SOURCE_DIR}/src/Container + ${CMAKE_SOURCE_DIR}/src/GenericObj + ${CMAKE_SOURCE_DIR}/src/Notification + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/Utils ) - ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} +) + ADD_LIBRARY(SalomePalm palm_port_factory.cxx) -TARGET_LINK_LIBRARIES(SalomePalm SalomeDSCSuperv ${OMNIORB_LIBRARIES}) +TARGET_LINK_LIBRARIES(SalomePalm ${_link_LIBRARIES} SalomeDSCSuperv) INSTALL(TARGETS SalomePalm EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -ADD_EXECUTABLE(test_DataIdContainer_Palm test_DataIdContainer.cxx) -ADD_DEPENDENCIES(test_DataIdContainer_Palm SalomeIDLKernel) -TARGET_LINK_LIBRARIES(test_DataIdContainer_Palm ${OMNIORB_LIBRARIES}) +IF(SALOME_BUILD_TESTS) + ADD_EXECUTABLE(test_DataIdContainer_Palm test_DataIdContainer.cxx) + TARGET_LINK_LIBRARIES(test_DataIdContainer_Palm ${_link_LIBRARIES}) +ENDIF() + +SET(SalomePalm_HEADERS + PalmCouplingPolicy.hxx + palm_data_seq_short_port_provides.hxx + palm_data_short_port_provides.hxx + palm_port_factory.hxx +) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +INSTALL(FILES ${SalomePalm_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) +UNSET(SalomePalm_HEADERS) +UNSET(_link_LIBRARIES) diff --git a/src/DSC/ParallelDSC/CMakeLists.txt b/src/DSC/ParallelDSC/CMakeLists.txt index 5a2a8e084..3045fd9f2 100644 --- a/src/DSC/ParallelDSC/CMakeLists.txt +++ b/src/DSC/ParallelDSC/CMakeLists.txt @@ -18,37 +18,51 @@ # INCLUDE_DIRECTORIES( + ${PTHREAD_INCLUDE_DIR} ${MPI_CXX_INCLUDE_PATH} ${PACO_INCLUDE_DIRS} ${OMNIORB_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/src/Container - ${PROJECT_SOURCE_DIR}/src/ParallelContainer - ${PROJECT_SOURCE_DIR}/src/Notification - ${PROJECT_SOURCE_DIR}/src/SALOMELocalTrace - ${PROJECT_SOURCE_DIR}/src/Basics - ${PROJECT_SOURCE_DIR}/src/NamingService - ${PROJECT_SOURCE_DIR}/src/Utils - ${PROJECT_SOURCE_DIR}/src/DSC/DSC_Basic - ${PROJECT_SOURCE_DIR}/src/GenericObj - ${PROJECT_BINARY_DIR}/idl - ${PROJECT_SOURCE_DIR}/src/Registry - ${PROJECT_SOURCE_DIR}/src/Utils - ${PROJECT_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Container + ${CMAKE_SOURCE_DIR}/src/ParallelContainer + ${CMAKE_SOURCE_DIR}/src/Notification + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/NamingService + ${CMAKE_SOURCE_DIR}/src/Utils + ${CMAKE_SOURCE_DIR}/src/DSC/DSC_Basic + ${CMAKE_SOURCE_DIR}/src/GenericObj + ${CMAKE_SOURCE_DIR}/src/Registry + ${CMAKE_SOURCE_DIR}/src/Utils ) ADD_DEFINITIONS( ${OMNIORB_DEFINITIONS} ${MPI_DEFINITIONS} ) + +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${MPI_CXX_LIBRARIES} + ${OMNIORB_LIBRARIES} + SalomeDSCContainer + SalomeParallelIDLKernel +) + SET(SalomeParallelDSCContainer_SOURCES - ParallelDSC_i.cxx - Param_Double_Port_provides_i.cxx - Param_Double_Port_uses_i.cxx + ParallelDSC_i.cxx + Param_Double_Port_provides_i.cxx + Param_Double_Port_uses_i.cxx ) ADD_LIBRARY(SalomeParallelDSCContainer ${SalomeParallelDSCContainer_SOURCES}) -ADD_DEPENDENCIES(SalomeParallelDSCContainer SalomeParallelIDLKernel) +TARGET_LINK_LIBRARIES(SalomeParallelDSCContainer ${_link_LIBRARIES}) INSTALL(TARGETS SalomeParallelDSCContainer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) + +UNSET(SalomeParallelDSCContainer_SOURCES) +UNSET(_link_LIBRARIES) diff --git a/src/GenericObj/CMakeLists.txt b/src/GenericObj/CMakeLists.txt index 3d44bfc0f..ec70cf6ee 100644 --- a/src/GenericObj/CMakeLists.txt +++ b/src/GenericObj/CMakeLists.txt @@ -20,16 +20,37 @@ INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${PROJECT_BINARY_DIR}/idl + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace ) ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) -ADD_LIBRARY(SalomeGenericObj SALOME_GenericObj_i.cc) -TARGET_LINK_LIBRARIES(SalomeGenericObj SALOMELocalTrace SalomeIDLKernel) + +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} + SalomeIDLKernel + SALOMELocalTrace +) + +SET(SalomeGenericObj_SOURCES + SALOME_GenericObj_i.cc +) + +SET(SalomeGenericObj_HEADERS + SALOME_GenericObj_i.hh + SALOME_GenericObj_wrap.hxx +) + +ADD_LIBRARY(SalomeGenericObj ${SalomeGenericObj_SOURCES}) +TARGET_LINK_LIBRARIES(SalomeGenericObj ${_link_LIBRARIES}) INSTALL(TARGETS SalomeGenericObj EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -INSTALL(FILES SALOME_GenericObj_i.hh SALOME_GenericObj_wrap.hxx DESTINATION ${SALOME_INSTALL_HEADERS}) +INSTALL(FILES ${SalomeGenericObj_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) +UNSET(SalomeGenericObj_SOURCES) +UNSET(SalomeGenericObj_HEADERS) +UNSET(_link_LIBRARIES) diff --git a/src/HDFPersist/CMakeLists.txt b/src/HDFPersist/CMakeLists.txt index 247ccb026..f53599005 100644 --- a/src/HDFPersist/CMakeLists.txt +++ b/src/HDFPersist/CMakeLists.txt @@ -20,22 +20,93 @@ INCLUDE_DIRECTORIES( ${HDF5_INCLUDE_DIRS} ${MPI_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics + ${CMAKE_SOURCE_DIR}/src/Basics ) -FILE(GLOB SalomeHDFPersist_SOURCES_C "${CMAKE_CURRENT_SOURCE_DIR}/HDF*.c") -FILE(GLOB SalomeHDFPersist_SOURCES_CC "${CMAKE_CURRENT_SOURCE_DIR}/HDF*.cc") -SET(SalomeHDFPersist_SOURCES ${SalomeHDFPersist_SOURCES_C} ${SalomeHDFPersist_SOURCES_CC}) ADD_DEFINITIONS(${HDF5_DEFINITIONS}) +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${HDF5_LIBRARIES} + ${MPI_LIBRARIES} + SALOMEBasics +) + +SET(SalomeHDFPersist_SOURCES + HDFarrayClose.c + HDFarrayCreate.c + HDFarrayGetDim.c + HDFarrayGetType.c + HDFarrayGetTypeId.c + HDFarrayGetnDim.c + HDFattrClose.c + HDFattrCreate.c + HDFattrGetSize.c + HDFattrGetType.c + HDFattrOpen.c + HDFattrRead.c + HDFattrWrite.c + HDFdatasetClose.c + HDFdatasetCreate.c + HDFdatasetGetDim.c + HDFdatasetGetOrder.c + HDFdatasetGetSize.c + HDFdatasetGetType.c + HDFdatasetGetnDim.c + HDFdatasetOpen.c + HDFdatasetRead.c + HDFdatasetWrite.c + HDFerrorModeLock.c + HDFfileClose.c + HDFfileCreate.c + HDFfileMount.c + HDFfileOpen.c + HDFfileUmount.c + HDFgroupClose.c + HDFgroupCreate.c + HDFgroupOpen.c + HDFnObjects.c + HDFobjectIdentify.c + HDFobjectType.c + + HDFarray.cc + HDFascii.cc + HDFattribute.cc + HDFcontainerObject.cc + HDFconvert.cc + HDFdataset.cc + HDFexplorer.cc + HDFfile.cc + HDFgroup.cc + HDFinternalObject.cc + HDFobject.cc +) + +SET(SalomeHDFPersist_HEADERS + HDFOI.hxx + HDFarray.hxx + HDFascii.hxx + HDFattribute.hxx + HDFcontainerObject.hxx + HDFconvert.hxx + HDFdataset.hxx + HDFexception.hxx + HDFexplorer.hxx + HDFexport.hxx + HDFfile.hxx + HDFgroup.hxx + HDFinternalObject.hxx + HDFobject.hxx + HDFtypes.h + hdfi.h +) + ADD_LIBRARY(SalomeHDFPersist ${SalomeHDFPersist_SOURCES}) -TARGET_LINK_LIBRARIES(SalomeHDFPersist ${HDF5_LIBRARIES} ${MPI_LIBRARIES} ${PLATFORM_LIBS} SALOMEBasics) +TARGET_LINK_LIBRARIES(SalomeHDFPersist ${_link_LIBRARIES}) INSTALL(TARGETS SalomeHDFPersist EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -FILE(GLOB COMMON_HEADERS_H "${CMAKE_CURRENT_SOURCE_DIR}/*.h") -SET(COMMON_HEADERS - ${COMMON_HEADERS_HXX} - ${COMMON_HEADERS_H} -) -INSTALL(FILES ${COMMON_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) +INSTALL(FILES ${SalomeHDFPersist_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +UNSET(SalomeHDFPersist_SOURCES) +UNSET(SalomeHDFPersist_HEADERS) +UNSET(_link_LIBRARIES) diff --git a/src/HDFPersist/test1.c b/src/HDFPersist/test1.c deleted file mode 100644 index 9693a8f29..000000000 --- a/src/HDFPersist/test1.c +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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 -// - -/*---------------------------------------------------------------------------- -SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) - File : test1.c - Module : SALOME -----------------------------------------------------------------------------*/ - -#include"hdfi.h" -#include - -#define MESSAGE(msg) printf(msg); -//__FILE__,":[",__LINE__,"]: ", - -int main() { - hdf_idt fid,gid,did,atid; - hdf_err ret; - hdf_size size[1]; - hdf_int32 data[10] = { 1,2,3,4,5,6,7,8,9,10}; - hdf_int32 attr_val = 2; - - system("rm titi.HDF"); - - HDFerrorModeLock(); - - if ((fid = HDFfileCreate("titi.HDF")) < 0) - return -1; - MESSAGE("Creation du fichier") - - if ((gid = HDFgroupCreate(fid,"GROUP")) < 0) - return -1; - MESSAGE("Creation d'un groupe") - - if ((atid = HDFattrCreate(gid,"ATTR",HDF_INT32))< 0) - return -1; - MESSAGE("Creation d'un attribut") - - if ((ret = HDFattrWrite(atid,&attr_val)) < 0) - return -1; - MESSAGE("Ecriture de l'attribut") - - if ((ret = HDFattrClose(atid)) < 0) - return -1; - MESSAGE("Fermeture de l'attribut") - - size[0] = 10; - if ((did = HDFdatasetCreate(gid,"DATASET",HDF_INT32,size)) < 0) - return -1; - MESSAGE("Creation d'un dataset") - - if ((ret = HDFdatasetWrite(did,data)) < 0) - return -1; - MESSAGE("Ecriture du dataset") - - if ((ret = HDFdatasetClose(did)) < 0) - return -1; - MESSAGE("Fermeture du datset") - - if ((ret = HDFgroupClose(gid)) < 0) - return -1; - MESSAGE("Fermeture du groupe") - - if ((ret = HDFfileClose(fid)) < 0) - return ret; - MESSAGE("Fermeture du fichier") - - if ((fid = HDFfileCreate("toto.HDF")) < 0) - return -1; - MESSAGE("Creation du fichier") - - if ((ret = HDFfileClose(fid)) < 0) - return ret; - MESSAGE("Fermeture du fichier") - - - return 0; -} diff --git a/src/HDFPersist/test2.c b/src/HDFPersist/test2.c deleted file mode 100644 index acf652275..000000000 --- a/src/HDFPersist/test2.c +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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 -// - -/*---------------------------------------------------------------------------- -SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) - File : test2.c - Module : SALOME -----------------------------------------------------------------------------*/ - -#include"hdfi.h" -#include - -int main() { - hdf_idt fid,gid,did,atid; - hdf_err ret; - hdf_size size[1]; - hdf_int32 data[10]; - int attr_val; - int i; - - HDFerrorModeLock(); - - if ((fid = HDFfileOpen("titi.HDF",HDF_RDONLY)) < 0) - return -1; - MESSAGE("Ouverture du fichier") - - if ((gid = HDFgroupOpen(fid,"GROUP")) < 0) - return -1; - MESSAGE("Ouverture du goupe") - - if ((atid = HDFattrOpen(gid,"ATTR"))< 0) - return -1; - MESSAGE("Ouverture de l'attribut du goupe") - - if ((ret = HDFattrRead(atid,&attr_val)) < 0) - return -1; - MESSAGE("Lecture de l'attribut du goupe : " << attr_val) - - if ((ret = HDFattrClose(atid)) < 0) - return -1; - MESSAGE("Fermeture de l'attribut du goupe") - - if ((did = HDFdatasetOpen(gid,"DATASET")) < 0) - return -1; - MESSAGE("Ouverture du dataset") - - if ((ret = HDFdatasetRead(did,data)) < 0) - return -1; - MESSAGE("Lecture du dataset") - for (i=0;i<10;i++) - MESSAGE(data[i]) - - if ((ret = HDFdatasetClose(did)) < 0) - return -1; - MESSAGE("Fermeture du dataset") - - if ((ret = HDFgroupClose(gid)) < 0) - return -1; - MESSAGE("Fermeture du groupe") - - if ((ret = HDFfileClose(fid)) < 0) - return ret; - MESSAGE("Fermeture du fichier") - - return 0; -} diff --git a/src/HDFPersist/test3.cxx b/src/HDFPersist/test3.cxx deleted file mode 100644 index d6d2e4f0b..000000000 --- a/src/HDFPersist/test3.cxx +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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 -// - -// SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) -// File : test3.cxx -// Module : SALOME -// -#include -#include "HDFOI.hxx" -#include - - -int main() -{ - HDFfile *hdf_file; - HDFgroup *hdf_group; - HDFdataset *hdf_dataset; - HDFdataset *hdf_dataset2; - HDFattribute *hdf_attribute; - hdf_size size[1]; - hdf_float64 coordinates[3] = {5.,-6.9,4.2}; - hdf_int32 unit[3] = {0,0,0}; - char message[HDF_NAME_MAX_LEN+1] = "MESSAGE"; - hdf_int32 attribute = 3; - HDFexplorer *explorer; - HDFinternalObject *object; - - system("rm file_test3.hdf"); - - try - { - // a new HDFfile object - hdf_file = new HDFfile("file_test3.hdf"); - MESSAGE( ">> A HDFfile object is created" ); - - hdf_file->CreateOnDisk(); - MESSAGE( ">> The HDF file is created on Disk " ); - - // Inside the HDF file - - // A new HDF group object - hdf_group = new HDFgroup("MESH",hdf_file); - MESSAGE( ">> A HDFgroup object 'MESH' is created" ); - - hdf_group->CreateOnDisk(); - MESSAGE( ">> The HDF group is created on Disk " ); - - // Inside the HDF group - - // A new HDF dataset object - // size of each dimension, only one in the example - size[0] = 3; - hdf_dataset = new HDFdataset("COORDINATES",hdf_group,HDF_FLOAT64,size,1); - MESSAGE( ">> A HDFdataset object 'COORDINATES' is created" ); - - hdf_dataset->CreateOnDisk(); - MESSAGE( ">> The HDF dataset is created on Disk " ); - - // a HDFattribute object inside the dataset - hdf_attribute = new HDFattribute("ATTRIBUTE",hdf_dataset,HDF_INT32); - MESSAGE( ">> A HDF attribute object is created for the dataset " ); - - hdf_dataset->WriteOnDisk(coordinates); - MESSAGE( ">> The HDF dataset is written on Disk " ); - - hdf_attribute->CreateOnDisk(); - MESSAGE( ">> The HDF attribute is created on Disk " ); - - hdf_attribute->WriteOnDisk(&attribute); - MESSAGE( ">> The HDF attribute is written on Disk " ); - - hdf_attribute->CloseOnDisk(); - MESSAGE( ">> The HDF attribute closed on Disk " ); - - hdf_dataset->CloseOnDisk(); - MESSAGE( ">> The HDF dataset is closed on Disk " ); - - // A new dataset is created - size[0] = 3; - hdf_dataset2 = new HDFdataset("UNIT",hdf_group,HDF_INT32,size,1); - MESSAGE( ">> A second HDFdataset object 'UNIT' is created" ); - - hdf_dataset2->CreateOnDisk(); - MESSAGE( ">> The HDF dataset is created on Disk " ); - - hdf_dataset2->WriteOnDisk(unit); - MESSAGE( ">> The HDF dataset is written on Disk " ); - - hdf_dataset2->CloseOnDisk(); - MESSAGE( ">> The HDF dataset is closed on Disk " ); - - // The HDF group is built, it can be closed - hdf_group->CloseOnDisk(); - MESSAGE( ">> The HDF group is closed on Disk " ); - - // The HDF file is built, it can be closed - hdf_file->CloseOnDisk(); - MESSAGE( ">> The HDF file is closed on disk" ); - - // Explorer - explorer = new HDFexplorer(hdf_file); - MESSAGE( ">> A HDF explorer object is created" ); - - MESSAGE( ">> File Exploration " ); - for (explorer->Init();explorer->More();explorer->Next()) - { - object = explorer->Value(); - MESSAGE( "--> Name of the object : " << object->GetName() ); - switch (object->GetObjectType()) - { - case HDF_FILE : - MESSAGE( "--> Type of the object : HDF_FILE : " ); - break; - - case HDF_GROUP : - MESSAGE( "--> Type of the object : HDF_GROUP : " ); - break; - - case HDF_DATASET : - MESSAGE( "--> Type of the object : HDF_DATASET : " ); - break; - - default : - MESSAGE( "--> PANIC !!! : " ); - } - } - - MESSAGE( ">> Group exploration" ); - explorer->Reset(hdf_group); - for (explorer->Init();explorer->More();explorer->Next()) - { - object = explorer->Value(); - MESSAGE( "--> Name of the object : " << object->GetName() ); - switch (object->GetObjectType()) - { - case HDF_FILE : - MESSAGE( "--> Type of the object : HDF_FILE : " ); - break; - - case HDF_GROUP : - MESSAGE( "--> Type of the object : HDF_GROUP : " ); - break; - - case HDF_DATASET : - MESSAGE( "--> Type of the object : HDF_DATASET : " ); - break; - - default : - MESSAGE( "--> !!! PANIC !!! : " ); - } - } - - // memory clean - MESSAGE( ">> MEMORY CLEAN " ); - delete explorer; - MESSAGE( ">> The HDF eplorer object is deleted" ); - delete hdf_attribute; - MESSAGE( ">> The HDF attribute object is deleted" ); - delete hdf_dataset; - MESSAGE( ">> The first HDF dataset object is deleted" ); - delete hdf_dataset2; - MESSAGE( ">> The second HDF dataset object is deleted" ); - delete hdf_group; - MESSAGE( ">> The HDF group object is deleted" ); - delete hdf_file; - MESSAGE( ">> The HDF file object is deleted" ); - } - catch (HDFexception) - { - MESSAGE( "!!!! HDFexception" ) - } - - return 0; -} diff --git a/src/HDFPersist/test4.cxx b/src/HDFPersist/test4.cxx deleted file mode 100644 index faf090d06..000000000 --- a/src/HDFPersist/test4.cxx +++ /dev/null @@ -1,218 +0,0 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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 -// - -// SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) -// File : test4.cxx -// Module : SALOME -// -#include -#include "HDFOI.hxx" -#include - - -int main() -{ - HDFfile *hdf_file; - HDFgroup *hdf_group; - HDFdataset *hdf_dataset1, *hdf_dataset2; - int n,i; - char name[HDF_NAME_MAX_LEN+1]; - hdf_object_type type; - hdf_type data_type; - int ndim, size; - hdf_size *dim; - hdf_float64 *val1; - hdf_int32 *val2; - - try - { - // a new HDFfile object - hdf_file = new HDFfile("file_test3.hdf"); - MESSAGE( ">> A HDFfile object is created" ); - - hdf_file->OpenOnDisk(HDF_RDONLY); - MESSAGE(">> The HDF file is opened on Disk with HDF_RDONLY access mode") - // It is possible to read the name of all (objects) sons in the file - n = hdf_file->nInternalObjects(); - for (i=0;iInternalObjectIndentify(i,name); - MESSAGE( "--> First Level Internal Object Name : " << name ); - } - - // Or it is possible to ask if an object is in the file - if (hdf_file->ExistInternalObject("MESH")) - MESSAGE( "--> The object naming 'MESH' is in the file " ); - - // it is possible to determine the type of an object - type = hdf_file->InternalObjectType("MESH"); - switch (type) - { - case HDF_GROUP : - MESSAGE( "--> Its type is HDF_GROUP" ); - break; - - case HDF_DATASET : - MESSAGE( "--> Its type is HDF_DATASET" ); - break; - - default : - MESSAGE( "--> !!!! PANIC !!!" ); - } - - hdf_group = new HDFgroup(name,hdf_file); - MESSAGE( ">> A new HDF group object " << name << " is created in memory") - - hdf_group->OpenOnDisk(); - MESSAGE( ">> The group " << name << " is opened on disk" ); - - // object inside the group ? - n = hdf_group->nInternalObjects(); - MESSAGE( ">> There are " << n << " objects in this group " ); - for (i=0;iInternalObjectIndentify(i,name); - type = hdf_group->InternalObjectType(name); - MESSAGE( "--> First Level Internal Object Name : " << name ); - switch (type) - { - case HDF_GROUP : - MESSAGE( "--> Its type is HDF_GROUP" ); - break; - - case HDF_DATASET : - MESSAGE( "--> Its type is HDF_DATASET" ); - break; - - default : - MESSAGE( "--> !!!! PANIC !!!" ); - } - } - - // The first dataset object 'COORDINATES' - hdf_dataset1 = new HDFdataset("COORDINATES",hdf_group); - MESSAGE( ">> The dataset object 'COORDINATES' is created in memory " ); - - hdf_dataset1->OpenOnDisk(); - MESSAGE( ">> The dataset object 'COORDINATES' is opened on disk " ); - - data_type = hdf_dataset1->GetType(); - switch(data_type) - { - case HDF_INT32 : - MESSAGE( "--> Type of data : HDF_INT32 " ); - break; - case HDF_INT64 : - MESSAGE( "--> Type of data : HDF_INT64 " ); - break; - case HDF_FLOAT64 : - MESSAGE( "--> Type of data : HDF_FLOAT64 " ); - break; - default : - MESSAGE( "--> Type of data : HDF_STRING " ); - } - - ndim = hdf_dataset1->nDim(); - MESSAGE( "--> Number of dimensions : " << ndim ); - - dim = new hdf_size[ndim]; - hdf_dataset1->GetDim(dim); - for (i=0;i Dimension " << i+1 << " of size : " << dim[i] ); - delete dim; - - size = hdf_dataset1->GetSize(); - val1 = new hdf_float64[size]; - hdf_dataset1->ReadFromDisk(val1); - MESSAGE( "--> The values are : "); - for (i=0;iCloseOnDisk(); - MESSAGE( ">> The dataset object 'COORDINATES' is closed on disk " ); - - // The second dataset 'UNIT' - hdf_dataset2 = new HDFdataset("UNIT",hdf_group); - MESSAGE( ">> The dataset object 'UNIT' is created in memory " ); - - hdf_dataset2->OpenOnDisk(); - MESSAGE( ">> The dataset object 'UNIT' is opened on disk " ); - - data_type = hdf_dataset2->GetType(); - switch(data_type) - { - case HDF_INT32 : - MESSAGE( "--> Type of data : HDF_INT32 " ); - break; - case HDF_INT64 : - MESSAGE( "--> Type of data : HDF_INT64 " ); - break; - case HDF_FLOAT64 : - MESSAGE( "--> Type of data : HDF_FLOAT64 " ); - break; - default : - MESSAGE( "--> Type of data : HDF_STRING " ); - } - - ndim = hdf_dataset2->nDim(); - MESSAGE( "--> Number of dimensions : " << ndim ); - - dim = new hdf_size[ndim]; - hdf_dataset2->GetDim(dim); - for (i=0;i Dimension " << i+1 << " of size : " << dim[i] ); - delete dim; - - size = hdf_dataset2->GetSize(); - val2 = new hdf_int32[size]; - hdf_dataset2->ReadFromDisk(val2); - MESSAGE( "--> The values are : "); - for (i=0;iCloseOnDisk(); - MESSAGE( ">> The dataset object 'UNIT' is closed on disk " ); - - hdf_group->CloseOnDisk(); - MESSAGE( ">> The group is closed on file" ); - - hdf_file->CloseOnDisk(); - MESSAGE(">> The HDF file is closed on Disk" ) - - // Memory clean - delete hdf_dataset1; - delete hdf_dataset2; - delete hdf_group; - delete hdf_file; - MESSAGE( ">> MEMORY CLEAN : all HDF objects have been deleted" ); - } - catch (HDFexception) - { - MESSAGE( "!!! HDFexception !!! " ) - } - - return 0; -} diff --git a/src/HDFPersist/test5.cxx b/src/HDFPersist/test5.cxx deleted file mode 100644 index 8de1048cc..000000000 --- a/src/HDFPersist/test5.cxx +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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 -// - -// SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) -// File : test5.cxx -// Module : SALOME -// -#include -#include "HDFOI.hxx" -#include - - -int main() -{ - HDFfile *hdf_file; - HDFgroup *hdf_group; - - try - { - // A file study.hdf with 2 groups : MESH and GEOM - hdf_file = new HDFfile("study.hdf"); - - hdf_file->CreateOnDisk(); - - hdf_group = new HDFgroup("GEOM",hdf_file); - - hdf_group->CreateOnDisk(); - - hdf_group->CloseOnDisk(); - - delete hdf_group; - - hdf_group = new HDFgroup("MESH",hdf_file); - - hdf_group->CreateOnDisk(); - - hdf_group->CloseOnDisk(); - - delete hdf_group; - - hdf_file->CloseOnDisk(); - - delete hdf_file; - - // a file mesh.hdf with 2 groups MESH_1 and MESH_2 - hdf_file = new HDFfile("mesh.hdf"); - - hdf_file->CreateOnDisk(); - - hdf_group = new HDFgroup("MESH_1",hdf_file); - - hdf_group->CreateOnDisk(); - - hdf_group->CloseOnDisk(); - - delete hdf_group; - - hdf_group = new HDFgroup("MESH_2",hdf_file); - - hdf_group->CreateOnDisk(); - - hdf_group->CloseOnDisk(); - - delete hdf_group; - - hdf_file->CloseOnDisk(); - - delete hdf_file; - - // a file geom.hdf with 2 groups GEOM_1 and GEOM_2 - hdf_file = new HDFfile("geom.hdf"); - - hdf_file->CreateOnDisk(); - - hdf_group = new HDFgroup("GEOM_1",hdf_file); - - hdf_group->CreateOnDisk(); - - hdf_group->CloseOnDisk(); - - delete hdf_group; - - hdf_group = new HDFgroup("GEOM_2",hdf_file); - - hdf_group->CreateOnDisk(); - - hdf_group->CloseOnDisk(); - - delete hdf_group; - - hdf_file->CloseOnDisk(); - - delete hdf_file; - } - catch (HDFexception) - { - MESSAGE( "!!!! HDFexception !!!" ) - } - - return 0; -} diff --git a/src/HDFPersist/test6.cxx b/src/HDFPersist/test6.cxx deleted file mode 100644 index 5081002a6..000000000 --- a/src/HDFPersist/test6.cxx +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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 -// - -// SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) -// File : test6.cxx -// Module : SALOME -// -#include -#include "HDFOI.hxx" -#include - -int main() -{ - HDFfile *study; - HDFgroup *geom, *mesh; - HDFgroup *geom1, *geom2, *mesh1, *mesh2; - int n,m,i; - char name[HDF_NAME_MAX_LEN+1]; - - try - { - // the groups 'GEOM' and 'MESH' become mounted points for - // the files 'geom.hdf' and 'mesh.hdf' in the 'study.hdf' file - - study = new HDFfile("study.hdf"); - MESSAGE( ">> The HDFfile object for 'study.hdf' is created" ); - - study->OpenOnDisk(HDF_RDONLY); - MESSAGE( "--> The file is opened" ); - - geom = new HDFgroup("GEOM",study); - MESSAGE( ">> The HDFgroup object for 'GEOM' is created" ); - - geom->FileMount("geom.hdf",HDF_RDONLY); - MESSAGE( ">> 'GEOM' becomes a mounted point for the file 'geom.hdf'" ); - - geom->OpenOnDisk(); - MESSAGE( "--> The group is opened" ); - - m = geom->nInternalObjects(); - MESSAGE( "--> There are " << m << " objects in the group" ); - - for (i=0;iInternalObjectIndentify(i,name); - MESSAGE( "--> First Level Internal Object Name : " << name ); - } - - geom1 = new HDFgroup("GEOM_1",geom); - MESSAGE( ">> The HDF group object is created for 'GEOM_1' with 'GEOM' as father" ); - MESSAGE( "--> This group is in fact in the file 'geom.hdf'"); - - geom1->OpenOnDisk(); - MESSAGE( "-> The group 'GEOM_1' is opened" ); - - geom1->CloseOnDisk(); - MESSAGE( "-> The group 'GEOM_1' is closed" ); - - geom2 = new HDFgroup("GEOM_2",geom); - MESSAGE( ">> The HDF group object is created for 'GEOM_2' with 'GEOM' as father" ); - MESSAGE( "--> This group is in fact in the file 'geom.hdf'"); - - geom2->OpenOnDisk(); - MESSAGE( "-> The group 'GEOM_2' is opened" ); - - geom2->CloseOnDisk(); - MESSAGE( "-> The group 'GEOM_2' is closed" ); - - geom->CloseOnDisk(); - MESSAGE( "-> The group 'GEOM' is closed" ); - - geom->FileUnMount(); - MESSAGE( ">> The file 'geom.hdf' is unmounted from 'GEOM' " ); - - mesh = new HDFgroup("MESH",study); - - mesh->FileMount("mesh.hdf",HDF_RDONLY); - - mesh->OpenOnDisk(); - - mesh1 = new HDFgroup("MESH_1",mesh); - - mesh1->OpenOnDisk(); - - mesh1->CloseOnDisk(); - - mesh2 = new HDFgroup("MESH_2",mesh); - - mesh2->OpenOnDisk(); - - mesh2->CloseOnDisk(); - - mesh->CloseOnDisk(); - - mesh->FileUnMount(); - - MESSAGE( ">> The same operations have been done for the file 'mesh.hdf'" ) - MESSAGE( " and the groups MESH_1 and MESH_2" ) - MESSAGE( "--> This file has been mounted on the group 'MESH' of the file 'study.hdf' ") - - study->CloseOnDisk(); - MESSAGE( ">> The study.hdf file is closed" ); - - MESSAGE( ">> Memory clean" ); - delete mesh1; - delete mesh2; - delete mesh; - delete geom1; - delete geom2; - delete geom; - delete study; - } - catch(HDFexception) - { - MESSAGE( "!!! HDFexception !!! ") - } - return 0; -} diff --git a/src/HDFPersist/test7.cxx b/src/HDFPersist/test7.cxx deleted file mode 100644 index e1fac8342..000000000 --- a/src/HDFPersist/test7.cxx +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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 -// - -// SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) -// File : test7.cxx -// Module : SALOME -// -#include "HDFIO.hxx" -#include - - -int main() -{ - - - return 0; -} diff --git a/src/HDFPersist/test8.cxx b/src/HDFPersist/test8.cxx deleted file mode 100644 index fd461f719..000000000 --- a/src/HDFPersist/test8.cxx +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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 -// - -// SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) -// File : test8.cxx -// Module : SALOME -// -#include -#include "HDFOI.hxx" -#include - - -int main() -{ - HDFfile *hdf_file; - HDFgroup *hdf_group; - HDFdataset *hdf_dataset; - hdf_size size[1]; - char message[HDF_NAME_MAX_LEN+1] = "MESSAGE"; - hdf_int32 attribute = 3; - - system("rm file_ascii.hdf"); - - try - { - // a new HDFfile object - hdf_file = new HDFfile("file_ascii.hdf"); - MESSAGE( ">> A HDFfile object is created" ); - - hdf_file->CreateOnDisk(); - MESSAGE( ">> The HDF file is created on Disk " ); - - // Inside the HDF file - - // A new HDF group object - hdf_group = new HDFgroup("ASCII GROUP",hdf_file); - MESSAGE( ">> A HDFgroup object 'ASCII' is created" ); - - hdf_group->CreateOnDisk(); - MESSAGE( ">> The HDF group is created on Disk " ); - - // Transfert d'un fichier ASCII dans un groupe HDF - HDFConvert::FromAscii("ascii.txt",*hdf_group,"ASCII DATASET"); - MESSAGE( ">> The ASCII file is transferred " ); - - // The HDF group is built, it can be closed - hdf_group->CloseOnDisk(); - MESSAGE( ">> The HDF group is closed on Disk " ); - - // The HDF file is built, it can be closed - hdf_file->CloseOnDisk(); - MESSAGE( ">> The HDF file is closed on disk" ); - - - delete hdf_group; - MESSAGE( ">> The HDF group object is deleted" ); - delete hdf_file; - MESSAGE( ">> The HDF file object is deleted" ); - } - catch (HDFexception) - { - MESSAGE( "!!!! HDFexception" ) - } - - return 0; -} diff --git a/src/HDFPersist/test9.cxx b/src/HDFPersist/test9.cxx deleted file mode 100644 index e38097518..000000000 --- a/src/HDFPersist/test9.cxx +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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 -// - -// SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) -// File : test9.cxx -// Module : SALOME -// -#include -#include "HDFOI.hxx" -#include - - -int main() -{ - HDFfile *hdf_file; - HDFgroup *hdf_group; - HDFdataset *hdf_dataset1; - int fd; - size_t size; - char * buffer; - off_t pos; - - system("rm ascii_hdf.txt"); - - try { - - // a new HDFfile object - hdf_file = new HDFfile("file_ascii.hdf"); - MESSAGE( ">> A HDFfile object is created" ); - - hdf_file->OpenOnDisk(HDF_RDONLY); - MESSAGE( ">> The HDF file is opened on Disk with HDF_RDONLY access mode" ) - - hdf_group = new HDFgroup("ASCII GROUP",hdf_file); - MESSAGE(">> A new HDF group object ASCII GROUP" << " is created in memory") - - hdf_group->OpenOnDisk(); - MESSAGE( ">> The group ASCII GROUP is opened on disk" ); - - // The dataset object 'ASCII DATASET' - hdf_dataset1 = new HDFdataset("ASCII DATASET",hdf_group); - MESSAGE( ">> The dataset object 'ASCII DATASET' is created in memory " ); - - hdf_dataset1->OpenOnDisk(); - MESSAGE( ">> The dataset object 'ASCII DATASET' is opened on disk " ); - - size = (size_t) hdf_dataset1->GetSize(); - - // Open the target file - - if ( (fd = open("ascii_hdf.txt",O_RDWR|O_CREAT,00666)) <0) { - perror("open : test9"); - return -1; - }; - - // if ( (pos = lseek(fd,(off_t) size-3,SEEK_SET)) <0) { -// perror("lseek : test9"); -// return -1; -// }; - -// if ( write(fd,"END",3) <0) { -// perror("write : test9"); -// return -1; -// }; - -#ifdef _POSIX_MAPPED_FILES - // Map le fichier en mémoire - // if ((buffer = (char *) mmap(0,size,PROT_WRITE,MAP_SHARED,fd,0)) == MAP_FAILED ) { - // perror("mmap : test9"); - //return -1; - //}; - buffer = new char[size]; -#else - // Sort de la compilation -#error Necessite l''utilisation de la primitive mmap -#endif - - // Transfert les informations dans le fichier destination - hdf_dataset1->ReadFromDisk(buffer); - - if ( write(fd,buffer,size) <0) { - perror("write : test9"); - return -1; - }; - - // Desalloue le mapping -// if (munmap(buffer,size) < 0 ) { -// perror("munmap : test9"); -// return -1; -// }; - - // Close the target file - if (close(fd) <0) { - perror("close : test9"); - return -1; - } - - hdf_dataset1->CloseOnDisk(); - MESSAGE( ">> The dataset is closed on disk " ); - - hdf_group->CloseOnDisk(); - MESSAGE( ">> The group is closed on file" ); - - hdf_file->CloseOnDisk(); - MESSAGE( ">> The HDF file is closed on Disk" ) - - // Memory clean - delete hdf_dataset1; - delete hdf_group; - delete hdf_file; - delete buffer; - MESSAGE( ">> MEMORY CLEAN : all HDF objects have been deleted" ); - - } - catch (HDFexception) { - return -1; - MESSAGE( "!!! HDFexception !!! " ) - } - - return 0; -} - diff --git a/src/KERNEL_PY/CMakeLists.txt b/src/KERNEL_PY/CMakeLists.txt index f00b0095c..a126d598c 100644 --- a/src/KERNEL_PY/CMakeLists.txt +++ b/src/KERNEL_PY/CMakeLists.txt @@ -21,25 +21,23 @@ ADD_SUBDIRECTORY(kernel) SET(salomepython_PYTHON omnipatch.py + Help.py + PyInterp.py + batchmode_salome.py + kernel_test.py + salome_test.py + salome_kernel.py + salome_study.py + salome_iapp.py + salome_ComponentGUI.py + iparameters.py + salome_version.py + salome_notebook.py + salome_pynode.py + salome_genericobj.py ) -SET(salomepython_PYTHON - ${salomepython_PYTHON} - Help.py - PyInterp.py - batchmode_salome.py - kernel_test.py - salome_test.py - salome_kernel.py - salome_study.py - salome_iapp.py - salome_ComponentGUI.py - iparameters.py - salome_version.py - salome_notebook.py - salome_pynode.py - salome_genericobj.py - ) - SALOME_INSTALL_SCRIPTS("${salomepython_PYTHON}" ${SALOME_INSTALL_PYTHON}) SALOME_INSTALL_SCRIPTS(__init__.py ${SALOME_INSTALL_PYTHON}/salome) + +UNSET(salomepython_PYTHON) diff --git a/src/KERNEL_PY/kernel/CMakeLists.txt b/src/KERNEL_PY/kernel/CMakeLists.txt index e9097c825..5d01c66af 100644 --- a/src/KERNEL_PY/kernel/CMakeLists.txt +++ b/src/KERNEL_PY/kernel/CMakeLists.txt @@ -46,3 +46,5 @@ LIST(APPEND mypkgpython_PYTHON ${CMAKE_CURRENT_BINARY_DIR}/logconfig.py ) SALOME_INSTALL_SCRIPTS("${mypkgpython_PYTHON}" ${SALOME_INSTALL_PYTHON}/salome/kernel) + +UNSET(mypkgpython_PYTHON) diff --git a/src/KERNEL_PY/kernel/parametric/CMakeLists.txt b/src/KERNEL_PY/kernel/parametric/CMakeLists.txt index a8a4bff35..56b1d7815 100644 --- a/src/KERNEL_PY/kernel/parametric/CMakeLists.txt +++ b/src/KERNEL_PY/kernel/parametric/CMakeLists.txt @@ -26,3 +26,5 @@ SET(mypkgpython_PYTHON # Executable scripts to be installed SALOME_INSTALL_SCRIPTS("${mypkgpython_PYTHON}" ${SALOME_INSTALL_PYTHON}/salome/kernel/parametric) + +UNSET(mypkgpython_PYTHON) diff --git a/src/KernelHelpers/CMakeLists.txt b/src/KernelHelpers/CMakeLists.txt index c5879fc71..361bb2c76 100644 --- a/src/KernelHelpers/CMakeLists.txt +++ b/src/KernelHelpers/CMakeLists.txt @@ -20,19 +20,23 @@ INCLUDE_DIRECTORIES( ${PTHREAD_INCLUDE_DIR} ${OMNIORB_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../NamingService - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../Utils - ${CMAKE_CURRENT_SOURCE_DIR}/../LifeCycleCORBA - ${CMAKE_CURRENT_SOURCE_DIR}/../Container - ${CMAKE_CURRENT_SOURCE_DIR}/../Notification - ${CMAKE_CURRENT_SOURCE_DIR}/../GenericObj - ${PROJECT_BINARY_DIR}/idl + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/NamingService + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/Utils + ${CMAKE_SOURCE_DIR}/src/LifeCycleCORBA + ${CMAKE_SOURCE_DIR}/src/Container + ${CMAKE_SOURCE_DIR}/src/Notification + ${CMAKE_SOURCE_DIR}/src/GenericObj ) +ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) + SET(SalomeKernelHelpers_LIBS + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} ${OMNIORB_LIBRARIES} SalomeNS SALOMELocalTrace @@ -51,15 +55,28 @@ SET(SalomeKernelHelpers_SOURCES SALOMEDS_DriverDefaultImpl.cxx ) -ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) +SET(SalomeKernelHelpers_HEADERS + KernelHelpers.hxx + SALOMEDS_DriverDefaultImpl.hxx + SALOME_KernelServices.hxx + SALOME_StudyEditor.hxx +) ADD_LIBRARY(SalomeKernelHelpers ${SalomeKernelHelpers_SOURCES}) TARGET_LINK_LIBRARIES(SalomeKernelHelpers ${SalomeKernelHelpers_LIBS}) INSTALL(TARGETS SalomeKernelHelpers EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -ADD_EXECUTABLE(KernelHelpersUseCases KernelHelpersUseCases.cxx) -TARGET_LINK_LIBRARIES(KernelHelpersUseCases SalomeKernelHelpers ${SalomeKernelHelpers_LIBS}) -INSTALL(TARGETS KernelHelpersUseCases DESTINATION ${SALOME_INSTALL_BINS}) +INSTALL(FILES ${SalomeKernelHelpers_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +IF(SALOME_BUILD_TESTS) + ADD_EXECUTABLE(KernelHelpersUseCases KernelHelpersUseCases.cxx) + TARGET_LINK_LIBRARIES(KernelHelpersUseCases ${SalomeKernelHelpers_LIBS} SalomeKernelHelpers) + INSTALL(TARGETS KernelHelpersUseCases DESTINATION ${SALOME_INSTALL_BINS}) +ENDIF() + +UNSET(SalomeKernelHelpers_SOURCES) +UNSET(SalomeKernelHelpers_HEADERS) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +IF(SALOME_BUILD_TESTS) + ADD_SUBDIRECTORY(Test) +ENDIF() diff --git a/src/KernelHelpers/Test/CMakeLists.txt b/src/KernelHelpers/Test/CMakeLists.txt index 0beda8460..8aed400e0 100644 --- a/src/KernelHelpers/Test/CMakeLists.txt +++ b/src/KernelHelpers/Test/CMakeLists.txt @@ -21,24 +21,28 @@ INCLUDE_DIRECTORIES( ${CPPUNIT_INCLUDE_DIRS} ${OMNIORB_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${PROJECT_SOURCE_DIR}/src/Basics/Test - ${CMAKE_CURRENT_SOURCE_DIR}/.. - ${PROJECT_SOURCE_DIR}/src/NamingService - ${PROJECT_SOURCE_DIR}/src/SALOMELocalTrace - ${PROJECT_SOURCE_DIR}/src/Basics - ${PROJECT_SOURCE_DIR}/src/Utils - ${PROJECT_SOURCE_DIR}/src/LifeCycleCORBA - ${PROJECT_SOURCE_DIR}/src/Container - ${PROJECT_SOURCE_DIR}/src/Notification - ${PROJECT_SOURCE_DIR}/src/GenericObj - ${PROJECT_BINARY_DIR}/idl + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Basics/Test + ${CMAKE_SOURCE_DIR}/src/NamingService + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/Utils + ${CMAKE_SOURCE_DIR}/src/LifeCycleCORBA + ${CMAKE_SOURCE_DIR}/src/Container + ${CMAKE_SOURCE_DIR}/src/Notification + ${CMAKE_SOURCE_DIR}/src/GenericObj + ${CMAKE_SOURCE_DIR}/src/KernelHelpers ) +ADD_DEFINITIONS(${CPPUNIT_DEFINITIONS} ${OMNIORB_DEFINITIONS}) + SET(SalomeKernelHelpersTest_LIBS + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} ${CPPUNIT_LIBRARIES} SalomeKernelHelpers - ${OMNIORB_LIBRARIES} SalomeNS SALOMELocalTrace SALOMEBasics @@ -50,8 +54,6 @@ SET(SalomeKernelHelpersTest_LIBS SalomeIDLKernel ) -ADD_DEFINITIONS(${CPPUNIT_DEFINITIONS} ${OMNIORB_DEFINITIONS}) - SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/KernelHelpers) ADD_LIBRARY(SalomeKernelHelpersTest KernelHelpersUnitTests.cxx) @@ -59,16 +61,14 @@ TARGET_LINK_LIBRARIES(SalomeKernelHelpersTest ${SalomeKernelHelpersTest_LIBS}) INSTALL(TARGETS SalomeKernelHelpersTest DESTINATION ${KERNEL_TEST_LIB}) ADD_EXECUTABLE(TestKernelHelpers TestKernelHelpers.cxx) -TARGET_LINK_LIBRARIES(TestKernelHelpers SalomeKernelHelpersTest ${SalomeKernelHelpersTest_LIBS}) -#ADD_TEST(TestKernelHelpers TestKernelHelpers) +TARGET_LINK_LIBRARIES(TestKernelHelpers ${SalomeKernelHelpersTest_LIBS} SalomeKernelHelpersTest) INSTALL(TARGETS TestKernelHelpers DESTINATION ${LOCAL_TEST_DIR}) -# Executable scripts to be installed INSTALL(FILES TestKernelHelpers.py DESTINATION ${LOCAL_TEST_DIR}) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${LOCAL_TEST_DIR}) - INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${LOCAL_TEST_DIR} RENAME CTestTestfile.cmake) + +SET(LOCAL_TEST_DIR) +UNSET(SalomeKernelHelpersTest_LIBS) diff --git a/src/Launcher/CMakeLists.txt b/src/Launcher/CMakeLists.txt index 708836437..ad3c16757 100644 --- a/src/Launcher/CMakeLists.txt +++ b/src/Launcher/CMakeLists.txt @@ -28,17 +28,17 @@ INCLUDE_DIRECTORIES( ${PTHREAD_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ${LIBBATCH_INCLUDE_DIRS} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../NamingService - ${CMAKE_CURRENT_SOURCE_DIR}/../Utils - ${CMAKE_CURRENT_SOURCE_DIR}/../Registry - ${CMAKE_CURRENT_SOURCE_DIR}/../Notification - ${CMAKE_CURRENT_SOURCE_DIR}/../Container - ${CMAKE_CURRENT_SOURCE_DIR}/../ResourcesManager - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMESDS - ${PROJECT_BINARY_DIR}/idl + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/NamingService + ${CMAKE_SOURCE_DIR}/src/Utils + ${CMAKE_SOURCE_DIR}/src/Registry + ${CMAKE_SOURCE_DIR}/src/Notification + ${CMAKE_SOURCE_DIR}/src/Container + ${CMAKE_SOURCE_DIR}/src/ResourcesManager + ${CMAKE_SOURCE_DIR}/src/SALOMESDS ) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${BOOST_DEFINITIONS} ${OMNIORB_DEFINITIONS}) @@ -46,25 +46,6 @@ IF(SALOME_USE_LIBBATCH) ADD_DEFINITIONS(-DWITH_LIBBATCH) ENDIF(SALOME_USE_LIBBATCH) -# This local variable defines the list of dependent libraries common to all target in this package. -SET(COMMON_LIBS - Registry - SalomeNotification - SalomeContainer - SalomeResourcesManager - SalomeNS - OpUtil - SALOMELocalTrace - SALOMEBasics - SalomeIDLKernel - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_SYSTEM_LIBRARY} - ${LIBBATCH_LIBRARIES} - ${OMNIORB_LIBRARIES} - ${LIBXML2_LIBRARIES} - ${PYTHON_LIBRARIES} -) - SET(Launcher_SOURCES SALOME_Launcher_Parser.cxx SALOME_Launcher_Handler.cxx @@ -78,46 +59,65 @@ SET(Launcher_SOURCES Launcher_XML_Persistence.cxx ) -ADD_LIBRARY(Launcher ${Launcher_SOURCES}) -TARGET_LINK_LIBRARIES(Launcher ResourcesManager ${LIBBATCH_LIBRARIES} ${LIBXML2_LIBS} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) -INSTALL(TARGETS Launcher EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) - -SET(TestLauncher_LIBS +SET(Launcher_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} ${LIBXML2_LIBRARIES} - ResourcesManager - Launcher + ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${LIBBATCH_LIBRARIES} - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_SYSTEM_LIBRARY} + ResourcesManager ) -# TestLauncher needs only (and must need only) libxml, libbatch, ResourceManager and Launcher libraries! -ADD_EXECUTABLE(TestLauncher TestLauncher.cxx) -TARGET_LINK_LIBRARIES(TestLauncher ${TestLauncher_LIBS}) -INSTALL(TARGETS TestLauncher DESTINATION ${SALOME_INSTALL_BINS}) +ADD_LIBRARY(Launcher ${Launcher_SOURCES}) +TARGET_LINK_LIBRARIES(Launcher ${Launcher_LIBRARIES}) +INSTALL(TARGETS Launcher EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) + +IF(SALOME_BUILD_TESTS) + # TestLauncher needs only (and must need only) + # libxml, libbatch, ResourceManager and Launcher libraries! + ADD_EXECUTABLE(TestLauncher TestLauncher.cxx) + TARGET_LINK_LIBRARIES(TestLauncher ${Launcher_LIBRARIES} Launcher) + INSTALL(TARGETS TestLauncher DESTINATION ${SALOME_INSTALL_BINS}) + INSTALL(FILES testLauncher.xml DESTINATION ${SALOME_KERNEL_INSTALL_RES_DATA}) +ENDIF() -ADD_LIBRARY(SalomeLauncher BatchTest.cxx SALOME_Launcher.cxx SALOME_ExternalServerLauncher.cxx SALOME_LauncherException.cxx SALOME_ExternalServerHandler.cxx) -TARGET_LINK_LIBRARIES(SalomeLauncher Launcher ${COMMON_LIBS}) -INSTALL(TARGETS SalomeLauncher EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) - -SET(SALOME_LauncherServer_LIBS - Launcher - SalomeLauncher - SalomeSDS - SALOMEBasics - SALOMELocalTrace - ${LIBBATCH_LIBRARIES} +SET(SalomeLauncher_SOURCES + BatchTest.cxx + SALOME_Launcher.cxx + SALOME_ExternalServerLauncher.cxx + SALOME_LauncherException.cxx + SALOME_ExternalServerHandler.cxx +) + +SET(SalomeLauncher_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} ${OMNIORB_LIBRARIES} ${LIBXML2_LIBRARIES} ${PYTHON_LIBRARIES} + ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} + ${LIBBATCH_LIBRARIES} + Registry + SalomeNotification + SalomeContainer + SalomeResourcesManager + SalomeNS + OpUtil + SALOMELocalTrace + SALOMEBasics + SalomeIDLKernel + Launcher ) +ADD_LIBRARY(SalomeLauncher ${SalomeLauncher_SOURCES}) +TARGET_LINK_LIBRARIES(SalomeLauncher ${SalomeLauncher_LIBRARIES}) +INSTALL(TARGETS SalomeLauncher EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) + ADD_EXECUTABLE(SALOME_LauncherServer SALOME_LauncherServer.cxx) -TARGET_LINK_LIBRARIES(SALOME_LauncherServer ${SALOME_LauncherServer_LIBS}) +TARGET_LINK_LIBRARIES(SALOME_LauncherServer ${SalomeLauncher_LIBRARIES} SalomeLauncher SalomeSDS) INSTALL(TARGETS SALOME_LauncherServer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) -SET(COMMON_HEADERS_HXX - BatchTest.hxx +SET(Launcher_HEADERS Launcher.hxx Launcher_Job.hxx Launcher_Job_Command.hxx @@ -132,11 +132,16 @@ SET(COMMON_HEADERS_HXX SALOME_ExternalServerLauncher.hxx SALOME_LauncherException.hxx ) +INSTALL(FILES ${Launcher_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) -SET(LAUNCHER_PYTHON_SCRIPTS +SET(Launcher_SCRIPTS launcher_proxy.py ) +SALOME_INSTALL_SCRIPTS("${Launcher_SCRIPTS}" ${SALOME_INSTALL_PYTHON}) -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) -INSTALL(FILES testLauncher.xml DESTINATION ${SALOME_KERNEL_INSTALL_RES_DATA}) -SALOME_INSTALL_SCRIPTS("${LAUNCHER_PYTHON_SCRIPTS}" ${SALOME_INSTALL_PYTHON}) +SET(Launcher_SOURCES) +SET(Launcher_LIBRARIES) +SET(SalomeLauncher_SOURCES) +SET(SalomeLauncher_LIBRARIES) +SET(Launcher_HEADERS) +SET(Launcher_SCRIPTS) diff --git a/src/Launcher/Test/CMakeLists.txt b/src/Launcher/Test/CMakeLists.txt index 1d4e6cd15..75d39e385 100644 --- a/src/Launcher/Test/CMakeLists.txt +++ b/src/Launcher/Test/CMakeLists.txt @@ -19,24 +19,15 @@ # --- rules --- +SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/Launcher) + IF(NOT WIN32) -# ** Now in CTestTestfileInstall.cmake ** -# ** In this file only remain unit tests (no SALOME session is needed) ** -# ADD_TEST(NAME SalomeLauncher -# COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../../UnitTests/prepare_test.py -# ${CMAKE_CURRENT_SOURCE_DIR}/test_launcher.py -# -d KERNEL_ROOT_DIR=${CMAKE_INSTALL_PREFIX} -# ) - INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/test_launcher.py - DESTINATION ${KERNEL_TEST_DIR}/Launcher) + INSTALL(PROGRAMS test_stress.sh launcher_use_case.py test_launcher.py + DESTINATION ${LOCAL_TEST_DIR}) INSTALL(FILES CTestTestfileInstall.cmake - DESTINATION ${KERNEL_TEST_DIR}/Launcher + DESTINATION ${LOCAL_TEST_DIR} RENAME CTestTestfile.cmake) - SET(STRESS_TEST_FILES - test_stress.sh - launcher_use_case.py - ) - INSTALL(PROGRAMS ${STRESS_TEST_FILES} - DESTINATION ${KERNEL_TEST_DIR}/Launcher) ENDIF() + +UNSET(LOCAL_TEST_DIR) diff --git a/src/Launcher/Test/CTestTestfileInstall.cmake b/src/Launcher/Test/CTestTestfileInstall.cmake index aca101e7c..daa22035c 100644 --- a/src/Launcher/Test/CTestTestfileInstall.cmake +++ b/src/Launcher/Test/CTestTestfileInstall.cmake @@ -20,16 +20,10 @@ IF(NOT WIN32) SET(TEST_NAME ${COMPONENT_NAME}_Launcher) ADD_TEST(${TEST_NAME} ${SALOME_TEST_DRIVER} 2000 test_launcher.py) - SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" - # TIMEOUT 500 - ) - - SET(TEST_NAME ${COMPONENT_NAME}_StressLauncher) - ADD_TEST(${TEST_NAME} ${SALOME_TEST_DRIVER} 2000 ./test_stress.sh) - SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" - # TIMEOUT 500 - ) - # /!\ DO NOT SET TIMEOUT PROPERTY IF USING ${SALOME_TEST_DRIVER} - # BUT PASS TIMEOUT VALUE TO THE DRIVER + SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") +# VSR: disable stress test as it often kills workstation +# SET(TEST_NAME ${COMPONENT_NAME}_StressLauncher) +# ADD_TEST(${TEST_NAME} ${SALOME_TEST_DRIVER} 2000 ./test_stress.sh) +# SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDIF() diff --git a/src/Launcher_SWIG/CMakeLists.txt b/src/Launcher_SWIG/CMakeLists.txt index a98274e97..bd3a4315c 100644 --- a/src/Launcher_SWIG/CMakeLists.txt +++ b/src/Launcher_SWIG/CMakeLists.txt @@ -19,37 +19,56 @@ INCLUDE(${SWIG_USE_FILE}) -ADD_DEFINITIONS(${PYTHON_DEFINITIONS}) - SET(Launcher_target_name pylauncher) +INCLUDE_DIRECTORIES( + ${PTHREAD_INCLUDE_DIR} + ${PYTHON_INCLUDE_DIRS} + ${LIBBATCH_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/src/ResourcesManager + ${CMAKE_SOURCE_DIR}/src/Launcher +) + IF(SALOME_USE_LIBBATCH) ADD_DEFINITIONS(-DWITH_LIBBATCH) SET(SWIG_MODULE_${Launcher_target_name}_EXTRA_FLAGS "-DWITH_LIBBATCH") ENDIF(SALOME_USE_LIBBATCH) +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${PYTHON_LIBRARIES} + Launcher +) + SET_SOURCE_FILES_PROPERTIES(Launcher.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(Launcher.i PROPERTIES SWIG_FLAGS "-py3") +IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") + SWIG_ADD_MODULE(${Launcher_target_name} python Launcher.i) +ELSE() + SWIG_ADD_LIBRARY(${Launcher_target_name} LANGUAGE python SOURCES Launcher.i) +ENDIF() -INCLUDE_DIRECTORIES( - ${PYTHON_INCLUDE_DIRS} - ${LIBBATCH_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR}/../ResourcesManager - ${CMAKE_CURRENT_SOURCE_DIR}/../Launcher - ) - -SWIG_ADD_LIBRARY(${Launcher_target_name} LANGUAGE python SOURCES Launcher.i) - -SWIG_LINK_LIBRARIES(${Launcher_target_name} ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} Launcher) +SWIG_LINK_LIBRARIES(${Launcher_target_name} ${_link_LIBRARIES}) SWIG_CHECK_GENERATION(${Launcher_target_name}) -INSTALL(TARGETS ${SWIG_MODULE_${Launcher_target_name}_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON}) +IF(WIN32) + SET_TARGET_PROPERTIES(_${Launcher_target_name} + PROPERTIES + DEBUG_OUTPUT_NAME _${Launcher_target_name}_d) +ENDIF() + +INSTALL(TARGETS ${SWIG_MODULE_${Launcher_target_name}_REAL_NAME} + DESTINATION ${SALOME_INSTALL_PYTHON}) -SET(PYFILES_TO_INSTALL ${PYFILES_TO_INSTALL} ${CMAKE_CURRENT_BINARY_DIR}/pylauncher.py) +SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/${Launcher_target_name}.py + ${SALOME_INSTALL_PYTHON} + EXTRA_DPYS "${SWIG_MODULE_${Launcher_target_name}_REAL_NAME}") -SALOME_INSTALL_SCRIPTS("${PYFILES_TO_INSTALL}" ${SALOME_INSTALL_PYTHON} EXTRA_DPYS "${SWIG_MODULE_${Launcher_target_name}_REAL_NAME}") +UNSET(Launcher_target_name) +UNSET(_link_LIBRARIES) IF(SALOME_BUILD_TESTS) ADD_SUBDIRECTORY(Test) diff --git a/src/Launcher_SWIG/Test/CMakeLists.txt b/src/Launcher_SWIG/Test/CMakeLists.txt index 501e8e441..bfffdbbc3 100644 --- a/src/Launcher_SWIG/Test/CMakeLists.txt +++ b/src/Launcher_SWIG/Test/CMakeLists.txt @@ -20,20 +20,10 @@ # --- rules --- IF(NOT WIN32) -# ** Now in CTestTestfileInstall.cmake ** -# ** In this file only remain unit tests (no SALOME session is needed) ** -# ADD_TEST(NAME SalomeLauncher -# COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../../UnitTests/prepare_test.py -# ${CMAKE_CURRENT_SOURCE_DIR}/test_launcher.py -# -d KERNEL_ROOT_DIR=${CMAKE_INSTALL_PREFIX} -# ) INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/test_swig_launcher.py DESTINATION ${KERNEL_TEST_DIR}/Launcher_SWIG) INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${KERNEL_TEST_DIR}/Launcher_SWIG RENAME CTestTestfile.cmake) - - INSTALL(PROGRAMS ${STRESS_TEST_FILES} - DESTINATION ${KERNEL_TEST_DIR}/Launcher_SWIG) ENDIF() diff --git a/src/LifeCycleCORBA/CMakeLists.txt b/src/LifeCycleCORBA/CMakeLists.txt index a89195de9..b9b51862c 100644 --- a/src/LifeCycleCORBA/CMakeLists.txt +++ b/src/LifeCycleCORBA/CMakeLists.txt @@ -21,24 +21,30 @@ INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMETraceCollector - ${CMAKE_CURRENT_SOURCE_DIR}/../NamingService - ${CMAKE_CURRENT_SOURCE_DIR}/../Utils - ${CMAKE_CURRENT_SOURCE_DIR}/../GenericObj - ${CMAKE_CURRENT_SOURCE_DIR}/../Container - ${CMAKE_CURRENT_SOURCE_DIR}/../ResourcesManager - ${CMAKE_CURRENT_SOURCE_DIR}/../Batch - ${CMAKE_CURRENT_SOURCE_DIR}/../Notification - ${CMAKE_CURRENT_SOURCE_DIR}/../Registry - ${CMAKE_CURRENT_SOURCE_DIR}/../Launcher - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMESDS - ${PROJECT_BINARY_DIR}/idl + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/SALOMETraceCollector + ${CMAKE_SOURCE_DIR}/src/NamingService + ${CMAKE_SOURCE_DIR}/src/Utils + ${CMAKE_SOURCE_DIR}/src/GenericObj + ${CMAKE_SOURCE_DIR}/src/Container + ${CMAKE_SOURCE_DIR}/src/ResourcesManager + ${CMAKE_SOURCE_DIR}/src/Batch + ${CMAKE_SOURCE_DIR}/src/Notification + ${CMAKE_SOURCE_DIR}/src/Registry + ${CMAKE_SOURCE_DIR}/src/Launcher + ${CMAKE_SOURCE_DIR}/src/SALOMESDS ) -SET(COMMON_LIBS +ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) + +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} + ${PYTHON_LIBRARIES} SalomeContainer SalomeResourcesManager SalomeNS @@ -49,21 +55,39 @@ SET(COMMON_LIBS SalomeGenericObj SalomeIDLKernel SalomeLauncher + Registry ) -ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) +SET(SalomeLifeCycleCORBA_SOURCES + SALOME_LifeCycleCORBA.cxx + SALOME_FileTransferCORBA.cxx +) -ADD_LIBRARY(SalomeLifeCycleCORBA SALOME_LifeCycleCORBA.cxx SALOME_FileTransferCORBA.cxx) -TARGET_LINK_LIBRARIES(SalomeLifeCycleCORBA ${COMMON_LIBS}) +SET(SalomeLifeCycleCORBA_HEADERS + SALOME_LifeCycleCORBA.hxx + SALOME_FileTransferCORBA.hxx +) + +ADD_LIBRARY(SalomeLifeCycleCORBA ${SalomeLifeCycleCORBA_SOURCES}) +TARGET_LINK_LIBRARIES(SalomeLifeCycleCORBA ${_link_LIBRARIES}) INSTALL(TARGETS SalomeLifeCycleCORBA EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -ADD_EXECUTABLE(Test_LifeCycleCORBA Test_LifeCycleCORBA.cxx) -TARGET_LINK_LIBRARIES(Test_LifeCycleCORBA SalomeLifeCycleCORBA Registry SalomeNotification SalomeContainer ${COMMON_LIBS} ${OMNIORB_LIBRARIES}) +INSTALL(FILES ${SalomeLifeCycleCORBA_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +IF(SALOME_BUILD_TESTS) + ADD_EXECUTABLE(Test_LifeCycleCORBA Test_LifeCycleCORBA.cxx) + TARGET_LINK_LIBRARIES(Test_LifeCycleCORBA ${_link_LIBRARIES} SalomeLifeCycleCORBA) + + ADD_EXECUTABLE(TestContainerManager TestContainerManager.cxx) + TARGET_LINK_LIBRARIES(TestContainerManager SalomeLifeCycleCORBA ${_link_LIBRARIES}) -ADD_EXECUTABLE(TestContainerManager TestContainerManager.cxx) -TARGET_LINK_LIBRARIES(TestContainerManager SalomeLifeCycleCORBA Registry SalomeNotification SalomeContainer ${COMMON_LIBS} ${OMNIORB_LIBRARIES}) + INSTALL(TARGETS Test_LifeCycleCORBA TestContainerManager DESTINATION ${SALOME_INSTALL_BINS}) +ENDIF() -INSTALL(TARGETS Test_LifeCycleCORBA TestContainerManager DESTINATION ${SALOME_INSTALL_BINS}) +UNSET(SalomeLifeCycleCORBA_SOURCES) +UNSET(SalomeLifeCycleCORBA_HEADERS) +UNSET(_link_LIBRARIES) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +IF(SALOME_BUILD_TESTS) + ADD_SUBDIRECTORY(Test) +ENDIF() diff --git a/src/LifeCycleCORBA/Test/CMakeLists.txt b/src/LifeCycleCORBA/Test/CMakeLists.txt index e3e400fbc..da6e1bb6a 100644 --- a/src/LifeCycleCORBA/Test/CMakeLists.txt +++ b/src/LifeCycleCORBA/Test/CMakeLists.txt @@ -19,25 +19,32 @@ INCLUDE_DIRECTORIES( ${PTHREAD_INCLUDE_DIR} - ${CPPUNIT_INCLUDE_DIRS} ${OMNIORB_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../../Basics/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMELocalTrace/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMETraceCollector - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMETraceCollector/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../NamingService - ${CMAKE_CURRENT_SOURCE_DIR}/../../NamingService/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../Utils - ${CMAKE_CURRENT_SOURCE_DIR}/../../Utils/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../ResourcesManager - ${CMAKE_CURRENT_SOURCE_DIR}/../../LifeCycleCORBA - ${PROJECT_BINARY_DIR}/idl + ${PYTHON_INCLUDE_DIRS} + ${CPPUNIT_INCLUDE_DIRS} + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/Basics/Test + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace/Test + ${CMAKE_SOURCE_DIR}/src/SALOMETraceCollector + ${CMAKE_SOURCE_DIR}/src/SALOMETraceCollector/Test + ${CMAKE_SOURCE_DIR}/src/NamingService + ${CMAKE_SOURCE_DIR}/src/NamingService/Test + ${CMAKE_SOURCE_DIR}/src/Utils + ${CMAKE_SOURCE_DIR}/src/Utils/Test + ${CMAKE_SOURCE_DIR}/src/ResourcesManager + ${CMAKE_SOURCE_DIR}/src/LifeCycleCORBA ) -SET(COMMON_LIBS +ADD_DEFINITIONS(${CPPUNIT_DEFINITIONS} ${OMNIORB_DEFINITIONS}) + +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} + ${PYTHON_LIBRARIES} ${CPPUNIT_LIBRARIES} SALOMEBasics SalomeResourcesManager @@ -45,33 +52,38 @@ SET(COMMON_LIBS SalomeNS Registry SalomeNotification - UtilsTest OpUtil - SALOMELocalTraceTest SALOMELocalTrace - SALOMETraceCollectorTest SalomeIDLKernel SalomeLifeCycleCORBA - ${OMNIORB_LIBRARIES} ) -ADD_DEFINITIONS(${CPPUNIT_DEFINITIONS} ${OMNIORB_DEFINITIONS}) SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/LifeCycleCORBA) ADD_LIBRARY(LifeCycleCORBATest LifeCycleCORBATest.cxx) -TARGET_LINK_LIBRARIES(LifeCycleCORBATest ${COMMON_LIBS}) +TARGET_LINK_LIBRARIES(LifeCycleCORBATest ${_link_LIBRARIES}) INSTALL(TARGETS LifeCycleCORBATest DESTINATION ${KERNEL_TEST_LIB}) +SET(_exe_LIBRARIES + ${_link_LIBRARIES} + NamingServiceTest + SALOMETraceCollectorTest + SALOMELocalTraceTest + UtilsTest + LifeCycleCORBATest +) + ADD_EXECUTABLE(TestLifeCycleCORBA TestLifeCycleCORBA.cxx) -TARGET_LINK_LIBRARIES(TestLifeCycleCORBA LifeCycleCORBATest NamingServiceTest SalomeLifeCycleCORBA ${COMMON_LIBS}) +TARGET_LINK_LIBRARIES(TestLifeCycleCORBA ${_exe_LIBRARIES}) INSTALL(TARGETS TestLifeCycleCORBA DESTINATION ${LOCAL_TEST_DIR}) # Executable scripts to be installed -INSTALL(FILES TestLifeCycleCORBA.py DESTINATION ${LOCAL_TEST_DIR}) - -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${LOCAL_TEST_DIR}) +INSTALL(PROGRAMS TestLifeCycleCORBA.py DESTINATION ${LOCAL_TEST_DIR}) INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${LOCAL_TEST_DIR} RENAME CTestTestfile.cmake) + +UNSET(LOCAL_TEST_DIR) +UNSET(_link_LIBRARIES) +UNSET(_exe_LIBRARIES) diff --git a/src/LifeCycleCORBA_SWIG/CMakeLists.txt b/src/LifeCycleCORBA_SWIG/CMakeLists.txt index 6284fff27..b279730d6 100644 --- a/src/LifeCycleCORBA_SWIG/CMakeLists.txt +++ b/src/LifeCycleCORBA_SWIG/CMakeLists.txt @@ -19,43 +19,56 @@ INCLUDE(${SWIG_USE_FILE}) -SET_SOURCE_FILES_PROPERTIES(libSALOME_LifeCycleCORBA.i PROPERTIES CPLUSPLUS ON) -SET_SOURCE_FILES_PROPERTIES(libSALOME_LifeCycleCORBA.i PROPERTIES SWIG_FLAGS "-py3") -ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) - INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_DIRS} ${PTHREAD_INCLUDE_DIR} ${OMNIORB_INCLUDE_DIR} - ${OMNIORBPY_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/../NamingService - ${CMAKE_CURRENT_SOURCE_DIR}/../LifeCycleCORBA - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../Utils - ${PROJECT_BINARY_DIR}/idl - ) + ${CMAKE_SOURCE_DIR}/src/NamingService + ${CMAKE_SOURCE_DIR}/src/LifeCycleCORBA + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/Utils +) + +ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) + +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${PYTHON_LIBRARIES} + SalomeLifeCycleCORBA +) + +SET_SOURCE_FILES_PROPERTIES(libSALOME_LifeCycleCORBA.i PROPERTIES CPLUSPLUS ON) +SET_SOURCE_FILES_PROPERTIES(libSALOME_LifeCycleCORBA.i PROPERTIES SWIG_FLAGS "-py3") IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") SWIG_ADD_MODULE(libSALOME_LifeCycleCORBA python libSALOME_LifeCycleCORBA.i) ELSE() - SWIG_ADD_LIBRARY(libSALOME_LifeCycleCORBA LANGUAGE python SOURCES libSALOME_LifeCycleCORBA.i) + SWIG_ADD_LIBRARY(libSALOME_LifeCycleCORBA LANGUAGE python SOURCES libSALOME_LifeCycleCORBA.i) ENDIF() -SWIG_LINK_LIBRARIES(libSALOME_LifeCycleCORBA ${PYTHON_LIBRARIES} SalomeLifeCycleCORBA) -TARGET_LINK_LIBRARIES(_libSALOME_LifeCycleCORBA ${PLATFORM_LIBS}) +SWIG_LINK_LIBRARIES(libSALOME_LifeCycleCORBA ${_link_LIBRARIES}) -IF(${MACHINE} STREQUAL WINDOWS) +IF(WIN32) SET_TARGET_PROPERTIES(_libSALOME_LifeCycleCORBA PROPERTIES DEBUG_OUTPUT_NAME _libSALOME_LifeCycleCORBA_d) -ENDIF(${MACHINE} STREQUAL WINDOWS) +ENDIF() INSTALL(TARGETS _libSALOME_LifeCycleCORBA DESTINATION ${SALOME_INSTALL_PYTHON}) -SET(SCRIPTS - LifeCycleCORBA.py - TestLifeCycleCORBA.py -) -SALOME_INSTALL_SCRIPTS("${SCRIPTS}" ${SALOME_INSTALL_SCRIPT_PYTHON}) + +SALOME_INSTALL_SCRIPTS(LifeCycleCORBA.py ${SALOME_INSTALL_SCRIPT_PYTHON}) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libSALOME_LifeCycleCORBA.py DESTINATION ${SALOME_INSTALL_PYTHON}) + +IF(SALOME_BUILD_TESTS) + SALOME_INSTALL_SCRIPTS(TestLifeCycleCORBA.py ${SALOME_INSTALL_SCRIPT_PYTHON}) +ENDIF() + +UNSET(_link_LIBRARIES) + +IF(SALOME_BUILD_TESTS) + ADD_SUBDIRECTORY(Test) +ENDIF() diff --git a/src/LifeCycleCORBA_SWIG/Test/CMakeLists.txt b/src/LifeCycleCORBA_SWIG/Test/CMakeLists.txt index 2d301c50c..6ed61b64e 100644 --- a/src/LifeCycleCORBA_SWIG/Test/CMakeLists.txt +++ b/src/LifeCycleCORBA_SWIG/Test/CMakeLists.txt @@ -17,7 +17,6 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -# Scripts to be installed SET(SCRIPTS LifeCycleCORBA_SWIGTest.py testresourcemanager.py @@ -27,7 +26,11 @@ SET(SCRIPTS ) SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/LifeCycleCORBA_SWIG) + INSTALL(FILES ${SCRIPTS} DESTINATION ${LOCAL_TEST_DIR}) + INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${LOCAL_TEST_DIR} RENAME CTestTestfile.cmake) + +UNSET(SCRIPTS) diff --git a/src/Logger/CMakeLists.txt b/src/Logger/CMakeLists.txt index fa5a540bc..edcdca2df 100644 --- a/src/Logger/CMakeLists.txt +++ b/src/Logger/CMakeLists.txt @@ -20,33 +20,46 @@ INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${PROJECT_BINARY_DIR}/idl + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace ) + ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) -ADD_LIBRARY(SalomeLoggerServer SALOME_Trace.cxx SALOME_Logger_Server.cxx) -TARGET_LINK_LIBRARIES(SalomeLoggerServer SalomeIDLKernel ${OMNIORB_LIBRARIES} ${PLATFORM_LIBS}) -INSTALL(TARGETS SalomeLoggerServer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${OMNIORB_LIBRARIES} + ${PTHREAD_LIBRARIES} + SalomeIDLKernel +) -SET(SALOME_Logger_Server_SOURCES - SALOME_Logger_Server_main.cxx - SALOME_Logger_Server.hxx +SET(Logger_SOURCES + SALOME_Trace.cxx + SALOME_Logger_Server.cxx ) -SET(SALOME_Logger_Server_LIBS - SalomeLoggerServer - SalomeIDLKernel - ${OMNIORB_LIBRARIES} +SET(Logger_HEADERS + SALOME_Trace.hxx ) -ADD_EXECUTABLE(SALOME_Logger_Server ${SALOME_Logger_Server_SOURCES}) -TARGET_LINK_LIBRARIES(SALOME_Logger_Server ${SALOME_Logger_Server_LIBS}) +ADD_LIBRARY(SalomeLoggerServer ${Logger_SOURCES}) +TARGET_LINK_LIBRARIES(SalomeLoggerServer ${_link_LIBRARIES}) +INSTALL(TARGETS SalomeLoggerServer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) + +ADD_EXECUTABLE(SALOME_Logger_Server SALOME_Logger_Server_main.cxx) +TARGET_LINK_LIBRARIES(SALOME_Logger_Server ${_link_LIBRARIES} SalomeLoggerServer) INSTALL(TARGETS SALOME_Logger_Server EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) -# Executable scripts to be installed SALOME_INSTALL_SCRIPTS(SALOME_Trace.py ${SALOME_INSTALL_SCRIPT_PYTHON}) -INSTALL(FILES SALOME_Trace.hxx DESTINATION ${SALOME_INSTALL_HEADERS}) +INSTALL(FILES ${Logger_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +UNSET(Logger_SOURCES) +UNSET(Logger_HEADERS) +UNSET(_link_LIBRARIES) + +IF(SALOME_BUILD_TESTS) + ADD_SUBDIRECTORY(Test) +ENDIF() diff --git a/src/MPIContainer/CMakeLists.txt b/src/MPIContainer/CMakeLists.txt index bc856b1a8..99ca5bbd1 100644 --- a/src/MPIContainer/CMakeLists.txt +++ b/src/MPIContainer/CMakeLists.txt @@ -22,20 +22,25 @@ INCLUDE_DIRECTORIES( ${PTHREAD_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS} ${OMNIORB_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../NamingService - ${CMAKE_CURRENT_SOURCE_DIR}/../Utils - ${CMAKE_CURRENT_SOURCE_DIR}/../Registry - ${CMAKE_CURRENT_SOURCE_DIR}/../Notification - ${CMAKE_CURRENT_SOURCE_DIR}/../ResourcesManager - ${CMAKE_CURRENT_SOURCE_DIR}/../Container - ${CMAKE_CURRENT_SOURCE_DIR}/../GenericObj - ${PROJECT_BINARY_DIR}/idl + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/NamingService + ${CMAKE_SOURCE_DIR}/src/Utils + ${CMAKE_SOURCE_DIR}/src/Registry + ${CMAKE_SOURCE_DIR}/src/Notification + ${CMAKE_SOURCE_DIR}/src/ResourcesManager + ${CMAKE_SOURCE_DIR}/src/Container + ${CMAKE_SOURCE_DIR}/src/GenericObj ) -SET(COMMON_LIBS +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} + ${MPI_CXX_LIBRARIES} + ${PYTHON_LIBRARIES} Registry SalomeNotification SalomeResourcesManager @@ -46,29 +51,31 @@ SET(COMMON_LIBS SalomeContainer SalomeGenericObj SalomeIDLKernel - ${OMNIORB_LIBRARIES} ) ADD_DEFINITIONS(${MPI_DEFINITIONS} ${OMNIORB_DEFINITIONS}) ADD_LIBRARY(SalomeMPIContainer MPIObject_i.cxx MPIContainer_i.cxx) -TARGET_LINK_LIBRARIES(SalomeMPIContainer ${COMMON_LIBS}) +TARGET_LINK_LIBRARIES(SalomeMPIContainer ${_link_LIBRARIES}) INSTALL(TARGETS SalomeMPIContainer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) ADD_EXECUTABLE(SALOME_MPIContainer SALOME_MPIContainer.cxx) -TARGET_LINK_LIBRARIES(SALOME_MPIContainer SalomeMPIContainer ${COMMON_LIBS} ${PYTHON_LIBRARIES} ${MPI_CXX_LIBRARIES}) - -ADD_EXECUTABLE(testMPI2 testMPI2.cxx) -TARGET_LINK_LIBRARIES(testMPI2 ${MPI_CXX_LIBRARIES}) +TARGET_LINK_LIBRARIES(SALOME_MPIContainer ${_link_LIBRARIES} SalomeMPIContainer) +INSTALL(TARGETS SALOME_MPIContainer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) ADD_EXECUTABLE(getMPIImplementation getMPIImplementation.cxx) TARGET_LINK_LIBRARIES(getMPIImplementation ${MPI_CXX_LIBRARIES}) +INSTALL(TARGETS getMPIImplementation EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) -INSTALL(TARGETS SALOME_MPIContainer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) -INSTALL(TARGETS testMPI2 DESTINATION ${SALOME_INSTALL_BINS}) -INSTALL(TARGETS getMPIImplementation DESTINATION ${SALOME_INSTALL_BINS}) +IF(SALOME_BUILD_TESTS) + ADD_EXECUTABLE(testMPI2 testMPI2.cxx) + TARGET_LINK_LIBRARIES(testMPI2 ${MPI_CXX_LIBRARIES}) + INSTALL(TARGETS testMPI2 DESTINATION ${SALOME_INSTALL_BINS}) + INSTALL(FILES launch_testMPI2.csh + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + DESTINATION ${SALOME_INSTALL_SCRIPT_SCRIPTS}) +ENDIF() -INSTALL(FILES launch_testMPI2.csh PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION ${SALOME_INSTALL_SCRIPT_SCRIPTS}) +INSTALL(FILES MPIContainer_i.hxx MPIObject_i.hxx DESTINATION ${SALOME_INSTALL_HEADERS}) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +UNSET(_link_LIBRARIES) diff --git a/src/ModuleCatalog/CMakeLists.txt b/src/ModuleCatalog/CMakeLists.txt index 3c8a47a22..325d68451 100644 --- a/src/ModuleCatalog/CMakeLists.txt +++ b/src/ModuleCatalog/CMakeLists.txt @@ -21,23 +21,26 @@ INCLUDE_DIRECTORIES( ${PTHREAD_INCLUDE_DIR} ${OMNIORB_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../NamingService - ${CMAKE_CURRENT_SOURCE_DIR}/../Utils - ${PROJECT_BINARY_DIR}/idl + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/NamingService + ${CMAKE_SOURCE_DIR}/src/Utils ) -# This local variable defines the list of dependent libraries common to all target in this package. -SET(COMMON_LIBS +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${OMNIORB_DEFINITIONS}) + +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${LIBXML2_LIBRARIES} + ${OMNIORB_LIBRARIES} SalomeNS OpUtil SALOMELocalTrace SALOMEBasics SalomeIDLKernel - ${LIBXML2_LIBRARIES} - ${PTHREAD_LIBRARIES} ) SET(SalomeCatalog_SOURCES @@ -46,29 +49,33 @@ SET(SalomeCatalog_SOURCES SALOME_ModuleCatalog_impl.cxx SALOME_ModuleCatalog_Acomponent_impl.cxx ) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${OMNIORB_DEFINITIONS}) + +SET(SalomeCatalog_HEADERS + SALOME_ModuleCatalog.hxx + SALOME_ModuleCatalog_Acomponent_impl.hxx + SALOME_ModuleCatalog_impl.hxx +) ADD_LIBRARY(SalomeCatalog ${SalomeCatalog_SOURCES}) -TARGET_LINK_LIBRARIES(SalomeCatalog ${COMMON_LIBS}) +TARGET_LINK_LIBRARIES(SalomeCatalog ${_link_LIBRARIES}) INSTALL(TARGETS SalomeCatalog EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) ADD_EXECUTABLE(SALOME_ModuleCatalog_Server SALOME_ModuleCatalog_Server.cxx) -TARGET_LINK_LIBRARIES(SALOME_ModuleCatalog_Server SalomeCatalog ${COMMON_LIBS} ${OMNIORB_LIBRARIES}) +TARGET_LINK_LIBRARIES(SALOME_ModuleCatalog_Server ${_link_LIBRARIES} SalomeCatalog) ADD_EXECUTABLE(SALOME_ModuleCatalog_Client SALOME_ModuleCatalog_Client.cxx) -TARGET_LINK_LIBRARIES(SALOME_ModuleCatalog_Client SalomeCatalog ${COMMON_LIBS} ${OMNIORB_LIBRARIES}) +TARGET_LINK_LIBRARIES(SALOME_ModuleCatalog_Client ${_link_LIBRARIES} SalomeCatalog) INSTALL(TARGETS SALOME_ModuleCatalog_Server SALOME_ModuleCatalog_Client EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) -# Executable scripts to be installed -SALOME_INSTALL_SCRIPTS(TestModuleCatalog.py ${SALOME_INSTALL_SCRIPT_PYTHON}) +IF(SALOME_BUILD_TESTS) + SALOME_INSTALL_SCRIPTS(TestModuleCatalog.py ${SALOME_INSTALL_SCRIPT_PYTHON}) +ENDIF() -SET(COMMON_HEADERS_HXX - SALOME_ModuleCatalog.hxx - SALOME_ModuleCatalog_Acomponent_impl.hxx - SALOME_ModuleCatalog_impl.hxx - ) +INSTALL(FILES ${SalomeCatalog_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +UNSET(SalomeCatalog_SOURCES) +UNSET(SalomeCatalog_HEADERS) +UNSET(_link_LIBRARIES) diff --git a/src/ModuleCatalog/PathPrefix.hxx b/src/ModuleCatalog/PathPrefix.hxx deleted file mode 100644 index ccc8f7a87..000000000 --- a/src/ModuleCatalog/PathPrefix.hxx +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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 -// - -// SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules -// File : PathPrefix.hxx -// Author : Estelle Deville -// Module : SALOME -// $Header$ -// -#ifndef PATH_PREFIX_H -#define PATH_PREFIX_H - -#include -#include - -struct PathPrefix -{ - string path ; - vector listOfComputer ; -} ; - -typedef vector ListOfPathPrefix ; - -#endif // PATH_PREFIX_H diff --git a/src/NOTIFICATION_SWIG/CMakeLists.txt b/src/NOTIFICATION_SWIG/CMakeLists.txt index c4c4c592a..8f35cedb7 100644 --- a/src/NOTIFICATION_SWIG/CMakeLists.txt +++ b/src/NOTIFICATION_SWIG/CMakeLists.txt @@ -19,23 +19,32 @@ INCLUDE(${SWIG_USE_FILE}) -SET_SOURCE_FILES_PROPERTIES(NOTIFICATION.i PROPERTIES CPLUSPLUS ON) -SET_SOURCE_FILES_PROPERTIES(NOTIFICATION.i PROPERTIES SWIG_FLAGS "-py3") -SET_SOURCE_FILES_PROPERTIES(NOTIFICATIONPYTHON_wrap.cxx PROPERTIES COMPILE_FLAGS "${OMNIORB_DEFINITIONS} -DHAVE_CONFIG_H") - INCLUDE_DIRECTORIES( - ${PYTHON_INCLUDE_DIRS} ${PTHREAD_INCLUDE_DIR} + ${PYTHON_INCLUDE_DIRS} ${OMNIORB_INCLUDE_DIR} + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/Notification ${CMAKE_CURRENT_SOURCE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../Notification - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ) +) + +ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) + +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} + ${PYTHON_LIBRARIES} + SalomeNotification +) # SWIG module name differs from file name - avoid unnecessary rebuild: SET_SOURCE_FILES_PROPERTIES(NOTIFICATION.i PROPERTIES SWIG_MODULE_NAME libNOTIFICATION) +SET_SOURCE_FILES_PROPERTIES(NOTIFICATION.i PROPERTIES CPLUSPLUS ON) +SET_SOURCE_FILES_PROPERTIES(NOTIFICATION.i PROPERTIES SWIG_FLAGS "-py3") +SET_SOURCE_FILES_PROPERTIES(NOTIFICATIONPYTHON_wrap.cxx PROPERTIES COMPILE_FLAGS "${OMNIORB_DEFINITIONS} -DHAVE_CONFIG_H") IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") SWIG_ADD_MODULE(libNOTIFICATION python NOTIFICATION.i NOTIFICATION_Swig.cxx) @@ -43,16 +52,13 @@ ELSE() SWIG_ADD_LIBRARY(libNOTIFICATION LANGUAGE python SOURCES NOTIFICATION.i NOTIFICATION_Swig.cxx) ENDIF() +SWIG_LINK_LIBRARIES(libNOTIFICATION ${_link_LIBRARIES}) -SWIG_LINK_LIBRARIES(libNOTIFICATION ${PYTHON_LIBRARIES} SalomeNotification) -ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) - -IF(${MACHINE} STREQUAL WINDOWS) +IF(WIN32) SET_TARGET_PROPERTIES(_libNOTIFICATION PROPERTIES DEBUG_OUTPUT_NAME _libNOTIFICATION_d) -ENDIF(${MACHINE} STREQUAL WINDOWS) +ENDIF() INSTALL(TARGETS _libNOTIFICATION DESTINATION ${SALOME_INSTALL_PYTHON}) - -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libNOTIFICATION.py DESTINATION ${SALOME_INSTALL_PYTHON}) + +UNSET(_link_LIBRARIES) diff --git a/src/NamingService/CMakeLists.txt b/src/NamingService/CMakeLists.txt index 797ddeb85..5043b0392 100644 --- a/src/NamingService/CMakeLists.txt +++ b/src/NamingService/CMakeLists.txt @@ -20,29 +20,49 @@ INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../Utils - ${PROJECT_BINARY_DIR}/idl - ) + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/Utils +) + +ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) + +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} + SALOMEBasics + OpUtil + SalomeIDLKernel +) SET(SalomeNS_SOURCES + NamingService_WaitForServerReadiness.cxx SALOME_NamingService.cxx ServiceUnreachable.cxx - NamingService_WaitForServerReadiness.cxx ) +SET(SalomeNS_HEADERS + NamingService_WaitForServerReadiness.hxx + SALOME_NamingService_defs.hxx + SALOME_NamingService.hxx + ServiceUnreachable.hxx +) -ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) ADD_LIBRARY(SalomeNS ${SalomeNS_SOURCES}) -ADD_DEPENDENCIES(SalomeNS SalomeIDLKernel) -TARGET_LINK_LIBRARIES(SalomeNS OpUtil) - +TARGET_LINK_LIBRARIES(SalomeNS ${_link_LIBRARIES}) INSTALL(TARGETS SalomeNS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -# Executable scripts to be installed SALOME_INSTALL_SCRIPTS(SALOME_NamingServicePy.py ${SALOME_INSTALL_SCRIPT_PYTHON}) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +INSTALL(FILES ${SalomeNS_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +UNSET(SalomeNS_SOURCES) +UNSET(SalomeNS_HEADERS) +UNSET(_link_LIBRARIES) + +IF(SALOME_BUILD_TESTS) + ADD_SUBDIRECTORY(Test) +ENDIF() diff --git a/src/NamingService/SALOME_NamingService.i b/src/NamingService/SALOME_NamingService.i deleted file mode 100644 index c18b4513b..000000000 --- a/src/NamingService/SALOME_NamingService.i +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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 -// - -// SALOME NamingService : wrapping NamingService services -// File : SALOME_NamingService.i -// Author : Paul RASCLE, EDF -// Module : SALOME -// $Header$ -// -%{ -#include "SALOME_NamingService.hxx" -//#include -#include -#include "ServiceUnreachable.hxx" -%} - -%except(python) -{ - try - { - $function - } - catch (ServiceUnreachable) - { - PyErr_SetString(PyExc_IndexError,"Naming Service Unreacheable"); - return NULL; - } -} - -class SALOME_NamingService -{ -public: - - //! standard constructor - SALOME_NamingService(); - - //! standard destructor - virtual ~SALOME_NamingService(); - - //! initialize ORB reference after default constructor - void init_orb(CORBA::ORB_ptr orb); - - //! method to create an association in the NamingService between an object reference and a path - void Register(CORBA::Object_ptr ObjRef, const char* Path) - throw(ServiceUnreachable); - - //! method to get the ObjRef of a symbolic name - CORBA::Object_ptr Resolve(const char* Path) - throw( ServiceUnreachable); - - //! method to research a name from the naming service's current directory - int Find(const char* name) - throw(ServiceUnreachable); - - //! method to create a directory from the current directory - bool Create_Directory(const char* Path) - throw(ServiceUnreachable); - - //! method to change the current directory to the directory Path indicated in "in" Parameter - bool Change_Directory(const char* Path) - throw(ServiceUnreachable); - - //!method to get the current directory - char* Current_Directory() - throw(ServiceUnreachable); - - //!method to print all the contexts contained from the current directory - void list() - throw(ServiceUnreachable); - - //! method to destroy an association Path-Object Reference - void Destroy_Name(const char* Path) - throw(ServiceUnreachable); - - //! method to destroy a directory if it is empty - virtual void Destroy_Directory(const char* Path) - throw(ServiceUnreachable); -}; - diff --git a/src/NamingService/Test/CMakeLists.txt b/src/NamingService/Test/CMakeLists.txt index 0487f6f91..a5115e0f1 100644 --- a/src/NamingService/Test/CMakeLists.txt +++ b/src/NamingService/Test/CMakeLists.txt @@ -19,60 +19,57 @@ INCLUDE_DIRECTORIES( ${PTHREAD_INCLUDE_DIR} - ${CPPUNIT_INCLUDE_DIRS} + ${CPPUNIT_INCLUDE_DIRS}ti ${OMNIORB_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../../NamingService - ${CMAKE_CURRENT_SOURCE_DIR}/../../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../../Utils - ${CMAKE_CURRENT_SOURCE_DIR}/../../LifeCycleCORBA - ${PROJECT_BINARY_DIR}/idl - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMELocalTrace/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMETraceCollector/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../Utils/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../Basics/Test + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/Basics/Test + ${CMAKE_SOURCE_DIR}/src/Utils + ${CMAKE_SOURCE_DIR}/src/Utils/Test + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace/Test + ${CMAKE_SOURCE_DIR}/src/SALOMETraceCollector + ${CMAKE_SOURCE_DIR}/src/SALOMETraceCollector/Test + ${CMAKE_SOURCE_DIR}/src/NamingService + ${CMAKE_SOURCE_DIR}/src/LifeCycleCORBA ) -# This local variable defines the list of dependent libraries common to all target in this package. -SET(COMMON_LIBS - ${CPPUNIT_LIBRARIES} - SalomeNS - SalomeLifeCycleCORBA - ${OMNIORB_LIBRARIES} - ${PLATFORM_LIBS} +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} + ${CPPUNIT_LIBRARIES} + SalomeNS + SalomeLifeCycleCORBA ) ADD_DEFINITIONS(${CPPUNIT_DEFINITIONS} ${OMNIORB_DEFINITIONS}) + SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/NamingService) ADD_LIBRARY(NamingServiceTest NamingServiceTest.cxx) -TARGET_LINK_LIBRARIES(NamingServiceTest ${COMMON_LIBS}) +TARGET_LINK_LIBRARIES(NamingServiceTest ${_link_LIBRARIES}) INSTALL(TARGETS NamingServiceTest DESTINATION ${KERNEL_TEST_LIB}) -SET(TestNamingService_LIBS +SET(_exe_LIBRARIES + ${_link_LIBRARIES} NamingServiceTest - SalomeNS - SALOMELocalTraceTest - SALOMELocalTrace SALOMETraceCollectorTest + SALOMELocalTraceTest UtilsTest - OpUtil - SALOMEBasics - SalomeIDLKernel - ${COMMON_LIBS} ) ADD_EXECUTABLE(TestNamingService TestNamingService.cxx) -TARGET_LINK_LIBRARIES(TestNamingService ${TestNamingService_LIBS}) +TARGET_LINK_LIBRARIES(TestNamingService ${_exe_LIBRARIES}) INSTALL(TARGETS TestNamingService DESTINATION ${LOCAL_TEST_DIR}) -# Executable scripts to be installed -INSTALL(FILES TestNamingService.py DESTINATION ${LOCAL_TEST_DIR}) - -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${LOCAL_TEST_DIR}) +INSTALL(PROGRAMS TestNamingService.py DESTINATION ${LOCAL_TEST_DIR}) INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${LOCAL_TEST_DIR} RENAME CTestTestfile.cmake) + +UNSET(LOCAL_TEST_DIR) +UNSET(_link_LIBRARIES) +UNSET(_exe_LIBRARIES) diff --git a/src/Notification/CMakeLists.txt b/src/Notification/CMakeLists.txt index 1673b599a..c45a6d4a0 100644 --- a/src/Notification/CMakeLists.txt +++ b/src/Notification/CMakeLists.txt @@ -18,19 +18,23 @@ # INCLUDE_DIRECTORIES( - ${OMNIORB_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../Utils - ) + ${OMNIORB_INCLUDE_DIR} + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/Utils +) + +ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) -SET(COMMON_LIBS +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} OpUtil SALOMELocalTrace SALOMEBasics - ${OMNIORB_LIBRARIES} ) SET(SalomeNotification_SOURCES @@ -39,12 +43,20 @@ SET(SalomeNotification_SOURCES NOTIFICATION_Consumer.cxx ) -ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) +SET(SalomeNotification_HEADERS + CosNotifyShorthands.h + NOTIFICATION_Consumer.hxx + NOTIFICATION.hxx + NOTIFICATION_Supplier.hxx + SALOME_NOTIFICATION.hxx +) ADD_LIBRARY(SalomeNotification ${SalomeNotification_SOURCES}) -TARGET_LINK_LIBRARIES(SalomeNotification ${COMMON_LIBS}) +TARGET_LINK_LIBRARIES(SalomeNotification ${_link_LIBRARIES}) INSTALL(TARGETS SalomeNotification EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -SET(COMMON_HEADERS ${COMMON_HEADERS_HXX} CosNotifyShorthands.h) -INSTALL(FILES ${COMMON_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) +INSTALL(FILES ${SalomeNotification_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +UNSET(SalomeNotification_SOURCES) +UNSET(SalomeNotification_HEADERS) +UNSET(_link_LIBRARIES) diff --git a/src/ParallelContainer/CMakeLists.txt b/src/ParallelContainer/CMakeLists.txt index e92ca7821..333246615 100644 --- a/src/ParallelContainer/CMakeLists.txt +++ b/src/ParallelContainer/CMakeLists.txt @@ -22,22 +22,29 @@ INCLUDE_DIRECTORIES( ${MPI_CXX_INCLUDE_PATH} ${PYTHON_INCLUDE_DIRS} ${PACO_INCLUDE_DIRS} - ${PROJECT_BINARY_DIR}/salome_adm - ${PROJECT_SOURCE_DIR}/src/Container - ${PROJECT_SOURCE_DIR}/src/Notification - ${PROJECT_SOURCE_DIR}/src/SALOMELocalTrace - ${PROJECT_SOURCE_DIR}/src/Basics - ${PROJECT_SOURCE_DIR}/src/NamingService - ${PROJECT_SOURCE_DIR}/src/Registry - ${PROJECT_SOURCE_DIR}/src/Utils - ${PROJECT_SOURCE_DIR}/src/GenericObj - ${CMAKE_CURRENT_SOURCE_DIR}/../HDFPersist - ${PROJECT_BINARY_DIR}/idl - ${PROJECT_SOURCE_DIR}/src/SALOMETraceCollector + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Container + ${CMAKE_SOURCE_DIR}/src/Notification + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/NamingService + ${CMAKE_SOURCE_DIR}/src/Registry + ${CMAKE_SOURCE_DIR}/src/Utils + ${CMAKE_SOURCE_DIR}/src/GenericObj + ${CMAKE_SOURCE_DIR}/src/HDFPersist + ${CMAKE_SOURCE_DIR}/src/SALOMETraceCollector ) -# This local variable defines the list of dependent libraries common to all target in this package. -SET(COMMON_LIBS +ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${MPI_DEFINITIONS}) + +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} + ${PACO_LIBRARIES} + ${PYTHON_LIBRARIES} + ${MPI_CXX_LIBRARIES} SalomeContainer SalomeNS SALOMELocalTrace @@ -45,9 +52,6 @@ SET(COMMON_LIBS SalomeHDFPersist SalomeParallelIDLKernel SalomeIDLKernel - ${OMNIORB_LIBRARIES} - ${PACO_LIBRARIES} - ${PYTHON_LIBRARIES} ) SET(SalomeParallelContainer_SOURCES @@ -58,42 +62,40 @@ SET(SalomeParallelContainer_SOURCES SALOME_ParallelGlobalProcessVar_i.cxx ) -ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${MPI_DEFINITIONS}) - ADD_LIBRARY(SalomeParallelContainer ${SalomeParallelContainer_SOURCES}) -TARGET_LINK_LIBRARIES(SalomeParallelContainer ${COMMON_LIBS} ${MPI_CXX_LIBRARIES}) +TARGET_LINK_LIBRARIES(SalomeParallelContainer ${_link_LIBRARIES}) INSTALL(TARGETS SalomeParallelContainer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) IF(SALOME_USE_MPI) - SET(SALOME_ParallelContainerProxyMpi_LIBS - SalomeParallelContainer - ${MPI_CXX_LIBRARIES} - ${COMMON_LIBS} - ) ADD_EXECUTABLE(SALOME_ParallelContainerProxyMpi SALOME_ParallelContainerProxyMpi.cxx) - TARGET_LINK_LIBRARIES(SALOME_ParallelContainerProxyMpi ${SALOME_ParallelContainerProxyMpi_LIBS}) + TARGET_LINK_LIBRARIES(SALOME_ParallelContainerProxyMpi ${_link_LIBRARIES} SalomeParallelContainer) ADD_EXECUTABLE(SALOME_ParallelContainerNodeMpi SALOME_ParallelContainerNodeMpi.cxx) - TARGET_LINK_LIBRARIES(SALOME_ParallelContainerNodeMpi ${SALOME_ParallelContainerProxyMpi_LIBS}) + TARGET_LINK_LIBRARIES(SALOME_ParallelContainerNodeMpi ${_link_LIBRARIES} SalomeParallelContainer) INSTALL(TARGETS SALOME_ParallelContainerProxyMpi SALOME_ParallelContainerNodeMpi - EXPORT ${PROJECT_NAME}TargetGroup - DESTINATION ${SALOME_INSTALL_BINS}) + EXPORT ${PROJECT_NAME}TargetGroup + DESTINATION ${SALOME_INSTALL_BINS}) ENDIF(SALOME_USE_MPI) -SET(SALOME_ParallelContainerProxyDummy_LIBS - SalomeParallelContainer - ${COMMON_LIBS} -) - ADD_EXECUTABLE(SALOME_ParallelContainerProxyDummy SALOME_ParallelContainerProxyDummy.cxx) -TARGET_LINK_LIBRARIES(SALOME_ParallelContainerProxyDummy ${SALOME_ParallelContainerProxyDummy_LIBS}) +TARGET_LINK_LIBRARIES(SALOME_ParallelContainerProxyDummy ${_link_LIBRARIES} SalomeParallelContainer) ADD_EXECUTABLE(SALOME_ParallelContainerNodeDummy SALOME_ParallelContainerNodeDummy.cxx) -TARGET_LINK_LIBRARIES(SALOME_ParallelContainerNodeDummy ${SALOME_ParallelContainerProxyDummy_LIBS}) +TARGET_LINK_LIBRARIES(SALOME_ParallelContainerNodeDummy ${_link_LIBRARIES} SalomeParallelContainer) INSTALL(TARGETS SALOME_ParallelContainerNodeDummy SALOME_ParallelContainerProxyDummy DESTINATION ${SALOME_INSTALL_BINS}) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +SET(SalomeParallelContainer_HEADERS + Parallel_Salome_file_i.hxx + SALOME_ParallelComponent_i.hxx + SALOME_ParallelContainer_i.hxx + SALOME_ParallelContainerProxy_i.hxx + SALOME_ParallelGlobalProcessVar_i.hxx +) + +INSTALL(FILES ${SalomeParallelContainer_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) +UNSET(SalomeParallelContainer_SOURCES) +UNSET(SalomeParallelContainer_HEADERS) +UNSET(_link_LIBRARIES) diff --git a/src/Registry/CMakeLists.txt b/src/Registry/CMakeLists.txt index 541eaa28a..84fc991ea 100644 --- a/src/Registry/CMakeLists.txt +++ b/src/Registry/CMakeLists.txt @@ -20,33 +20,47 @@ INCLUDE_DIRECTORIES( ${PTHREAD_INCLUDE_DIR} ${OMNIORB_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../NamingService - ${CMAKE_CURRENT_SOURCE_DIR}/../Utils - ${PROJECT_BINARY_DIR}/idl + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/NamingService + ${CMAKE_SOURCE_DIR}/src/Utils ) -ADD_LIBRARY(Registry RegistryConnexion.cxx RegistryService.cxx) ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) -TARGET_LINK_LIBRARIES(Registry SalomeNS OpUtil SALOMELocalTrace SalomeIDLKernel ${PLATFORM_LIBS}) -INSTALL(TARGETS Registry EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -SET(SALOME_Registry_Server_LIBS - SalomeIDLKernel - Registry - SalomeNS - OpUtil - SALOMELocalTrace - SALOMEBasics - ${PLATFORM_LIBS} - ${PTHREAD_LIBRARIES} +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} + OpUtil + SALOMELocalTrace + SalomeIDLKernel + SalomeNS +) + +SET(Registry_SOURCES + RegistryConnexion.cxx + RegistryService.cxx +) + +SET(Registry_HEADERS + RegistryConnexion.hxx + RegistryService.hxx + SALOME_Registry.hxx ) +ADD_LIBRARY(Registry ${Registry_SOURCES}) +TARGET_LINK_LIBRARIES(Registry ${_link_LIBRARIES}) +INSTALL(TARGETS Registry EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) + ADD_EXECUTABLE(SALOME_Registry_Server SALOME_Registry_Server.cxx) -TARGET_LINK_LIBRARIES(SALOME_Registry_Server ${SALOME_Registry_Server_LIBS}) +TARGET_LINK_LIBRARIES(SALOME_Registry_Server ${_link_LIBRARIES} Registry) INSTALL(TARGETS SALOME_Registry_Server EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +INSTALL(FILES ${Registry_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +UNSET(Registry_SOURCES) +UNSET(Registry_HEADERS) +UNSET(_link_LIBRARIES) diff --git a/src/ResourcesManager/CMakeLists.txt b/src/ResourcesManager/CMakeLists.txt index a32527cb4..0ffe136d7 100644 --- a/src/ResourcesManager/CMakeLists.txt +++ b/src/ResourcesManager/CMakeLists.txt @@ -18,52 +18,64 @@ # INCLUDE_DIRECTORIES( - ${LIBXML2_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIR} ${OMNIORB_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../NamingService - ${CMAKE_CURRENT_SOURCE_DIR}/../Utils - ${PROJECT_BINARY_DIR}/idl + ${LIBXML2_INCLUDE_DIR} + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/NamingService + ${CMAKE_SOURCE_DIR}/src/Utils ) - -# This local variable defines the list of dependent libraries common to all target in this package. -SET(COMMON_LIBS - SalomeNS - OpUtil - SALOMEBasics - SalomeIDLKernel - ${LIBXML2_LIBRARIES} -) +ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${LIBXML2_DEFINITIONS}) SET(ResourcesManager_SOURCES - SALOME_ResourcesCatalog_Parser.cxx - SALOME_ResourcesCatalog_Handler.cxx - SALOME_LoadRateManager.cxx - ResourcesManager.cxx + SALOME_ResourcesCatalog_Parser.cxx + SALOME_ResourcesCatalog_Handler.cxx + SALOME_LoadRateManager.cxx + ResourcesManager.cxx ) -ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${LIBXML2_DEFINITIONS}) +SET(ResourcesManager_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${LIBXML2_LIBRARIES} + SALOMEBasics +) ADD_LIBRARY(ResourcesManager ${ResourcesManager_SOURCES}) -TARGET_LINK_LIBRARIES(ResourcesManager SALOMEBasics ${LIBXML2_LIBRARIES}) -INSTALL(TARGETS ResourcesManager EXPORT ${PROJECT_NAME}TargetGroup - DESTINATION ${SALOME_INSTALL_LIBS}) +TARGET_LINK_LIBRARIES(ResourcesManager ${ResourcesManager_LIBRARIES}) +INSTALL(TARGETS ResourcesManager + EXPORT ${PROJECT_NAME}TargetGroup + DESTINATION ${SALOME_INSTALL_LIBS}) SET(SalomeResourcesManager_SOURCES SALOME_ResourcesManager.cxx SALOME_ResourcesManager_Client.cxx SALOME_ResourcesManager_Common.cxx ) + +SET(SalomeResourcesManager_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${LIBXML2_LIBRARIES} + ${OMNIORB_LIBRARIES} + SALOMEBasics + SalomeNS + OpUtil + SalomeIDLKernel + ResourcesManager +) + ADD_LIBRARY(SalomeResourcesManager ${SalomeResourcesManager_SOURCES}) -TARGET_LINK_LIBRARIES(SalomeResourcesManager ResourcesManager ${COMMON_LIBS}) -INSTALL(TARGETS SalomeResourcesManager EXPORT ${PROJECT_NAME}TargetGroup +TARGET_LINK_LIBRARIES(SalomeResourcesManager ${SalomeResourcesManager_LIBRARIES}) +INSTALL(TARGETS SalomeResourcesManager + EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -SET(COMMON_HEADERS_HXX +SET(ResourcesManager_HEADERS ResourcesManager.hxx ResourcesManager_Defs.hxx SALOME_LoadRateManager.hxx @@ -71,5 +83,12 @@ SET(COMMON_HEADERS_HXX SALOME_ResourcesManager.hxx SALOME_ResourcesManager_Client.hxx SALOME_ResourcesManager_Common.hxx - ) -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +) + +INSTALL(FILES ${ResourcesManager_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +UNSET(ResourcesManager_SOURCES) +UNSET(ResourcesManager_LIBRARIES) +UNSET(SalomeResourcesManager_SOURCES) +UNSET(SalomeResourcesManager_LIBRARIES) +UNSET(ResourcesManager_HEADERS) diff --git a/src/SALOMEDS/CMakeLists.txt b/src/SALOMEDS/CMakeLists.txt index 5423648ec..af9347489 100644 --- a/src/SALOMEDS/CMakeLists.txt +++ b/src/SALOMEDS/CMakeLists.txt @@ -22,21 +22,21 @@ INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} ${HDF5_INCLUDE_DIRS} ${Boost_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../HDFPersist - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../KernelHelpers - ${CMAKE_CURRENT_SOURCE_DIR}/../Utils - ${CMAKE_CURRENT_SOURCE_DIR}/../DF - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMEDSImpl - ${CMAKE_CURRENT_SOURCE_DIR}/../NamingService - ${CMAKE_CURRENT_SOURCE_DIR}/../GenericObj - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMEDSClient - ${CMAKE_CURRENT_SOURCE_DIR}/../LifeCycleCORBA - ${CMAKE_CURRENT_SOURCE_DIR}/../TOOLSDS - ${CMAKE_CURRENT_SOURCE_DIR}/../Container - ${PROJECT_BINARY_DIR}/idl + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/HDFPersist + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/KernelHelpers + ${CMAKE_SOURCE_DIR}/src/Utils + ${CMAKE_SOURCE_DIR}/src/DF + ${CMAKE_SOURCE_DIR}/src/SALOMEDSImpl + ${CMAKE_SOURCE_DIR}/src/NamingService + ${CMAKE_SOURCE_DIR}/src/GenericObj + ${CMAKE_SOURCE_DIR}/src/SALOMEDSClient + ${CMAKE_SOURCE_DIR}/src/LifeCycleCORBA + ${CMAKE_SOURCE_DIR}/src/TOOLSDS + ${CMAKE_SOURCE_DIR}/src/Container ) ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${HDF5_DEFINITIONS} ${BOOST_DEFINITIONS}) @@ -44,7 +44,11 @@ IF(WIN32) ADD_DEFINITIONS(-DNOGDI) ENDIF(WIN32) -SET(COMMON_LIBS +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${HDF5_C_LIBRARIES} + ${OMNIORB_LIBRARIES} TOOLSDS SalomeNS OpUtil @@ -58,7 +62,6 @@ SET(COMMON_LIBS SalomeLifeCycleCORBA SalomeIDLKernel SalomeDSClient - ${HDF5_C_LIBRARIES} ) SET(SalomeDS_SOURCES @@ -146,25 +149,23 @@ SET(SalomeDS_SOURCES SALOMEDS_IParameters.cxx ) - ADD_LIBRARY(SalomeDS ${SalomeDS_SOURCES}) -TARGET_LINK_LIBRARIES(SalomeDS ${COMMON_LIBS}) +TARGET_LINK_LIBRARIES(SalomeDS ${_link_LIBRARIES}) INSTALL(TARGETS SalomeDS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) ADD_EXECUTABLE(SALOMEDS_Server SALOMEDS_Server.cxx) -TARGET_LINK_LIBRARIES(SALOMEDS_Server SalomeDS SALOMEBasics ${COMMON_LIBS} ${OMNIORB_LIBRARIES}) - -ADD_EXECUTABLE(SALOMEDS_Client SALOMEDS_Client.cxx) -TARGET_LINK_LIBRARIES(SALOMEDS_Client SalomeDS SALOMEBasics ${COMMON_LIBS} ${OMNIORB_LIBRARIES}) +TARGET_LINK_LIBRARIES(SALOMEDS_Server SalomeDS SALOMEBasics ${_link_LIBRARIES}) +INSTALL(TARGETS SALOMEDS_Server EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) -INSTALL(TARGETS SALOMEDS_Server SALOMEDS_Client - EXPORT ${PROJECT_NAME}TargetGroup - DESTINATION ${SALOME_INSTALL_BINS}) +IF(SALOME_BUILD_TESTS) + ADD_EXECUTABLE(SALOMEDS_Client SALOMEDS_Client.cxx) + TARGET_LINK_LIBRARIES(SALOMEDS_Client SalomeDS SALOMEBasics ${_link_LIBRARIES}) + INSTALL(TARGETS SALOMEDS_Client DESTINATION ${SALOME_INSTALL_BINS}) +ENDIF() -# Executable scripts to be installed SALOME_INSTALL_SCRIPTS(SALOME_DriverPy.py ${SALOME_INSTALL_SCRIPT_PYTHON}) -SET(COMMON_HEADERS_HXX +SET(SALOMEDS_HEADERS SALOMEDS_Driver_i.hxx SALOMEDS_Study_i.hxx SALOMEDS_Study.hxx @@ -179,4 +180,13 @@ SET(COMMON_HEADERS_HXX SALOMEDS_wrap.hxx SALOMEDS_Attributes_wrap.hxx ) -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) + +INSTALL(FILES ${SALOMEDS_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +UNSET(SalomeDS_SOURCES) +UNSET(SALOMEDS_HEADERS) +UNSET(_link_LIBRARIES) + +IF(SALOME_BUILD_TESTS) + ADD_SUBDIRECTORY(Test) +ENDIF() diff --git a/src/SALOMEDS/Test/CMakeLists.txt b/src/SALOMEDS/Test/CMakeLists.txt index bec056549..ed1d3dbc5 100644 --- a/src/SALOMEDS/Test/CMakeLists.txt +++ b/src/SALOMEDS/Test/CMakeLists.txt @@ -22,72 +22,65 @@ INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../../Basics/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMELocalTrace/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMETraceCollector - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMETraceCollector/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../NamingService - ${CMAKE_CURRENT_SOURCE_DIR}/../../NamingService/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../Utils - ${CMAKE_CURRENT_SOURCE_DIR}/../../Utils/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../ResourcesManager - ${CMAKE_CURRENT_SOURCE_DIR}/../../LifeCycleCORBA - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMEDS - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMEDSClient - ${CMAKE_CURRENT_SOURCE_DIR}/../../DF - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMEDSImpl - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMEDSImpl/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../GenericObj - ${PROJECT_BINARY_DIR}/idl + ${HDF5_INCLUDE_DIRS} + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/SALOMETraceCollector + ${CMAKE_SOURCE_DIR}/src/NamingService + ${CMAKE_SOURCE_DIR}/src/Utils + ${CMAKE_SOURCE_DIR}/src/ResourcesManager + ${CMAKE_SOURCE_DIR}/src/LifeCycleCORBA + ${CMAKE_SOURCE_DIR}/src/SALOMEDS + ${CMAKE_SOURCE_DIR}/src/SALOMEDSClient + ${CMAKE_SOURCE_DIR}/src/DF + ${CMAKE_SOURCE_DIR}/src/SALOMEDSImpl + ${CMAKE_SOURCE_DIR}/src/GenericObj ) -# This local variable defines the list of dependent libraries common to all target in this package. -SET(COMMON_LIBS - ${CPPUNIT_LIBRARIES} - SALOMEBasics - SalomeResourcesManager - SalomeContainer - SalomeNS - Registry - SalomeNotification - UtilsTest - OpUtil - SALOMELocalTraceTest - SALOMELocalTrace - SALOMETraceCollectorTest - SALOMEDSImplTest - DF - SalomeDSImpl - SalomeDSClient - SalomeDS - SalomeGenericObj - SalomeIDLKernel -) - -ADD_DEFINITIONS(${CPPUNIT_DEFINITIONS} ${OMNIORB_DEFINITIONS} ${BOOST_DEFINITIONS}) -SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/SALOMEDS) - +ADD_DEFINITIONS(${CPPUNIT_DEFINITIONS} ${OMNIORB_DEFINITIONS} ${HDF5_DEFINITIONS} ${BOOST_DEFINITIONS}) IF(WIN32) ADD_DEFINITIONS(-DNOGDI) ENDIF(WIN32) +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${HDF5_C_LIBRARIES} + ${OMNIORB_LIBRARIES} + ${CPPUNIT_LIBRARIES} + SALOMEBasics + SalomeResourcesManager + SalomeContainer + SalomeNS + Registry + SalomeNotification + OpUtil + SALOMELocalTrace + DF + SalomeDSImpl + SalomeDSClient + SalomeDS + SalomeGenericObj + SalomeIDLKernel +) + +SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/SALOMEDS) + ADD_LIBRARY(SALOMEDSTest SALOMEDSTest.cxx) -TARGET_LINK_LIBRARIES(SALOMEDSTest ${COMMON_LIBS}) +TARGET_LINK_LIBRARIES(SALOMEDSTest ${_link_LIBRARIES}) INSTALL(TARGETS SALOMEDSTest DESTINATION ${KERNEL_TEST_LIB}) ADD_EXECUTABLE(TestSALOMEDS TestSALOMEDS.cxx) -TARGET_LINK_LIBRARIES(TestSALOMEDS SALOMEDSTest SALOMEBasics ${COMMON_LIBS} ${OMNIORB_LIBRARIES}) +TARGET_LINK_LIBRARIES(TestSALOMEDS ${_link_LIBRARIES} SALOMEDSTest) INSTALL(TARGETS TestSALOMEDS DESTINATION ${LOCAL_TEST_DIR}) -# Executable scripts to be installed INSTALL(FILES TestSALOMEDS.py DESTINATION ${LOCAL_TEST_DIR}) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${LOCAL_TEST_DIR}) - INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${LOCAL_TEST_DIR} - RENAME CTestTestfile.cmake) \ No newline at end of file + RENAME CTestTestfile.cmake) + +UNSET(LOCAL_TEST_DIR) +UNSET(_link_LIBRARIES) diff --git a/src/SALOMEDS/Test/TestSALOMEDS.cxx b/src/SALOMEDS/Test/TestSALOMEDS.cxx index 23157cbef..acc030240 100644 --- a/src/SALOMEDS/Test/TestSALOMEDS.cxx +++ b/src/SALOMEDS/Test/TestSALOMEDS.cxx @@ -20,10 +20,6 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// --- include all SALOMEDS Test from basics until the present directory -// -#include "SALOMELocalTraceTest.hxx" -#include "SALOMEDSImplTest.hxx" #include "SALOMEDSTest.hxx" // --- Registers the fixture into the 'registry' diff --git a/src/SALOMEDSClient/CMakeLists.txt b/src/SALOMEDSClient/CMakeLists.txt index 8b17fb7cf..8e7915875 100644 --- a/src/SALOMEDSClient/CMakeLists.txt +++ b/src/SALOMEDSClient/CMakeLists.txt @@ -20,15 +20,72 @@ INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} ${Boost_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${PROJECT_BINARY_DIR}/idl + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl ) -ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) +ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${BOOST_DEFINITIONS}) + +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} + SalomeIDLKernel +) + +SET(SalomeDSClient_HEADERS + SALOMEDSClient_AttributeComment.hxx + SALOMEDSClient_AttributeDrawable.hxx + SALOMEDSClient_AttributeExpandable.hxx + SALOMEDSClient_AttributeExternalFileDef.hxx + SALOMEDSClient_AttributeFileType.hxx + SALOMEDSClient_AttributeFlags.hxx + SALOMEDSClient_AttributeGraphic.hxx + SALOMEDSClient_AttributeInteger.hxx + SALOMEDSClient_AttributeIOR.hxx + SALOMEDSClient_AttributeLocalID.hxx + SALOMEDSClient_AttributeName.hxx + SALOMEDSClient_AttributeOpened.hxx + SALOMEDSClient_AttributeParameter.hxx + SALOMEDSClient_AttributePersistentRef.hxx + SALOMEDSClient_AttributePixMap.hxx + SALOMEDSClient_AttributePythonObject.hxx + SALOMEDSClient_AttributeReal.hxx + SALOMEDSClient_AttributeSelectable.hxx + SALOMEDSClient_AttributeSequenceOfInteger.hxx + SALOMEDSClient_AttributeSequenceOfReal.hxx + SALOMEDSClient_AttributeString.hxx + SALOMEDSClient_AttributeStudyProperties.hxx + SALOMEDSClient_AttributeTable.hxx + SALOMEDSClient_AttributeTableOfInteger.hxx + SALOMEDSClient_AttributeTableOfReal.hxx + SALOMEDSClient_AttributeTableOfString.hxx + SALOMEDSClient_AttributeTarget.hxx + SALOMEDSClient_AttributeTextColor.hxx + SALOMEDSClient_AttributeTextHighlightColor.hxx + SALOMEDSClient_AttributeTreeNode.hxx + SALOMEDSClient_AttributeUserID.hxx + SALOMEDSClient_ChildIterator.hxx + SALOMEDSClient_ClientFactory.hxx + SALOMEDSClient_definitions.hxx + SALOMEDSClient_GenericAttribute.hxx + SALOMEDSClient.hxx + SALOMEDSClient_IParameters.hxx + SALOMEDSClient_Observer.hxx + SALOMEDSClient_SComponent.hxx + SALOMEDSClient_SComponentIterator.hxx + SALOMEDSClient_SObject.hxx + SALOMEDSClient_StudyBuilder.hxx + SALOMEDSClient_Study.hxx + SALOMEDSClient_UseCaseBuilder.hxx + SALOMEDSClient_UseCaseIterator.hxx +) ADD_LIBRARY(SalomeDSClient SALOMEDSClient_ClientFactory.cxx) -TARGET_LINK_LIBRARIES(SalomeDSClient SalomeIDLKernel ${PLATFORM_LIBS}) +TARGET_LINK_LIBRARIES(SalomeDSClient ${_link_LIBRARIES}) INSTALL(TARGETS SalomeDSClient EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +INSTALL(FILES ${SalomeDSClient_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +UNSET(SalomeDSClient_HEADERS) +UNSET(_link_LIBRARIES) diff --git a/src/SALOMEDSImpl/CMakeLists.txt b/src/SALOMEDSImpl/CMakeLists.txt index 7362489c2..790723413 100644 --- a/src/SALOMEDSImpl/CMakeLists.txt +++ b/src/SALOMEDSImpl/CMakeLists.txt @@ -21,22 +21,24 @@ INCLUDE_DIRECTORIES( ${PTHREAD_INCLUDE_DIR} ${HDF5_INCLUDE_DIRS} ${Boost_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../HDFPersist - ${CMAKE_CURRENT_SOURCE_DIR}/../DF - ${PROJECT_BINARY_DIR} + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/HDFPersist + ${CMAKE_SOURCE_DIR}/src/DF ) -# This local variable defines the list of FLAGS common to all target in this package. -ADD_DEFINITIONS(${BOOST_DEFINITIONS}) -# This local variable defines the list of dependent libraries common to all target in this package. -SET(COMMON_LIBS +ADD_DEFINITIONS(${HDF5_DEFINITIONS} ${BOOST_DEFINITIONS}) + +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${HDF5_C_LIBRARIES} SALOMEBasics + SALOMELocalTrace SalomeHDFPersist DF - ${HDF5_C_LIBRARIES} ) SET(SalomeDSImpl_SOURCES @@ -90,20 +92,77 @@ SET(SalomeDSImpl_SOURCES SALOMEDSImpl_ScalarVariable.cxx ) +SET(SalomeDSImpl_HEADERS + SALOMEDSImpl_AttributeComment.hxx + SALOMEDSImpl_AttributeDrawable.hxx + SALOMEDSImpl_AttributeExpandable.hxx + SALOMEDSImpl_AttributeExternalFileDef.hxx + SALOMEDSImpl_AttributeFileType.hxx + SALOMEDSImpl_AttributeFlags.hxx + SALOMEDSImpl_AttributeGraphic.hxx + SALOMEDSImpl_AttributeInteger.hxx + SALOMEDSImpl_AttributeIOR.hxx + SALOMEDSImpl_AttributeLocalID.hxx + SALOMEDSImpl_AttributeName.hxx + SALOMEDSImpl_AttributeOpened.hxx + SALOMEDSImpl_AttributeParameter.hxx + SALOMEDSImpl_AttributePersistentRef.hxx + SALOMEDSImpl_AttributePixMap.hxx + SALOMEDSImpl_AttributePythonObject.hxx + SALOMEDSImpl_AttributeReal.hxx + SALOMEDSImpl_AttributeReference.hxx + SALOMEDSImpl_AttributeSelectable.hxx + SALOMEDSImpl_AttributeSequenceOfInteger.hxx + SALOMEDSImpl_AttributeSequenceOfReal.hxx + SALOMEDSImpl_Attributes.hxx + SALOMEDSImpl_AttributeString.hxx + SALOMEDSImpl_AttributeStudyProperties.hxx + SALOMEDSImpl_AttributeTable.hxx + SALOMEDSImpl_AttributeTableOfInteger.hxx + SALOMEDSImpl_AttributeTableOfReal.hxx + SALOMEDSImpl_AttributeTableOfString.hxx + SALOMEDSImpl_AttributeTarget.hxx + SALOMEDSImpl_AttributeTextColor.hxx + SALOMEDSImpl_AttributeTextHighlightColor.hxx + SALOMEDSImpl_AttributeTreeNode.hxx + SALOMEDSImpl_AttributeUserID.hxx + SALOMEDSImpl_Callback.hxx + SALOMEDSImpl_ChildIterator.hxx + SALOMEDSImpl_ChildNodeIterator.hxx + SALOMEDSImpl_Defines.hxx + SALOMEDSImpl_Driver.hxx + SALOMEDSImpl_GenericAttribute.hxx + SALOMEDSImpl_GenericVariable.hxx + SALOMEDSImpl_IParameters.hxx + SALOMEDSImpl_ScalarVariable.hxx + SALOMEDSImpl_SComponent.hxx + SALOMEDSImpl_SComponentIterator.hxx + SALOMEDSImpl_SObject.hxx + SALOMEDSImpl_StudyBuilder.hxx + SALOMEDSImpl_Study.hxx + SALOMEDSImpl_TMPFile.hxx + SALOMEDSImpl_UseCaseBuilder.hxx + SALOMEDSImpl_UseCaseIterator.hxx +) +# SALOMEDSImpl_Tool.hxx +# SALOMEDSImpl_StudyHandle.hxx + ADD_LIBRARY(SalomeDSImpl ${SalomeDSImpl_SOURCES}) -TARGET_LINK_LIBRARIES(SalomeDSImpl SALOMELocalTrace ${COMMON_LIBS} ${PLATFORM_LIBS}) +TARGET_LINK_LIBRARIES(SalomeDSImpl ${_link_LIBRARIES}) INSTALL(TARGETS SalomeDSImpl EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -ADD_EXECUTABLE(testDS testDS.cxx) -TARGET_LINK_LIBRARIES(testDS SalomeDSImpl ${COMMON_LIBS} ${PLATFORM_LIBS}) -INSTALL(TARGETS testDS DESTINATION ${SALOME_INSTALL_BINS}) +IF(SALOME_BUILD_TESTS) + ADD_EXECUTABLE(testDS testDS.cxx) + TARGET_LINK_LIBRARIES(testDS ${_link_LIBRARIES} SalomeDSImpl) + INSTALL(TARGETS testDS DESTINATION ${SALOME_INSTALL_BINS}) +ENDIF() -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -SET(NOINST_HEADERS_HXX - SALOMEDSImpl_Tool.hxx - SALOMEDSImpl_StudyHandle.hxx -) -FOREACH(HEADER ${NOINST_HEADERS_HXX}) - LIST(REMOVE_ITEM COMMON_HEADERS_HXX ${CMAKE_CURRENT_SOURCE_DIR}/${HEADER}) -ENDFOREACH(HEADER ${NOINST_HEADERS_HXX}) -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +INSTALL(FILES ${SalomeDSImpl_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +UNSET(_link_LIBRARIES) +UNSET(SalomeDSImpl_SOURCES) +UNSET(SalomeDSImpl_HEADERS) + +IF(SALOME_BUILD_TESTS) + ADD_SUBDIRECTORY(Test) +ENDIF() diff --git a/src/SALOMEDSImpl/Test/CMakeLists.txt b/src/SALOMEDSImpl/Test/CMakeLists.txt index 33b649df4..5fc71020f 100644 --- a/src/SALOMEDSImpl/Test/CMakeLists.txt +++ b/src/SALOMEDSImpl/Test/CMakeLists.txt @@ -20,62 +20,44 @@ INCLUDE_DIRECTORIES( ${CPPUNIT_INCLUDE_DIRS} ${Boost_INCLUDE_DIR} - ${OMNIORB_INCLUDE_DIR} + ${HDF5_INCLUDE_DIRS} ${PTHREAD_INCLUDE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/../../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../../Basics/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMELocalTrace/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMETraceCollector - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMETraceCollector/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../NamingService - ${CMAKE_CURRENT_SOURCE_DIR}/../../NamingService/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../Utils - ${CMAKE_CURRENT_SOURCE_DIR}/../../Utils/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../ResourcesManager - ${CMAKE_CURRENT_SOURCE_DIR}/../../LifeCycleCORBA - ${CMAKE_CURRENT_SOURCE_DIR}/../../DF - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMEDSImpl - ${PROJECT_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/Basics/Test + ${CMAKE_SOURCE_DIR}/src/DF + ${CMAKE_SOURCE_DIR}/src/SALOMEDSImpl + ${CMAKE_BINARY_DIR}/idl ) -# This local variable defines the list of dependent libraries common to all target in this package. -SET(COMMON_LIBS +ADD_DEFINITIONS(${CPPUNIT_DEFINITIONS} ${BOOST_DEFINITIONS}) + +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${HDF5_C_LIBRARIES} ${CPPUNIT_LIBRARIES} SALOMEBasics - SalomeResourcesManager - SalomeContainer - SalomeNS - Registry - SalomeNotification - UtilsTest - OpUtil - SALOMELocalTraceTest SALOMELocalTrace - SALOMETraceCollectorTest + SalomeHDFPersist DF SalomeDSImpl - SalomeHDFPersist - SalomeIDLKernel ) -ADD_DEFINITIONS(${CPPUNIT_DEFINITIONS} ${OMNIORB_DEFINITIONS} ${BOOST_DEFINITIONS}) SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/SALOMEDSImpl) ADD_LIBRARY(SALOMEDSImplTest SALOMEDSImplTest.cxx) -TARGET_LINK_LIBRARIES(SALOMEDSImplTest ${COMMON_LIBS}) +TARGET_LINK_LIBRARIES(SALOMEDSImplTest ${_link_LIBRARIES}) INSTALL(TARGETS SALOMEDSImplTest DESTINATION ${KERNEL_TEST_LIB}) ADD_EXECUTABLE(TestSALOMEDSImpl TestSALOMEDSImpl.cxx) -TARGET_LINK_LIBRARIES(TestSALOMEDSImpl SALOMEDSImplTest SalomeDSImpl NamingServiceTest ${COMMON_LIBS}) +TARGET_LINK_LIBRARIES(TestSALOMEDSImpl ${_link_LIBRARIES} SALOMEDSImplTest) INSTALL(TARGETS TestSALOMEDSImpl DESTINATION ${LOCAL_TEST_DIR}) -# Executable scripts to be installed INSTALL(FILES TestSALOMEDSImpl.py DESTINATION ${LOCAL_TEST_DIR}) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${LOCAL_TEST_DIR}) - INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${LOCAL_TEST_DIR} - RENAME CTestTestfile.cmake) \ No newline at end of file + RENAME CTestTestfile.cmake) + +UNSET(_link_LIBRARIES) +UNSET(LOCAL_TEST_DIR) diff --git a/src/SALOMEDSImpl/Test/SALOMEDSImplTest.cxx b/src/SALOMEDSImpl/Test/SALOMEDSImplTest.cxx index e89103367..9b6ad9e04 100644 --- a/src/SALOMEDSImpl/Test/SALOMEDSImplTest.cxx +++ b/src/SALOMEDSImpl/Test/SALOMEDSImplTest.cxx @@ -27,7 +27,6 @@ #include #include #include -#include "utilities.h" #include "SALOMEDSImpl_AttributeParameter.hxx" #include "SALOMEDSImpl_Study.hxx" diff --git a/src/SALOMELocalTrace/CMakeLists.txt b/src/SALOMELocalTrace/CMakeLists.txt index bb523aa18..177794264 100644 --- a/src/SALOMELocalTrace/CMakeLists.txt +++ b/src/SALOMELocalTrace/CMakeLists.txt @@ -19,31 +19,39 @@ INCLUDE_DIRECTORIES( ${PTHREAD_INCLUDE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${PTHREAD_INCLUDE_DIR} + ${CMAKE_SOURCE_DIR}/src/Basics ) -SET(COMMON_HEADERS - utilities.h - LocalTraceBufferPool.hxx +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + SALOMEBasics +) + +SET(SALOMELocalTrace_HEADERS BaseTraceCollector.hxx + LocalTraceBufferPool.hxx SALOME_LocalTrace.hxx + utilities.h ) SET(SALOMELocalTrace_SOURCES BaseTraceCollector.cxx - BaseTraceCollector.hxx - LocalTraceCollector.cxx - LocalTraceCollector.hxx FileTraceCollector.cxx - FileTraceCollector.hxx LocalTraceBufferPool.cxx - LocalTraceBufferPool.hxx - SALOME_LocalTrace.hxx + LocalTraceCollector.cxx ) ADD_LIBRARY(SALOMELocalTrace ${SALOMELocalTrace_SOURCES}) -TARGET_LINK_LIBRARIES(SALOMELocalTrace SALOMEBasics ${PLATFORM_LIBS} ${PTHREAD_LIBRARIES}) +TARGET_LINK_LIBRARIES(SALOMELocalTrace ${_link_LIBRARIES}) INSTALL(TARGETS SALOMELocalTrace EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -INSTALL(FILES ${COMMON_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) +INSTALL(FILES ${SALOMELocalTrace_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +UNSET(SALOMELocalTrace_SOURCES) +UNSET(SALOMELocalTrace_HEADERS) +UNSET(_link_LIBRARIES) + +IF(SALOME_BUILD_TESTS) + ADD_SUBDIRECTORY(Test) +ENDIF() diff --git a/src/SALOMELocalTrace/LocalTraceBufferPool.hxx b/src/SALOMELocalTrace/LocalTraceBufferPool.hxx index 949fd1546..dc4da6194 100644 --- a/src/SALOMELocalTrace/LocalTraceBufferPool.hxx +++ b/src/SALOMELocalTrace/LocalTraceBufferPool.hxx @@ -39,7 +39,7 @@ #include #endif #include "BaseTraceCollector.hxx" -#include "BasicsGenericDestructor.hxx" +#include "Basics_GenericDestructor.hxx" #define BRIEF_MESS 2 #define ABORT_MESS 1 // for traceType field in struct LocalTrace_TraceInfo diff --git a/src/SALOMELocalTrace/Test/CMakeLists.txt b/src/SALOMELocalTrace/Test/CMakeLists.txt index 76bb3d9d7..d947d808c 100644 --- a/src/SALOMELocalTrace/Test/CMakeLists.txt +++ b/src/SALOMELocalTrace/Test/CMakeLists.txt @@ -18,30 +18,37 @@ # INCLUDE_DIRECTORIES( - ${CPPUNIT_INCLUDE_DIRS} ${PTHREAD_INCLUDE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/../../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../../Basics/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMELocalTrace + ${CPPUNIT_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/Basics/Test + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace ) ADD_DEFINITIONS(${CPPUNIT_DEFINITIONS}) + +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${CPPUNIT_LIBRARIES} + SALOMELocalTrace +) + SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/SALOMELocalTrace) ADD_LIBRARY(SALOMELocalTraceTest SALOMELocalTraceTest.cxx) -TARGET_LINK_LIBRARIES(SALOMELocalTraceTest SALOMELocalTrace ${CPPUNIT_LIBRARIES} ${PTHREAD_LIBRARIES} ${PLATFORM_LIBS}) +TARGET_LINK_LIBRARIES(SALOMELocalTraceTest ${_link_LIBRARIES}) INSTALL(TARGETS SALOMELocalTraceTest DESTINATION ${KERNEL_TEST_LIB}) ADD_EXECUTABLE(TestSALOMELocalTrace TestSALOMELocalTrace.cxx) -TARGET_LINK_LIBRARIES(TestSALOMELocalTrace SALOMELocalTraceTest SALOMELocalTrace SALOMEBasics ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS}) +TARGET_LINK_LIBRARIES(TestSALOMELocalTrace ${_link_LIBRARIES} SALOMELocalTraceTest) INSTALL(TARGETS TestSALOMELocalTrace DESTINATION ${LOCAL_TEST_DIR}) -# Executable scripts to be installed INSTALL(FILES TestSALOMELocalTrace.py DESTINATION ${LOCAL_TEST_DIR}) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${LOCAL_TEST_DIR}) - INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${LOCAL_TEST_DIR} - RENAME CTestTestfile.cmake) \ No newline at end of file + RENAME CTestTestfile.cmake) + +UNSET(LOCAL_TEST_DIR) +UNSET(_link_LIBRARIES) diff --git a/src/SALOMELocalTrace/Test/TestSALOMELocalTrace.py b/src/SALOMELocalTrace/Test/TestSALOMELocalTrace.py index 3df01a4dd..daf8fef94 100644 --- a/src/SALOMELocalTrace/Test/TestSALOMELocalTrace.py +++ b/src/SALOMELocalTrace/Test/TestSALOMELocalTrace.py @@ -23,7 +23,6 @@ import sys, signal,string,subprocess import subprocess -import runSalome import setenv # get SALOME environment : diff --git a/src/SALOMESDS/CMakeLists.txt b/src/SALOMESDS/CMakeLists.txt index 737f21eec..1a2ccf8d8 100644 --- a/src/SALOMESDS/CMakeLists.txt +++ b/src/SALOMESDS/CMakeLists.txt @@ -22,18 +22,26 @@ INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS} - ${PROJECT_BINARY_DIR}/idl - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../Utils - ${CMAKE_CURRENT_SOURCE_DIR}/../NamingService - ${CMAKE_CURRENT_SOURCE_DIR}/../Launcher - ${CMAKE_CURRENT_SOURCE_DIR}/../Container - ${CMAKE_CURRENT_SOURCE_DIR}/../ResourcesManager + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_SOURCE_DIR}/src/Utils + ${CMAKE_SOURCE_DIR}/src/NamingService + ${CMAKE_SOURCE_DIR}/src/Launcher + ${CMAKE_SOURCE_DIR}/src/Container + ${CMAKE_SOURCE_DIR}/src/ResourcesManager ) -ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${PYTHON_DEFINITIONS}) +ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) -SET(COMMON_LIBS SalomeNS SalomeContainer SalomeIDLKernel ${OMNIORB_LIBRARIES} ${PYTHON_LIBRARIES}) +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} + ${PYTHON_LIBRARIES} + SalomeNS + SalomeContainer + SalomeIDLKernel +) SET(SalomeSDS_SOURCES SALOMESDS_Exception.cxx @@ -50,19 +58,48 @@ SET(SalomeSDS_SOURCES SALOMESDS_Transaction.cxx SALOMESDS_KeyWaiter.cxx SALOMESDS_Sha1Keeper.cxx - ) +) ADD_LIBRARY(SalomeSDS ${SalomeSDS_SOURCES}) -TARGET_LINK_LIBRARIES(SalomeSDS ${COMMON_LIBS} ${PTHREAD_LIBRARIES}) +TARGET_LINK_LIBRARIES(SalomeSDS ${_link_LIBRARIES}) INSTALL(TARGETS SalomeSDS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) ADD_EXECUTABLE(SALOME_DataScopeServer SALOME_DataScopeServer.cxx) -TARGET_LINK_LIBRARIES(SALOME_DataScopeServer SalomeSDS) -INSTALL(TARGETS SALOME_DataScopeServer DESTINATION ${SALOME_INSTALL_BINS}) +TARGET_LINK_LIBRARIES(SALOME_DataScopeServer ${_link_LIBRARIES} SalomeSDS) +INSTALL(TARGETS SALOME_DataScopeServer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) + INSTALL(FILES SalomeSDSClt.py SALOMEWrappedStdType.py DESTINATION ${SALOME_INSTALL_BINS}) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) -# tests part -SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/SALOMESDS) -INSTALL(FILES TestSalomeSDS.py TestSalomeSDSHelper0.py DESTINATION ${LOCAL_TEST_DIR}) -INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${LOCAL_TEST_DIR} RENAME CTestTestfile.cmake) + +SET(SalomeSDS_HEADERS + SALOMESDS_Auto.hxx + SALOMESDS_AutoRefCountPtr.hxx + SALOMESDS_BasicDataServer.hxx + SALOMESDS_DataScopeServer.hxx + SALOMESDS_DataServerManager.hxx + SALOMESDS_Defines.hxx + SALOMESDS_Exception.hxx + SALOMESDS_KeyWaiter.hxx + SALOMESDS_PickelizedPyObjRdExtInitServer.hxx + SALOMESDS_PickelizedPyObjRdExtServer.hxx + SALOMESDS_PickelizedPyObjRdOnlyServer.hxx + SALOMESDS_PickelizedPyObjRdWrServer.hxx + SALOMESDS_PickelizedPyObjServer.hxx + SALOMESDS_RefCountServ.hxx + SALOMESDS_RequestSwitcher.hxx + SALOMESDS_Sha1Keeper.hxx + SALOMESDS_Transaction.hxx + SALOMESDS_TrustTransaction.hxx +) + +INSTALL(FILES ${SalomeSDS_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +IF(SALOME_BUILD_TESTS) + SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/SALOMESDS) + INSTALL(FILES TestSalomeSDS.py TestSalomeSDSHelper0.py DESTINATION ${LOCAL_TEST_DIR}) + INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${LOCAL_TEST_DIR} RENAME CTestTestfile.cmake) +ENDIF() + +UNSET(LOCAL_TEST_DIR) +UNSET(SalomeSDS_SOURCES) +UNSET(SalomeSDS_HEADERS) +UNSET(_link_LIBRARIES) diff --git a/src/SALOMETraceCollector/CMakeLists.txt b/src/SALOMETraceCollector/CMakeLists.txt index f5dda20ca..724c22301 100644 --- a/src/SALOMETraceCollector/CMakeLists.txt +++ b/src/SALOMETraceCollector/CMakeLists.txt @@ -20,17 +20,42 @@ INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl ${CMAKE_CURRENT_SOURCE_DIR}/../Basics ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${PROJECT_BINARY_DIR}/idl ) -ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${PTHREAD_DEFINITIONS}) -ADD_LIBRARY(with_loggerTraceCollector SALOMETraceCollector.cxx TraceCollector_WaitForServerReadiness.cxx) +ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) -TARGET_LINK_LIBRARIES(with_loggerTraceCollector SALOMELocalTrace SalomeIDLKernel ${OMNIORB_LIBRARIES} ${PTHREAD_LIBRARIES}) +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} + SalomeIDLKernel + SALOMELocalTrace +) + +SET(TraceCollector_SOURCES + SALOMETraceCollector.cxx + TraceCollector_WaitForServerReadiness.cxx +) + +SET(TraceCollector_HEADERS + SALOMETraceCollector.hxx + TraceCollector_WaitForServerReadiness.hxx +) + +ADD_LIBRARY(with_loggerTraceCollector ${TraceCollector_SOURCES}) +TARGET_LINK_LIBRARIES(with_loggerTraceCollector ${_link_LIBRARIES}) INSTALL(TARGETS with_loggerTraceCollector EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +INSTALL(FILES ${TraceCollector_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +UNSET(TraceCollector_SOURCES) +UNSET(TraceCollector_HEADERS) +UNSET(_link_LIBRARIES) + +IF(SALOME_BUILD_TESTS) + ADD_SUBDIRECTORY(Test) +ENDIF() diff --git a/src/SALOMETraceCollector/Test/CMakeLists.txt b/src/SALOMETraceCollector/Test/CMakeLists.txt index f862a8578..6eb684dd5 100644 --- a/src/SALOMETraceCollector/Test/CMakeLists.txt +++ b/src/SALOMETraceCollector/Test/CMakeLists.txt @@ -18,41 +18,46 @@ # INCLUDE_DIRECTORIES( - ${CPPUNIT_INCLUDE_DIRS} ${PTHREAD_INCLUDE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/../../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../../Basics/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMELocalTrace/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMETraceCollector + ${CPPUNIT_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/Basics/Test + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace/Test + ${CMAKE_SOURCE_DIR}/src/SALOMETraceCollector ) -SET(COMMON_LIBS - SALOMELocalTraceTest - SALOMELocalTrace - SALOMEBasics - ${PTHREAD_LIBRARIES} +SET(_link_LIBRARIES ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} ${CPPUNIT_LIBRARIES} + SALOMELocalTrace + SALOMEBasics +) + +SET(_exe_LIBRARIES + ${_link_LIBRARIES} + SALOMELocalTraceTest ) ADD_DEFINITIONS(${CPPUNIT_DEFINITIONS}) + SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/SALOMETraceCollector) ADD_LIBRARY(SALOMETraceCollectorTest SALOMETraceCollectorTest.cxx) -TARGET_LINK_LIBRARIES(SALOMETraceCollectorTest ${COMMON_LIBS}) +TARGET_LINK_LIBRARIES(SALOMETraceCollectorTest ${_link_LIBRARIES}) INSTALL(TARGETS SALOMETraceCollectorTest DESTINATION ${KERNEL_TEST_LIB}) ADD_EXECUTABLE(TestSALOMETraceCollector TestSALOMETraceCollector.cxx) -TARGET_LINK_LIBRARIES(TestSALOMETraceCollector SALOMETraceCollectorTest ${COMMON_LIBS}) +TARGET_LINK_LIBRARIES(TestSALOMETraceCollector ${_exe_LIBRARIES} SALOMETraceCollectorTest) INSTALL(TARGETS TestSALOMETraceCollector DESTINATION ${LOCAL_TEST_DIR}) -# Executable scripts to be installed INSTALL(PROGRAMS TestSALOMETraceCollector.py DESTINATION ${LOCAL_TEST_DIR}) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${LOCAL_TEST_DIR}) - INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${LOCAL_TEST_DIR} RENAME CTestTestfile.cmake) + +UNSET(LOCAL_TEST_DIR) +UNSET(_link_LIBRARIES) +UNSET(_exe_LIBRARIES) diff --git a/src/TOOLSDS/CMakeLists.txt b/src/TOOLSDS/CMakeLists.txt index 81520c256..a849cf0f5 100644 --- a/src/TOOLSDS/CMakeLists.txt +++ b/src/TOOLSDS/CMakeLists.txt @@ -19,20 +19,26 @@ INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} - ${HDF5_INCLUDE_DIRS} ${PTHREAD_INCLUDE_DIR} - ${Boost_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../Utils - ${PROJECT_BINARY_DIR}/idl + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Basics +) + +ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) + +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} + SALOMEBasics + SalomeIDLKernel ) ADD_LIBRARY(TOOLSDS SALOMEDS_Tool.cxx) -ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${HDF5_DEFINITIONS} ${BOOST_DEFINITIONS}) -TARGET_LINK_LIBRARIES(TOOLSDS OpUtil SalomeIDLKernel ${OMNIORB_LIBRARIES}) +TARGET_LINK_LIBRARIES(TOOLSDS ${_link_LIBRARIES}) INSTALL(TARGETS TOOLSDS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +INSTALL(FILES SALOMEDS_Tool.hxx DESTINATION ${SALOME_INSTALL_HEADERS}) + +UNSET(_link_LIBRARIES) diff --git a/src/TOOLSDS/SALOMEDS_Tool.cxx b/src/TOOLSDS/SALOMEDS_Tool.cxx index 9a0db6e2c..e509bbba1 100644 --- a/src/TOOLSDS/SALOMEDS_Tool.cxx +++ b/src/TOOLSDS/SALOMEDS_Tool.cxx @@ -28,7 +28,6 @@ // #include "SALOMEDS_Tool.hxx" -#include "utilities.h" #include "Basics_DirUtils.hxx" #include "Basics_Utils.hxx" diff --git a/src/TestContainer/CMakeLists.txt b/src/TestContainer/CMakeLists.txt index 034da0748..057187ad8 100644 --- a/src/TestContainer/CMakeLists.txt +++ b/src/TestContainer/CMakeLists.txt @@ -20,26 +20,25 @@ INCLUDE_DIRECTORIES( ${PTHREAD_INCLUDE_DIR} ${OMNIORB_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../NamingService - ${CMAKE_CURRENT_SOURCE_DIR}/../Utils - ${CMAKE_CURRENT_SOURCE_DIR}/../Registry - ${CMAKE_CURRENT_SOURCE_DIR}/../Notification - ${CMAKE_CURRENT_SOURCE_DIR}/../ResourcesManager - ${CMAKE_CURRENT_SOURCE_DIR}/../Container - ${CMAKE_CURRENT_SOURCE_DIR}/../GenericObj - ${PROJECT_BINARY_DIR}/idl + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/NamingService + ${CMAKE_SOURCE_DIR}/src/Utils + ${CMAKE_SOURCE_DIR}/src/Registry + ${CMAKE_SOURCE_DIR}/src/Notification + ${CMAKE_SOURCE_DIR}/src/ResourcesManager + ${CMAKE_SOURCE_DIR}/src/Container + ${CMAKE_SOURCE_DIR}/src/GenericObj ) -SET(SalomeTestComponentEngine_SOURCES - SALOME_TestComponent.hxx - SALOME_TestComponent_i.cxx - SALOME_TestComponent_i.hxx -) +ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) -SET(COMMON_LIBS +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} SalomeContainer Registry SalomeNotification @@ -51,25 +50,32 @@ SET(COMMON_LIBS SalomeIDLKernel ) -ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) +SET(SalomeTestComponentEngine_SOURCES + SALOME_TestComponent.hxx + SALOME_TestComponent_i.cxx + SALOME_TestComponent_i.hxx +) ADD_LIBRARY(SalomeTestComponentEngine ${SalomeTestComponentEngine_SOURCES}) -TARGET_LINK_LIBRARIES(SalomeTestComponentEngine ${COMMON_LIBS}) - -INSTALL(TARGETS SalomeTestComponentEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) +TARGET_LINK_LIBRARIES(SalomeTestComponentEngine ${_link_LIBRARIES}) +INSTALL(TARGETS SalomeTestComponentEngine DESTINATION ${SALOME_INSTALL_LIBS}) ADD_EXECUTABLE(TestLogger TestLogger.cxx) -TARGET_LINK_LIBRARIES(TestLogger SalomeTestComponentEngine SALOMEBasics ${COMMON_LIBS} ${OMNIORB_LIBRARIES}) +TARGET_LINK_LIBRARIES(TestLogger ${_link_LIBRARIES} SalomeTestComponentEngine) ADD_EXECUTABLE(TestContainer TestContainer.cxx) -TARGET_LINK_LIBRARIES(TestContainer SalomeTestComponentEngine SALOMEBasics ${COMMON_LIBS} ${OMNIORB_LIBRARIES}) +TARGET_LINK_LIBRARIES(TestContainer ${_link_LIBRARIES} SalomeTestComponentEngine) -INSTALL(TARGETS TestLogger TestContainer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) +INSTALL(TARGETS TestLogger TestContainer DESTINATION ${SALOME_INSTALL_BINS}) -# Executable scripts to be installed SET(SCRIPTS SALOME_TestComponentPy.py TestComponentPy.py TestLogger.py ) + SALOME_INSTALL_SCRIPTS("${SCRIPTS}" ${SALOME_INSTALL_SCRIPT_PYTHON}) + +UNSET(SCRIPTS) +UNSET(SalomeTestComponentEngine_SOURCES) +UNSET(_link_LIBRARIES) diff --git a/src/TestMPIContainer/CMakeLists.txt b/src/TestMPIContainer/CMakeLists.txt index aa5498e6b..ffed8d227 100644 --- a/src/TestMPIContainer/CMakeLists.txt +++ b/src/TestMPIContainer/CMakeLists.txt @@ -20,23 +20,27 @@ INCLUDE_DIRECTORIES( ${MPI_CXX_INCLUDE_PATH} ${OMNIORB_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../NamingService - ${CMAKE_CURRENT_SOURCE_DIR}/../Utils - ${CMAKE_CURRENT_SOURCE_DIR}/../Registry - ${CMAKE_CURRENT_SOURCE_DIR}/../Notification - ${CMAKE_CURRENT_SOURCE_DIR}/../ResourcesManager - ${CMAKE_CURRENT_SOURCE_DIR}/../Container - ${CMAKE_CURRENT_SOURCE_DIR}/../MPIContainer - ${CMAKE_CURRENT_SOURCE_DIR}/../GenericObj - ${PROJECT_BINARY_DIR}/idl + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/NamingService + ${CMAKE_SOURCE_DIR}/src/Utils + ${CMAKE_SOURCE_DIR}/src/Registry + ${CMAKE_SOURCE_DIR}/src/Notification + ${CMAKE_SOURCE_DIR}/src/ResourcesManager + ${CMAKE_SOURCE_DIR}/src/Container + ${CMAKE_SOURCE_DIR}/src/MPIContainer + ${CMAKE_SOURCE_DIR}/src/GenericObj ) ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${MPI_DEFINITIONS}) -SET(COMMON_LIBS +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} + ${OMNIORB_LIBRARIES} + ${MPI_CXX_LIBRARIES} Registry SalomeNotification SalomeResourcesManager @@ -48,16 +52,14 @@ SET(COMMON_LIBS SalomeMPIContainer SalomeGenericObj SalomeIDLKernel - ${OMNIORB_LIBRARIES} ) ADD_LIBRARY(SalomeTestMPIComponentEngine TestMPIComponentEngine.cxx) -TARGET_LINK_LIBRARIES(SalomeTestMPIComponentEngine ${COMMON_LIBS}) +TARGET_LINK_LIBRARIES(SalomeTestMPIComponentEngine ${_link_LIBRARIES}) INSTALL(TARGETS SalomeTestMPIComponentEngine DESTINATION ${SALOME_INSTALL_LIBS}) ADD_EXECUTABLE(TestMPIContainer TestMPIContainer.cxx) -TARGET_LINK_LIBRARIES(TestMPIContainer SalomeTestMPIComponentEngine ${COMMON_LIBS} ${MPI_CXX_LIBRARIES}) +TARGET_LINK_LIBRARIES(TestMPIContainer ${_link_LIBRARIES} SalomeTestMPIComponentEngine) INSTALL(TARGETS TestMPIContainer DESTINATION ${SALOME_INSTALL_BINS}) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +UNSET(_link_LIBRARIES) diff --git a/src/UnitTests/CMakeLists.txt b/src/UnitTests/CMakeLists.txt index 3b2ea81db..aea59592d 100644 --- a/src/UnitTests/CMakeLists.txt +++ b/src/UnitTests/CMakeLists.txt @@ -20,28 +20,18 @@ INCLUDE_DIRECTORIES( ${CPPUNIT_INCLUDE_DIRS} ${PTHREAD_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace/Test + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/Basics/Test + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace/Test ) -# =============================================================== -# Files to be installed -# =============================================================== - -# Executable scripts to be installed -SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/UnitTests) -INSTALL(PROGRAMS UnitTests.py DESTINATION ${LOCAL_TEST_DIR}) - -# =============================================================== -# Executables targets -# =============================================================== - ADD_DEFINITIONS(${CPPUNIT_DEFINITIONS}) -SET(COMMON_LIBS +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} ${CPPUNIT_LIBRARIES} SALOMEBasics SALOMELocalTrace @@ -51,27 +41,27 @@ SET(COMMON_LIBS IF(NOT SALOME_LIGHT_ONLY) INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMETraceCollector - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMETraceCollector/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../NamingService - ${CMAKE_CURRENT_SOURCE_DIR}/../NamingService/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../Utils - ${CMAKE_CURRENT_SOURCE_DIR}/../Utils/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../LifeCycleCORBA - ${CMAKE_CURRENT_SOURCE_DIR}/../LifeCycleCORBA/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMDESImpl - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMEDSImpl/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMDES - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMEDS/Test - ${PROJECT_BINARY_DIR}/idl - ${CMAKE_CURRENT_SOURCE_DIR}/../Registry - ${CMAKE_CURRENT_SOURCE_DIR}/../Notification - ${CMAKE_CURRENT_SOURCE_DIR}/../ResourcesManager + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_SOURCE_DIR}/src/SALOMETraceCollector + ${CMAKE_SOURCE_DIR}/src/SALOMETraceCollector/Test + ${CMAKE_SOURCE_DIR}/src/NamingService + ${CMAKE_SOURCE_DIR}/src/NamingService/Test + ${CMAKE_SOURCE_DIR}/src/Utils + ${CMAKE_SOURCE_DIR}/src/Utils/Test + ${CMAKE_SOURCE_DIR}/src/LifeCycleCORBA + ${CMAKE_SOURCE_DIR}/src/LifeCycleCORBA/Test + ${CMAKE_SOURCE_DIR}/src/SALOMDESImpl + ${CMAKE_SOURCE_DIR}/src/SALOMEDSImpl/Test + ${CMAKE_SOURCE_DIR}/src/SALOMDES + ${CMAKE_SOURCE_DIR}/src/SALOMEDS/Test + ${CMAKE_SOURCE_DIR}/src/Registry + ${CMAKE_SOURCE_DIR}/src/Notification + ${CMAKE_SOURCE_DIR}/src/ResourcesManager ) ADD_DEFINITIONS(-DWITH_CORBA ${OMNIORB_DEFINITIONS}) - SET(COMMON_LIBS - ${COMMON_LIBS} + LIST(APPEND _link_LIBRARIES + ${OMNIORB_LIBRARIES} Registry SalomeNotification SalomeResourcesManager @@ -88,14 +78,19 @@ IF(NOT SALOME_LIGHT_ONLY) SalomeDS SALOMEDSTest SalomeIDLKernel - ${OMNIORB_LIBRARIES} ) ENDIF() +SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/UnitTests) + ADD_EXECUTABLE(UnitTests UnitTests.cxx) -TARGET_LINK_LIBRARIES(UnitTests ${COMMON_LIBS}) +TARGET_LINK_LIBRARIES(UnitTests ${_link_LIBRARIES}) INSTALL(TARGETS UnitTests DESTINATION ${LOCAL_TEST_DIR}) INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${LOCAL_TEST_DIR} RENAME CTestTestfile.cmake) + +INSTALL(PROGRAMS UnitTests.py DESTINATION ${LOCAL_TEST_DIR}) + +UNSET(_link_LIBRARIES) diff --git a/src/Utils/CMakeLists.txt b/src/Utils/CMakeLists.txt index b218f7dc6..cb74b1474 100644 --- a/src/Utils/CMakeLists.txt +++ b/src/Utils/CMakeLists.txt @@ -17,65 +17,87 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +INCLUDE_DIRECTORIES(${PTHREAD_INCLUDE_DIR}) IF(NOT SALOME_LIGHT_ONLY) + INCLUDE_DIRECTORIES(${OMNIORB_INCLUDE_DIR}) +ENDIF() +INCLUDE_DIRECTORIES( + ${CMAKE_BINARY_DIR}/salome_adm + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace +) +IF(NOT SALOME_LIGHT_ONLY) + INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/idl) +ENDIF() - INCLUDE_DIRECTORIES( - ${OMNIORB_INCLUDE_DIR} - ${PTHREAD_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ${PROJECT_BINARY_DIR}/idl - ) - ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${PTHREAD_DEFINITIONS}) - SET(COMMON_LIBS - SALOMELocalTrace - SalomeIDLKernel - ${OMNIORB_LIBRARIES} - ${PTHREAD_LIBRARIES} - ) - SET(OpUtil_SOURCES - Utils_Timer.cxx - duplicate.cxx - Utils_CommException.cxx - Utils_SALOME_Exception.cxx - Utils_Identity.cxx - Utils_ORB_INIT.cxx - Utils_DESTRUCTEUR_GENERIQUE.cxx - Utils_ExceptHandlers.cxx - Utils_Mutex.cxx - ) - FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx" ) - -ELSE() +IF(NOT SALOME_LIGHT_ONLY) + ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) +ENDIF() - INCLUDE_DIRECTORIES( - ${PTHREAD_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/salome_adm - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace - ) - SET(COMMON_LIBS - SALOMELocalTrace - ${PTHREAD_LIBRARIES} +SET(_link_LIBRARIES ${PTHREAD_LIBRARIES}) +IF(NOT SALOME_LIGHT_ONLY) + SET(_link_LIBRARIES ${_link_LIBRARIES} ${OMNIORB_LIBRARIES}) +ENDIF() +SET(_link_LIBRARIES ${_link_LIBRARIES} SALOMELocalTrace) +IF(NOT SALOME_LIGHT_ONLY) + SET(_link_LIBRARIES ${_link_LIBRARIES} SalomeIDLKernel) +ENDIF() + +SET(OpUtil_SOURCES + Utils_SALOME_Exception.cxx + duplicate.cxx +) +IF(NOT SALOME_LIGHT_ONLY) + SET(OpUtil_SOURCES ${OpUtil_SOURCES} + Utils_CommException.cxx + Utils_DESTRUCTEUR_GENERIQUE.cxx + Utils_ExceptHandlers.cxx + Utils_Identity.cxx + Utils_Mutex.cxx + Utils_ORB_INIT.cxx + Utils_Timer.cxx ) - SET(OpUtil_SOURCES - Utils_SALOME_Exception.cxx - duplicate.cxx - ) - SET(COMMON_HEADERS_HXX Utils_SALOME_Exception.hxx) - ENDIF() -SET(COMMON_SCRIPTS - Utils_Identity.py - SALOME_utilities.py +SET(OpUtil_HEADERS + OpUtil.hxx + Utils_SALOME_Exception.hxx ) -SALOME_INSTALL_SCRIPTS("${COMMON_SCRIPTS}" ${SALOME_INSTALL_SCRIPT_PYTHON}) +IF(NOT SALOME_LIGHT_ONLY) + SET(OpUtil_HEADERS ${OpUtil_HEADERS} + SALOME_Utils.hxx + Utils_CommException.hxx + Utils_CorbaException.hxx + Utils_DESTRUCTEUR_GENERIQUE.hxx + Utils_ExceptHandlers.hxx + Utils_Identity.hxx + Utils_Mutex.hxx + Utils_ORB_INIT.hxx + Utils_SINGLETON.hxx + Utils_Timer.hxx + ) +ENDIF() + +IF(NOT SALOME_LIGHT_ONLY) + SET(OpUtil_SCRIPTS + Utils_Identity.py + SALOME_utilities.py + ) +ENDIF() ADD_LIBRARY(OpUtil ${OpUtil_SOURCES}) -TARGET_LINK_LIBRARIES(OpUtil ${COMMON_LIBS}) +TARGET_LINK_LIBRARIES(OpUtil ${_link_LIBRARIES}) INSTALL(TARGETS OpUtil EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) + +INSTALL(FILES ${OpUtil_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + +SALOME_INSTALL_SCRIPTS("${OpUtil_SCRIPTS}" ${SALOME_INSTALL_SCRIPT_PYTHON}) + +UNSET(OpUtil_SOURCES) +UNSET(OpUtil_HEADERS) +UNSET(OpUtil_SCRIPTS) +UNSET(_link_LIBRARIES) + +IF(SALOME_BUILD_TESTS) + ADD_SUBDIRECTORY(Test) +ENDIF() diff --git a/src/Utils/Test/CMakeLists.txt b/src/Utils/Test/CMakeLists.txt index 233168882..56ae71511 100644 --- a/src/Utils/Test/CMakeLists.txt +++ b/src/Utils/Test/CMakeLists.txt @@ -20,42 +20,43 @@ INCLUDE_DIRECTORIES( ${PTHREAD_INCLUDE_DIR} ${CPPUNIT_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR}/../../Basics - ${CMAKE_CURRENT_SOURCE_DIR}/../../Basics/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMELocalTrace - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMELocalTrace/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMETraceCollector - ${CMAKE_CURRENT_SOURCE_DIR}/../../SALOMETraceCollector/Test - ${CMAKE_CURRENT_SOURCE_DIR}/../../Utils - ${CMAKE_CURRENT_SOURCE_DIR}/../../Utils/Test + ${CMAKE_SOURCE_DIR}/src/Basics + ${CMAKE_SOURCE_DIR}/src/Basics/Test + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace + ${CMAKE_SOURCE_DIR}/src/SALOMELocalTrace/Test + ${CMAKE_SOURCE_DIR}/src/Utils ) -SET(COMMON_LIBS +ADD_DEFINITIONS(${CPPUNIT_DEFINITIONS}) + +SET(_link_LIBRARIES + ${PLATFORM_LIBS} + ${PTHREAD_LIBRARIES} ${CPPUNIT_LIBRARIES} OpUtil +) + +SET(_exe_LIBRARIES + ${_link_LIBRARIES} SALOMELocalTraceTest - SALOMELocalTrace - SALOMETraceCollectorTest - SALOMEBasics - ${PLATFORM_LIBS} ) -ADD_DEFINITIONS(${CPPUNIT_DEFINITIONS}) SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/Utils) ADD_LIBRARY(UtilsTest UtilsTest.cxx) -TARGET_LINK_LIBRARIES(UtilsTest ${COMMON_LIBS} ) +TARGET_LINK_LIBRARIES(UtilsTest ${_link_LIBRARIES}) INSTALL(TARGETS UtilsTest DESTINATION ${KERNEL_TEST_LIB}) ADD_EXECUTABLE(TestUtils TestUtils.cxx) -TARGET_LINK_LIBRARIES(TestUtils ${COMMON_LIBS} UtilsTest ${OMNIORB_LIBRARIES}) +TARGET_LINK_LIBRARIES(TestUtils ${_exe_LIBRARIES} UtilsTest) INSTALL(TARGETS TestUtils DESTINATION ${LOCAL_TEST_DIR}) INSTALL(FILES TestUtils.py DESTINATION ${LOCAL_TEST_DIR}) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") -INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${LOCAL_TEST_DIR}) - INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${LOCAL_TEST_DIR} - RENAME CTestTestfile.cmake) \ No newline at end of file + RENAME CTestTestfile.cmake) + +UNSET(_link_LIBRARIES) +UNSET(_exe_LIBRARIES) +UNSET(LOCAL_TEST_DIR) diff --git a/src/Utils/Test/TestUtils.cxx b/src/Utils/Test/TestUtils.cxx index 76ed68a24..9998612e2 100644 --- a/src/Utils/Test/TestUtils.cxx +++ b/src/Utils/Test/TestUtils.cxx @@ -23,13 +23,11 @@ // --- include all Unit Test from basics until the present directory // #include "SALOMELocalTraceTest.hxx" -#include "SALOMETraceCollectorTest.hxx" #include "UtilsTest.hxx" // --- Registers the fixture into the 'registry' CPPUNIT_TEST_SUITE_REGISTRATION( SALOMELocalTraceTest ); -CPPUNIT_TEST_SUITE_REGISTRATION( SALOMETraceCollectorTest ); CPPUNIT_TEST_SUITE_REGISTRATION( UtilsTest ); // --- generic Main program from Basic/Test diff --git a/src/Utils/Test/TestUtils.py b/src/Utils/Test/TestUtils.py index afe207fdd..d7ba5ce4f 100644 --- a/src/Utils/Test/TestUtils.py +++ b/src/Utils/Test/TestUtils.py @@ -23,9 +23,6 @@ import sys, os,signal,string,subprocess import subprocess -import runSalome -import orbmodule -import TestKiller import setenv # get SALOME environment : @@ -33,23 +30,10 @@ import setenv args, modules_list, modules_root_dir = setenv.get_config() setenv.set_env(args, modules_list, modules_root_dir) -# launch CORBA naming server - -clt=orbmodule.client() - -# launch CORBA logger server - -myServer=runSalome.LoggerServer(args) -myServer.run() -clt.waitLogger("Logger") - # execute Unit Test command = ['./TestUtils'] ret = subprocess.call(command) -# kill Test process - -TestKiller.killProcess(runSalome.process_id) -TestKiller.closeSalome() +# no process to kill exit(ret)