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:
shahramn 2019-03-19 16:05:09 +00:00 committed by GitHub
commit 52453dc198
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View File

@ -2,7 +2,7 @@
# general configuration #
#---------------------------------#
version: 2.11.0-{build}-{branch}
version: 2.12.0-{build}-{branch}
branches:
only:

View File

@ -351,6 +351,21 @@ get_directory_property( COMPILE_DEFINITIONS ECCODES_DEFINITIONS )
foreach( _tpl ${ECCODES_TPLS} )
string( TOUPPER ${_tpl} TPL )
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_INCLUDE_DIRS ${${TPL}_INCLUDE_DIRS} ${${TPL}_INCLUDE_DIR} )
list( APPEND ECCODES_EXTRA_LIBRARIES ${${TPL}_LIBRARIES} )