diff --git a/CMakeLists.txt b/CMakeLists.txt index 72e63f62..80fa907c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,6 @@ set( GENERIC_LIB_SOVERSION "26" ) # options and their default values option( BUILD_SHARED_LIBS "Build exiv2lib as a shared library" ON ) option( EXIV2_ENABLE_XMP "Build with XMP metadata support" ON ) -option( EXIV2_ENABLE_LIBXMP "Build a static convenience Library for XMP" 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_PRINTUCS2 "Build with Printucs2" ON ) diff --git a/bootstrap.linux b/bootstrap.linux index efd93eb4..224353c4 100755 --- a/bootstrap.linux +++ b/bootstrap.linux @@ -19,7 +19,6 @@ cmake -G "$MAKEFILES_TYPE" . \ -DCMAKE_INSTALL_PREFIX=/usr \ -DBUILD_SHARED_LIBS=ON \ -DEXIV2_ENABLE_XMP=ON \ - -DEXIV2_ENABLE_LIBXMP=ON \ -DEXIV2_ENABLE_PNG=ON \ -DEXIV2_ENABLE_NLS=ON \ -DEXIV2_ENABLE_PRINTUCS2=ON \ diff --git a/bootstrap.macports b/bootstrap.macports index 729ad9bd..a3110a67 100755 --- a/bootstrap.macports +++ b/bootstrap.macports @@ -62,7 +62,6 @@ cmake -G "$MAKEFILES_TYPE" . \ -DCMAKE_MODULE_PATH="${INSTALL_PREFIX}/share/cmake/modules" \ -DBUILD_SHARED_LIBS=ON \ -DEXIV2_ENABLE_XMP=ON \ - -DEXIV2_ENABLE_LIBXMP=ON \ -DEXIV2_ENABLE_PNG=ON \ -DEXIV2_ENABLE_NLS=ON \ -DEXIV2_ENABLE_PRINTUCS2=ON \ diff --git a/config/printSummary.cmake b/config/printSummary.cmake index deb5a094..21e444a4 100644 --- a/config/printSummary.cmake +++ b/config/printSummary.cmake @@ -22,7 +22,6 @@ message( STATUS "${PACKAGE_STRING} configure results <${PACKAGE_URL}>" OptionOutput( "Building shared library: " BUILD_SHARED_LIBS ) OptionOutput( "Building PNG support: " EXIV2_ENABLE_PNG AND ZLIB_FOUND ) OptionOutput( "XMP metadata support: " EXIV2_ENABLE_XMP ) -OptionOutput( "Building static libxmp: " EXIV2_ENABLE_LIBXMP ) OptionOutput( "Native language support: " EXIV2_ENABLE_NLS ) OptionOutput( "Conversion of Windows XP tags: " EXIV2_ENABLE_PRINTUCS2 ) OptionOutput( "Nikon lens database: " EXIV2_ENABLE_LENSDATA ) diff --git a/contrib/cmake/msvc/ReadMe.txt b/contrib/cmake/msvc/ReadMe.txt index 099d2cfa..9a5424e2 100755 --- a/contrib/cmake/msvc/ReadMe.txt +++ b/contrib/cmake/msvc/ReadMe.txt @@ -231,7 +231,6 @@ How to use this # options and their default values option( BUILD_SHARED_LIBS "Build exiv2 as a shared library (dll)" ON ) option( EXIV2_ENABLE_XMP "Build with XMP metadata support" ON ) - option( EXIV2_ENABLE_LIBXMP "Build a static convenience Library for XMP" 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_PRINTUCS2 "Build with Printucs2" ON ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f9df0dd1..fe49a0a6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -165,12 +165,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) # ****************************************************************************** # exiv2lib library -if( EXIV2_ENABLE_XMP AND NOT EXIV2_ENABLE_LIBXMP ) - add_library( exiv2lib ${LIBEXIV2_SRC} ${LIBEXIV2_HDR} ${LIBEXIV2_PRIVATE_HDR} $) - target_link_libraries(exiv2lib PUBLIC ${EXPAT_LIBRARIES}) -else() - add_library( exiv2lib ${LIBEXIV2_SRC} ${LIBEXIV2_HDR} ${LIBEXIV2_PRIVATE_HDR}) -endif() +add_library( exiv2lib ${LIBEXIV2_SRC} ${LIBEXIV2_HDR} ${LIBEXIV2_PRIVATE_HDR}) set_target_properties( exiv2lib PROPERTIES VERSION ${GENERIC_LIB_VERSION} @@ -192,10 +187,8 @@ if ( UNIX AND CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" ) endif() if ( EXIV2_ENABLE_XMP ) - target_include_directories(exiv2lib PRIVATE ${CMAKE_SOURCE_DIR}/xmpsdk/include) - if( EXIV2_ENABLE_LIBXMP ) - target_link_libraries( exiv2lib PUBLIC xmp ) - endif() + #target_include_directories(exiv2lib PRIVATE ${CMAKE_SOURCE_DIR}/xmpsdk/include) + target_link_libraries(exiv2lib PUBLIC xmp) endif() # TODO : We should not include include/exiv2 but only include !!! diff --git a/xmpsdk/CMakeLists.txt b/xmpsdk/CMakeLists.txt index 6403c2b8..ff8fd8bb 100644 --- a/xmpsdk/CMakeLists.txt +++ b/xmpsdk/CMakeLists.txt @@ -28,29 +28,28 @@ set(XMPSRC src/ExpatAdapter.cpp include/XMP_Version.h ) -foreach(_currentfile ${XMPSRC}) - if(UNIX AND NOT CYGWIN) - set_source_files_properties(${_currentfile} PROPERTIES COMPILE_FLAGS "-fPIC") - endif() -endforeach() +add_library(xmp STATIC ${XMPSRC}) -# We generate a CMake OBJECT LIBRARY (a bunch of object files) -add_library( xmp_object OBJECT ${XMPSRC} ) +target_link_libraries(xmp + PRIVATE + ${EXPAT_LIBRARY} +) -target_include_directories(xmp_object +target_include_directories(xmp + PUBLIC + $ PRIVATE ${EXPAT_INCLUDE_DIR} - ${CMAKE_SOURCE_DIR}/xmpsdk/include ) +# TODO : We should only add this definition for Windows +target_compile_definitions(xmp PRIVATE XML_STATIC) + check_include_file( "stdint.h" EXV_HAVE_STDINT_H ) if (EXV_HAVE_STDINT_H) - target_compile_definitions(xmp_object PUBLIC EXV_HAVE_STDINT_H) + target_compile_definitions(xmp PRIVATE EXV_HAVE_STDINT_H) endif() -# TODO : We should only add this definition if EXPAT is static -target_compile_definitions(xmp_object PRIVATE XML_STATIC) - # http://stackoverflow.com/questions/10046114/in-cmake-how-can-i-test-if-the-compiler-is-clang if ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") # 1123 - hide xmpsdk symbols @@ -58,17 +57,8 @@ if ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") COMPILE_FLAGS "-fvisibility=hidden -fvisibility-inlines-hidden") endif() -if( EXIV2_ENABLE_LIBXMP ) - add_library(xmp STATIC $) - target_link_libraries(xmp PUBLIC ${EXPAT_LIBRARY}) - - # This is also needed for the xmp static library - target_include_directories(xmp PUBLIC ${EXPAT_INCLUDE_DIR}) - target_compile_definitions(xmp PUBLIC XML_STATIC) - - if (BUILD_SHARED_LIBS) - set_property(TARGET xmp_object PROPERTY POSITION_INDEPENDENT_CODE ON) - endif() +if (BUILD_SHARED_LIBS) + set_property(TARGET xmp PROPERTY POSITION_INDEPENDENT_CODE ON) endif() # 1119 Install libxmp.a for use by third party applications (Thanks, Emmanuel)