Merge pull request #37 from a17r/cmakebeautification

cmakebeautification
v0.27.3
Luis Díaz Más 8 years ago committed by GitHub
commit cd5a3ed02a

@ -19,56 +19,55 @@ endif()
set(CMAKE_MACOSX_RPATH 1) set(CMAKE_MACOSX_RPATH 1)
SET( PACKAGE_COPYRIGHT "Andreas Huggel" ) set( PACKAGE_COPYRIGHT "Andreas Huggel" )
SET( PACKAGE_BUGREPORT "http://github.com/exiv2/exiv2" ) set( PACKAGE_BUGREPORT "http://github.com/exiv2/exiv2" )
SET( PACKAGE "exiv2" ) set( PACKAGE "exiv2" )
SET( PACKAGE_NAME "exiv2" ) set( PACKAGE_NAME "exiv2" )
SET( PACKAGE_VERSION "0.26" ) set( PACKAGE_VERSION "0.26" )
SET( PACKAGE_URL "http://www.exiv2.org" ) set( PACKAGE_URL "http://www.exiv2.org" )
SET( PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}" ) set( PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}" )
SET( GENERIC_LIB_VERSION "26.0.0" ) set( GENERIC_LIB_VERSION "26.0.0" )
SET( GENERIC_LIB_SOVERSION "26" ) set( GENERIC_LIB_SOVERSION "26" )
# options and their default values # options and their default values
OPTION( EXIV2_ENABLE_SHARED "Build exiv2 as a shared library (dll)" ON ) option( EXIV2_ENABLE_SHARED "Build exiv2 as a shared library (dll)" ON )
OPTION( EXIV2_ENABLE_XMP "Build with XMP metadata support" 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_LIBXMP "Build a static convenience Library for XMP" ON )
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 )
OPTION( EXIV2_ENABLE_LENSDATA "Build including lens data" ON ) option( EXIV2_ENABLE_LENSDATA "Build including lens data" ON )
OPTION( EXIV2_ENABLE_COMMERCIAL "Build with the EXV_COMMERCIAL_VERSION symbol set" OFF ) option( EXIV2_ENABLE_COMMERCIAL "Build with the EXV_COMMERCIAL_VERSION symbol set" OFF )
OPTION( EXIV2_ENABLE_BUILD_SAMPLES "Build the unit tests" ON ) option( EXIV2_ENABLE_BUILD_SAMPLES "Build the unit tests" ON )
OPTION( EXIV2_ENABLE_BUILD_PO "Build translations files" OFF ) option( EXIV2_ENABLE_BUILD_PO "Build translations files" OFF )
OPTION( EXIV2_ENABLE_VIDEO "Build video support into library" OFF ) option( EXIV2_ENABLE_VIDEO "Build video support into library" OFF )
OPTION( EXIV2_ENABLE_WEBREADY "Build webready support into library" OFF ) option( EXIV2_ENABLE_WEBREADY "Build webready support into library" OFF )
OPTION( EXIV2_ENABLE_DYNAMIC_RUNTIME "Use dynamic runtime (used for static libs)" OFF ) option( EXIV2_ENABLE_DYNAMIC_RUNTIME "Use dynamic runtime (used for static libs)" OFF )
IF (WIN32) if (WIN32)
OPTION( EXIV2_ENABLE_WIN_UNICODE "Use Unicode paths (wstring) on Windows" OFF ) option( EXIV2_ENABLE_WIN_UNICODE "Use Unicode paths (wstring) on Windows" OFF )
OPTION( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" OFF ) option( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" OFF )
OPTION( EXIV2_ENABLE_SSH "USE Libssh for SshIo" OFF ) option( EXIV2_ENABLE_SSH "USE Libssh for SshIo" OFF )
ELSE() else()
OPTION( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" ON ) option( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" ON )
OPTION( EXIV2_ENABLE_SSH "USE Libssh for SshIo" ON ) option( EXIV2_ENABLE_SSH "USE Libssh for SshIo" ON )
ENDIF() endif()
OPTION( EXIV2_ENABLE_TOOLS "Build exiv2 executable" ON ) option( EXIV2_ENABLE_TOOLS "Build exiv2 executable" ON )
include(config/findDependencies.cmake) include(config/findDependencies.cmake)
include(config/compilerFlags.cmake) include(config/compilerFlags.cmake)
if( EXIV2_ENABLE_COMMERCIAL )
IF( EXIV2_ENABLE_COMMERCIAL ) set (EXIV2_ENABLE_LENSDATA OFF)
SET (EXIV2_ENABLE_LENSDATA OFF) set (EXIV2_ENABLE_NLS OFF)
SET (EXIV2_ENABLE_NLS OFF) endif()
ENDIF()
if( MSVC ) if( MSVC )
set(CMAKE_DEBUG_POSTFIX "d") set(CMAKE_DEBUG_POSTFIX "d")
endif( MSVC ) endif()
IF( EXIV2_ENABLE_XMP ) if( EXIV2_ENABLE_XMP )
SET( HAVE_XMP_TOOLKIT ON ) set( HAVE_XMP_TOOLKIT ON )
ENDIF( EXIV2_ENABLE_XMP ) endif()
include( config/generateConfigFile.cmake ) include( config/generateConfigFile.cmake )
include_directories(${CMAKE_BINARY_DIR}) # Make the exv_conf.h file visible for the full project include_directories(${CMAKE_BINARY_DIR}) # Make the exv_conf.h file visible for the full project
@ -76,34 +75,34 @@ include_directories(${CMAKE_BINARY_DIR}) # Make the exv_conf.h file visible for
include( config/CMakeChecks.txt ) include( config/CMakeChecks.txt )
if( EXIV2_ENABLE_XMP ) if( EXIV2_ENABLE_XMP )
ADD_SUBDIRECTORY( xmpsdk ) add_subdirectory( xmpsdk )
endif() endif()
ADD_SUBDIRECTORY( src ) add_subdirectory( src )
IF( EXIV2_ENABLE_BUILD_SAMPLES ) if( EXIV2_ENABLE_BUILD_SAMPLES )
ADD_SUBDIRECTORY( samples ) add_subdirectory( samples )
ENDIF( EXIV2_ENABLE_BUILD_SAMPLES ) endif()
IF( EXIV2_ENABLE_BUILD_PO ) if( EXIV2_ENABLE_BUILD_PO )
ADD_SUBDIRECTORY( po ) add_subdirectory( po )
ENDIF( EXIV2_ENABLE_BUILD_PO ) endif()
## ##
# tests # tests
ADD_CUSTOM_TARGET(tests COMMAND env EXIV2_BINDIR="${CMAKE_BINARY_DIR}"/bin make tests WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" ) add_custom_target(tests COMMAND env EXIV2_BINDIR="${CMAKE_BINARY_DIR}"/bin make tests WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" )
ADD_CUSTOM_TARGET(geotag-test COMMAND env EXIV2_BINDIR="${CMAKE_BINARY_DIR}"/bin make geotag-test WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" ) add_custom_target(geotag-test COMMAND env EXIV2_BINDIR="${CMAKE_BINARY_DIR}"/bin make geotag-test WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" )
## ##
# http://dev.exiv2.org/boards/3/topics/1364 # http://dev.exiv2.org/boards/3/topics/1364
# effectively does a make doc on the root directory # effectively does a make doc on the root directory
# has to run 'make config' and './configure' # has to run 'make config' and './configure'
# and copy bin/taglist to <exiv2dir>/bin/taglist for use by 'make doc' # and copy bin/taglist to <exiv2dir>/bin/taglist for use by 'make doc'
IF( MINGW OR UNIX OR APPLE) if( MINGW OR UNIX OR APPLE)
ADD_CUSTOM_TARGET(doc add_custom_target(doc
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/doc" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/doc"
COMMAND chmod +x ./cmake_doc.sh COMMAND chmod +x ./cmake_doc.sh
COMMAND ./cmake_doc.sh "${CMAKE_BINARY_DIR}" COMMAND ./cmake_doc.sh "${CMAKE_BINARY_DIR}"
) )
ENDIF() endif()
INCLUDE( config/printSummary.cmake ) include( config/printSummary.cmake )

@ -31,24 +31,24 @@
# #
# ConfigureChecks for exiv2 # ConfigureChecks for exiv2
IF( EXIV2_ENABLE_SHARED ) if( EXIV2_ENABLE_SHARED )
ADD_DEFINITIONS( -DEXV_HAVE_DLL ) add_definitions( -DEXV_HAVE_DLL )
SET( STATIC_FLAG SHARED ) set( STATIC_FLAG SHARED )
ELSE( EXIV2_ENABLE_SHARED ) else()
SET( STATIC_FLAG STATIC ) set( STATIC_FLAG STATIC )
ENDIF( EXIV2_ENABLE_SHARED ) endif()
IF( EXIV2_ENABLE_COMMERCIAL ) if( EXIV2_ENABLE_COMMERCIAL )
ADD_DEFINITIONS( -DEXV_COMMERCIAL_VERSION ) add_definitions( -DEXV_COMMERCIAL_VERSION )
ENDIF( EXIV2_ENABLE_COMMERCIAL ) endif()
CONFIGURE_FILE(config/exiv2_uninstall.cmake ${CMAKE_BINARY_DIR}/cmake_uninstall.cmake COPYONLY) configure_file(config/exiv2_uninstall.cmake ${CMAKE_BINARY_DIR}/cmake_uninstall.cmake COPYONLY)
ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake") add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake")
IF( NOT MSVC ) if( NOT MSVC )
CONFIGURE_FILE( config/exiv2.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/exiv2.pc @ONLY ) configure_file( config/exiv2.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/exiv2.pc @ONLY )
INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/exiv2.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/exiv2.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig )
CONFIGURE_FILE( config/exiv2.lsm.cmake ${CMAKE_CURRENT_BINARY_DIR}/exiv2.lsm) configure_file( config/exiv2.lsm.cmake ${CMAKE_CURRENT_BINARY_DIR}/exiv2.lsm)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/exiv2.lsm DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/exiv2.lsm DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig )
ENDIF( NOT MSVC ) endif()

@ -12,7 +12,7 @@ UPDATE_TRANSLATIONS(exiv2 ${PO_FILES})
ADD_TRANSLATIONS(exiv2 ${PO_FILES}) ADD_TRANSLATIONS(exiv2 ${PO_FILES})
ADD_CUSTOM_TARGET( pot-update add_custom_target( pot-update
COMMAND xgettext -d ${PACKAGE_NAME} COMMAND xgettext -d ${PACKAGE_NAME}
-s -s
-D ${CMAKE_CURRENT_SOURCE_DIR}/.. -D ${CMAKE_CURRENT_SOURCE_DIR}/..

@ -4,7 +4,7 @@
# Redistribution and use is allowed according to the terms of the BSD license. # Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
SET( SAMPLES addmoddel.cpp set( SAMPLES addmoddel.cpp
convert-test.cpp convert-test.cpp
easyaccess-test.cpp easyaccess-test.cpp
exifcomment.cpp exifcomment.cpp
@ -80,7 +80,7 @@ target_link_libraries(conntest PRIVATE exiv2lib)
# ****************************************************************************** # ******************************************************************************
# exifprint application # exifprint application
# ADD_EXECUTABLE( exifprint exifprint.cpp ) # ADD_EXECUTABLE( exifprint exifprint.cpp )
# TARGET_LINK_LIBRARIES( exifprint exiv2lib ) # target_link_libraries( exifprint exiv2lib )
# ****************************************************************************** # ******************************************************************************
# remotetest application # remotetest application
@ -89,4 +89,4 @@ target_link_libraries(remotetest exiv2lib)
# ****************************************************************************** # ******************************************************************************
# Man page # Man page
INSTALL( FILES exiv2samples.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 ) install( FILES exiv2samples.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 )

@ -7,7 +7,7 @@
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# Private headers which are only needed for the library itself # Private headers which are only needed for the library itself
SET( LIBEXIV2_PRIVATE_HDR canonmn_int.hpp set( LIBEXIV2_PRIVATE_HDR canonmn_int.hpp
casiomn_int.hpp casiomn_int.hpp
cr2image_int.hpp cr2image_int.hpp
crwimage_int.hpp crwimage_int.hpp
@ -33,7 +33,7 @@ SET( LIBEXIV2_PRIVATE_HDR canonmn_int.hpp
) )
# Add standalone C++ header files to this list # Add standalone C++ header files to this list
SET( LIBEXIV2_HDR ../include/exiv2/asfvideo.hpp set( LIBEXIV2_HDR ../include/exiv2/asfvideo.hpp
../include/exiv2/basicio.hpp ../include/exiv2/basicio.hpp
../include/exiv2/bmpimage.hpp ../include/exiv2/bmpimage.hpp
../include/exiv2/config.h ../include/exiv2/config.h
@ -82,7 +82,7 @@ SET( LIBEXIV2_HDR ../include/exiv2/asfvideo.hpp
) )
# Add library C++ source files to this list # Add library C++ source files to this list
SET( LIBEXIV2_SRC asfvideo.cpp set( LIBEXIV2_SRC asfvideo.cpp
basicio.cpp basicio.cpp
bmpimage.cpp bmpimage.cpp
canonmn.cpp canonmn.cpp
@ -151,7 +151,7 @@ if( EXIV2_ENABLE_WEBREADY )
set( LIBEXIV2_SRC ${LIBEXIV2_SRC} ssh.cpp) set( LIBEXIV2_SRC ${LIBEXIV2_SRC} ssh.cpp)
set( LIBEXIV2_HDR ${LIBEXIV2_HDR} ../include/exiv2/ssh.hpp) set( LIBEXIV2_HDR ${LIBEXIV2_HDR} ../include/exiv2/ssh.hpp)
endif() endif()
endif( EXIV2_ENABLE_WEBREADY ) endif()
## ##
# add png*.cpp files if PNG support requested # add png*.cpp files if PNG support requested
@ -160,7 +160,7 @@ if( EXIV2_ENABLE_PNG )
set( LIBEXIV2_HDR ${LIBEXIV2_HDR} ../include/exiv2/pngimage.hpp ) set( LIBEXIV2_HDR ${LIBEXIV2_HDR} ../include/exiv2/pngimage.hpp )
endif() endif()
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
# ****************************************************************************** # ******************************************************************************
# exiv2lib library # exiv2lib library
@ -172,7 +172,7 @@ else()
add_library( exiv2lib ${STATIC_FLAG} ${LIBEXIV2_SRC} ${LIBEXIV2_HDR} ${LIBEXIV2_PRIVATE_HDR}) add_library( exiv2lib ${STATIC_FLAG} ${LIBEXIV2_SRC} ${LIBEXIV2_HDR} ${LIBEXIV2_PRIVATE_HDR})
endif() endif()
SET_TARGET_PROPERTIES( exiv2lib PROPERTIES set_target_properties( exiv2lib PROPERTIES
VERSION ${GENERIC_LIB_VERSION} VERSION ${GENERIC_LIB_VERSION}
SOVERSION ${GENERIC_LIB_SOVERSION} SOVERSION ${GENERIC_LIB_SOVERSION}
DEFINE_SYMBOL EXV_BUILDING_LIB DEFINE_SYMBOL EXV_BUILDING_LIB
@ -187,7 +187,7 @@ 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)
endif () endif()
# TODO : We should not include include/exiv2 but only include !!! # TODO : We should not include include/exiv2 but only include !!!
target_include_directories(exiv2lib PUBLIC target_include_directories(exiv2lib PUBLIC
@ -207,9 +207,9 @@ if ( MSVC )
target_compile_definitions(exiv2lib PRIVATE PSAPI_VERSION=1) # to be compatible with <= WinVista (#905) target_compile_definitions(exiv2lib PRIVATE PSAPI_VERSION=1) # to be compatible with <= WinVista (#905)
if ( EXIV2_ENABLE_STATIC ) if ( EXIV2_ENABLE_STATIC )
TARGET_LINK_LIBRARIES( exiv2lib zlibstatic ${ZLIB_LIBRARIES} ) target_link_libraries( exiv2lib zlibstatic ${ZLIB_LIBRARIES} )
else() else()
TARGET_LINK_LIBRARIES( exiv2lib PRIVATE ${ZLIB_LIBRARIES} ) target_link_libraries( exiv2lib PRIVATE ${ZLIB_LIBRARIES} )
endif() endif()
source_group("Header Files" FILES ${LIBEXIV2_HDR} ) source_group("Header Files" FILES ${LIBEXIV2_HDR} )
source_group("Header Files" FILES ${LIBCURL_HDR} ) source_group("Header Files" FILES ${LIBCURL_HDR} )
@ -225,24 +225,24 @@ else()
endif() endif()
if( EXIV2_ENABLE_XMP AND EXIV2_ENABLE_LIBXMP ) if( EXIV2_ENABLE_XMP AND EXIV2_ENABLE_LIBXMP )
TARGET_LINK_LIBRARIES( exiv2lib PUBLIC xmp ) target_link_libraries( exiv2lib PUBLIC xmp )
ENDIF() endif()
IF( EXIV2_ENABLE_PNG ) if( EXIV2_ENABLE_PNG )
TARGET_LINK_LIBRARIES( exiv2lib PRIVATE ${ZLIB_LIBRARIES} ) target_link_libraries( exiv2lib PRIVATE ${ZLIB_LIBRARIES} )
ENDIF() endif()
IF( EXIV2_ENABLE_NLS ) if( EXIV2_ENABLE_NLS )
TARGET_LINK_LIBRARIES( exiv2lib PRIVATE ${LIBINTL_LIBRARIES} ) target_link_libraries( exiv2lib PRIVATE ${LIBINTL_LIBRARIES} )
ENDIF( EXIV2_ENABLE_NLS ) endif()
IF( ICONV_FOUND ) if( ICONV_FOUND )
TARGET_LINK_LIBRARIES( exiv2lib PRIVATE ${ICONV_LIBRARIES} ) target_link_libraries( exiv2lib PRIVATE ${ICONV_LIBRARIES} )
ENDIF( ICONV_FOUND ) endif()
IF (CYGWIN OR MINGW) if (CYGWIN OR MINGW)
TARGET_LINK_LIBRARIES( exiv2lib PRIVATE psapi ws2_32 ) target_link_libraries( exiv2lib PRIVATE psapi ws2_32 )
ENDIF(CYGWIN OR MINGW) endif()
install(TARGETS exiv2lib install(TARGETS exiv2lib
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
@ -287,4 +287,4 @@ endif()
# ****************************************************************************** # ******************************************************************************
# Man page # Man page
INSTALL( FILES exiv2.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 ) install( FILES exiv2.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 )

Loading…
Cancel
Save