Add CMake code to handle external XMP

Experiment: Try with testing package
v0.27.3
Luis Diaz Mas 7 years ago committed by Luis Díaz Más
parent e483856a61
commit 9586928d29

@ -32,6 +32,7 @@ set( GENERIC_LIB_SOVERSION "26" )
# options and their default values # options and their default values
option( BUILD_SHARED_LIBS "Build exiv2lib as a shared library" ON ) option( BUILD_SHARED_LIBS "Build exiv2lib as a shared library" ON )
option( EXIV2_ENABLE_XMP "Build with XMP metadata support" ON ) option( EXIV2_ENABLE_XMP "Build with XMP metadata support" ON )
option( EXIV2_ENABLE_EXTERNAL_XMP "Use external version of XMP" OFF )
option( EXIV2_ENABLE_PNG "Build with png support (requires libz)" ON ) option( EXIV2_ENABLE_PNG "Build with png support (requires libz)" ON )
option( EXIV2_ENABLE_NLS "Build native language support (requires gettext)" ON ) option( EXIV2_ENABLE_NLS "Build native language support (requires gettext)" ON )
option( EXIV2_ENABLE_PRINTUCS2 "Build with Printucs2" ON ) option( EXIV2_ENABLE_PRINTUCS2 "Build with Printucs2" ON )
@ -93,6 +94,7 @@ endif()
if( EXIV2_ENABLE_XMP ) if( EXIV2_ENABLE_XMP )
add_subdirectory( xmpsdk ) add_subdirectory( xmpsdk )
endif() endif()
add_subdirectory( src ) add_subdirectory( src )
if( EXIV2_BUILD_UNIT_TESTS ) if( EXIV2_BUILD_UNIT_TESTS )

@ -4,8 +4,12 @@ from conans.tools import os_info
class Exiv2Conan(ConanFile): class Exiv2Conan(ConanFile):
settings = 'os', 'compiler', 'build_type', 'arch' settings = 'os', 'compiler', 'build_type', 'arch'
generators = 'cmake' generators = 'cmake'
options = {'unitTests': [True, False]} options = {'unitTests': [True, False],
default_options = 'unitTests=True' 'xmp': [True, False],
}
default_options = ('unitTests=True',
'xmp=False',
)
def configure(self): def configure(self):
if not os_info.is_macos: if not os_info.is_macos:
@ -20,6 +24,9 @@ class Exiv2Conan(ConanFile):
if self.options.unitTests: if self.options.unitTests:
self.requires('gtest/1.8.0@bincrafters/stable') self.requires('gtest/1.8.0@bincrafters/stable')
if self.options.xmp:
self.requires('XmpSdk/2016.7@piponazo/testing')
def imports(self): def imports(self):
self.copy('*.dll', dst='conanDlls', src='bin') self.copy('*.dll', dst='conanDlls', src='bin')
self.copy('*.dylib', dst='bin', src='lib') self.copy('*.dylib', dst='bin', src='lib')

@ -30,6 +30,10 @@ if (EXIV2_ENABLE_XMP)
find_package(EXPAT REQUIRED) find_package(EXPAT REQUIRED)
endif () endif ()
if (EXIV2_ENABLE_EXTERNAL_XMP)
find_package(XmpSdk REQUIRED)
endif()
if( EXIV2_ENABLE_NLS ) if( EXIV2_ENABLE_NLS )
find_package(Intl) find_package(Intl)
if(Intl_FOUND) if(Intl_FOUND)

@ -13,7 +13,7 @@ set(EXV_HAVE_PRINTUCS2 ${EXIV2_ENABLE_PRINTUCS2})
set(EXV_PACKAGE ${PACKAGE}) set(EXV_PACKAGE ${PACKAGE})
set(EXV_PACKAGE_VERSION ${PACKAGE_VERSION}) set(EXV_PACKAGE_VERSION ${PACKAGE_VERSION})
set(EXV_PACKAGE_STRING ${PACKAGE_STRING}) set(EXV_PACKAGE_STRING ${PACKAGE_STRING})
set(EXV_HAVE_XMP_TOOLKIT ${EXIV2_ENABLE_XMP}) set(EXV_HAVE_XMP_TOOLKIT ${EXIV2_ENABLE_XMP} OR ${EXIV2_ENABLE_EXTERNAL_XMP})
set(EXV_HAVE_ICONV ${ICONV_FOUND}) set(EXV_HAVE_ICONV ${ICONV_FOUND})
set(EXV_HAVE_LIBZ ${ZLIB_FOUND}) set(EXV_HAVE_LIBZ ${ZLIB_FOUND})
set(EXV_UNICODE_PATH ${EXIV2_ENABLE_WIN_UNICODE}) set(EXV_UNICODE_PATH ${EXIV2_ENABLE_WIN_UNICODE})

@ -207,6 +207,10 @@ endif()
if (EXIV2_ENABLE_XMP) if (EXIV2_ENABLE_XMP)
#target_include_directories(exiv2lib PRIVATE ${CMAKE_SOURCE_DIR}/xmpsdk/include) #target_include_directories(exiv2lib PRIVATE ${CMAKE_SOURCE_DIR}/xmpsdk/include)
target_link_libraries(exiv2lib PUBLIC xmp) target_link_libraries(exiv2lib PUBLIC xmp)
elseif(EXIV2_ENABLE_EXTERNAL_XMP)
target_link_libraries(exiv2lib PUBLIC ${XMPSDK_LIBRARY})
target_include_directories(exiv2lib PUBLIC ${XMPSDK_INCLUDE_DIR})
target_compile_definitions(exiv2lib PUBLIC EXV_ADOBE_XMPSDK=2016)
endif() endif()
# TODO : We should not include include/exiv2 but only include !!! # TODO : We should not include include/exiv2 but only include !!!

Loading…
Cancel
Save