From: inv Date: Fri, 8 Nov 2013 17:16:28 +0000 (+0000) Subject: Synchronize adm files X-Git-Tag: V7_3_0a1~27 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=82ada17648420b6d78adf671243ef1f604301e08;p=modules%2Fmed.git Synchronize adm files --- diff --git a/adm_local_without_kernel/cmake_files/FindCppUnit.cmake b/adm_local_without_kernel/cmake_files/FindCppUnit.cmake index b34e80a35..7ab228727 100644 --- a/adm_local_without_kernel/cmake_files/FindCppUnit.cmake +++ b/adm_local_without_kernel/cmake_files/FindCppUnit.cmake @@ -60,20 +60,28 @@ ELSE(WIN32) MESSAGE(FATAL_ERROR "Error in CPPUNIT detection ! cppunit-config executable not found !") ENDIF(NOT CPPUNIT_CONFIG_BIN) EXECUTE_PROCESS(COMMAND ${CPPUNIT_CONFIG_BIN} --libs OUTPUT_VARIABLE CPPUNIT_LDFLAGS) - STRING( REGEX MATCHALL "-L([^\" ]+|\"[^\"]+\")" CPPUNIT_TMP4 "${CPPUNIT_LDFLAGS}" ) - IF(CPPUNIT_TMP4) - STRING( REGEX REPLACE "^-L" "" CPPUNIT_LIBRARY_DIRS ${CPPUNIT_TMP4}) - LIST(APPEND CMAKE_LIBRARY_PATH ${CPPUNIT_LIBRARY_DIRS}) - ENDIF(CPPUNIT_TMP4) - STRING( REGEX MATCHALL "-l([^\", \n]+)" CPPUNIT_TMP5 "${CPPUNIT_LDFLAGS}" ) - FOREACH(LIB ${CPPUNIT_TMP5}) - STRING(REGEX REPLACE "^-l" "" LIB2 ${LIB}) - FIND_LIBRARY(CPPUNIT_SUBLIB_${LIB2} ${LIB2}) - IF(NOT CPPUNIT_SUBLIB_${LIB2}) - MESSAGE(FATAL_ERROR "Error in CPPUNIT detection ! Fail to locate the needed library ${LIB2} !") - ENDIF(NOT CPPUNIT_SUBLIB_${LIB2}) - LIST(APPEND CPPUNIT_LIBRARIES ${CPPUNIT_SUBLIB_${LIB2}}) - ENDFOREACH(LIB ${CPPUNIT_TMP5}) + STRING(STRIP ${CPPUNIT_LDFLAGS} CPPUNIT_LDFLAGS) + STRING(REPLACE " " ";" LDFLAGS_LIST ${CPPUNIT_LDFLAGS}) + FOREACH(LDFLAG ${LDFLAGS_LIST}) + STRING(REGEX MATCH "^-L.*" LIBDIR "${LDFLAG}") + STRING(REGEX MATCH "^-l.*" LIB "${LDFLAG}") + IF(LIBDIR) + STRING(REGEX REPLACE "^-L" "" LIBDIR ${LIBDIR}) + LIST(APPEND CMAKE_LIBRARY_PATH ${LIBDIR}) + ELSEIF(LIB) + STRING(REGEX REPLACE "^-l" "" LIB ${LIB}) + LIST(APPEND LIBS ${LIB}) + ELSE() + MESSAGE(FATAL_ERROR "Unrecognized token \"${LDFLAG}\" in the output of cppunit-config --libs") + ENDIF() + ENDFOREACH(LDFLAG ${LDFLAGS_LIST}) + FOREACH(LIB ${LIBS}) + FIND_LIBRARY(CPPUNIT_SUBLIB_${LIB} ${LIB}) + IF(NOT CPPUNIT_SUBLIB_${LIB}) + MESSAGE(FATAL_ERROR "Error in CPPUNIT detection! Fail to locate the needed library ${LIB}!") + ENDIF(NOT CPPUNIT_SUBLIB_${LIB}) + LIST(APPEND CPPUNIT_LIBRARIES ${CPPUNIT_SUBLIB_${LIB}}) + ENDFOREACH(LIB ${LIBS}) # MESSAGE("**** ${CPPUNIT_LIBRARIES}") ENDIF(WIN32) diff --git a/adm_local_without_kernel/cmake_files/SalomeMacros.cmake b/adm_local_without_kernel/cmake_files/SalomeMacros.cmake index 454728b56..707e04c0e 100755 --- a/adm_local_without_kernel/cmake_files/SalomeMacros.cmake +++ b/adm_local_without_kernel/cmake_files/SalomeMacros.cmake @@ -798,18 +798,32 @@ ENDMACRO(SALOME_GENERATE_ENVIRONMENT_SCRIPT) # MACRO(SALOME_GENERATE_TESTS_ENVIRONMENT output) SET(_env) + SET(_WIN_LD_LIBRARY OFF) FOREACH(_item ${_${PROJECT_NAME}_EXTRA_ENV}) + IF(${_item} STREQUAL "LD_LIBRARY_PATH") + SET(_WIN_LD_LIBRARY ON) + ENDIF() + SET(_env_${_item}) FOREACH(_val ${_${PROJECT_NAME}_EXTRA_ENV_${_item}}) IF(WIN32) - SET(_env "${_val};${_env}") + SET(_env_${_item} "${_val};${_env_${_item}}") ELSE() - SET(_env "${_val}:${_env}") + SET(_env_${_item} "${_val}:${_env_${_item}}") ENDIF() ENDFOREACH() - SET(_env " ${_item}=${_env}") - ENDFOREACH() + ENDFOREACH() + + IF(_WIN_LD_LIBRARY AND WIN32) + SET(_env_PATH "${_env_PATH} ${_env_LD_LIBRARY_PATH}") + ENDIF() + + FOREACH(_item ${_${PROJECT_NAME}_EXTRA_ENV}) + IF(NOT(WIN32 AND ${_item} STREQUAL "LD_LIBRARY_PATH")) + SET(_env "${_item}=${_env_${_item}} ${_env}") + ENDIF() + ENDFOREACH() SET(${output} ${_env}) -ENDMACRO(SALOME_GENERATE_TESTS_ENVIRONMENT) +ENDMACRO(SALOME_GENERATE_TESTS_ENVIRONMENT) ######################################################################### # SALOME_APPEND_LIST_OF_LIST()