Fix. Issue: #853. More flexible way to detect and use existing Zlib libraries. Thanks Daniel for providing this patch.

v0.27.3
Robin Mills 13 years ago
parent fbde18806d
commit 6318d3d806

@ -70,22 +70,30 @@ if( MSVC )
set(OUT_OF_SOURCE 1) set(OUT_OF_SOURCE 1)
endif() endif()
# link dependent libraries
if ( NOT EXPAT_LIBRARY ) if ( NOT EXPAT_LIBRARY )
# link dependent libraries
if (OUT_OF_SOURCE) if (OUT_OF_SOURCE)
set(EXPAT_LIBRARY ../../../${E}/$(ConfigurationName)/expat) set(EXPAT_LIBRARY ../../../${E}/$(ConfigurationName)/expat)
set(ZLIB_LIBRARY ../../../${Z}/$(ConfigurationName)/zlib ) set(EXPAT_INCLUDE_DIR ../${E}/lib)
set(EXPAT_INCLUDE_DIR ../${E}/lib )
set(ZLIB_INCLUDE_DIR ../${Z} )
else() else()
set(EXPAT_LIBRARY ../../${E}/$(ConfigurationName)/expat) set(EXPAT_LIBRARY ../../${E}/$(ConfigurationName)/expat)
set(ZLIB_LIBRARY ../../${Z}/$(ConfigurationName)/zlib) set(EXPAT_INCLUDE_DIR ../${E}/lib)
set(EXPAT_INCLUDE_DIR ../${E}/lib )
set(ZLIB_INCLUDE_DIR ../${Z} )
endif() endif()
include_directories( ${EXPAT_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} msvc64\\include src\\include) include_directories( ${EXPAT_INCLUDE_DIR} msvc64\\include src\\include)
endif() endif()
FIND_PACKAGE(ZLIB QUIET)
if ( NOT ZLIB_FOUND )
if (OUT_OF_SOURCE)
set(ZLIB_LIBRARY ../../../${Z}/$(ConfigurationName)/zlib )
set(ZLIB_INCLUDE_DIR ../${Z})
else()
set(ZLIB_LIBRARY ../../${Z}/$(ConfigurationName)/zlib)
set(ZLIB_INCLUDE_DIR ../${Z})
endif()
endif()
include_directories(${ZLIB_INCLUDE_DIR})
if ( EXIV2_ENABLE_SHARED ) if ( EXIV2_ENABLE_SHARED )
add_library(${E} SHARED IMPORTED) add_library(${E} SHARED IMPORTED)
add_library(${Z} SHARED IMPORTED) add_library(${Z} SHARED IMPORTED)

@ -214,6 +214,12 @@ Specify the location of the prebuilt libraries on the cmake command line:
For example: For example:
cmake -G "NMake Makefiles" .. -DEXPAT_LIBRARY=%KDE4_INSTALL_DIR%/lib/libexpat.lib cmake -G "NMake Makefiles" .. -DEXPAT_LIBRARY=%KDE4_INSTALL_DIR%/lib/libexpat.lib
Daniel has provided a patch (SVN:2893) which enables you to specify a ZLIB search path:
Example:
cmake.exe -G "Visual Studio 11 Win64" -DZLIB_ROOT=..\zlib-1.2.7-dev;..\zlib-1.2.7-dev\Release ...
If ZLIB is not located on the path provided, the normal default (..\zlib-1.2.7) will be used.
ToDo: More information about parameters -DEXPAT_LIBRARTY -DZLIB_LIBRARY etc. ToDo: More information about parameters -DEXPAT_LIBRARTY -DZLIB_LIBRARY etc.
4 Building and Installing for other users (Xcode, Eclipse, Qt) 4 Building and Installing for other users (Xcode, Eclipse, Qt)

Loading…
Cancel
Save