CMake: Simplify Intl finding

v0.27.3
Luis Díaz Más 7 years ago
parent fecf313715
commit 38b60a3e8e

@ -36,17 +36,8 @@ else()
endif() endif()
if( EXIV2_ENABLE_NLS ) if (EXIV2_ENABLE_NLS)
find_package(Intl) find_package(Intl REQUIRED)
if(Intl_FOUND)
include_directories(${Intl_INCLUDE_DIRS})
set(LIBINTL_LIBRARIES ${Intl_LIBRARIES})
else()
set(LIBINTL_LIBRARIES)
endif()
set( ENABLE_NLS 1 )
# TODO : This is assuming that Intl is always found. This check should be improved and remove
# the manual check in cmake/generateConfigFile.cmake
endif( ) endif( )
find_package(Iconv) find_package(Iconv)

@ -28,8 +28,6 @@ check_function_exists( mmap EXV_HAVE_MMAP )
check_function_exists( munmap EXV_HAVE_MUNMAP ) check_function_exists( munmap EXV_HAVE_MUNMAP )
check_function_exists( strerror_r EXV_HAVE_STRERROR_R ) check_function_exists( strerror_r EXV_HAVE_STRERROR_R )
# TODO: This check should be removed and rely on the check done in findDependencies.cmake
check_include_file( "libintl.h" EXV_HAVE_LIBINTL_H )
check_include_file( "unistd.h" EXV_HAVE_UNISTD_H ) check_include_file( "unistd.h" EXV_HAVE_UNISTD_H )
check_include_file( "memory.h" EXV_HAVE_MEMORY_H ) check_include_file( "memory.h" EXV_HAVE_MEMORY_H )
check_include_file( "process.h" EXV_HAVE_PROCESS_H ) check_include_file( "process.h" EXV_HAVE_PROCESS_H )
@ -44,6 +42,6 @@ if ( NOT MINGW AND NOT MSYS AND NOT MSVC )
check_include_file( "regex.h" EXV_HAVE_REGEX_H ) check_include_file( "regex.h" EXV_HAVE_REGEX_H )
endif() endif()
set(EXV_ENABLE_NLS ${EXV_HAVE_LIBINTL_H}) set(EXV_ENABLE_NLS ${EXIV2_ENABLE_NLS})
configure_file(cmake/config.h.cmake ${CMAKE_BINARY_DIR}/exv_conf.h @ONLY) configure_file(cmake/config.h.cmake ${CMAKE_BINARY_DIR}/exv_conf.h @ONLY)

@ -293,7 +293,8 @@ if( EXIV2_ENABLE_PNG )
endif() endif()
if( EXIV2_ENABLE_NLS ) if( EXIV2_ENABLE_NLS )
target_link_libraries( exiv2lib PRIVATE ${LIBINTL_LIBRARIES} ) target_link_libraries(exiv2lib PRIVATE ${Intl_LIBRARIES})
target_include_directories(exiv2lib PRIVATE ${Intl_INCLUDE_DIRS})
endif() endif()
if( ICONV_FOUND ) if( ICONV_FOUND )
@ -336,7 +337,8 @@ if(EXIV2_BUILD_EXIV2_COMMAND)
target_link_libraries( exiv2 PRIVATE exiv2lib ) target_link_libraries( exiv2 PRIVATE exiv2lib )
if( EXIV2_ENABLE_NLS ) if( EXIV2_ENABLE_NLS )
target_link_libraries(exiv2 PRIVATE ${LIBINTL_LIBRARIES}) target_link_libraries(exiv2 PRIVATE ${Intl_LIBRARIES})
target_include_directories(exiv2lib PRIVATE ${Intl_INCLUDE_DIRS})
endif() endif()
# Copy DLLs from conan packages to the bin folder # Copy DLLs from conan packages to the bin folder

Loading…
Cancel
Save