From: Gilles DAVID Date: Thu, 24 Oct 2024 14:36:29 +0000 (+0200) Subject: Ajout d'une option RELOCATABLE qui positionne le RPATH X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6db7c35049df6165848ba0958edf57564d0faa03;p=modules%2Fkernel.git Ajout d'une option RELOCATABLE qui positionne le RPATH --- diff --git a/CMakeLists.txt b/CMakeLists.txt index c1d925ba1..b87f6e1a4 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/idl/CMakeLists.txt b/idl/CMakeLists.txt index fc044fdbb..2c2eb57de 100644 --- a/idl/CMakeLists.txt +++ b/idl/CMakeLists.txt @@ -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() diff --git a/src/ArgvKeeper/CMakeLists.txt b/src/ArgvKeeper/CMakeLists.txt index 1089254e2..f199f5651 100644 --- a/src/ArgvKeeper/CMakeLists.txt +++ b/src/ArgvKeeper/CMakeLists.txt @@ -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 diff --git a/src/ArgvKeeper/Test/CMakeLists.txt b/src/ArgvKeeper/Test/CMakeLists.txt index ea87a0707..72f188d69 100644 --- a/src/ArgvKeeper/Test/CMakeLists.txt +++ b/src/ArgvKeeper/Test/CMakeLists.txt @@ -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}) diff --git a/src/Basics/CMakeLists.txt b/src/Basics/CMakeLists.txt index 6d26785dd..33b4d7c2c 100644 --- a/src/Basics/CMakeLists.txt +++ b/src/Basics/CMakeLists.txt @@ -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}) diff --git a/src/Communication/CMakeLists.txt b/src/Communication/CMakeLists.txt index a0ab87fb1..199635c92 100755 --- a/src/Communication/CMakeLists.txt +++ b/src/Communication/CMakeLists.txt @@ -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 diff --git a/src/Communication_SWIG/CMakeLists.txt b/src/Communication_SWIG/CMakeLists.txt index c9ab96a9e..683641ca4 100644 --- a/src/Communication_SWIG/CMakeLists.txt +++ b/src/Communication_SWIG/CMakeLists.txt @@ -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}) diff --git a/src/Container/CMakeLists.txt b/src/Container/CMakeLists.txt index 054cb6ec3..00cd73ac7 100644 --- a/src/Container/CMakeLists.txt +++ b/src/Container/CMakeLists.txt @@ -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 diff --git a/src/DF/CMakeLists.txt b/src/DF/CMakeLists.txt index df364cb03..bddbfc871 100644 --- a/src/DF/CMakeLists.txt +++ b/src/DF/CMakeLists.txt @@ -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") diff --git a/src/DSC/DSC_Basic/CMakeLists.txt b/src/DSC/DSC_Basic/CMakeLists.txt index 971adbeb6..25a49edf5 100644 --- a/src/DSC/DSC_Basic/CMakeLists.txt +++ b/src/DSC/DSC_Basic/CMakeLists.txt @@ -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") diff --git a/src/DSC/DSC_Python/CMakeLists.txt b/src/DSC/DSC_Python/CMakeLists.txt index 319782d7d..4ef276702 100644 --- a/src/DSC/DSC_Python/CMakeLists.txt +++ b/src/DSC/DSC_Python/CMakeLists.txt @@ -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 diff --git a/src/DSC/DSC_User/Basic/CMakeLists.txt b/src/DSC/DSC_User/Basic/CMakeLists.txt index 9d4bb949e..e55044ff1 100644 --- a/src/DSC/DSC_User/Basic/CMakeLists.txt +++ b/src/DSC/DSC_User/Basic/CMakeLists.txt @@ -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") diff --git a/src/DSC/DSC_User/CMakeLists.txt b/src/DSC/DSC_User/CMakeLists.txt index 12cb2afc5..3c6cd0470 100644 --- a/src/DSC/DSC_User/CMakeLists.txt +++ b/src/DSC/DSC_User/CMakeLists.txt @@ -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) diff --git a/src/DSC/DSC_User/Datastream/CMakeLists.txt b/src/DSC/DSC_User/Datastream/CMakeLists.txt index 37d44f3de..9e2b9b842 100644 --- a/src/DSC/DSC_User/Datastream/CMakeLists.txt +++ b/src/DSC/DSC_User/Datastream/CMakeLists.txt @@ -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 diff --git a/src/DSC/DSC_User/Datastream/Calcium/CMakeLists.txt b/src/DSC/DSC_User/Datastream/Calcium/CMakeLists.txt index eb097abe9..d8f6909a9 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CMakeLists.txt +++ b/src/DSC/DSC_User/Datastream/Calcium/CMakeLists.txt @@ -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}) diff --git a/src/DSC/DSC_User/Datastream/Palm/CMakeLists.txt b/src/DSC/DSC_User/Datastream/Palm/CMakeLists.txt index 5f8c506aa..68ec8a81e 100644 --- a/src/DSC/DSC_User/Datastream/Palm/CMakeLists.txt +++ b/src/DSC/DSC_User/Datastream/Palm/CMakeLists.txt @@ -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}) diff --git a/src/DSC/ParallelDSC/CMakeLists.txt b/src/DSC/ParallelDSC/CMakeLists.txt index 678b22b11..ae6003eab 100644 --- a/src/DSC/ParallelDSC/CMakeLists.txt +++ b/src/DSC/ParallelDSC/CMakeLists.txt @@ -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") diff --git a/src/GenericObj/CMakeLists.txt b/src/GenericObj/CMakeLists.txt index 0ce1661ad..7b65e43d3 100644 --- a/src/GenericObj/CMakeLists.txt +++ b/src/GenericObj/CMakeLists.txt @@ -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}) diff --git a/src/HDFPersist/CMakeLists.txt b/src/HDFPersist/CMakeLists.txt index 305a60737..57f9c9ae4 100644 --- a/src/HDFPersist/CMakeLists.txt +++ b/src/HDFPersist/CMakeLists.txt @@ -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") diff --git a/src/KernelHelpers/CMakeLists.txt b/src/KernelHelpers/CMakeLists.txt index 55bb64a20..5fe55a0b6 100644 --- a/src/KernelHelpers/CMakeLists.txt +++ b/src/KernelHelpers/CMakeLists.txt @@ -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}) diff --git a/src/KernelHelpers/Test/CMakeLists.txt b/src/KernelHelpers/Test/CMakeLists.txt index 944db57bc..57cae3682 100644 --- a/src/KernelHelpers/Test/CMakeLists.txt +++ b/src/KernelHelpers/Test/CMakeLists.txt @@ -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 diff --git a/src/Launcher/CMakeLists.txt b/src/Launcher/CMakeLists.txt index 6acb1414d..5968c6b17 100644 --- a/src/Launcher/CMakeLists.txt +++ b/src/Launcher/CMakeLists.txt @@ -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}) diff --git a/src/Launcher_SWIG/CMakeLists.txt b/src/Launcher_SWIG/CMakeLists.txt index fea28b491..fbb23ec1d 100644 --- a/src/Launcher_SWIG/CMakeLists.txt +++ b/src/Launcher_SWIG/CMakeLists.txt @@ -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}) diff --git a/src/LifeCycleCORBA/CMakeLists.txt b/src/LifeCycleCORBA/CMakeLists.txt index b76b57636..be64b0187 100644 --- a/src/LifeCycleCORBA/CMakeLists.txt +++ b/src/LifeCycleCORBA/CMakeLists.txt @@ -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") diff --git a/src/LifeCycleCORBA/Test/CMakeLists.txt b/src/LifeCycleCORBA/Test/CMakeLists.txt index cfca5b789..057e30c6d 100644 --- a/src/LifeCycleCORBA/Test/CMakeLists.txt +++ b/src/LifeCycleCORBA/Test/CMakeLists.txt @@ -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 diff --git a/src/LifeCycleCORBA_SWIG/CMakeLists.txt b/src/LifeCycleCORBA_SWIG/CMakeLists.txt index 1fb19d9ce..27a5e11a7 100644 --- a/src/LifeCycleCORBA_SWIG/CMakeLists.txt +++ b/src/LifeCycleCORBA_SWIG/CMakeLists.txt @@ -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 ) diff --git a/src/Logger/CMakeLists.txt b/src/Logger/CMakeLists.txt index d7c578631..649ff8585 100644 --- a/src/Logger/CMakeLists.txt +++ b/src/Logger/CMakeLists.txt @@ -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}) diff --git a/src/MPIContainer/CMakeLists.txt b/src/MPIContainer/CMakeLists.txt index 4ecd2cafa..9efe63500 100644 --- a/src/MPIContainer/CMakeLists.txt +++ b/src/MPIContainer/CMakeLists.txt @@ -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}) diff --git a/src/ModuleCatalog/CMakeLists.txt b/src/ModuleCatalog/CMakeLists.txt index 938365e9c..98124ab16 100644 --- a/src/ModuleCatalog/CMakeLists.txt +++ b/src/ModuleCatalog/CMakeLists.txt @@ -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}) diff --git a/src/NOTIFICATION_SWIG/CMakeLists.txt b/src/NOTIFICATION_SWIG/CMakeLists.txt index 9dee78791..9e7b1e826 100644 --- a/src/NOTIFICATION_SWIG/CMakeLists.txt +++ b/src/NOTIFICATION_SWIG/CMakeLists.txt @@ -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}) diff --git a/src/NamingService/CMakeLists.txt b/src/NamingService/CMakeLists.txt index b3beed6e0..46479baa5 100644 --- a/src/NamingService/CMakeLists.txt +++ b/src/NamingService/CMakeLists.txt @@ -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}) diff --git a/src/NamingService/Test/CMakeLists.txt b/src/NamingService/Test/CMakeLists.txt index a23272388..7dee89504 100644 --- a/src/NamingService/Test/CMakeLists.txt +++ b/src/NamingService/Test/CMakeLists.txt @@ -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 diff --git a/src/Notification/CMakeLists.txt b/src/Notification/CMakeLists.txt index bcea6b46f..347f5b213 100644 --- a/src/Notification/CMakeLists.txt +++ b/src/Notification/CMakeLists.txt @@ -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") diff --git a/src/ParallelContainer/CMakeLists.txt b/src/ParallelContainer/CMakeLists.txt index 450597eb4..9ace25335 100644 --- a/src/ParallelContainer/CMakeLists.txt +++ b/src/ParallelContainer/CMakeLists.txt @@ -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") diff --git a/src/Registry/CMakeLists.txt b/src/Registry/CMakeLists.txt index 1fa3b946a..d859b746b 100644 --- a/src/Registry/CMakeLists.txt +++ b/src/Registry/CMakeLists.txt @@ -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") diff --git a/src/ResourcesManager/CMakeLists.txt b/src/ResourcesManager/CMakeLists.txt index 34f6e1259..827e61d89 100644 --- a/src/ResourcesManager/CMakeLists.txt +++ b/src/ResourcesManager/CMakeLists.txt @@ -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}) diff --git a/src/SALOMEDS/CMakeLists.txt b/src/SALOMEDS/CMakeLists.txt index 3556e04a2..d1ea656e4 100644 --- a/src/SALOMEDS/CMakeLists.txt +++ b/src/SALOMEDS/CMakeLists.txt @@ -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}) diff --git a/src/SALOMEDS/Test/CMakeLists.txt b/src/SALOMEDS/Test/CMakeLists.txt index 0ce442637..4dea32dcb 100644 --- a/src/SALOMEDS/Test/CMakeLists.txt +++ b/src/SALOMEDS/Test/CMakeLists.txt @@ -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 diff --git a/src/SALOMEDSClient/CMakeLists.txt b/src/SALOMEDSClient/CMakeLists.txt index 1e8c7137b..e70e96c47 100644 --- a/src/SALOMEDSClient/CMakeLists.txt +++ b/src/SALOMEDSClient/CMakeLists.txt @@ -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") diff --git a/src/SALOMEDSImpl/CMakeLists.txt b/src/SALOMEDSImpl/CMakeLists.txt index f264af568..7eddaffd0 100644 --- a/src/SALOMEDSImpl/CMakeLists.txt +++ b/src/SALOMEDSImpl/CMakeLists.txt @@ -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") diff --git a/src/SALOMEDSImpl/Test/CMakeLists.txt b/src/SALOMEDSImpl/Test/CMakeLists.txt index 54c064470..acddd768b 100644 --- a/src/SALOMEDSImpl/Test/CMakeLists.txt +++ b/src/SALOMEDSImpl/Test/CMakeLists.txt @@ -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 diff --git a/src/SALOMELocalTrace/CMakeLists.txt b/src/SALOMELocalTrace/CMakeLists.txt index 5372a7968..01a2a5b25 100644 --- a/src/SALOMELocalTrace/CMakeLists.txt +++ b/src/SALOMELocalTrace/CMakeLists.txt @@ -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}) diff --git a/src/SALOMELocalTrace/Test/CMakeLists.txt b/src/SALOMELocalTrace/Test/CMakeLists.txt index 990bea629..bdaea3790 100644 --- a/src/SALOMELocalTrace/Test/CMakeLists.txt +++ b/src/SALOMELocalTrace/Test/CMakeLists.txt @@ -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 diff --git a/src/SALOMESDS/CMakeLists.txt b/src/SALOMESDS/CMakeLists.txt index 613a60928..ef9e20007 100644 --- a/src/SALOMESDS/CMakeLists.txt +++ b/src/SALOMESDS/CMakeLists.txt @@ -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}) diff --git a/src/SALOMETraceCollector/CMakeLists.txt b/src/SALOMETraceCollector/CMakeLists.txt index 12fef2047..f6c6cf22f 100644 --- a/src/SALOMETraceCollector/CMakeLists.txt +++ b/src/SALOMETraceCollector/CMakeLists.txt @@ -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") diff --git a/src/SALOMETraceCollector/Test/CMakeLists.txt b/src/SALOMETraceCollector/Test/CMakeLists.txt index 5417cfb1e..ebc855d73 100644 --- a/src/SALOMETraceCollector/Test/CMakeLists.txt +++ b/src/SALOMETraceCollector/Test/CMakeLists.txt @@ -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 diff --git a/src/TOOLSDS/CMakeLists.txt b/src/TOOLSDS/CMakeLists.txt index 54d3c0040..4ee29facc 100644 --- a/src/TOOLSDS/CMakeLists.txt +++ b/src/TOOLSDS/CMakeLists.txt @@ -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") diff --git a/src/TestContainer/CMakeLists.txt b/src/TestContainer/CMakeLists.txt index 47b129395..0d2318548 100644 --- a/src/TestContainer/CMakeLists.txt +++ b/src/TestContainer/CMakeLists.txt @@ -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}) diff --git a/src/TestMPIContainer/CMakeLists.txt b/src/TestMPIContainer/CMakeLists.txt index 204269539..7942a3de6 100644 --- a/src/TestMPIContainer/CMakeLists.txt +++ b/src/TestMPIContainer/CMakeLists.txt @@ -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") diff --git a/src/UnitTests/CMakeLists.txt b/src/UnitTests/CMakeLists.txt index 9978d708f..6031e3eaa 100644 --- a/src/UnitTests/CMakeLists.txt +++ b/src/UnitTests/CMakeLists.txt @@ -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 diff --git a/src/Utils/CMakeLists.txt b/src/Utils/CMakeLists.txt index 4af645181..d9e75fdef 100644 --- a/src/Utils/CMakeLists.txt +++ b/src/Utils/CMakeLists.txt @@ -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}) diff --git a/src/Utils/Test/CMakeLists.txt b/src/Utils/Test/CMakeLists.txt index 08c26b9dc..51b8d2d03 100644 --- a/src/Utils/Test/CMakeLists.txt +++ b/src/Utils/Test/CMakeLists.txt @@ -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})