ECC-380: eccodes attempts to link to openjpeg 1.X library if found

This commit is contained in:
Shahram Najm 2016-11-11 11:56:01 +00:00
parent d3c709ef54
commit 9304e8e592
2 changed files with 16 additions and 0 deletions

View File

@ -10,6 +10,14 @@ if( HAVE_PYTHON )
get_filename_component(JASPER_DIR ${JASPER_INCLUDE_DIR} PATH )
endif()
if( HAVE_LIBOPENJPEG )
# Get the name of the OpenJPEG library: version dependent!
# E.g. openjpeg (version 1.5) or openjp2 (version 2.x)
get_filename_component(OPENJPEG_LIB_DIR ${OPENJPEG_LIBRARY} PATH )
get_filename_component(OJ_NAME_WE ${OPENJPEG_LIBRARY} NAME_WE )
STRING(REGEX REPLACE "^lib" "" OJ_WITHOUT_LIB ${OJ_NAME_WE})
endif()
if( HAVE_AEC )
get_filename_component(AEC_DIR ${AEC_INCLUDE_DIR} PATH )
endif()

View File

@ -36,6 +36,14 @@ if shared_libs == 'OFF':
runtime_library_dirs=os.path.join(jasper_dir, 'lib'))
add_attribute(libraries='jasper')
if @HAVE_LIBOPENJPEG@:
openjpeg_lib_dir = '@OPENJPEG_LIB_DIR@'
openjpeg_libname = '@OJ_WITHOUT_LIB@'
if openjpeg_lib_dir:
add_attribute(library_dirs=openjpeg_lib_dir,
runtime_library_dirs=openjpeg_lib_dir)
add_attribute(libraries=openjpeg_libname)
# assumes png is supplied by system paths -- may not be true
if @HAVE_LIBPNG@:
add_attribute(libraries='png')