Polish options. Move exv_conf.h to directory include/exiv2

This commit is contained in:
clanmills 2017-09-13 15:33:16 +01:00
parent d356aaae95
commit 012d630125
3 changed files with 33 additions and 37 deletions

View File

@ -24,51 +24,49 @@ set( GENERIC_LIB_VERSION "26.0.0" )
set( GENERIC_LIB_SOVERSION "26" )
# options and their default values
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 )
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_VIDEO "Build video 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 )
if (WIN32)
option( EXIV2_ENABLE_WIN_UNICODE "Use Unicode paths (wstring) on Windows" OFF )
endif()
if ( EXIV2_ENABLE_WEBREADY )
option( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" ON )
option( EXIV2_ENABLE_SSH "USE Libssh for SshIo" ON )
else()
option( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" OFF )
option( EXIV2_ENABLE_SSH "USE Libssh for SshIo" OFF )
endif()
option( EXIV2_BUILD_SAMPLES "Build sample applications" ON )
option( EXIV2_BUILD_PO "Build translations files" OFF )
option( EXIV2_BUILD_EXIV2_COMMAND "Build exiv2 command-line executable" 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 )
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_VIDEO "Build video 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_WIN_UNICODE "Use Unicode paths (wstring) on Windows" OFF )
option( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" OFF )
option( EXIV2_ENABLE_SSH "USE Libssh for SshIo" OFF )
option( EXIV2_BUILD_SAMPLES "Build sample applications" ON )
option( EXIV2_BUILD_PO "Build translations files" OFF )
option( EXIV2_BUILD_EXIV2_COMMAND "Build exiv2 command-line executable" ON )
include(config/findDependencies.cmake)
include(config/compilerFlags.cmake)
if ( EXIV2_ENABLE_WEBREADY )
set ( EXIV2_ENABLE_CURL ON )
set ( EXIV2_ENABLE_CURL ON )
set ( EXIV2_ENABLE_SSH ON )
endif()
if( EXIV2_ENABLE_COMMERCIAL )
set (EXIV2_ENABLE_LENSDATA OFF)
set (EXIV2_ENABLE_NLS OFF)
endif()
if( MSVC )
set(CMAKE_DEBUG_POSTFIX "d")
endif()
if( EXIV2_ENABLE_XMP )
set( HAVE_XMP_TOOLKIT ON )
endif()
include(config/findDependencies.cmake)
include(config/compilerFlags.cmake)
include( config/generateConfigFile.cmake )
include_directories(${CMAKE_BINARY_DIR}) # Make the exv_conf.h file visible for the full project
include( config/CMakeChecks.txt )
if( MSVC )
set(CMAKE_DEBUG_POSTFIX "d")
endif()
if( EXIV2_ENABLE_XMP )
add_subdirectory( xmpsdk )
endif()
@ -85,7 +83,6 @@ endif()
##
# tests
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}" )
##
# http://dev.exiv2.org/boards/3/topics/1364

View File

@ -67,4 +67,4 @@ return 0;
#####################################################################################
configure_file( config/config.h.cmake ${CMAKE_BINARY_DIR}/exv_conf.h @ONLY)
configure_file( config/config.h.cmake ${CMAKE_SOURCE_DIR}/include/exiv2/exv_conf.h @ONLY)

View File

@ -1,8 +1,7 @@
# CMakeLists.txt for exiv2 library and command-line program
# list of public C++ include files
file(GLOB LIBEXIV2_HDR ../include/exiv2/*.hpp)
list(APPEND LIBEXIV2_HDR ${CMAKE_BINARY_DIR}/exv_conf.h)
file(GLOB LIBEXIV2_HDR ../include/exiv2/*.hpp ../include/exiv2/exv_conf.h)
# list of internal include files only required to build the library
file(GLOB LIBEXIV2_PRIVATE_HDR *_int.hpp)
@ -10,7 +9,7 @@ file(GLOB LIBEXIV2_PRIVATE_HDR *_int.hpp)
# list of library C++ source files
file(GLOB LIBEXIV2_SRC *.cpp)
# remove files which are not part of the library
file(GLOB LIBEXIV2_SRC_NOT actions.cpp exiv2.cpp *test.cpp crwparse.cpp mrwthumb.cpp xmpdump.cpp)
file(GLOB LIBEXIV2_SRC_NOT actions.cpp exiv2.cpp *test.cpp crwparse.cpp mrwthumb.cpp xmpdump.cpp)
foreach(entry ${LIBEXIV2_SRC_NOT})
list(REMOVE_ITEM LIBEXIV2_SRC ${entry})
endforeach()
@ -87,7 +86,7 @@ if ( MSVC )
if( EXIV2_ENABLE_PNG )
target_link_libraries( exiv2lib PRIVATE ${ZLIB_LIBRARIES} )
endif()
source_group("Header Files" FILES ${LIBEXIV2_HDR} )
source_group("Header Files" FILES ${LIBCURL_HDR} )
source_group("Header Files" FILES ${SSH_HDR} )
@ -133,7 +132,7 @@ install(FILES ${LIBEXIV2_HDR}
# ******************************************************************************
# exiv2 application
set( EXIV2_SRC
set( EXIV2_SRC
exiv2.cpp
exiv2app.hpp
actions.cpp
@ -148,7 +147,7 @@ if(EXIV2_BUILD_EXIV2_COMMAND)
target_link_libraries( exiv2 PRIVATE exiv2lib )
if ( BUILD_SHARED_LIBS )
target_compile_definitions(exiv2 PRIVATE EXV_HAVE_DLL )
endif()
endif()
install(TARGETS exiv2 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()