From: mpa Date: Wed, 26 Feb 2014 12:37:19 +0000 (+0400) Subject: Debug of CMake build procedure X-Git-Tag: V7_4_0a1~3^2~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=26426022f34895ebc308550a4ad989b969e0a5b5;p=modules%2Fkernel.git Debug of CMake build procedure --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ddf4c953..6e649bc6d 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,8 +52,6 @@ SET(LONG_OR_INT int) # User options # ============ -CMAKE_DEPENDENT_OPTION(SALOME_USE_MPI "Use MPI containers" OFF - "NOT SALOME_PACO_PARALLEL" ON) OPTION(SALOME_BUILD_DOC "Generate SALOME KERNEL documentation" ON) OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON) @@ -61,10 +59,15 @@ OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON) OPTION(SALOME_LIGHT_ONLY "Build SALOME Light only (no CORBA)" OFF) OPTION(SALOME_USE_LIBBATCH "Use LibBatch in KERNEL" OFF) OPTION(SALOME_USE_SIMAN "Add SIMAN support" OFF) -OPTION(SALOME_PACO_PARALLEL "Build with PACO (implies SALOME_USE_MPI)" OFF) -OPTION(SALOME_LAUNCHER_ONLY "Build only the Launcher part" OFF) +CMAKE_DEPENDENT_OPTION(SALOME_PACO_PARALLEL "Build with PACO (implies SALOME_USE_MPI)" OFF + "NOT SALOME_LIGHT_ONLY" OFF) OPTION(SALOME_USE_PORTMANAGER "Add PortManager support" OFF) -MARK_AS_ADVANCED(SALOME_LIGHT_ONLY SALOME_USE_LIBBATCH SALOME_USE_SIMAN SALOME_PACO_PARALLEL SALOME_LAUNCHER_ONLY SALOME_USE_PORTMANAGER) +CMAKE_DEPENDENT_OPTION(SALOME_USE_MPI "Use MPI containers" OFF + "NOT SALOME_PACO_PARALLEL" ON) +CMAKE_DEPENDENT_OPTION(SALOME_USE_MPI "Use MPI containers" ${SALOME_USE_MPI} + "NOT SALOME_LIGHT_ONLY" OFF) +MARK_AS_ADVANCED(SALOME_LIGHT_ONLY SALOME_USE_LIBBATCH SALOME_USE_SIMAN SALOME_PACO_PARALLEL SALOME_USE_PORTMANAGER) +SET(SALOME_LAUNCHER_ONLY OFF) # deprecated option: Build only the Launcher part # Required prerequisites # Find "big" prerequisites first - they reference themselves many others @@ -203,35 +206,61 @@ 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" -# Temporary solution for package src\DSC on windows -IF(NOT WIN32) - SET(DSC_TGS CalciumC SalomeCalcium SalomeDatastream - SalomePalm SalomeDSCSupervBasic SalomeDSCSuperv) -ENDIF() - -SET(_${PROJECT_NAME}_exposed_targets - ${DSC_TGS} DF Launcher OpUtil Registry ResourcesManager - SALOMEBasics SalomeCatalog SalomeCommunication SalomeContainer - SalomeDSCContainer SalomeDSClient SalomeDSImpl - SalomeDS SalomeGenericObj SalomeHDFPersist SalomeIDLKernel - SalomeLauncher SalomeLifeCycleCORBA SALOMELocalTrace - SalomeLoggerServer SalomeNotification SalomeNS - SalomeResourcesManager TOOLSDS with_loggerTraceCollector - SalomeKernelHelpers) +IF(SALOME_LAUNCHER_ONLY) + SET(_${PROJECT_NAME}_exposed_targets + SALOMEBasics ResourcesManager Launcher) +ELSE() + 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 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() + # 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() -# Test targets: -IF(SALOME_BUILD_TESTS) - LIST(APPEND _${PROJECT_NAME}_exposed_targets - LifeCycleCORBATest NamingServiceTest SALOMEDSImplTest SALOMEDSTest SALOMELocalTraceTest - SalomeTestComponentEngine SALOMETraceCollectorTest UtilsTest ) + # PACO specific targets: + IF(SALOME_PACO_PARALLEL) + LIST(APPEND _${PROJECT_NAME}_exposed_targets SalomeParallelContainer) + ENDIF() 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) diff --git a/SalomeKERNELConfig.cmake.in b/SalomeKERNELConfig.cmake.in index fd8f2d696..f3fc6bd48 100644 --- a/SalomeKERNELConfig.cmake.in +++ b/SalomeKERNELConfig.cmake.in @@ -62,10 +62,10 @@ IF(SALOME_USE_MPI) LIST(APPEND KERNEL_DEFINITIONS "@MPI_DEFINITIONS@") ENDIF() -SET(SALOME_KERNEL_BUILD_DOC @SALOME_BUILD_DOC@) -SET(SALOME_KERNEL_BUILD_TESTS @SALOME_BUILD_TESTS@) -SET(SALOME_LIGHT_ONLY @SALOME_LIGHT_ONLY@) -SET(SALOME_USE_LIBBATCH @SALOME_USE_LIBBATCH@) +SET(SALOME_KERNEL_BUILD_DOC @SALOME_BUILD_DOC@) +SET(SALOME_KERNEL_BUILD_TESTS @SALOME_BUILD_TESTS@) +SET(SALOME_KERNEL_LIGHT_ONLY @SALOME_LIGHT_ONLY@) +SET(SALOME_USE_LIBBATCH @SALOME_USE_LIBBATCH@) SET(SALOME_USE_SIMAN @SALOME_USE_SIMAN@) IF(SALOME_USE_SIMAN) diff --git a/salome_adm/cmake_files/FindSalomeKERNEL.cmake b/salome_adm/cmake_files/FindSalomeKERNEL.cmake index af6ae3921..2f7c18584 100644 --- a/salome_adm/cmake_files/FindSalomeKERNEL.cmake +++ b/salome_adm/cmake_files/FindSalomeKERNEL.cmake @@ -51,3 +51,13 @@ ENDIF() FOREACH(_res ${SalomeKERNEL_EXTRA_ENV}) SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeKERNEL_EXTRA_ENV_${_res}}") ENDFOREACH() + +#---------------------------------------------------------------------------- +# KERNEL_WITH_CORBA is a macro useful for determining whether a KERNEL module +# builded in not light mode(with CORBA) +#---------------------------------------------------------------------------- +MACRO(KERNEL_WITH_CORBA) + IF(SALOME_KERNEL_LIGHT_ONLY) + MESSAGE(FATAL_ERROR "\nWe absolutely need a Salome KERNEL module with CORBA.\nPlease set option SALOME_LIGHT_ONLY to OFF when building KERNEL module.") + ENDIF() +ENDMACRO(KERNEL_WITH_CORBA) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b84c3a8cf..8ea2b8ca1 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -22,13 +22,13 @@ SET(SUBDIR_BASE SALOMELocalTrace HDFPersist KERNEL_PY + Utils ) SET(SUBDIR_CORBA DF Logger SALOMETraceCollector - Utils NamingService GenericObj Registry @@ -83,12 +83,12 @@ ELSE() IF(SALOME_USE_MPI) LIST(APPEND SUBDIRS ${SUBDIR_MPI}) -ENDIF(SALOME_USE_MPI) + ENDIF(SALOME_USE_MPI) -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_BUILD_TESTS) + LIST(APPEND SUBDIRS ${SUBDIR_CPPUNIT_BASE} ${SUBDIR_CPPUNIT_GENERAL}) + IF(NOT SALOME_LIGHT_ONLY) + LIST(APPEND SUBDIRS ${SUBDIR_CPPUNIT_CORBA}) ENDIF() ENDIF() diff --git a/src/UnitTests/CMakeLists.txt b/src/UnitTests/CMakeLists.txt index cbdf17935..b891402f2 100755 --- a/src/UnitTests/CMakeLists.txt +++ b/src/UnitTests/CMakeLists.txt @@ -47,7 +47,8 @@ SET(COMMON_LIBS SALOMELocalTraceTest ) -INCLUDE_DIRECTORIES( +IF(NOT SALOME_LIGHT_ONLY) + INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMETraceCollector ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMETraceCollector/Test @@ -88,6 +89,7 @@ INCLUDE_DIRECTORIES( SalomeIDLKernel ${OMNIORB_LIBRARIES} ) +ENDIF() ADD_EXECUTABLE(UnitTests UnitTests.cxx) TARGET_LINK_LIBRARIES(UnitTests ${COMMON_LIBS}) diff --git a/src/Utils/CMakeLists.txt b/src/Utils/CMakeLists.txt index 9f3aebfd1..e9eb5c878 100755 --- a/src/Utils/CMakeLists.txt +++ b/src/Utils/CMakeLists.txt @@ -17,31 +17,57 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -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 -) -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 -) +IF(NOT SALOME_LIGHT_ONLY) -ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${PTHREAD_DEFINITIONS}) -ADD_LIBRARY(OpUtil ${OpUtil_SOURCES}) -TARGET_LINK_LIBRARIES(OpUtil SALOMELocalTrace SalomeIDLKernel ${OMNIORB_LIBRARIES} ${PTHREAD_LIBRARIES}) -INSTALL(TARGETS OpUtil EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) + 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() + + 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(OpUtil_SOURCES + Utils_SALOME_Exception.cxx + duplicate.cxx + ) + SET(COMMON_HEADERS_HXX Utils_SALOME_Exception.hxx) + +ENDIF() SET(COMMON_SCRIPTS Utils_Identity.py @@ -49,5 +75,7 @@ SET(COMMON_SCRIPTS ) SALOME_INSTALL_SCRIPTS("${COMMON_SCRIPTS}" ${SALOME_INSTALL_SCRIPT_PYTHON}) -FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") +ADD_LIBRARY(OpUtil ${OpUtil_SOURCES}) +TARGET_LINK_LIBRARIES(OpUtil ${COMMON_LIBS}) +INSTALL(TARGETS OpUtil EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS})