mirror of https://github.com/ecmwf/eccodes.git
Merge pull request #13 from ecmwf/dtip-replace-absolute-paths
Add option to replace TPL absolute paths with library names
This commit is contained in:
commit
52453dc198
|
@ -2,7 +2,7 @@
|
||||||
# general configuration #
|
# general configuration #
|
||||||
#---------------------------------#
|
#---------------------------------#
|
||||||
|
|
||||||
version: 2.11.0-{build}-{branch}
|
version: 2.12.0-{build}-{branch}
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
|
|
|
@ -351,6 +351,21 @@ get_directory_property( COMPILE_DEFINITIONS ECCODES_DEFINITIONS )
|
||||||
foreach( _tpl ${ECCODES_TPLS} )
|
foreach( _tpl ${ECCODES_TPLS} )
|
||||||
string( TOUPPER ${_tpl} TPL )
|
string( TOUPPER ${_tpl} TPL )
|
||||||
if( ${TPL}_FOUND )
|
if( ${TPL}_FOUND )
|
||||||
|
if( REPLACE_TPL_ABSOLUTE_PATHS )
|
||||||
|
# replace TPL absolute paths with their library names
|
||||||
|
# this helps make ecCodes relocatable
|
||||||
|
set( _TMP "" )
|
||||||
|
|
||||||
|
foreach( _lib ${${TPL}_LIBRARIES} )
|
||||||
|
get_filename_component( _lib_name ${_lib} NAME_WE )
|
||||||
|
string( REGEX REPLACE "^lib" "" _name ${_lib_name} )
|
||||||
|
list( APPEND _TMP "-l${_name}" )
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
set( ${TPL}_LIBRARIES ${_TMP} )
|
||||||
|
set( _TMP "" )
|
||||||
|
endif()
|
||||||
|
|
||||||
list( APPEND ECCODES_EXTRA_DEFINITIONS ${${TPL}_DEFINITIONS} )
|
list( APPEND ECCODES_EXTRA_DEFINITIONS ${${TPL}_DEFINITIONS} )
|
||||||
list( APPEND ECCODES_EXTRA_INCLUDE_DIRS ${${TPL}_INCLUDE_DIRS} ${${TPL}_INCLUDE_DIR} )
|
list( APPEND ECCODES_EXTRA_INCLUDE_DIRS ${${TPL}_INCLUDE_DIRS} ${${TPL}_INCLUDE_DIR} )
|
||||||
list( APPEND ECCODES_EXTRA_LIBRARIES ${${TPL}_LIBRARIES} )
|
list( APPEND ECCODES_EXTRA_LIBRARIES ${${TPL}_LIBRARIES} )
|
||||||
|
|
Loading…
Reference in New Issue