Merge pull request #44 from piponazo/iconv

Small cmake cleanup about ICONV
v0.27.3
Luis Díaz Más 8 years ago committed by GitHub
commit b772a43bca

@ -2,12 +2,11 @@
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/config/") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/config/")
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
include( FindIconv )
if( EXIV2_ENABLE_PNG ) if( EXIV2_ENABLE_PNG )
find_package( ZLIB REQUIRED ) find_package( ZLIB REQUIRED )
include_directories( ${ZLIB_INCLUDE_DIR} ) include_directories( ${ZLIB_INCLUDE_DIR} )
endif( EXIV2_ENABLE_PNG ) endif( )
if( EXIV2_ENABLE_WEBREADY ) if( EXIV2_ENABLE_WEBREADY )
set( ENABLE_WEBREADY 1 ) set( ENABLE_WEBREADY 1 )
@ -17,12 +16,12 @@ if( EXIV2_ENABLE_WEBREADY )
if( EXIV2_ENABLE_SSH ) if( EXIV2_ENABLE_SSH )
find_package( SSH REQUIRED) find_package( SSH REQUIRED)
endif( EXIV2_ENABLE_SSH ) endif( )
endif( EXIV2_ENABLE_WEBREADY ) endif( )
if (EXIV2_ENABLE_XMP) if (EXIV2_ENABLE_XMP)
find_package(EXPAT REQUIRED) find_package(EXPAT REQUIRED)
endif (EXIV2_ENABLE_XMP) endif ()
if( EXIV2_ENABLE_NLS ) if( EXIV2_ENABLE_NLS )
find_package(Intl) find_package(Intl)
@ -35,20 +34,19 @@ if( EXIV2_ENABLE_NLS )
set( ENABLE_NLS 1 ) set( ENABLE_NLS 1 )
# TODO : This is assuming that Intl is always found. This check should be improved and remove # TODO : This is assuming that Intl is always found. This check should be improved and remove
# the manual check in config/generateConfigFile.cmake # the manual check in config/generateConfigFile.cmake
endif( EXIV2_ENABLE_NLS ) endif( )
find_package(Iconv) include( FindIconv )
if( ICONV_FOUND ) if( ICONV_FOUND )
include_directories(${ICONV_INCLUDE_DIR})
message ( "-- ICONV_INCLUDE_DIR : " ${ICONV_INCLUDE_DIR} ) message ( "-- ICONV_INCLUDE_DIR : " ${ICONV_INCLUDE_DIR} )
message ( "-- ICONV_LIBRARIES : " ${ICONV_LIBRARIES} ) message ( "-- ICONV_LIBRARIES : " ${ICONV_LIBRARIES} )
message ( "-- ICONV_ACCEPTS_CONST_INPUT : ${ICONV_ACCEPTS_CONST_INPUT}" ) message ( "-- ICONV_ACCEPTS_CONST_INPUT : ${ICONV_ACCEPTS_CONST_INPUT}" )
endif( ICONV_FOUND ) endif()
if( EXIV2_ENABLE_BUILD_PO ) if( EXIV2_ENABLE_BUILD_PO )
find_package(MSGFMT) find_package(MSGFMT)
if(MSGFMT_FOUND) if(MSGFMT_FOUND)
message(STATUS "Program msgfmt found (${MSGFMT_EXECUTABLE})") message(STATUS "Program msgfmt found (${MSGFMT_EXECUTABLE})")
set( EXIV2_BUILD_PO 1 ) set( EXIV2_BUILD_PO 1 )
endif(MSGFMT_FOUND) endif()
endif() endif()

@ -241,6 +241,7 @@ if( EXIV2_ENABLE_NLS )
endif() endif()
if( ICONV_FOUND ) if( ICONV_FOUND )
target_include_directories( exiv2lib SYSTEM PRIVATE ${ICONV_INCLUDE_DIR})
target_link_libraries( exiv2lib PRIVATE ${ICONV_LIBRARIES} ) target_link_libraries( exiv2lib PRIVATE ${ICONV_LIBRARIES} )
endif() endif()

Loading…
Cancel
Save