]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Debug of CMake build procedure
authormpa <mpa@opencascade.com>
Wed, 26 Feb 2014 12:37:19 +0000 (16:37 +0400)
committermpa <mpa@opencascade.com>
Wed, 26 Feb 2014 12:37:19 +0000 (16:37 +0400)
CMakeLists.txt
SalomeKERNELConfig.cmake.in
salome_adm/cmake_files/FindSalomeKERNEL.cmake
src/CMakeLists.txt
src/UnitTests/CMakeLists.txt
src/Utils/CMakeLists.txt

index 0ddf4c953f186a2ace50fd024c1a8d8dc7bb9bf1..6e649bc6d8f8309a8aa4d23a5fc5b33d7e758320 100755 (executable)
@@ -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)
index fd8f2d69612bec0d5e59eaf9103998aa670b1531..f3fc6bd4812ff03da744d85fdb91759ab80e3a3b 100644 (file)
@@ -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)
index af6ae3921a6336e9fb6de7264c7f91fb0afa8885..2f7c18584a668f9669aa01ea157d0c75fbf117ca 100644 (file)
@@ -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)
index b84c3a8cf3be18c34e7272f43f19b03b481ca3e7..8ea2b8ca16509a3a4cea8894ce925a54b90ae162 100755 (executable)
@@ -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()
 
index cbdf1793587de77df6852ba816d33e6c070329ab..b891402f22ea8eb7f7431b1e192db57898830b6f 100755 (executable)
@@ -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})
index 9f3aebfd182debbc9c75a87eb003ecd480f78bed..e9eb5c878cbe99c5fa2fb2271cb99eb616a8c567 100755 (executable)
 # 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})