]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Ajout d'une option RELOCATABLE qui positionne le RPATH
authorGilles DAVID <gilles-g.david@edf.fr>
Thu, 24 Oct 2024 14:36:29 +0000 (16:36 +0200)
committerGilles DAVID <gilles-g.david@edf.fr>
Sat, 26 Oct 2024 11:07:20 +0000 (13:07 +0200)
52 files changed:
CMakeLists.txt
idl/CMakeLists.txt
src/ArgvKeeper/CMakeLists.txt
src/ArgvKeeper/Test/CMakeLists.txt
src/Basics/CMakeLists.txt
src/Communication/CMakeLists.txt
src/Communication_SWIG/CMakeLists.txt
src/Container/CMakeLists.txt
src/DF/CMakeLists.txt
src/DSC/DSC_Basic/CMakeLists.txt
src/DSC/DSC_Python/CMakeLists.txt
src/DSC/DSC_User/Basic/CMakeLists.txt
src/DSC/DSC_User/CMakeLists.txt
src/DSC/DSC_User/Datastream/CMakeLists.txt
src/DSC/DSC_User/Datastream/Calcium/CMakeLists.txt
src/DSC/DSC_User/Datastream/Palm/CMakeLists.txt
src/DSC/ParallelDSC/CMakeLists.txt
src/GenericObj/CMakeLists.txt
src/HDFPersist/CMakeLists.txt
src/KernelHelpers/CMakeLists.txt
src/KernelHelpers/Test/CMakeLists.txt
src/Launcher/CMakeLists.txt
src/Launcher_SWIG/CMakeLists.txt
src/LifeCycleCORBA/CMakeLists.txt
src/LifeCycleCORBA/Test/CMakeLists.txt
src/LifeCycleCORBA_SWIG/CMakeLists.txt
src/Logger/CMakeLists.txt
src/MPIContainer/CMakeLists.txt
src/ModuleCatalog/CMakeLists.txt
src/NOTIFICATION_SWIG/CMakeLists.txt
src/NamingService/CMakeLists.txt
src/NamingService/Test/CMakeLists.txt
src/Notification/CMakeLists.txt
src/ParallelContainer/CMakeLists.txt
src/Registry/CMakeLists.txt
src/ResourcesManager/CMakeLists.txt
src/SALOMEDS/CMakeLists.txt
src/SALOMEDS/Test/CMakeLists.txt
src/SALOMEDSClient/CMakeLists.txt
src/SALOMEDSImpl/CMakeLists.txt
src/SALOMEDSImpl/Test/CMakeLists.txt
src/SALOMELocalTrace/CMakeLists.txt
src/SALOMELocalTrace/Test/CMakeLists.txt
src/SALOMESDS/CMakeLists.txt
src/SALOMETraceCollector/CMakeLists.txt
src/SALOMETraceCollector/Test/CMakeLists.txt
src/TOOLSDS/CMakeLists.txt
src/TestContainer/CMakeLists.txt
src/TestMPIContainer/CMakeLists.txt
src/UnitTests/CMakeLists.txt
src/Utils/CMakeLists.txt
src/Utils/Test/CMakeLists.txt

index c1d925ba15818abe4dbdc58b2881e6238beb035f..b87f6e1a4f37bea73444f37ff879717e5a1927e0 100755 (executable)
@@ -57,6 +57,7 @@ SET(LONG_OR_INT int)
 
 # User options
 # ============
+option(RELOCATABLE "Make installed targets relocatable (disable by default)" OFF)
 OPTION(SALOME_BUILD_DOC "Generate SALOME KERNEL documentation" ON)
 OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON)
 
@@ -167,11 +168,41 @@ SET(SALOME_INSTALL_DOC share/doc/salome CACHE PATH "Install path: SALOME documen
 SET(SALOME_KERNEL_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/kernel" CACHE PATH "Install path: SALOME KERNEL specific data")
 SET(SALOME_KERNEL_INSTALL_RES_SCRIPTS "${SALOME_INSTALL_RES}/kernel" CACHE PATH "Install path: SALOME KERNEL specific scripts")
 
+################
+# Runtime path #
+################
+
+# Define the rpath
+macro(complete_rpath rpath root_dir)
+    if(NOT "${${root_dir}}" STREQUAL "${CMAKE_INSTALL_PREFIX}")
+        # the RPATH to be used when installing, but only if it's not a system directory
+        list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${${root_dir}}/lib" isSystemDir)
+        if("${isSystemDir}" STREQUAL "-1")
+            message(STATUS "==> add to rpath ${${root_dir}}/lib")
+            set(${rpath}
+                "${${rpath}}"
+                "${${root_dir}}/lib")
+        endif("${isSystemDir}" STREQUAL "-1")
+        unset(isSystemDir)
+    endif(NOT "${${root_dir}}" STREQUAL "${CMAKE_INSTALL_PREFIX}")
+endmacro()
+
+# Set the run-time search path if the installation isn't relocatable
+if(RELOCATABLE)
+    set(rpath_install_libs "$ORIGIN/../../${SALOME_INSTALL_LIBS}")
+    set(rpath_install_python "$ORIGIN/../../../../${SALOME_INSTALL_PYTHON}:$ORIGIN/../../../../${SALOME_INSTALL_LIBS}")
+    message(STATUS "==> rpath_install_libs is set to ${rpath_install_libs}")
+    message(STATUS "==> rpath_install_python is set to ${rpath_install_python}")
+endif(RELOCATABLE)
+
 MARK_AS_ADVANCED(SALOME_INSTALL_BINS SALOME_INSTALL_LIBS SALOME_INSTALL_IDLS SALOME_INSTALL_HEADERS)
 MARK_AS_ADVANCED(SALOME_INSTALL_SCRIPT_SCRIPTS SALOME_INSTALL_SCRIPT_DATA SALOME_INSTALL_SCRIPT_PYTHON)
 MARK_AS_ADVANCED(SALOME_INSTALL_APPLISKEL_SCRIPTS  SALOME_INSTALL_APPLISKEL_PYTHON SALOME_INSTALL_CMAKE SALOME_INSTALL_CMAKE_LOCAL SALOME_INSTALL_RES)
 MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_INSTALL_PYTHON_SHARED SALOME_KERNEL_INSTALL_RES_DATA SALOME_KERNEL_INSTALL_RES_SCRIPTS SALOME_INSTALL_DOC)
 MARK_AS_ADVANCED(SALOME_INSTALL_AMCONFIG SALOME_INSTALL_AMCONFIG_LOCAL)
+if(RELOCATABLE)
+    MARK_AS_ADVANCED(rpath_install_libs rpath_install_libs rpath_install_python)
+endif(RELOCATABLE)
 
 # Accumulate environment variables for KERNEL module
 SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_BINS}
@@ -187,6 +218,14 @@ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfileInstall.cmake
         DESTINATION ${KERNEL_TEST_DIR}
         RENAME CTestTestfile.cmake)
 
+if(RELOCATABLE)
+    # rpath_install_test_bins should be used with by concataing it with the bin test directory
+    set(rpath_install_test_libs "$ORIGIN/../../../../../${KERNEL_TEST_LIB}:$ORIGIN/../../../../../${SALOME_INSTALL_LIBS}")
+    set(rpath_install_test_bins "${rpath_install_test_libs}:$ORIGIN/../../../../../${SALOME_INSTALL_LIBS}")
+    message(STATUS "==> rpath_install_test_bins is set to ${rpath_install_test_bins}")
+    message(STATUS "==> rpath_install_test_libs is set to ${rpath_install_test_libs}")
+    MARK_AS_ADVANCED(rpath_install_test_bins rpath_install_test_libs)
+endif(RELOCATABLE)
 
 IF(SALOME_LIGHT_ONLY)
   ADD_DEFINITIONS(-DSALOME_LIGHT)
index fc044fdbbae43554695a0a9a65abb48db80bf193..2c2eb57de17963ed187e1191f17ea5e0b0eec795 100644 (file)
@@ -83,6 +83,13 @@ OMNIORB_ADD_MODULE(SalomeIDLKernel "${SalomeIDLKernel_IDLSOURCES}" "${IDL_INCLUD
 ADD_DEFINITIONS(${COMMON_FLAGS})
 TARGET_LINK_LIBRARIES(SalomeIDLKernel ${OMNIORB_LIBRARIES})
 
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeIDLKernel
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
+
 INSTALL(TARGETS SalomeIDLKernel EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 IF(SALOME_PACO_PARALLEL)
@@ -194,6 +201,12 @@ IF(SALOME_PACO_PARALLEL)
     ${SalomeParallelIDLKernel_GEN_PACO_SOURCES}
   )
   ADD_DEPENDENCIES(SalomeParallelIDLKernel BUILD_PAR_INCLUDES)
+  if(RELOCATABLE)
+      set_property(
+          TARGET SalomeParallelIDLKernel
+          PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+      )
+  endif()
 
   INSTALL(TARGETS SalomeParallelIDLKernel EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 ENDIF()
index 1089254e230d2dab09232e738f9aed6cbf594881..f199f56510731f6bfec3c76de3da27bd69915171 100644 (file)
@@ -40,10 +40,16 @@ ELSE()
   SWIG_ADD_LIBRARY(ArgvKeeper LANGUAGE python SOURCES ArgvKeeper.i ArgvKeeper.hxx)
 ENDIF()
 IF(${MACHINE} STREQUAL WINDOWS)
-  SET_TARGET_PROPERTIES(_ArgvKeeper PROPERTIES DEBUG_OUTPUT_NAME _ArgvKeeper_d)
+  SET_TARGET_PROPERTIES(${SWIG_MODULE_ArgvKeeper_REAL_NAME} PROPERTIES DEBUG_OUTPUT_NAME _ArgvKeeper_d)
 ENDIF(${MACHINE} STREQUAL WINDOWS)
 SWIG_LINK_LIBRARIES(ArgvKeeper ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} ArgvKeeper)
-INSTALL(TARGETS _ArgvKeeper DESTINATION ${SALOME_INSTALL_PYTHON})
+if(RELOCATABLE)
+    set_property(
+        TARGET ${SWIG_MODULE_ArgvKeeper_REAL_NAME}
+        PROPERTY INSTALL_RPATH "${rpath_install_python}"
+    )
+endif()
+INSTALL(TARGETS ${SWIG_MODULE_ArgvKeeper_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON})
 SALOME_INSTALL_SCRIPTS( "${_swig_SCRIPTS}" ${SALOME_INSTALL_PYTHON} DEF_PERMS)
 
 # Tests
index ea87a0707672e8ab2854c0550d4e9e80a4949311..72f188d69b0068301b5cdc201cdd4bfdb800eedb 100644 (file)
@@ -29,6 +29,12 @@ ADD_DEFINITIONS(${CPPUNIT_DEFINITIONS})
 
 ADD_EXECUTABLE(TestArgvKeeper ArgvKeeperTest.cxx TestArgvKeeper.cxx)
 TARGET_LINK_LIBRARIES(TestArgvKeeper ArgvKeeper ${CPPUNIT_LIBRARIES})
+if(RELOCATABLE)
+    set_property(
+        TARGET TestArgvKeeper
+        PROPERTY INSTALL_RPATH "${rpath_install_test_bins}"
+    )
+endif()
 
 INSTALL(TARGETS TestArgvKeeper DESTINATION ${LOCAL_TEST_DIR})
 INSTALL(FILES test_ArgvKeeper.py DESTINATION ${LOCAL_TEST_DIR})
index 6d26785dd799388fee33f531e2596fa5ef5b95ca..33b4d7c2c78792550eac5cc80725b34d922cb55d 100644 (file)
@@ -40,9 +40,16 @@ SET(SALOMEBasics_SOURCES
 
 ADD_LIBRARY(SALOMELog ${SALOMELog_SOURCES})
 TARGET_LINK_LIBRARIES(SALOMELog ${PLATFORM_LIBS} ${PTHREAD_LIBRARIES})
-INSTALL(TARGETS SALOMELog EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 ADD_LIBRARY(SALOMEBasics ${SALOMEBasics_SOURCES})
+if(RELOCATABLE)
+    set_property(
+        TARGET SALOMELog SALOMEBasics
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
+
+INSTALL(TARGETS SALOMELog EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 INSTALL(TARGETS SALOMEBasics EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 TARGET_LINK_LIBRARIES(SALOMEBasics SALOMELog ${PLATFORM_LIBS} ${PTHREAD_LIBRARIES})
@@ -62,10 +69,16 @@ ELSE()
   SWIG_ADD_LIBRARY(KernelBasis LANGUAGE python SOURCES ${KernelBasis_SOURCES})
 ENDIF()
 IF(${MACHINE} STREQUAL WINDOWS)
-  SET_TARGET_PROPERTIES(_KernelBasis PROPERTIES DEBUG_OUTPUT_NAME _KernelBasis_d)
+  SET_TARGET_PROPERTIES(${SWIG_MODULE_KernelBasis_REAL_NAME} PROPERTIES DEBUG_OUTPUT_NAME _KernelBasis_d)
 ENDIF(${MACHINE} STREQUAL WINDOWS)
 SWIG_LINK_LIBRARIES(KernelBasis ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} SALOMEBasics)
-install(TARGETS _KernelBasis DESTINATION ${SALOME_INSTALL_PYTHON})
+if(RELOCATABLE)
+    set_property(
+        TARGET ${SWIG_MODULE_KernelBasis_REAL_NAME}
+        PROPERTY INSTALL_RPATH "${rpath_install_python}"
+    )
+endif()
+install(TARGETS ${SWIG_MODULE_KernelBasis_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON})
 install(FILES ${KernelBasis_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
 install(FILES ${_swig_SCRIPTS} DESTINATION ${SALOME_INSTALL_PYTHON})
 
index a0ab87fb165cf4dc399d293f5d5448c1feed700a..199635c9222f74b214f6f1896874402bd7e53f5f 100755 (executable)
@@ -54,6 +54,12 @@ ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${MPI_DEFINITIONS})
 
 ADD_LIBRARY(SalomeCommunication ${SalomeCommunication_SOURCES})
 TARGET_LINK_LIBRARIES(SalomeCommunication ${COMMON_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeCommunication
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeCommunication EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 SET(COMMON_HEADERS_HXX
index c9ab96a9e61708a2a2ff1a1b03ac975cf1825ec4..683641ca4f3d85a3207b0e40f0585eadd23e1bc6 100644 (file)
@@ -57,10 +57,17 @@ ENDIF()
 SWIG_LINK_LIBRARIES(libSALOME_Comm ${_libSALOME_Comm_LIBS})
 
 IF(${MACHINE} STREQUAL WINDOWS)
-  SET_TARGET_PROPERTIES(_libSALOME_Comm PROPERTIES DEBUG_OUTPUT_NAME _libSALOME_Comm_d)
+  SET_TARGET_PROPERTIES(${SWIG_MODULE_libSALOME_Comm_REAL_NAME} PROPERTIES DEBUG_OUTPUT_NAME _libSALOME_Comm_d)
 ENDIF(${MACHINE} STREQUAL WINDOWS)
 
-ADD_DEPENDENCIES(_libSALOME_Comm SalomeIDLKernel)
+ADD_DEPENDENCIES(${SWIG_MODULE_libSALOME_Comm_REAL_NAME} SalomeIDLKernel)
 
-INSTALL(TARGETS _libSALOME_Comm DESTINATION ${SALOME_INSTALL_PYTHON})
+if(RELOCATABLE)
+    set_property(
+        TARGET ${SWIG_MODULE_libSALOME_Comm_REAL_NAME}
+        PROPERTY INSTALL_RPATH "${rpath_install_python}"
+    )
+endif()
+
+INSTALL(TARGETS ${SWIG_MODULE_libSALOME_Comm_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON})
 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libSALOME_Comm.py DESTINATION ${SALOME_INSTALL_PYTHON})
index 054cb6ec3ed77fcad9acd1a951ac5aa84b001874..00cd73ac77bd2d7059b9977adf760f916b8abfb2 100644 (file)
@@ -99,6 +99,12 @@ SET(SalomeContainer_SOURCES
 
 ADD_LIBRARY(SalomeContainer ${SalomeContainer_SOURCES})
 TARGET_LINK_LIBRARIES(SalomeContainer ${COMMON_LIBS} ${PTHREAD_LIBRARIES})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeContainer
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeContainer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 SET(SALOME_Container_LIBS
@@ -111,6 +117,12 @@ SET(SALOME_Container_LIBS
 
 ADD_LIBRARY(SalomeContainerServer SALOME_Container_SignalsHandler.cxx)
 TARGET_LINK_LIBRARIES(SalomeContainerServer ${SALOME_Container_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeContainerServer
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeContainerServer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 ADD_EXECUTABLE(SALOME_Container SALOME_Container.cxx)
@@ -135,6 +147,12 @@ IF(SALOME_BUILD_TESTS)
   ADD_EXECUTABLE(TestSalome_file TestSalome_file.cxx)
   TARGET_LINK_LIBRARIES(TestSalome_file SALOMETraceCollectorTest ${SALOME_Container_LIBS})
 ENDIF()
+if(RELOCATABLE)
+    set_property(
+        TARGET SALOME_Container SALOME_Container_No_NS_Serv SALOME_Container_No_NS_Serv_OutProcess SALOME_Container_No_NS_Serv_OutProcess_Replay SALOME_Container_No_NS_Serv_OutProcess_FT SALOME_Container_No_NS_Serv_OutProcess_Replay_FT
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SALOME_Container SALOME_Container_No_NS_Serv SALOME_Container_No_NS_Serv_OutProcess SALOME_Container_No_NS_Serv_OutProcess_Replay SALOME_Container_No_NS_Serv_OutProcess_FT SALOME_Container_No_NS_Serv_OutProcess_Replay_FT DESTINATION ${SALOME_INSTALL_BINS})
 
 # Executable scripts to be installed
@@ -158,10 +176,16 @@ ELSE()
   SWIG_ADD_LIBRARY(KernelContainer LANGUAGE python SOURCES ${KernelContainer_SOURCES})
 ENDIF()
 IF(${MACHINE} STREQUAL WINDOWS)
-  SET_TARGET_PROPERTIES(_KernelContainer PROPERTIES DEBUG_OUTPUT_NAME _KernelContainer_d)
+  SET_TARGET_PROPERTIES(${SWIG_MODULE_KernelContainer_REAL_NAME} PROPERTIES DEBUG_OUTPUT_NAME _KernelContainer_d)
 ENDIF(${MACHINE} STREQUAL WINDOWS)
 SWIG_LINK_LIBRARIES(KernelContainer ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} SalomeContainer SalomeKernelHelpers)
-install(TARGETS _KernelContainer DESTINATION ${SALOME_INSTALL_PYTHON})
+if(RELOCATABLE)
+    set_property(
+        TARGET ${SWIG_MODULE_KernelContainer_REAL_NAME}
+        PROPERTY INSTALL_RPATH "${rpath_install_python}"
+    )
+endif()
+install(TARGETS ${SWIG_MODULE_KernelContainer_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON})
 install(FILES ${KernelContainer_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
 # /!\ Order of next 2 lines is important
 # because SALOME_INSTALL_SCRIPTS macro will compute the pyc/pyo files
index df364cb03fdd08bed326923739ff0fb261eeb672..bddbfc87167469210a8bf2a17cc309464b307724 100644 (file)
@@ -37,6 +37,12 @@ INSTALL(TARGETS DF EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTAL
 
 ADD_EXECUTABLE(testDF testDF.cxx)
 TARGET_LINK_LIBRARIES(testDF DF SALOMEBasics)
+if(RELOCATABLE)
+    set_property(
+        TARGET testDF
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS testDF DESTINATION ${SALOME_INSTALL_BINS})
 
 FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
index 971adbeb6de2eb82f5b1c556d7c9f78105ce3a24..25a49edf5450525883a13ab78750d4fe0480c952 100644 (file)
@@ -42,6 +42,12 @@ ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
 
 ADD_LIBRARY(SalomeDSCContainer ${SalomeDSCContainer_SOURCES})
 TARGET_LINK_LIBRARIES(SalomeDSCContainer SalomeContainer ${OMNIORB_LIBRARIES})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeDSCContainer
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeDSCContainer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 SET(SALOME_ConnectionManagerServer_SOURCES
@@ -60,6 +66,12 @@ SET(SALOME_ConnectionManagerServer_LIBS
 
 ADD_EXECUTABLE(SALOME_ConnectionManagerServer ${SALOME_ConnectionManagerServer_SOURCES})
 TARGET_LINK_LIBRARIES(SALOME_ConnectionManagerServer ${SALOME_ConnectionManagerServer_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SALOME_ConnectionManagerServer
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SALOME_ConnectionManagerServer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS})
 
 FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
index 319782d7d42d9970e014859e243e9f7ac594b87e..4ef276702ae7f229a8374f87f3f1f1bde723be93 100644 (file)
@@ -64,8 +64,14 @@ ELSE()
   SWIG_ADD_LIBRARY(calcium LANGUAGE python SOURCES calcium.i)
 ENDIF()
 
-SWIG_LINK_LIBRARIES(calcium ${_calcium_LIBS})
-INSTALL(TARGETS _calcium DESTINATION ${SALOME_INSTALL_PYTHON})
+SWIG_LINK_LIBRARIES(calcium ${${SWIG_MODULE_calcium_REAL_NAME}})
+if(RELOCATABLE)
+    set_property(
+        TARGET ${SWIG_MODULE_calcium_REAL_NAME}
+        PROPERTY INSTALL_RPATH "${rpath_install_python}"
+    )
+endif()
+INSTALL(TARGETS ${SWIG_MODULE_calcium_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON})
 
 SET(SCRIPTS
   dsccalcium.py
index 9d4bb949ed77f24b9babc1b114207afcf35699f9..e55044ff11aaec06dd646aa58ac656efd590e82c 100644 (file)
@@ -40,6 +40,12 @@ SET(SalomeDSCSupervBasic_SOURCES
 ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
 ADD_LIBRARY(SalomeDSCSupervBasic ${SalomeDSCSupervBasic_SOURCES})
 TARGET_LINK_LIBRARIES(SalomeDSCSupervBasic SalomeDSCSuperv)
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeDSCSupervBasic
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeDSCSupervBasic EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
index 12cb2afc583161d9ef6e7e08b7c696d35ab7a95e..3c6cd047065089a710c83dbfededc1ee4ebaada9 100644 (file)
@@ -46,6 +46,12 @@ SET(SalomeDSCSuperv_SOURCES
 
 ADD_LIBRARY(SalomeDSCSuperv ${SalomeDSCSuperv_SOURCES})
 TARGET_LINK_LIBRARIES(SalomeDSCSuperv SalomeDSCContainer ${PLATFORM_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeDSCSuperv
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeDSCSuperv EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 ADD_EXECUTABLE(test_DSC_Exception test_DSC_Exception.cxx)
index 37d44f3de5c4b715b5acff51c34050f25dd78b85..9e2b9b842222e334bb3006d7bb363fb935b4b262 100644 (file)
@@ -40,6 +40,12 @@ ADD_DEFINITIONS(${BOOST_DEFINITIONS})
 
 ADD_LIBRARY(SalomeDatastream fake.cc)
 TARGET_LINK_LIBRARIES(SalomeDatastream ${COMMON_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeDatastream
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeDatastream EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 SET(COMMON_HEADERS_HXX
index eb097abe968204a7d8e6207c1da4503edb6a263e..d8f6909a92abb14772c97b2d756879423c9902ce 100644 (file)
@@ -56,6 +56,12 @@ ADD_DEFINITIONS(${BOOST_DEFINITIONS} ${OMNIORB_DEFINITIONS})
 
 ADD_LIBRARY(SalomeCalcium ${SalomeCalcium_SOURCES})
 TARGET_LINK_LIBRARIES(SalomeCalcium SalomeDSCSuperv SalomeContainer ${OMNIORB_LIBRARIES} ${PLATFORM_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeCalcium
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 
 INSTALL(TARGETS SalomeCalcium EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
@@ -66,6 +72,12 @@ SET(CalciumC_SOURCES
 )
 ADD_LIBRARY(CalciumC ${CalciumC_SOURCES})
 TARGET_LINK_LIBRARIES(CalciumC SalomeDSCSuperv SalomeCalcium)
+if(RELOCATABLE)
+    set_property(
+        TARGET CalciumC
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 
 INSTALL(TARGETS CalciumC EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
index 5f8c506aa7737fa014c0df79c1dd471a2d129c54..68ec8a81e4ce94d901365f882477605c5e39a526 100644 (file)
@@ -37,6 +37,12 @@ ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
 
 ADD_LIBRARY(SalomePalm palm_port_factory.cxx)
 TARGET_LINK_LIBRARIES(SalomePalm SalomeDSCSuperv ${OMNIORB_LIBRARIES})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomePalm
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 
 INSTALL(TARGETS SalomePalm EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
index 678b22b11ef82f91b35826035fe1fa19e193f648..ae6003eabd9c2802b17f8e65ab50a4a32486b44b 100644 (file)
@@ -48,6 +48,12 @@ SET(SalomeParallelDSCContainer_SOURCES
 
 ADD_LIBRARY(SalomeParallelDSCContainer ${SalomeParallelDSCContainer_SOURCES})
 ADD_DEPENDENCIES(SalomeParallelDSCContainer SalomeParallelIDLKernel)
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeParallelDSCContainer
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeParallelDSCContainer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
index 0ce1661adb5275dfa1b193971789f6c1321c19e0..7b65e43d3439d5d50a2458a79d686a33247f5710 100644 (file)
@@ -29,6 +29,12 @@ INCLUDE_DIRECTORIES(
 ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
 ADD_LIBRARY(SalomeGenericObj SALOME_GenericObj_i.cc)
 TARGET_LINK_LIBRARIES(SalomeGenericObj SALOMELocalTrace SalomeIDLKernel)
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeGenericObj
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 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})
index 305a607378f96b1aabbf3a1a714cee8b4544f3a1..57f9c9ae40c26c2d7958e95f56a6b1aec7107533 100644 (file)
@@ -30,6 +30,12 @@ ADD_DEFINITIONS(${HDF5_DEFINITIONS})
 
 ADD_LIBRARY(SalomeHDFPersist ${SalomeHDFPersist_SOURCES})
 TARGET_LINK_LIBRARIES(SalomeHDFPersist ${HDF5_LIBRARIES} ${MPI_LIBRARIES} ${PLATFORM_LIBS} SALOMEBasics)
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeHDFPersist
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeHDFPersist EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
index 55bb64a20a8658f7008b64a5004759331e467027..5fe55a0b65ffb61bae6a56f0bd9ad97a3722fef2 100644 (file)
@@ -43,6 +43,12 @@ SET(SalomeORB_SOURCES
 
 ADD_LIBRARY(SalomeORB ${SalomeORB_SOURCES})
 TARGET_LINK_LIBRARIES(SalomeORB OpUtil ${OMNIORB_LIBRARIES})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeORB
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeORB EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 SET(SalomeKernelHelpers_LIBS
@@ -68,10 +74,22 @@ ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
 
 ADD_LIBRARY(SalomeKernelHelpers ${SalomeKernelHelpers_SOURCES})
 TARGET_LINK_LIBRARIES(SalomeKernelHelpers ${SalomeKernelHelpers_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeKernelHelpers
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeKernelHelpers EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 ADD_EXECUTABLE(KernelHelpersUseCases KernelHelpersUseCases.cxx)
 TARGET_LINK_LIBRARIES(KernelHelpersUseCases SalomeKernelHelpers ${SalomeKernelHelpers_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET KernelHelpersUseCases
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS KernelHelpersUseCases DESTINATION ${SALOME_INSTALL_BINS})
 
 #
@@ -88,10 +106,16 @@ ELSE()
   SWIG_ADD_LIBRARY(KernelServices LANGUAGE python SOURCES ${KernelServices_SOURCES})
 ENDIF()
 IF(${MACHINE} STREQUAL WINDOWS)
-  SET_TARGET_PROPERTIES(_KernelServices PROPERTIES DEBUG_OUTPUT_NAME _KernelServices_d)
+  SET_TARGET_PROPERTIES(${SWIG_MODULE_KernelServices_REAL_NAME} PROPERTIES DEBUG_OUTPUT_NAME _KernelServices_d)
 ENDIF(${MACHINE} STREQUAL WINDOWS)
 SWIG_LINK_LIBRARIES(KernelServices ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} SalomeKernelHelpers)
-install(TARGETS _KernelServices DESTINATION ${SALOME_INSTALL_PYTHON})
+if(RELOCATABLE)
+    set_property(
+        TARGET ${SWIG_MODULE_KernelServices_REAL_NAME}
+        PROPERTY INSTALL_RPATH "${rpath_install_python}"
+    )
+endif()
+install(TARGETS ${SWIG_MODULE_KernelServices_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON})
 install(FILES ${KernelServices_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
 install(FILES ${_swig_SCRIPTS} DESTINATION ${SALOME_INSTALL_PYTHON})
 
index 944db57bc5086032acd22481c5f2914694c0bc51..57cae36827f980f32b42352b4628a513ca389828 100644 (file)
@@ -56,11 +56,23 @@ SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/KernelHelpers)
 
 ADD_LIBRARY(SalomeKernelHelpersTest KernelHelpersUnitTests.cxx)
 TARGET_LINK_LIBRARIES(SalomeKernelHelpersTest ${SalomeKernelHelpersTest_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeKernelHelpersTest
+        PROPERTY INSTALL_RPATH "${rpath_install_test_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeKernelHelpersTest DESTINATION ${KERNEL_TEST_LIB})
 
 ADD_EXECUTABLE(TestKernelHelpers TestKernelHelpers.cxx)
 TARGET_LINK_LIBRARIES(TestKernelHelpers SalomeKernelHelpersTest ${SalomeKernelHelpersTest_LIBS})
 #ADD_TEST(TestKernelHelpers TestKernelHelpers)
+if(RELOCATABLE)
+    set_property(
+        TARGET TestKernelHelpers
+        PROPERTY INSTALL_RPATH "${rpath_install_test_bins}"
+    )
+endif()
 INSTALL(TARGETS TestKernelHelpers DESTINATION ${LOCAL_TEST_DIR})
 
 # Executable scripts to be installed
index 6acb1414d0f2560bb9278e2e4804a8407293c5a2..5968c6b1772661202516358ea4eb7597fa86e55e 100644 (file)
@@ -87,6 +87,14 @@ SET(Launcher_SOURCES
 
 ADD_LIBRARY(Launcher ${Launcher_SOURCES})
 TARGET_LINK_LIBRARIES(Launcher ResourcesManager ${LIBBATCH_LIBRARIES} ${LIBXML2_LIBS} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY})
+if(RELOCATABLE)
+    set(rpath "${rpath_install_libs}")
+    complete_rpath(rpath LIBBATCH_ROOT_DIR)
+    set_property(
+        TARGET Launcher
+        PROPERTY INSTALL_RPATH "${rpath}"
+    )
+endif()
 INSTALL(TARGETS Launcher EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 SET(TestLauncher_LIBS
@@ -101,10 +109,26 @@ SET(TestLauncher_LIBS
 # TestLauncher needs only (and must need only) libxml, libbatch, ResourceManager and Launcher libraries!
 ADD_EXECUTABLE(TestLauncher TestLauncher.cxx)
 TARGET_LINK_LIBRARIES(TestLauncher ${TestLauncher_LIBS})
+if(RELOCATABLE)
+    set(rpath "${rpath_install_libs}")
+    complete_rpath(rpath LIBBATCH_ROOT_DIR)
+    set_property(
+        TARGET TestLauncher
+        PROPERTY INSTALL_RPATH "${rpath}"
+    )
+endif()
 INSTALL(TARGETS TestLauncher DESTINATION ${SALOME_INSTALL_BINS})
 
 ADD_LIBRARY(SalomeLauncher BatchTest.cxx SALOME_Launcher.cxx SALOME_ExternalServerLauncher.cxx SALOME_LauncherException.cxx SALOME_ExternalServerHandler.cxx SALOME_LogManager.cxx)
 TARGET_LINK_LIBRARIES(SalomeLauncher Launcher ${COMMON_LIBS})
+if(RELOCATABLE)
+    set(rpath "${rpath_install_libs}")
+    complete_rpath(rpath LIBBATCH_ROOT_DIR)
+    set_property(
+        TARGET SalomeLauncher
+        PROPERTY INSTALL_RPATH "${rpath}"
+    )
+endif()
 INSTALL(TARGETS SalomeLauncher EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
   
 SET(SALOME_LauncherServer_LIBS
@@ -121,6 +145,14 @@ SET(SALOME_LauncherServer_LIBS
 
 ADD_EXECUTABLE(SALOME_LauncherServer SALOME_LauncherServer.cxx)
 TARGET_LINK_LIBRARIES(SALOME_LauncherServer ${SALOME_LauncherServer_LIBS})
+if(RELOCATABLE)
+    set(rpath "${rpath_install_libs}")
+    complete_rpath(rpath LIBBATCH_ROOT_DIR)
+    set_property(
+        TARGET SALOME_LauncherServer
+        PROPERTY INSTALL_RPATH "${rpath}"
+    )
+endif()
 INSTALL(TARGETS SALOME_LauncherServer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS})
 
 SET(COMMON_HEADERS_HXX
@@ -159,10 +191,16 @@ ELSE()
   SWIG_ADD_LIBRARY(KernelLauncher LANGUAGE python SOURCES ${KernelLauncher_SOURCES})
 ENDIF()
 IF(${MACHINE} STREQUAL WINDOWS)
-  SET_TARGET_PROPERTIES(_KernelLauncher PROPERTIES DEBUG_OUTPUT_NAME _KernelLauncher_d)
+  SET_TARGET_PROPERTIES(${SWIG_MODULE_KernelLauncher_REAL_NAME} PROPERTIES DEBUG_OUTPUT_NAME _KernelLauncher_d)
 ENDIF(${MACHINE} STREQUAL WINDOWS)
 SWIG_LINK_LIBRARIES(KernelLauncher ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} SalomeDS SalomeKernelHelpers)
-install(TARGETS _KernelLauncher DESTINATION ${SALOME_INSTALL_PYTHON})
+if(RELOCATABLE)
+    set_property(
+        TARGET ${SWIG_MODULE_KernelLauncher_REAL_NAME}
+        PROPERTY INSTALL_RPATH "${rpath_install_python}"
+    )
+endif()
+install(TARGETS ${SWIG_MODULE_KernelLauncher_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON})
 install(FILES ${KernelLauncher_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
 
 INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS})
index fea28b491eac4882be02ebc9269f8cc3a76fec09..fbb23ec1d5457fcb99026b9a47aeab3ce525f143 100644 (file)
@@ -42,6 +42,12 @@ INCLUDE_DIRECTORIES(
 
 ADD_LIBRARY(LauncherWrapHelper LauncherResourceDefinition.cxx)
 TARGET_LINK_LIBRARIES(LauncherWrapHelper Launcher)
+if(RELOCATABLE)
+    set_property(
+        TARGET LauncherWrapHelper
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS LauncherWrapHelper EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 IF(WIN32)
   ADD_LIBRARY(LauncherWrapHelper_static STATIC  LauncherResourceDefinition.cxx)
@@ -62,6 +68,12 @@ ELSE(WIN32)
 ENDIF(WIN32)
 
 SWIG_CHECK_GENERATION(${Launcher_target_name})
+if(RELOCATABLE)
+    set_property(
+        TARGET ${SWIG_MODULE_${Launcher_target_name}_REAL_NAME}
+        PROPERTY INSTALL_RPATH "${rpath_install_python}"
+    )
+endif()
 
 INSTALL(TARGETS ${SWIG_MODULE_${Launcher_target_name}_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON})
 
index b76b57636ba895c3d905e0e7645f2b2a2d4d1eeb..be64b018751ba591b00546aed8009184fa05f455 100644 (file)
@@ -57,6 +57,12 @@ ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
 
 ADD_LIBRARY(SalomeLifeCycleCORBA SALOME_LifeCycleCORBA.cxx SALOME_FileTransferCORBA.cxx)
 TARGET_LINK_LIBRARIES(SalomeLifeCycleCORBA ${COMMON_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeLifeCycleCORBA
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeLifeCycleCORBA EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 ADD_EXECUTABLE(Test_LifeCycleCORBA Test_LifeCycleCORBA.cxx)
@@ -65,6 +71,13 @@ TARGET_LINK_LIBRARIES(Test_LifeCycleCORBA SalomeLifeCycleCORBA Registry SalomeNo
 ADD_EXECUTABLE(TestContainerManager TestContainerManager.cxx)
 TARGET_LINK_LIBRARIES(TestContainerManager SalomeLifeCycleCORBA Registry SalomeNotification SalomeContainer ${COMMON_LIBS} ${OMNIORB_LIBRARIES})
 
+if(RELOCATABLE)
+    set_property(
+        TARGET Test_LifeCycleCORBA TestContainerManager
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
+
 INSTALL(TARGETS Test_LifeCycleCORBA TestContainerManager DESTINATION ${SALOME_INSTALL_BINS})
 
 FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
index cfca5b789c0505784a0a386285384802322386e0..057e30c6d15e60a4bdedde08f6ff621fcd4fccd0 100644 (file)
@@ -60,10 +60,22 @@ SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/LifeCycleCORBA)
 
 ADD_LIBRARY(LifeCycleCORBATest LifeCycleCORBATest.cxx)
 TARGET_LINK_LIBRARIES(LifeCycleCORBATest ${COMMON_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET LifeCycleCORBATest
+        PROPERTY INSTALL_RPATH "${rpath_install_test_libs}"
+    )
+endif()
 INSTALL(TARGETS LifeCycleCORBATest DESTINATION ${KERNEL_TEST_LIB})
 
 ADD_EXECUTABLE(TestLifeCycleCORBA TestLifeCycleCORBA.cxx)
 TARGET_LINK_LIBRARIES(TestLifeCycleCORBA LifeCycleCORBATest NamingServiceTest SalomeLifeCycleCORBA ${COMMON_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET TestLifeCycleCORBA
+        PROPERTY INSTALL_RPATH "${rpath_install_test_bins}"
+    )
+endif()
 INSTALL(TARGETS TestLifeCycleCORBA DESTINATION ${LOCAL_TEST_DIR})
 
 # Executable scripts to be installed
index 1fb19d9ce94d2ee86fb869ce3fa082bb5124dd00..27a5e11a7964be61d01897ec254b1e7fd4e814ec 100644 (file)
@@ -47,13 +47,19 @@ ELSE()
 ENDIF()
 
 SWIG_LINK_LIBRARIES(libSALOME_LifeCycleCORBA ${PYTHON_LIBRARIES} SalomeLifeCycleCORBA)
-TARGET_LINK_LIBRARIES(_libSALOME_LifeCycleCORBA ${PLATFORM_LIBS})
+TARGET_LINK_LIBRARIES(${SWIG_MODULE_libSALOME_LifeCycleCORBA_REAL_NAME} ${PLATFORM_LIBS})
 
 IF(${MACHINE} STREQUAL WINDOWS)
-  SET_TARGET_PROPERTIES(_libSALOME_LifeCycleCORBA PROPERTIES DEBUG_OUTPUT_NAME _libSALOME_LifeCycleCORBA_d)
+  SET_TARGET_PROPERTIES(${SWIG_MODULE_libSALOME_LifeCycleCORBA_REAL_NAME} PROPERTIES DEBUG_OUTPUT_NAME _libSALOME_LifeCycleCORBA_d)
 ENDIF(${MACHINE} STREQUAL WINDOWS)
+if(RELOCATABLE)
+    set_property(
+        TARGET ${SWIG_MODULE_libSALOME_LifeCycleCORBA_REAL_NAME}
+        PROPERTY INSTALL_RPATH "${rpath_install_python}"
+    )
+endif()
 
-INSTALL(TARGETS _libSALOME_LifeCycleCORBA DESTINATION ${SALOME_INSTALL_PYTHON})
+INSTALL(TARGETS ${SWIG_MODULE_libSALOME_LifeCycleCORBA_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON})
 SET(SCRIPTS
   TestLifeCycleCORBA.py 
 )
index d7c57863186da1c81a37b86fe7d1d1f633e5a417..649ff8585bfb1b01c1fd8988ca28becc6e8d869d 100644 (file)
@@ -38,6 +38,12 @@ ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
 
 ADD_LIBRARY(SalomeLoggerServer SALOME_Trace.cxx SALOME_Logger_Server.cxx)
 TARGET_LINK_LIBRARIES(SalomeLoggerServer SalomeKernelHelpers  SalomeIDLKernel ${OMNIORB_LIBRARIES} ${PLATFORM_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeLoggerServer
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeLoggerServer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 SET(SALOME_Logger_Server_SOURCES
@@ -56,6 +62,12 @@ SET(SALOME_Logger_Server_LIBS
 
 ADD_EXECUTABLE(SALOME_Logger_Server ${SALOME_Logger_Server_SOURCES})
 TARGET_LINK_LIBRARIES(SALOME_Logger_Server ${SALOME_Logger_Server_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SALOME_Logger_Server
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SALOME_Logger_Server EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS})
 
 SET(KernelLogger_HEADERS KernelLogger.hxx KernelLogger.i)
@@ -70,10 +82,16 @@ ELSE()
   SWIG_ADD_LIBRARY(KernelLogger LANGUAGE python SOURCES ${KernelLogger_SOURCES})
 ENDIF()
 IF(${MACHINE} STREQUAL WINDOWS)
-  SET_TARGET_PROPERTIES(_KernelLogger PROPERTIES DEBUG_OUTPUT_NAME _KernelLogger_d)
+  SET_TARGET_PROPERTIES(${SWIG_MODULE_KernelLogger_REAL_NAME} PROPERTIES DEBUG_OUTPUT_NAME _KernelLogger_d)
 ENDIF(${MACHINE} STREQUAL WINDOWS)
 SWIG_LINK_LIBRARIES(KernelLogger ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} SalomeLoggerServer)
-install(TARGETS _KernelLogger DESTINATION ${SALOME_INSTALL_PYTHON})
+if(RELOCATABLE)
+    set_property(
+        TARGET ${SWIG_MODULE_KernelLogger_REAL_NAME}
+        PROPERTY INSTALL_RPATH "${rpath_install_python}"
+    )
+endif()
+install(TARGETS ${SWIG_MODULE_KernelLogger_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON})
 install(FILES ${KernelLogger_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
 install(FILES ${_swig_SCRIPTS} SALOME_Trace.py DESTINATION ${SALOME_INSTALL_PYTHON})
 
index 4ecd2cafaea80327922617ec19f357bb9e8dfec9..9efe63500777108ef681172ad0b4496bd01aaa4c 100644 (file)
@@ -55,6 +55,12 @@ ADD_DEFINITIONS(${MPI_DEFINITIONS} ${OMNIORB_DEFINITIONS})
 
 ADD_LIBRARY(SalomeMPIContainer MPIObject_i.cxx MPIContainer_i.cxx)
 TARGET_LINK_LIBRARIES(SalomeMPIContainer ${COMMON_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeMPIContainer
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeMPIContainer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 ADD_EXECUTABLE(SALOME_MPIContainer SALOME_MPIContainer.cxx)
@@ -66,6 +72,13 @@ TARGET_LINK_LIBRARIES(testMPI2 ${MPI_CXX_LIBRARIES})
 ADD_EXECUTABLE(getMPIImplementation getMPIImplementation.cxx)
 TARGET_LINK_LIBRARIES(getMPIImplementation ${MPI_CXX_LIBRARIES})
 
+if(RELOCATABLE)
+    set_property(
+        TARGET SALOME_MPIContainer testMPI2 getMPIImplementation
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
+
 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})
index 938365e9c7214622490c4858c2b7b4b722916359..98124ab162ccea307eef02007546655a19a8b294 100644 (file)
@@ -59,6 +59,12 @@ ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${OMNIORB_DEFINITIONS})
 
 ADD_LIBRARY(SalomeCatalog ${SalomeCatalog_SOURCES})
 TARGET_LINK_LIBRARIES(SalomeCatalog ${COMMON_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeCatalog
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeCatalog EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 ADD_EXECUTABLE(SALOME_ModuleCatalog_Server SALOME_ModuleCatalog_Server.cxx)
@@ -67,6 +73,12 @@ TARGET_LINK_LIBRARIES(SALOME_ModuleCatalog_Server SalomeCatalog ${COMMON_LIBS} $
 ADD_EXECUTABLE(SALOME_ModuleCatalog_Client SALOME_ModuleCatalog_Client.cxx)
 TARGET_LINK_LIBRARIES(SALOME_ModuleCatalog_Client SalomeCatalog ${COMMON_LIBS} ${OMNIORB_LIBRARIES})
 
+if(RELOCATABLE)
+    set_property(
+        TARGET SALOME_ModuleCatalog_Client SALOME_ModuleCatalog_Server
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 #
 
 SET(KernelModuleCatalog_HEADERS KernelModuleCatalog.hxx KernelModuleCatalog.i)
@@ -81,10 +93,16 @@ ELSE()
   SWIG_ADD_LIBRARY(KernelModuleCatalog LANGUAGE python SOURCES ${KernelModuleCatalog_SOURCES})
 ENDIF()
 IF(${MACHINE} STREQUAL WINDOWS)
-  SET_TARGET_PROPERTIES(_KernelModuleCatalog PROPERTIES DEBUG_OUTPUT_NAME _KernelModuleCatalog_d)
+  SET_TARGET_PROPERTIES(${SWIG_MODULE_KernelModuleCatalog_REAL_NAME} PROPERTIES DEBUG_OUTPUT_NAME _KernelModuleCatalog_d)
 ENDIF(${MACHINE} STREQUAL WINDOWS)
 SWIG_LINK_LIBRARIES(KernelModuleCatalog ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} SalomeCatalog SalomeKernelHelpers)
-install(TARGETS _KernelModuleCatalog DESTINATION ${SALOME_INSTALL_PYTHON})
+if(RELOCATABLE)
+    set_property(
+        TARGET ${SWIG_MODULE_KernelModuleCatalog_REAL_NAME}
+        PROPERTY INSTALL_RPATH "${rpath_install_python}"
+    )
+endif()
+install(TARGETS ${SWIG_MODULE_KernelModuleCatalog_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON})
 install(FILES ${KernelModuleCatalog_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
 install(FILES ${_swig_SCRIPTS} DESTINATION ${SALOME_INSTALL_PYTHON})
 
index 9dee78791b10d185bfb3f3ec46e7df33de65c42b..9e7b1e826b8f715d19a7777034e88648abd0f3f6 100644 (file)
@@ -48,10 +48,16 @@ SWIG_LINK_LIBRARIES(libNOTIFICATION ${PYTHON_LIBRARIES} SalomeNotification)
 ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
 
 IF(${MACHINE} STREQUAL WINDOWS)
-  SET_TARGET_PROPERTIES(_libNOTIFICATION PROPERTIES DEBUG_OUTPUT_NAME _libNOTIFICATION_d)
+  SET_TARGET_PROPERTIES(${SWIG_MODULE_libNOTIFICATION_REAL_NAME} PROPERTIES DEBUG_OUTPUT_NAME _libNOTIFICATION_d)
 ENDIF(${MACHINE} STREQUAL WINDOWS)
 
-INSTALL(TARGETS _libNOTIFICATION DESTINATION ${SALOME_INSTALL_PYTHON})
+if(RELOCATABLE)
+    set_property(
+        TARGET ${SWIG_MODULE_libNOTIFICATION_REAL_NAME}
+        PROPERTY INSTALL_RPATH "${rpath_install_python}"
+    )
+endif()
+INSTALL(TARGETS ${SWIG_MODULE_libNOTIFICATION_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON})
 
 FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
 INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS})
index b3beed6e00da703b15bbd8ca0fc42cbf5a505f8b..46479baa58019b0e239769e7e355fb5b2225067b 100644 (file)
@@ -55,7 +55,12 @@ ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
 ADD_LIBRARY(SalomeNS ${SalomeNS_SOURCES})
 ADD_DEPENDENCIES(SalomeNS SalomeIDLKernel)
 TARGET_LINK_LIBRARIES(SalomeNS OpUtil SalomeORB)
-
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeNS
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeNS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
@@ -73,9 +78,15 @@ ELSE()
   SWIG_ADD_LIBRARY(NamingService LANGUAGE python SOURCES ${NamingService_SOURCES})
 ENDIF()
 IF(${MACHINE} STREQUAL WINDOWS)
-  SET_TARGET_PROPERTIES(_NamingService PROPERTIES DEBUG_OUTPUT_NAME _NamingService_d)
+  SET_TARGET_PROPERTIES(${SWIG_MODULE_NamingService_REAL_NAME} PROPERTIES DEBUG_OUTPUT_NAME _NamingService_d)
 ENDIF(${MACHINE} STREQUAL WINDOWS)
 SWIG_LINK_LIBRARIES(NamingService ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} SalomeNS)
-install(TARGETS _NamingService DESTINATION ${SALOME_INSTALL_PYTHON})
+if(RELOCATABLE)
+    set_property(
+        TARGET ${SWIG_MODULE_NamingService_REAL_NAME}
+        PROPERTY INSTALL_RPATH "${rpath_install_python}"
+    )
+endif()
+install(TARGETS ${SWIG_MODULE_NamingService_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON})
 install(FILES ${NamingService_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
 install(FILES ${_swig_SCRIPTS} ${PACKAGES} DESTINATION ${SALOME_INSTALL_PYTHON})
index a2327238853383631f950d1f1c8611352f6562f9..7dee895044bd978edeff7b5bbfe3c2c3ba8a6dc1 100644 (file)
@@ -48,6 +48,12 @@ SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/NamingService)
 
 ADD_LIBRARY(NamingServiceTest NamingServiceTest.cxx)
 TARGET_LINK_LIBRARIES(NamingServiceTest ${COMMON_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET NamingServiceTest
+        PROPERTY INSTALL_RPATH "${rpath_install_test_libs}"
+    )
+endif()
 INSTALL(TARGETS NamingServiceTest DESTINATION ${KERNEL_TEST_LIB})
 
 SET(TestNamingService_LIBS
@@ -65,6 +71,12 @@ SET(TestNamingService_LIBS
 
 ADD_EXECUTABLE(TestNamingService TestNamingService.cxx)
 TARGET_LINK_LIBRARIES(TestNamingService ${TestNamingService_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET TestNamingService
+        PROPERTY INSTALL_RPATH "${rpath_install_test_bins}"
+    )
+endif()
 INSTALL(TARGETS TestNamingService DESTINATION ${LOCAL_TEST_DIR})
 
 # Executable scripts to be installed
index bcea6b46f4c07b8d44b5bd204a715f8836a4dab5..347f5b213126afbdca4bb8c4e9e6889f07eb7fba 100644 (file)
@@ -43,6 +43,12 @@ ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
 
 ADD_LIBRARY(SalomeNotification ${SalomeNotification_SOURCES}) 
 TARGET_LINK_LIBRARIES(SalomeNotification ${COMMON_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeNotification
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeNotification EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
index 450597eb4ae6ad29a05303a2fdcc10463cdfb4d3..9ace25335113c82e7dc3975f79c6eef66b36f47e 100644 (file)
@@ -64,6 +64,12 @@ ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${MPI_DEFINITIONS})
 
 ADD_LIBRARY(SalomeParallelContainer ${SalomeParallelContainer_SOURCES})
 TARGET_LINK_LIBRARIES(SalomeParallelContainer ${COMMON_LIBS} ${MPI_CXX_LIBRARIES})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeParallelContainer
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeParallelContainer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 IF(SALOME_USE_MPI)
@@ -78,6 +84,13 @@ IF(SALOME_USE_MPI)
   ADD_EXECUTABLE(SALOME_ParallelContainerNodeMpi SALOME_ParallelContainerNodeMpi.cxx)
   TARGET_LINK_LIBRARIES(SALOME_ParallelContainerNodeMpi ${SALOME_ParallelContainerProxyMpi_LIBS})
 
+  if(RELOCATABLE)
+      set_property(
+          TARGET SALOME_ParallelContainerProxyMpi SALOME_ParallelContainerNodeMpi
+          PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+      )
+  endif()
+
   INSTALL(TARGETS SALOME_ParallelContainerProxyMpi SALOME_ParallelContainerNodeMpi
         EXPORT ${PROJECT_NAME}TargetGroup 
         DESTINATION ${SALOME_INSTALL_BINS})
@@ -94,6 +107,13 @@ TARGET_LINK_LIBRARIES(SALOME_ParallelContainerProxyDummy ${SALOME_ParallelContai
 ADD_EXECUTABLE(SALOME_ParallelContainerNodeDummy SALOME_ParallelContainerNodeDummy.cxx)
 TARGET_LINK_LIBRARIES(SALOME_ParallelContainerNodeDummy ${SALOME_ParallelContainerProxyDummy_LIBS})
 
+if(RELOCATABLE)
+    set_property(
+        TARGET SALOME_ParallelContainerNodeDummy SALOME_ParallelContainerProxyDummy
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
+
 INSTALL(TARGETS SALOME_ParallelContainerNodeDummy SALOME_ParallelContainerProxyDummy DESTINATION ${SALOME_INSTALL_BINS})
 
 FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
index 1fa3b946a568d806405162c083ee639ad3d742cb..d859b746b5fbe2486f8ff9750402464ce381ea0a 100644 (file)
@@ -32,6 +32,12 @@ INCLUDE_DIRECTORIES(
 ADD_LIBRARY(Registry RegistryConnexion.cxx RegistryService.cxx)
 ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
 TARGET_LINK_LIBRARIES(Registry SalomeNS OpUtil SALOMELocalTrace SalomeIDLKernel ${PLATFORM_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET Registry
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS Registry EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 SET(SALOME_Registry_Server_LIBS
@@ -48,6 +54,12 @@ SET(SALOME_Registry_Server_LIBS
 
 ADD_EXECUTABLE(SALOME_Registry_Server SALOME_Registry_Server.cxx)
 TARGET_LINK_LIBRARIES(SALOME_Registry_Server ${SALOME_Registry_Server_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SALOME_Registry_Server
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SALOME_Registry_Server EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS})
 
 FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
index 34f6e1259e54c632a9a604b78875bc26efb6644a..827e61d89b85d903dca59b92d089a4eb4bd58e8f 100644 (file)
@@ -50,6 +50,12 @@ ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${LIBXML2_DEFINITIONS})
 
 ADD_LIBRARY(ResourcesManager ${ResourcesManager_SOURCES})
 TARGET_LINK_LIBRARIES(ResourcesManager SALOMEBasics SALOMELocalTrace ${LIBXML2_LIBRARIES})
+if(RELOCATABLE)
+    set_property(
+        TARGET ResourcesManager
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS ResourcesManager EXPORT ${PROJECT_NAME}TargetGroup 
     DESTINATION ${SALOME_INSTALL_LIBS})
 
@@ -60,6 +66,12 @@ SET(SalomeResourcesManager_SOURCES
 )
 ADD_LIBRARY(SalomeResourcesManager ${SalomeResourcesManager_SOURCES})
 TARGET_LINK_LIBRARIES(SalomeResourcesManager ResourcesManager ${COMMON_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeResourcesManager
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeResourcesManager EXPORT ${PROJECT_NAME}TargetGroup
         DESTINATION ${SALOME_INSTALL_LIBS})
 
index 3556e04a23dadda51cbac5d6f357a17b83c7b1d9..d1ea656e4fae6001ff1632e6e968f2d435100bba 100644 (file)
@@ -155,6 +155,12 @@ SET(SalomeDS_SOURCES
 
 ADD_LIBRARY(SalomeDS ${SalomeDS_SOURCES})
 TARGET_LINK_LIBRARIES(SalomeDS ${COMMON_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeDS
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeDS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 ADD_EXECUTABLE(SALOMEDS_Server SALOMEDS_Server.cxx)
@@ -175,13 +181,25 @@ ELSE()
   SWIG_ADD_LIBRARY(KernelDS LANGUAGE python SOURCES ${KernelDS_SOURCES})
 ENDIF()
 IF(${MACHINE} STREQUAL WINDOWS)
-  SET_TARGET_PROPERTIES(_KernelDS PROPERTIES DEBUG_OUTPUT_NAME _KernelDS_d)
+  SET_TARGET_PROPERTIES(${SWIG_MODULE_KernelDS_REAL_NAME} PROPERTIES DEBUG_OUTPUT_NAME _KernelDS_d)
 ENDIF(${MACHINE} STREQUAL WINDOWS)
 SWIG_LINK_LIBRARIES(KernelDS ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} SalomeDS SalomeKernelHelpers)
-install(TARGETS _KernelDS DESTINATION ${SALOME_INSTALL_PYTHON})
+if(RELOCATABLE)
+    set_property(
+        TARGET ${SWIG_MODULE_KernelDS_REAL_NAME}
+        PROPERTY INSTALL_RPATH "${rpath_install_python}"
+    )
+endif()
+install(TARGETS ${SWIG_MODULE_KernelDS_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON})
 install(FILES ${KernelDS_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
 install(FILES ${_swig_SCRIPTS} SALOME_DriverPy.py DESTINATION ${SALOME_INSTALL_PYTHON})
 
+if(RELOCATABLE)
+    set_property(
+        TARGET SALOMEDS_Server SALOMEDS_Client
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SALOMEDS_Server SALOMEDS_Client
       EXPORT ${PROJECT_NAME}TargetGroup
       DESTINATION ${SALOME_INSTALL_BINS})
index 0ce442637400a95790f0f42b932537ec1c959580..4dea32dcbf7317d079ff308ec4e0de24d9f19e1e 100644 (file)
@@ -78,10 +78,22 @@ ENDIF(WIN32)
 
 ADD_LIBRARY(SALOMEDSTest SALOMEDSTest.cxx)
 TARGET_LINK_LIBRARIES(SALOMEDSTest ${COMMON_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SALOMEDSTest
+        PROPERTY INSTALL_RPATH "${rpath_install_test_libs}"
+    )
+endif()
 INSTALL(TARGETS SALOMEDSTest DESTINATION ${KERNEL_TEST_LIB})
 
 ADD_EXECUTABLE(TestSALOMEDS TestSALOMEDS.cxx)
 TARGET_LINK_LIBRARIES(TestSALOMEDS SALOMEDSTest SALOMEBasics ${COMMON_LIBS} ${OMNIORB_LIBRARIES})
+if(RELOCATABLE)
+    set_property(
+        TARGET TestSALOMEDS
+        PROPERTY INSTALL_RPATH "${rpath_install_test_bins}"
+    )
+endif()
 INSTALL(TARGETS TestSALOMEDS DESTINATION ${LOCAL_TEST_DIR})
 
 # Executable scripts to be installed
index 1e8c7137ba9a1d76cd96efe85ccd5e7ea0a1e398..e70e96c47248b12314515d837a149ca114ecd96c 100644 (file)
@@ -28,6 +28,12 @@ ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
 
 ADD_LIBRARY(SalomeDSClient SALOMEDSClient_ClientFactory.cxx)
 TARGET_LINK_LIBRARIES(SalomeDSClient SalomeIDLKernel ${PLATFORM_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeDSClient
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeDSClient EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
index f264af568fad9c8701db65bfe5c5787772e3b0c9..7eddaffd08077b986b6d7771b6a12a1bb15b9581 100644 (file)
@@ -92,10 +92,22 @@ SET(SalomeDSImpl_SOURCES
 
 ADD_LIBRARY(SalomeDSImpl ${SalomeDSImpl_SOURCES})
 TARGET_LINK_LIBRARIES(SalomeDSImpl SALOMELocalTrace ${COMMON_LIBS} ${PLATFORM_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeDSImpl
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 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})
+if(RELOCATABLE)
+    set_property(
+        TARGET testDS
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS testDS DESTINATION ${SALOME_INSTALL_BINS})
 
 FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
index 54c06447070250b8799338ff23ccec9269f66561..acddd768b3a174a8bd275c0b67ab415af877219b 100644 (file)
@@ -64,10 +64,22 @@ SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/SALOMEDSImpl)
 
 ADD_LIBRARY(SALOMEDSImplTest SALOMEDSImplTest.cxx)
 TARGET_LINK_LIBRARIES(SALOMEDSImplTest ${COMMON_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SALOMEDSImplTest
+        PROPERTY INSTALL_RPATH "${rpath_install_test_libs}"
+    )
+endif()
 INSTALL(TARGETS SALOMEDSImplTest DESTINATION ${KERNEL_TEST_LIB})
 
 ADD_EXECUTABLE(TestSALOMEDSImpl TestSALOMEDSImpl.cxx)
 TARGET_LINK_LIBRARIES(TestSALOMEDSImpl SALOMEDSImplTest SalomeDSImpl NamingServiceTest ${COMMON_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET TestSALOMEDSImpl
+        PROPERTY INSTALL_RPATH "${rpath_install_test_bins}"
+    )
+endif()
 INSTALL(TARGETS TestSALOMEDSImpl DESTINATION ${LOCAL_TEST_DIR})
 
 # Executable scripts to be installed
index 5372a796864034514025ec31150038eeb0ccec10..01a2a5b25bac9af74e6b87445fba46a55f3f1798 100644 (file)
@@ -43,6 +43,12 @@ SET(SALOMELocalTrace_SOURCES
 
 ADD_LIBRARY(SALOMELocalTrace ${SALOMELocalTrace_SOURCES})
 TARGET_LINK_LIBRARIES(SALOMELocalTrace SALOMEBasics SALOMELog ${PLATFORM_LIBS} ${PTHREAD_LIBRARIES})
+if(RELOCATABLE)
+    set_property(
+        TARGET SALOMELocalTrace
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SALOMELocalTrace EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 INSTALL(FILES ${COMMON_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
index 990bea6295b770d5edb4590810b83b18755204ae..bdaea3790da5397263d561191a9073a908605d00 100644 (file)
@@ -30,10 +30,22 @@ SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/SALOMELocalTrace)
 
 ADD_LIBRARY(SALOMELocalTraceTest SALOMELocalTraceTest.cxx)
 TARGET_LINK_LIBRARIES(SALOMELocalTraceTest SALOMELocalTrace ${CPPUNIT_LIBRARIES} ${PTHREAD_LIBRARIES} ${PLATFORM_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SALOMELocalTraceTest
+        PROPERTY INSTALL_RPATH "${rpath_install_test_libs}"
+    )
+endif()
 INSTALL(TARGETS SALOMELocalTraceTest DESTINATION ${KERNEL_TEST_LIB})
 
 ADD_EXECUTABLE(TestSALOMELocalTrace TestSALOMELocalTrace.cxx)
 TARGET_LINK_LIBRARIES(TestSALOMELocalTrace SALOMELocalTraceTest SALOMELocalTrace SALOMEBasics ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS})
+if(RELOCATABLE)
+  set_property(
+      TARGET TestSALOMELocalTrace
+      PROPERTY INSTALL_RPATH "${rpath_install_test_bins}"
+  )
+endif()
 INSTALL(TARGETS TestSALOMELocalTrace DESTINATION ${LOCAL_TEST_DIR})
 
 # Executable scripts to be installed
index 613a60928c7a4c99311349d929511caa0694bd3d..ef9e200075bc9ce72f1f7cb59f0265dc98d66789 100644 (file)
@@ -60,12 +60,24 @@ SET(SalomeSDS_SOURCES
 
 ADD_LIBRARY(SalomeSDS ${SalomeSDS_SOURCES})
 TARGET_LINK_LIBRARIES(SalomeSDS ${COMMON_LIBS} ${PTHREAD_LIBRARIES})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeSDS
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeSDS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 ADD_EXECUTABLE(SALOME_DataScopeServer SALOME_DataScopeServer.cxx)
 TARGET_LINK_LIBRARIES(SALOME_DataScopeServer SalomeSDS)
 ADD_EXECUTABLE(SALOME_DataScopeServer_SSL SALOME_DataScopeServer_SSL.cxx)
 TARGET_LINK_LIBRARIES(SALOME_DataScopeServer_SSL SalomeSDS)
+if(RELOCATABLE)
+    set_property(
+        TARGET SALOME_DataScopeServer SALOME_DataScopeServer_SSL
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SALOME_DataScopeServer SALOME_DataScopeServer_SSL DESTINATION ${SALOME_INSTALL_BINS})
 INSTALL(FILES SalomeSDSClt.py SALOMEWrappedStdType.py DESTINATION ${SALOME_INSTALL_PYTHON})
 FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
@@ -85,9 +97,15 @@ ELSE()
   SWIG_ADD_LIBRARY(KernelSDS LANGUAGE python SOURCES ${KernelSDS_SOURCES})
 ENDIF()
 IF(${MACHINE} STREQUAL WINDOWS)
-  SET_TARGET_PROPERTIES(_KernelSDS PROPERTIES DEBUG_OUTPUT_NAME _KernelSDS_d)
+  SET_TARGET_PROPERTIES(${SWIG_MODULE_KernelSDS_REAL_NAME} PROPERTIES DEBUG_OUTPUT_NAME _KernelSDS_d)
 ENDIF(${MACHINE} STREQUAL WINDOWS)
 SWIG_LINK_LIBRARIES(KernelSDS ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} SalomeSDS)
-install(TARGETS _KernelSDS DESTINATION ${SALOME_INSTALL_PYTHON})
+if(RELOCATABLE)
+    set_property(
+        TARGET ${SWIG_MODULE_KernelSDS_REAL_NAME}
+        PROPERTY INSTALL_RPATH "${rpath_install_python}"
+    )
+endif()
+install(TARGETS ${SWIG_MODULE_KernelSDS_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON})
 install(FILES ${KernelSDS_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
 install(FILES ${_swig_SCRIPTS} DESTINATION ${SALOME_INSTALL_PYTHON})
index 12fef2047c4e8eb14bc1472daae7b132599d226e..f6c6cf22f1a9aa4221c0c3177199f291410a14bb 100644 (file)
@@ -34,6 +34,12 @@ ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${PTHREAD_DEFINITIONS})
 ADD_LIBRARY(with_loggerTraceCollector SALOMETraceCollector.cxx TraceCollector_WaitForServerReadiness.cxx)
 
 TARGET_LINK_LIBRARIES(with_loggerTraceCollector SalomeNS ArgvKeeper SALOMELocalTrace SalomeLoggerServer OpUtil SalomeIDLKernel ${OMNIORB_LIBRARIES} ${PTHREAD_LIBRARIES})
+if(RELOCATABLE)
+    set_property(
+        TARGET with_loggerTraceCollector
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS with_loggerTraceCollector EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
index 5417cfb1e93d9c2883067c51cb6b939179a2e531..ebc855d739afcbb421ba17ca8a1fcfa32a394400 100644 (file)
@@ -41,10 +41,22 @@ SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/SALOMETraceCollector)
 
 ADD_LIBRARY(SALOMETraceCollectorTest SALOMETraceCollectorTest.cxx)
 TARGET_LINK_LIBRARIES(SALOMETraceCollectorTest ${COMMON_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SALOMETraceCollectorTest
+        PROPERTY INSTALL_RPATH "${rpath_install_test_libs}"
+    )
+endif()
 INSTALL(TARGETS SALOMETraceCollectorTest DESTINATION ${KERNEL_TEST_LIB})
 
 ADD_EXECUTABLE(TestSALOMETraceCollector TestSALOMETraceCollector.cxx)
 TARGET_LINK_LIBRARIES(TestSALOMETraceCollector SALOMETraceCollectorTest ${COMMON_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET TestSALOMETraceCollector
+        PROPERTY INSTALL_RPATH "${rpath_install_test_bins}"
+    )
+endif()
 INSTALL(TARGETS TestSALOMETraceCollector DESTINATION ${LOCAL_TEST_DIR})
 
 # Executable scripts to be installed
index 54d3c004047bbba4892f53e0ef5bd7650edd3729..4ee29facc8b867bd7d6a32658ced7c9b91cf7021 100644 (file)
@@ -32,6 +32,12 @@ INCLUDE_DIRECTORIES(
 ADD_LIBRARY(TOOLSDS SALOMEDS_Tool.cxx)
 ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${HDF5_DEFINITIONS} ${BOOST_DEFINITIONS})
 TARGET_LINK_LIBRARIES(TOOLSDS OpUtil SalomeIDLKernel ${OMNIORB_LIBRARIES})
+if(RELOCATABLE)
+    set_property(
+        TARGET TOOLSDS
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS TOOLSDS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
index 47b129395319c4e1e175fda2c129a4fee5bbd7c3..0d23185489586cc387906d447f37e5583675c686 100644 (file)
@@ -57,6 +57,12 @@ ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
 
 ADD_LIBRARY(SalomeTestComponentEngine ${SalomeTestComponentEngine_SOURCES})
 TARGET_LINK_LIBRARIES(SalomeTestComponentEngine ${COMMON_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeTestComponentEngine
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 
 INSTALL(TARGETS SalomeTestComponentEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
@@ -65,6 +71,12 @@ TARGET_LINK_LIBRARIES(TestLogger SalomeTestComponentEngine SALOMEBasics ${COMMON
 
 ADD_EXECUTABLE(TestContainer TestContainer.cxx)
 TARGET_LINK_LIBRARIES(TestContainer SalomeTestComponentEngine SALOMEBasics ${COMMON_LIBS} ${OMNIORB_LIBRARIES})
+if(RELOCATABLE)
+    set_property(
+        TARGET TestLogger TestContainer
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 
 INSTALL(TARGETS TestLogger TestContainer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS})
 
index 204269539a6f49f7f2e3dee9b3be357c14e7d1ff..7942a3de6c97b539c817b63658d2f926243df2cc 100644 (file)
@@ -55,10 +55,22 @@ SET(COMMON_LIBS
 
 ADD_LIBRARY(SalomeTestMPIComponentEngine TestMPIComponentEngine.cxx)
 TARGET_LINK_LIBRARIES(SalomeTestMPIComponentEngine ${COMMON_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET SalomeTestMPIComponentEngine
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS SalomeTestMPIComponentEngine DESTINATION ${SALOME_INSTALL_LIBS})
 
 ADD_EXECUTABLE(TestMPIContainer TestMPIContainer.cxx)
 TARGET_LINK_LIBRARIES(TestMPIContainer SalomeTestMPIComponentEngine ${COMMON_LIBS} ${MPI_CXX_LIBRARIES})
+if(RELOCATABLE)
+    set_property(
+        TARGET TestMPIContainer
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS TestMPIContainer DESTINATION ${SALOME_INSTALL_BINS})
 
 FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
index 9978d708f6467c68487fbd0f9cb99dabe7153962..6031e3eaa7154745ae3feb22e2cc672c8953b6a3 100644 (file)
@@ -94,6 +94,12 @@ ENDIF()
 
 ADD_EXECUTABLE(UnitTests UnitTests.cxx)
 TARGET_LINK_LIBRARIES(UnitTests ${COMMON_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET UnitTests
+        PROPERTY INSTALL_RPATH "${rpath_install_test_bins}"
+    )
+endif()
 INSTALL(TARGETS UnitTests DESTINATION ${LOCAL_TEST_DIR})
 
 INSTALL(FILES CTestTestfileInstall.cmake
index 4af645181df1c5c751f3e084fc67f13e14cc6c39..d9e75fdef000084997acf8e7e9d3b95917cb5c0c 100644 (file)
@@ -83,5 +83,11 @@ install(FILES ${COMMON_SCRIPTS} DESTINATION ${SALOME_INSTALL_PYTHON})
 
 ADD_LIBRARY(OpUtil ${OpUtil_SOURCES})
 TARGET_LINK_LIBRARIES(OpUtil ${COMMON_LIBS})
+if(RELOCATABLE)
+    set_property(
+        TARGET OpUtil
+        PROPERTY INSTALL_RPATH "${rpath_install_libs}"
+    )
+endif()
 INSTALL(TARGETS OpUtil EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS})
index 08c26b9dc3b0cd14ad81ad4dc0c1c7aa1ae2c97f..51b8d2d033b91028c564a16326402d2f54e57008 100644 (file)
@@ -45,10 +45,22 @@ SET(LOCAL_TEST_DIR ${KERNEL_TEST_DIR}/Utils)
 
 ADD_LIBRARY(UtilsTest UtilsTest.cxx)
 TARGET_LINK_LIBRARIES(UtilsTest ${COMMON_LIBS} )
+if(RELOCATABLE)
+    set_property(
+        TARGET UtilsTest
+        PROPERTY INSTALL_RPATH "${rpath_install_test_libs}"
+    )
+endif()
 INSTALL(TARGETS UtilsTest DESTINATION ${KERNEL_TEST_LIB})
 
 ADD_EXECUTABLE(TestUtils TestUtils.cxx)
 TARGET_LINK_LIBRARIES(TestUtils ${COMMON_LIBS} UtilsTest ${OMNIORB_LIBRARIES})
+if(RELOCATABLE)
+    set_property(
+        TARGET TestUtils
+        PROPERTY INSTALL_RPATH "${rpath_install_test_bins}"
+    )
+endif()
 INSTALL(TARGETS TestUtils DESTINATION ${LOCAL_TEST_DIR})
 
 INSTALL(FILES TestUtils.py DESTINATION ${LOCAL_TEST_DIR})