From: Ovidiu Mircescu Date: Mon, 12 Sep 2016 15:58:50 +0000 (+0200) Subject: Use conditional build for the Insitu component. X-Git-Tag: SHAPER_2.7.0~15^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e3780554b5da3e6197bcf25a51541bb415bcee65;p=modules%2Fparavis.git Use conditional build for the Insitu component. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index adc06fc3..29ea4d47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -144,7 +144,7 @@ FIND_PACKAGE(SalomeParaView REQUIRED) ## ## From MEDCoupling / MEDFile / or MEDModule (if CORBA plugin required): ## - +SET(SALOME_PARAVIS_BUILD_INSITU OFF) IF(SALOME_PARAVIS_BUILD_PLUGINS) # If CORBA plugins required, take in MED module IF(SALOME_PARAVIS_BUILD_CORBA_PLUGINS) @@ -153,6 +153,9 @@ IF(SALOME_PARAVIS_BUILD_PLUGINS) LIST(APPEND CMAKE_MODULE_PATH "${MED_ROOT_DIR}/adm_local/cmake_files") FIND_PACKAGE(SalomeMED) SALOME_LOG_OPTIONAL_PACKAGE(SalomeMED SALOME_PARAVIS_BUILD_CORBA_PLUGINS) + IF(SALOME_USE_MPI) + SET(SALOME_PARAVIS_BUILD_INSITU ON) + ENDIF(SALOME_USE_MPI) ENDIF() ELSE(SALOME_PARAVIS_BUILD_CORBA_PLUGINS) SET(MEDCOUPLING_ROOT_DIR $ENV{MEDCOUPLING_ROOT_DIR} CACHE PATH "Path to the MEDCoupling tool") @@ -163,35 +166,6 @@ IF(SALOME_PARAVIS_BUILD_PLUGINS) SALOME_LOG_OPTIONAL_PACKAGE(MEDCoupling SALOME_PARAVIS_BUILD_PLUGINS) ENDIF() ENDIF(SALOME_PARAVIS_BUILD_PLUGINS) - -##################################### -# FIND MED -##################################### -SET(MED_ROOT_DIR $ENV{MED_ROOT_DIR} CACHE PATH "Path to MED module") -IF(EXISTS ${MED_ROOT_DIR}) - LIST(APPEND CMAKE_MODULE_PATH "${MED_ROOT_DIR}/adm_local/cmake_files") - FIND_PACKAGE(SalomeMED REQUIRED) - ADD_DEFINITIONS(${MED_DEFINITIONS}) - INCLUDE_DIRECTORIES(${MED_INCLUDE_DIRS}) -ELSE(EXISTS ${MED_ROOT_DIR}) - MESSAGE(FATAL_ERROR "We absolutely need MED module, please define MED_ROOT_DIR") -ENDIF(EXISTS ${MED_ROOT_DIR}) -##################################### - -##################################### -# FIND MEDCOUPLING -##################################### -SET(MEDCOUPLING_ROOT_DIR $ENV{MEDCOUPLING_ROOT_DIR} CACHE PATH "Path to MEDCOUPLING module") -IF(EXISTS ${MEDCOUPLING_ROOT_DIR}) - LIST(APPEND CMAKE_MODULE_PATH "${MEDCOUPLING_ROOT_DIR}/cmake_files") - FIND_PACKAGE(SalomeMEDCoupling REQUIRED) - ADD_DEFINITIONS(${MEDCOUPLING_DEFINITIONS}) - INCLUDE_DIRECTORIES(${MEDCOUPLING_INCLUDE_DIRS}) -ELSE(EXISTS ${MEDCOUPLING_ROOT_DIR}) - MESSAGE(FATAL_ERROR "We absolutely need MEDCOUPLING module, please define MEDCOUPLING_ROOT_DIR") -ENDIF(EXISTS ${MEDCOUPLING_ROOT_DIR}) -##################################### - ## ## From GEOM ## diff --git a/idl/CMakeLists.txt b/idl/CMakeLists.txt index 4f6a89e5..544cd60b 100644 --- a/idl/CMakeLists.txt +++ b/idl/CMakeLists.txt @@ -1,28 +1,31 @@ +IF(SALOME_PARAVIS_BUILD_INSITU) + INCLUDE(UseOmniORB) # Provided by KERNEL -INCLUDE(UseOmniORB) # Provided by KERNEL + INCLUDE_DIRECTORIES( + ${OMNIORB_INCLUDE_DIR} + ${KERNEL_INCLUDE_DIRS} + ${PROJECT_BINARY_DIR}/idl + ${MED_INCLUDE_DIRS} + ${MEDCOUPLING_INCLUDE_DIRS} + ) -INCLUDE_DIRECTORIES( - ${OMNIORB_INCLUDE_DIR} - ${KERNEL_INCLUDE_DIRS} - ${PROJECT_BINARY_DIR}/idl -) + SET(SalomeIDLPARAVIS_IDLSOURCES + PARAVIS.idl + + ) -SET(SalomeIDLPARAVIS_IDLSOURCES - PARAVIS.idl - -) + SET(_idl_include_dirs + ${KERNEL_ROOT_DIR}/idl/salome + ${MED_ROOT_DIR}/idl/salome + + ) -SET(_idl_include_dirs - ${KERNEL_ROOT_DIR}/idl/salome - ${MED_ROOT_DIR}/idl/salome - -) + SET(_idl_link_flags + ${KERNEL_SalomeIDLKernel} + ${MED_SalomeIDLMED} + + ) -SET(_idl_link_flags - ${KERNEL_SalomeIDLKernel} - ${MED_SalomeIDLMED} - -) - -OMNIORB_ADD_MODULE(SalomeIDLPARAVIS "${SalomeIDLPARAVIS_IDLSOURCES}" "${_idl_include_dirs}" "${_idl_link_flags}") -INSTALL(TARGETS SalomeIDLPARAVIS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) + OMNIORB_ADD_MODULE(SalomeIDLPARAVIS "${SalomeIDLPARAVIS_IDLSOURCES}" "${_idl_include_dirs}" "${_idl_link_flags}") + INSTALL(TARGETS SalomeIDLPARAVIS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) +ENDIF(SALOME_PARAVIS_BUILD_INSITU) \ No newline at end of file diff --git a/src/Insitu/CMakeLists.txt b/src/Insitu/CMakeLists.txt index 1bc1057f..bb8efca2 100644 --- a/src/Insitu/CMakeLists.txt +++ b/src/Insitu/CMakeLists.txt @@ -1,3 +1,4 @@ -ADD_SUBDIRECTORY(VisualizationComponent) -ADD_SUBDIRECTORY(VisualizationLibrary) - +IF(SALOME_PARAVIS_BUILD_INSITU) + ADD_SUBDIRECTORY(VisualizationComponent) + ADD_SUBDIRECTORY(VisualizationLibrary) +ENDIF(SALOME_PARAVIS_BUILD_INSITU) diff --git a/src/Insitu/VisualizationComponent/CMakeLists.txt b/src/Insitu/VisualizationComponent/CMakeLists.txt index 2ccee2d6..0517d685 100644 --- a/src/Insitu/VisualizationComponent/CMakeLists.txt +++ b/src/Insitu/VisualizationComponent/CMakeLists.txt @@ -6,19 +6,18 @@ INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} ${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}/idl + ${MED_INCLUDE_DIRS} + ${MEDCOUPLING_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/../VisualizationLibrary ) # --- definitions --- ADD_DEFINITIONS( ${OMNIORB_DEFINITIONS} + ${MED_DEFINITIONS} + ${MEDCOUPLING_DEFINITIONS} ) -# find additional libraries -#FIND_LIBRARY( _userlib_visulib visulib PATH /home/I35256/salome/install/V7_main_git/modules/install/PARAVIS_master/lib/salome) -#FIND_LIBRARY( _userlib_MEDLoaderForPV MEDLoaderForPV PATH /home/I35256/salome/install/V7_main_git/modules/install/PARAVIS_master/lib/salome) - - # libraries to link to SET(_link_LIBRARIES ${OMNIORB_LIBRARIES} @@ -27,10 +26,8 @@ SET(_link_LIBRARIES ${KERNEL_SalomeContainer} SalomeIDLPARAVIS ${KERNEL_SalomeMPIContainer} - #${_userlib_visulib} - #${_userlib_MEDLoaderForPV} - ${PARAVIS_MEDLoaderForPV} - ${PARAVIS_visulib} + MEDLoaderForPV + visulib ${MED_SalomeIDLMED} ${MED_med} ${MED_medcouplingcorba} @@ -60,8 +57,8 @@ SET(PARAVIS_SOURCES ADD_LIBRARY(VisualizationComponentEngine ${PARAVIS_SOURCES}) TARGET_LINK_LIBRARIES(VisualizationComponentEngine ${_link_LIBRARIES} ) -#SET_TARGET_PROPERTIES( VisualizationComponentEngine PROPERTIES INSTALL_RPATH /home/I35256/salome/install/V7_main_git/modules/install/PARAVIS_master/lib/salome) -INSTALL(TARGETS VisualizationComponentEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) +INSTALL(TARGETS VisualizationComponentEngine + DESTINATION ${SALOME_INSTALL_LIBS}) INSTALL(FILES ${PARAVIS_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) diff --git a/src/Insitu/VisualizationLibrary/CMakeLists.txt b/src/Insitu/VisualizationLibrary/CMakeLists.txt index 5ff03098..880976cf 100644 --- a/src/Insitu/VisualizationLibrary/CMakeLists.txt +++ b/src/Insitu/VisualizationLibrary/CMakeLists.txt @@ -1,20 +1,22 @@ SET(BUILD_SHARED_LIBS TRUE) + +ADD_DEFINITIONS(${MEDCOUPLING_DEFINITIONS}) + INCLUDE_DIRECTORIES( ${MEDCOUPLING_INCLUDE_DIRS} ${MPI_INCLUDE_PATH} ${PARAVIS_INCLUDE_DIRS} + ${MEDCOUPLING_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/../../Plugins/MEDReader/IO/ ) - SET(_link_LIBRARIES ${MEDCoupling_medcoupling} ${MEDCoupling_interpkernel} ${MPI_LIBRARIES} ${VTK_LIBRARIES} ${PARAVIS_MEDLoaderForPV} - #${MEDLoaderForPV} ${MEDCoupling_medloader} ${MEDFILE_C_LIBRARIES} vtkPVCatalyst @@ -33,10 +35,8 @@ ADD_LIBRARY(visulib ${_lib_SOURCES}) TARGET_LINK_LIBRARIES(visulib ${_link_LIBRARIES} ) INSTALL(TARGETS visulib - RUNTIME DESTINATION lib/salome - LIBRARY DESTINATION lib/salome - ARCHIVE DESTINATION lib/salome - ) + EXPORT ${PROJECT_NAME}TargetGroup + DESTINATION ${SALOME_INSTALL_LIBS}) INSTALL(FILES ${_lib_HEADERS} DESTINATION include/salome )