#11 Integrating fix into master (accidentally lost on 2017-08-07 by rebase -force)

v0.27.3
clanmills 8 years ago
parent 122cd5737f
commit 1505b4c3aa

@ -1,217 +1,217 @@
@@@Marco@@@@@b ;mm /##Gilles###\ @@@Marco@@@@@b ;mm /##Gilles###\
j@@@#Robin", Brad /@@@Thomas@@@@Q j@@@#Robin", Brad /@@@Thomas@@@@Q
@@@# \ ## @@@b |@@@b @@@# \ ## @@@b |@@@b
@@@# .;;;;, ,;;;, ,;;;; ,;;;p .;;; 7@@ ]Alan @@@# .;;;;, ,;;;, ,;;;; ,;;;p .;;; 7@@ ]Alan
@@@# j@@@@, ]@@#/ '@@@# j@@@# ]@@^ ;@@@" @@@# j@@@@, ]@@#/ '@@@# j@@@# ]@@^ ;@@@"
@@@Andreas@C "@@@p @@@" @@@b j@@@p @@b @@@#/ @@@Andreas@C "@@@p @@@" @@@b j@@@p @@b @@@#/
@@@#^7"7%#\ ^@@@@@#~ Benb 1@@@ {@# s@@@# @@@#^7"7%#\ ^@@@@@#~ Benb 1@@@ {@# s@@@#
@@@# Niels @@@b @@@Q ]@# ;@@@#/ @@@# Niels @@@b @@@Q ]@# ;@@@#/
@@@# ,@@##@@m @@@b @@@p @@C #@@#C @@@# ,@@##@@m @@@b @@@p @@C #@@#C
@@@# ,/ s@@# @@@@ @@@b Volker @Tuan@ @@@# ,/ s@@# @@@@ @@@b Volker @Tuan@
]@@@Abhinav@@\ /@@@\ \@@@Q @@@Q %@@@# /@@@@Mahesh@@# ]@@@Abhinav@@\ /@@@\ \@@@Q @@@Q %@@@# /@@@@Mahesh@@#
/@@Raphael@@@@@\ /@@@@@\ C++ Metadata Library /@Sridhar@@@v0.26\ /@@Raphael@@@@@\ /@@@@@\ C++ Metadata Library /@Sridhar@@@v0.26\
exiv2/contrib/cmake/msvc/ReadMe.txt exiv2/contrib/cmake/msvc/ReadMe.txt
----------------------------------- -----------------------------------
How to use this How to use this
--------------- ---------------
1 Setting up your machine 1 Setting up your machine
You need cmake.exe, svn.exe and 7z.exe on your PATH. You need cmake.exe, svn.exe and 7z.exe on your PATH.
Please get "Windows" versions of cmake/svn/7z etc (NOT Cygwin or MinGW versions) Please get "Windows" versions of cmake/svn/7z (NOT Cygwin or MinGW versions)
You should initialize the Visual Studio environment You should initialize the Visual Studio environment
using the version of vcvars32.bat or vcvarsall.bat using the version of vcvars32.bat or vcvarsall.bat
installed with Visual Studio. For example: installed with Visual Studio. For example:
call "C:\Program Files (x86)\Microsoft Visual Studio 8\VC\bin\vcvars32.bat" call "C:\Program Files (x86)\Microsoft Visual Studio 8\VC\bin\vcvars32.bat"
The batch file contrib\cmake\msvc\vcvars.bat is designed to take the pain The batch file contrib\cmake\msvc\vcvars.bat is designed to take the pain
out of this - provided Visual Studio is installed in %ProgramFiles(x86)% out of this - provided Visual Studio is installed in %ProgramFiles(x86)%
%ProgramFiles(x86)% is usually c:\Program Files (x86) %ProgramFiles(x86)% is usually c:\Program Files (x86)
vcvars 2005 # sets 2005 x86 vcvars 2005 # sets 2005 x86
vcvars 2010 64 # sets 2010 x86_amd64 vcvars 2010 64 # sets 2010 x86_amd64
2 Always build "out of source". I recommend: 2 Always build "out of source". I recommend:
cd <exiv2dir> cd <exiv2dir>\contrib\cmake\cmake
mkdir build cmd.exe
vcvars 2015 64
+-------------------------------------------------------+ cmakeBuild --help # display syntax and options
| Never attempt to build in a directory with a space in | cmakeBuild --rebuild
| the path name. Example c:\My Build Tree\exiv2\build | ....
+-------------------------------------------------------+ exit
Ensure that cmakeBuild.cmd and cmakeDefaults.cmd are on your path (eg your build directory) +-------------------------------------------------------+
copy contrib\cmake\msvc\* build | Never attempt to build in a directory with a space in |
cd build | the path name. Example c:\My Build Tree\exiv2\build |
cmakeBuild --help +-------------------------------------------------------+
You should never have reason to modify the code in cmakeBuild.cmd You should never have reason to modify the code in cmakeBuild.cmd
You may wish to change the defaults in cmakeDefaults.cmd You may wish to change the defaults in cmakeDefaults.cmd
You can change the defaults on the command-line (or modify cmakeDefaults.cmd) You can change the defaults on the command-line (or modify cmakeDefaults.cmd)
You can also change defaults using the dos set command. For example: You can also change defaults using the dos set command. For example:
set _CONFIG_=Debug set _CONFIG_=Debug
To unset an environment string, set _CONFIG_= To unset an environment string, set _CONFIG_=
For your first build, I recommend the command: For your first build, I recommend the command:
cmakeBuild --pause --verbose cmakeBuild --pause --verbose
This will print out a lot of information, and pause after each build step. This will print out a lot of information, and pause after each build step.
When you are building happily, you may prefer: When you are building happily, you may prefer:
cmakeBuild --silent cmakeBuild --silent
3 What gets built? 3 What gets built?
The build is performed in build\temp The build is performed in work
The output is generated in build\dist The output is generated in dist
build\dist\..mumble..\bin contains *.exe and *.dll files dist\..mumble..\bin contains *.exe and *.dll files
build\dist\..mumble..\lib contains *.lib files dist\..mumble..\lib contains *.lib files
build\dist\..mumble..\include contains *.h and *.hpp files dist\..mumble..\include contains *.h and *.hpp files
mumble identifies the compiler and build. mumble identifies the compiler and build.
Example C:\gnu\exiv2\build\dist\2013\x64\dll\Release\bin Example C:\gnu\github\exiv2\contrib\cmake\msvc\dist\2013\x64\dll\Release\bin
2013 = Visual Studio Choices: 2005/2008/2010/2012/2013/2015 2013 = Visual Studio Choices: 2005/2008/2010/2012/2013/2015
x64 = 64 bit build Win32/x64 x64 = 64 bit build Win32/x64
dll = shared library dll/static dll = shared library dll/static
Release = configuration Release/Debug/RelWithDebInfo/MinSizeRel Release = configuration Release/Debug/RelWithDebInfo/MinSizeRel
4 Building manually with CMake 4 Building manually with CMake
The cmake option -G Generator should be chosen for the version of Visual Studio installed. The cmake option -G Generator should be chosen for the version of Visual Studio installed.
cmake --help for more information cmake --help for more information
I personally always build/test with Visual Studio 2005 in 64 bits. I personally always build/test with Visual Studio 2005 in 64 bits.
The generator is: "Visual Studio 8 2005 Win64" The generator is: "Visual Studio 8 2005 Win64"
cd <exiv2dir> cd <exiv2dir>
mkdir ../build mkdir ../build
cd ../build cd ../build
rem download support libraries rem download support libraries
svn export svn://dev.exiv2.org/svn/team/libraries/zlib-1.2.8.tar.gz svn export svn://dev.exiv2.org/svn/team/libraries/zlib-1.2.8.tar.gz
svn export svn://dev.exiv2.org/svn/team/libraries/expat-2.1.0.tar.gz svn export svn://dev.exiv2.org/svn/team/libraries/expat-2.1.0.tar.gz
... ...
for webready for webready
you need curl-7.45.0 libssh-0.7.2 and openssl-1.0.1p you need curl-7.45.0 libssh-0.7.2 and openssl-1.0.1p
See below: "About webready support libraries (openssl, libssh and curl) See below: "About webready support libraries (openssl, libssh and curl)
... ...
rem create a temp directory and a dist (distribution) directory rem create a temp directory and a dist (distribution) directory
mkdir temp # build, compile and link in this directory mkdir temp # build, compile and link in this directory
mkdir dist # the output artifacts are stored here mkdir dist # the output artifacts are stored here
rem build zlib-1.2.8 rem build zlib-1.2.8
mkdir temp\zlib-1.2.8 mkdir temp\zlib-1.2.8
cd temp\zlib-1.2.8 cd temp\zlib-1.2.8
cmake -G "Visual Studio 8 2005 Win64" "-DCMAKE_INSTALL_PREFIX=..\..dist" ..\..\zlib-1.2.8 cmake -G "Visual Studio 8 2005 Win64" "-DCMAKE_INSTALL_PREFIX=..\..dist" ..\..\zlib-1.2.8
cmake --build . # TAKE CARE with expat-2.1.0 use: cmake --build . --target expat cmake --build . # TAKE CARE with expat-2.1.0 use: cmake --build . --target expat
cmake --build . --target install cmake --build . --target install
cd ..\.. cd ..\..
rem build expat-2.1.0 and other required libraries rem build expat-2.1.0 and other required libraries
rem build exiv2 rem build exiv2
mkdir temp\exiv2 mkdir temp\exiv2
cd temp\exiv2 cd temp\exiv2
cmake -G "Visual Studio 8 2005 Win64" "-DCMAKE_INSTALL_PREFIX=..\..\dist" ^ cmake -G "Visual Studio 8 2005 Win64" "-DCMAKE_INSTALL_PREFIX=..\..\dist" ^
"-DCMAKE_LIBRARY_PATH=..\..\dist\lib" "-DCMAKE_INCLUDE_PATH=..\..\dist\include" ^ "-DCMAKE_LIBRARY_PATH=..\..\dist\lib" "-DCMAKE_INCLUDE_PATH=..\..\dist\include" ^
-DEXIV2_ENABLE_SHARED=ON ^ -DEXIV2_ENABLE_SHARED=ON ^
..\..\..\<exiv2dir> ..\..\..\<exiv2dir>
cmake --build . --config Release cmake --build . --config Release
cmake --build . --config Release --target install cmake --build . --config Release --target install
5 About webready support libraries (openssl, libssh and curl) 5 About webready support libraries (openssl, libssh and curl)
a) openssl a) openssl
You cannot build openssl with CMake. However we have prebuilt binaries which You cannot build openssl with CMake. However we have prebuilt binaries which
you can download and extract into your build tree. you can download and extract into your build tree.
You will have to match the version to your compiler. You will have to match the version to your compiler.
In this example: vs2015/64 bit In this example: vs2015/64 bit
svn export svn://dev.exiv2.org/svn/team/libraries/openssl-1.0.1p-vs2015.7z svn export svn://dev.exiv2.org/svn/team/libraries/openssl-1.0.1p-vs2015.7z
7z x openssl-1.0.1p-vs2015.7z 7z x openssl-1.0.1p-vs2015.7z
xcopy/yesihq openssl-1.0.1p-vs2015\bin64 dist\bin" xcopy/yesihq openssl-1.0.1p-vs2015\bin64 dist\bin"
xcopy/yesihq openssl-1.0.1p-vs2015\lib64 dist\bin" xcopy/yesihq openssl-1.0.1p-vs2015\lib64 dist\bin"
xcopy/yesihq openssl-1.0.1p-vs2015\include64 dist\include" xcopy/yesihq openssl-1.0.1p-vs2015\include64 dist\include"
In this example: vs2008/32 bit In this example: vs2008/32 bit
svn export svn://dev.exiv2.org/svn/team/libraries/openssl-1.0.1p-vs2008.7z svn export svn://dev.exiv2.org/svn/team/libraries/openssl-1.0.1p-vs2008.7z
7z x openssl-1.0.1p-vs2015.7z 7z x openssl-1.0.1p-vs2015.7z
xcopy/yesihq openssl-1.0.1p-vs2008\bin dist\bin" xcopy/yesihq openssl-1.0.1p-vs2008\bin dist\bin"
xcopy/yesihq openssl-1.0.1p-vs2008\lib dist\bin" xcopy/yesihq openssl-1.0.1p-vs2008\lib dist\bin"
xcopy/yesihq openssl-1.0.1p-vs2008\include dist\include" xcopy/yesihq openssl-1.0.1p-vs2008\include dist\include"
The script contrib/cmake/msvc/cmakeOpenssl was used to create the vs2005.7z file The script contrib/cmake/msvc/cmakeOpenssl was used to create the vs2005.7z file
from a complete build performed by msvc/exiv2-webready.sln and openssl-1.0.1p source from a complete build performed by msvc/exiv2-webready.sln and openssl-1.0.1p source
b) curl b) curl
curl does not seem to build with CMake. curl does not seem to build with CMake.
It announces itself "the curl cmake build system is poorly maintained. Be aware" It announces itself "the curl cmake build system is poorly maintained. Be aware"
I have given up trying to get this to work and used nmake in the winbuild directory. I have given up trying to get this to work and used nmake in the winbuild directory.
For more information, read: winbuild\BUILD.WINDOWS.txt For more information, read: winbuild\BUILD.WINDOWS.txt
c) libssh c) libssh
Three changes have been made to libssh to build with VS2015, VS2008, VS2995 Three changes have been made to libssh to build with VS2015, VS2008, VS2995
These have been reported (with fixes) These have been reported (with fixes)
VS2015: https://red.libssh.org/issues/214 VS2015: https://red.libssh.org/issues/214
VS2005/8: https://red.libssh.org/issues/2205 VS2005/8: https://red.libssh.org/issues/2205
The fixes are included in svn://dev.exiv2.org/svn/team/libraries/libssh-0.7.2.tar.gz The fixes are included in svn://dev.exiv2.org/svn/team/libraries/libssh-0.7.2.tar.gz
A 'vanilla' version of libssh will may require those fixes to be applied. A 'vanilla' version of libssh will may require those fixes to be applied.
6 Build options 6 Build options
You can inspect CMake options by running grep OPTION on CMakeLists.txt in <exiv2dir> You can inspect CMake options by running grep OPTION on CMakeLists.txt in <exiv2dir>
C:\cygwin64\home\rmills\gnu\exiv2\build>cd ..\trunk C:\cygwin64\home\rmills\gnu\exiv2\build>cd ..\trunk
C:\cygwin64\home\rmills\gnu\exiv2\trunk>grep OPTION CMakeLists.txt C:\cygwin64\home\rmills\gnu\exiv2\trunk>grep OPTION CMakeLists.txt
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_VIDEO "Build with video support" OFF ) OPTION( EXIV2_ENABLE_VIDEO "Build with video support" OFF )
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_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 )
C:\cygwin64\home\rmills\gnu\exiv2\trunk> C:\cygwin64\home\rmills\gnu\exiv2\trunk>
7 Running the test suite 7 Running the test suite
http://dev.exiv2.org/projects/exiv2/wiki/How_do_I_run_the_test_suite_for_Exiv2 http://dev.exiv2.org/projects/exiv2/wiki/How_do_I_run_the_test_suite_for_Exiv2
You can run the test-suite directly from cmakeBuild.cmd with the argument --test You can run the test-suite directly from cmakeBuild.cmd with the argument --test
You need cygwin's bash.exe to run the test suite. You need cygwin's bash.exe to run the test suite.
8 Building with different versions of the support libraries 8 Building with different versions of the support libraries
You can change the standard libraries. For example, to build with curl-7.39.0 You can change the standard libraries. For example, to build with curl-7.39.0
1) set _CURL_=curl-7.39.0 1) set _CURL_=curl-7.39.0
2) add curl-7.39.0.tar.gz in your build directory 2) add curl-7.39.0.tar.gz in your build directory
To change the version of openssl: To change the version of openssl:
1) set _OPENSSL_=openssl-1.0.1j 1) set _OPENSSL_=openssl-1.0.1j
2) add openssl-1.0.1j-vs2015.zip into your build directory 2) add openssl-1.0.1j-vs2015.zip into your build directory
9 Rebuilding with VS 2005/8/10/12/13/15 32/64 9 Rebuilding with VS 2005/8/10/12/13/15 32/64
The script cmakeBuildAll.cmd is provided for convenience: The script cmakeBuildAll.cmd is provided for convenience:
cmakeBuildAll.cmd --test > rebuildAll.txt cmakeBuildAll.cmd --test > rebuildAll.txt
To view progress, open another shell: tail -f rebuildAll.txt To view progress, open another shell: tail -f rebuildAll.txt
cmakeBuildAll.cmd takes about a hour if you don't specify --webready cmakeBuildAll.cmd takes about a hour if you don't specify --webready
12 build+test cycles of about 5 minutes each. 12 build+test cycles of about 5 minutes each.
With webready, 12 build+test cycles of 12 minutes = 2.5 hours With webready, 12 build+test cycles of 12 minutes = 2.5 hours
Robin Mills Robin Mills
robin@clanmills.com robin@clanmills.com

@ -1,438 +1,445 @@
@echo off @echo off
setlocal enableextensions setlocal enableextensions
set "_BUILDDIR_=%CD%" set "_BUILDDIR_=%CD%"
:GETOPTS :GETOPTS
if /I "%1" == "--bash" set "_BASH_=%2"& shift if /I "%1" == "--bash" set "_BASH_=%2"& shift
if /I "%1" == "--config" set "_CONFIG_=%2"& shift if /I "%1" == "--config" set "_CONFIG_=%2"& shift
if /I "%1" == "--curl" set "_CURL_=%2"& shift if /I "%1" == "--curl" set "_CURL_=%2"& shift
if /I "%1" == "--exiv2" set "_EXIV2_=%2"& shift if /I "%1" == "--exiv2" set "_EXIV2_=%2"& shift
if /I "%1" == "--expat" set "_EXPAT_=%2"& shift if /I "%1" == "--expat" set "_EXPAT_=%2"& shift
if /I "%1" == "--generator" set "_GENERATOR_=%2"& shift if /I "%1" == "--generator" set "_GENERATOR_=%2"& shift
if /I "%1" == "--openssl" set "_OPENSSL_=%2"& shift if /I "%1" == "--openssl" set "_OPENSSL_=%2"& shift
if /I "%1" == "--libssh" set "_LIBSSH_=%2"& shift if /I "%1" == "--libssh" set "_LIBSSH_=%2"& shift
if /I "%1" == "--work" set "_WORK_=%2"& shift if /I "%1" == "--work" set "_WORK_=%2"& shift
if /I "%1" == "--zlib" set "_ZLIB_=%2"& shift if /I "%1" == "--zlib" set "_ZLIB_=%2"& shift
if /I "%1" == "--help" call:Help && goto end if /I "%1" == "--help" call:Help && goto end
if /I "%1" == "--dryrun" set "_DRYRUN_=1" if /I "%1" == "--dryrun" set "_DRYRUN_=1"
if /I "%1" == "--pause" set "_PAUSE_=1" if /I "%1" == "--nosamples" set "_NOSAMPLES_=1"
if /I "%1" == "--rebuild" set "_REBUILD_=1" if /I "%1" == "--pause" set "_PAUSE_=1"
if /I "%1" == "--silent" set "_SILENT_=1" if /I "%1" == "--rebuild" set "_REBUILD_=1"
if /I "%1" == "--static" set "_MODE_=static" if /I "%1" == "--silent" set "_SILENT_=1"
if /I "%1" == "--test" set "_TEST_=1" if /I "%1" == "--static" set "_MODE_=static"
if /I "%1" == "--trace" set ("_VERBOSE_=1 && echo on)" if /I "%1" == "--test" set "_TEST_=1"
if /I "%1" == "--verbose" set "_VERBOSE_=1" if /I "%1" == "--trace" set ("_VERBOSE_=1 && echo on)"
if /I "%1" == "--video" set "_VIDEO_=1" if /I "%1" == "--verbose" set "_VERBOSE_=1"
if /I "%1" == "--webready" set "_WEBREADY_=1" if /I "%1" == "--video" set "_VIDEO_=1"
if /I "%1" == "--webready" set "_WEBREADY_=1"
shift
if not (%1) EQU () goto GETOPTS shift
goto main if not (%1) EQU () goto GETOPTS
goto main
:help
call cmakeDefaults >NUL 2>NUL :help
echo Options: --help ^| --webready ^| --rebuild ^| --video ^| --static call cmakeDefaults >NUL 2>NUL
echo. --silent ^| --verbose ^| --pause ^| --dryrun ^| --test ^| --trace echo Options: --help ^| --webready ^| --rebuild ^| --video ^| --static
echo. --exiv2 %_EXIV2_% ^| --work %_WORK_% ^| --config %_CONFIG_% ^| --generator generator echo. --silent ^| --verbose ^| --pause ^| --dryrun ^| --test ^| --trace
echo. --zlib %_ZLIB_% ^| --expat %_EXPAT_% ^| --curl %_CURL_% ^| --libssh %_LIBSSH_% echo. --exiv2 %_EXIV2_% ^| --work %_WORK_% ^| --config %_CONFIG_% ^| --generator generator
echo. --bash %_BASH_% echo. --zlib %_ZLIB_% ^| --expat %_EXPAT_% ^| --curl %_CURL_% ^| --libssh %_LIBSSH_%
exit /b 0 echo. --bash %_BASH_%
exit /b 0
:report
echo.&&echo.&&echo. :report
echo.------ cmakeBuild Settings ---------- echo.&&echo.&&echo.
echo.bash = %_BASH_% echo.------ cmakeBuild Settings ----------
echo.binpath = %_BINPATH_% echo.bash = %_BASH_%
echo.builddir = %_BUILDDIR_% echo.binpath = %_BINPATH_%
echo.config = %_CONFIG_% echo.builddir = %_BUILDDIR_%
echo.curl = %_CURL_% echo.config = %_CONFIG_%
echo.exiv2 = %_EXIV2_% echo.curl = %_CURL_%
echo.expat = %_EXPAT_% echo.exiv2 = %_EXIV2_%
echo.generator = %_GENERATOR_% echo.expat = %_EXPAT_%
echo.incpath = %_INCPATH_% echo.generator = %_GENERATOR_%
echo.libpath = %_LIBPATH_% echo.incpath = %_INCPATH_%
echo.libssh = %_LIBSSH_% echo.libpath = %_LIBPATH_%
echo.mode = %_MODE_% echo.libssh = %_LIBSSH_%
echo.openssl = %_OPENSSL_% echo.mode = %_MODE_%
echo.work = %_WORK_% echo.openssl = %_OPENSSL_%
echo.test = %_TEST_% echo.work = %_WORK_%
echo.video = %_VIDEO_% echo.test = %_TEST_%
echo.vc = %_VC_% echo.video = %_VIDEO_%
echo.vs = %_VS_% echo.vc = %_VC_%
echo.webready = %_WEBREADY_% echo.vs = %_VS_%
echo.zlib = %_ZLIB_% echo.webready = %_WEBREADY_%
echo.&&echo.&&echo. echo.zlib = %_ZLIB_%
exit /b 0 echo.&&echo.&&echo.
exit /b 0
:main
if NOT DEFINED _SILENT_ set _VERBOSE_=1 :main
set _UNSUPPORTED_= if NOT DEFINED _SILENT_ set _VERBOSE_=1
set _UNSUPPORTED_=
rem ----
call:echo calling cmakeDefaults.cmd rem ----
call cmakeDefaults call:echo calling cmakeDefaults.cmd
IF ERRORLEVEL 1 ( call cmakeDefaults
echo "*** cmakeDefaults.cmd has failed ***" >&2 IF ERRORLEVEL 1 (
GOTO error_end echo "*** cmakeDefaults.cmd has failed ***" >&2
) GOTO error_end
call:echo _EXIV2_ = %_EXIV2_% )
call:echo _EXIV2_ = %_EXIV2_%
rem ----
call:echo testing VSINSTALLDIR "%VSINSTALLDIR%" rem ----
IF NOT DEFINED VSINSTALLDIR ( call:echo testing VSINSTALLDIR "%VSINSTALLDIR%"
echo "VSINSTALLDIR not set. Run vcvars32.bat or vcvarsall.bat or vcvars.bat ***" IF NOT DEFINED VSINSTALLDIR (
GOTO error_end echo "VSINSTALLDIR not set. Run vcvars32.bat or vcvarsall.bat or vcvars.bat ***"
) GOTO error_end
IF NOT EXIST "%VSINSTALLDIR%" ( )
echo "VSINSTALLDIR %VSINSTALLDIR% does not exist. Run vcvars32.bat or vcvarsall.bat ***" IF NOT EXIST "%VSINSTALLDIR%" (
GOTO error_end echo "VSINSTALLDIR %VSINSTALLDIR% does not exist. Run vcvars32.bat or vcvarsall.bat ***"
) GOTO error_end
)
if /I "%VSINSTALLDIR%" == "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\" set "_VS_=2015" && set "_VC_=14"
if /I "%VSINSTALLDIR%" == "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\" set "_VS_=2013" && set "_VC_=12" if /I "%VSINSTALLDIR%" == "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\" set "_VS_=2015" && set "_VC_=14"
if /I "%VSINSTALLDIR%" == "%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\" set "_VS_=2012" && set "_VC_=11" if /I "%VSINSTALLDIR%" == "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\" set "_VS_=2013" && set "_VC_=12"
if /I "%VSINSTALLDIR%" == "%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\" set "_VS_=2010" && set "_VC_=10" if /I "%VSINSTALLDIR%" == "%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\" set "_VS_=2012" && set "_VC_=11"
if /I "%VSINSTALLDIR%" == "%ProgramFiles(x86)%\Microsoft Visual Studio 9.0" set "_VS_=2008" && set "_VC_=9" if /I "%VSINSTALLDIR%" == "%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\" set "_VS_=2010" && set "_VC_=10"
if /I "%VSINSTALLDIR%" == "%ProgramFiles(x86)%\Microsoft Visual Studio 8" set "_VS_=2005" && set "_VC_=8" if /I "%VSINSTALLDIR%" == "%ProgramFiles(x86)%\Microsoft Visual Studio 9.0" set "_VS_=2008" && set "_VC_=9"
if /I "%VSINSTALLDIR%" == "%ProgramFiles(x86)%\Microsoft Visual Studio 8" set "_VS_=2005" && set "_VC_=8"
if NOT DEFINED _VC_ set _VS_=
if NOT DEFINED _VS_ ( if NOT DEFINED _VC_ set _VS_=
echo "*** Unsupported version of Visual Studio in '%VSINSTALLDIR%' ***" if NOT DEFINED _VS_ (
GOTO error_end echo "*** Unsupported version of Visual Studio in '%VSINSTALLDIR%' ***"
) GOTO error_end
)
call:echo testing architecture
if "%PROCESSOR_ARCHITECTURE%" EQU "x86" ( call:echo testing architecture
set Platform=Win32 if "%PROCESSOR_ARCHITECTURE%" EQU "x86" (
set RawPlatform=x86 set Platform=Win32
set CpuPlatform=ia32 set RawPlatform=x86
) ELSE ( set CpuPlatform=ia32
set Platform=x64 ) ELSE (
set RawPlatform=x64 set Platform=x64
set CpuPlatform=intel64 set RawPlatform=x64
) set CpuPlatform=intel64
call:echo Platform = %Platform% (%RawPlatform%) )
call:echo Platform = %Platform% (%RawPlatform%)
call:echo determine generator
if NOT DEFINED _GENERATOR_ ( call:echo determine generator
set "_GENERATOR_=Visual Studio %_VC_% %_VS_%" if NOT DEFINED _GENERATOR_ (
IF /I "%Platform%" == "x64" set "_GENERATOR_=Visual Studio %_VC_% %_VS_% Win64" set "_GENERATOR_=Visual Studio %_VC_% %_VS_%"
) IF /I "%Platform%" == "x64" set "_GENERATOR_=Visual Studio %_VC_% %_VS_% Win64"
call:echo GENERATOR = %_GENERATOR_% )
call:echo GENERATOR = %_GENERATOR_%
rem ----
call:echo testing out of source build rem ----
dir/s exiv2.cpp >NUL 2>NUL call:echo testing out of source build
IF NOT ERRORLEVEL 1 ( dir/s exiv2.cpp >NUL 2>NUL
echo "*** error: do not execute this script within the exiv2 source directory ***" IF NOT ERRORLEVEL 1 (
goto error_end echo "*** error: do not execute this script within the exiv2 source directory ***"
) goto error_end
)
rem ----
call:echo testing compiler rem ----
cl > NUL 2>NUL call:echo testing compiler
IF ERRORLEVEL 1 ( cl > NUL 2>NUL
echo "*** ensure cl is on path. Run vcvars32.bat or vcvarsall.bat ***" IF ERRORLEVEL 1 (
GOTO error_end echo "*** ensure cl is on path. Run vcvars32.bat or vcvarsall.bat ***"
) GOTO error_end
if NOT DEFINED _SILENT_ cl )
if NOT DEFINED _SILENT_ cl
rem ----
call:echo testing svn is on path rem ----
svn --version > NUL call:echo testing svn is on path
IF ERRORLEVEL 1 ( svn --version > NUL
echo "*** please ensure svn.exe is on the PATH ***" IF ERRORLEVEL 1 (
GOTO error_end echo "*** please ensure svn.exe is on the PATH ***"
) GOTO error_end
)
rem ----
call:echo testing 7z is on path rem ----
7z > NUL call:echo testing 7z is on path
IF ERRORLEVEL 1 ( 7z > NUL
echo "*** please ensure 7z.exe is on the PATH ***" IF ERRORLEVEL 1 (
GOTO error_end echo "*** please ensure 7z.exe is on the PATH ***"
) GOTO error_end
)
rem ----
call:echo testing cmake is on path rem ----
cmake --version > NUL call:echo testing cmake is on path
IF ERRORLEVEL 1 ( cmake --version > NUL
echo "*** please ensure cmake.exe is on the PATH ***" IF ERRORLEVEL 1 (
GOTO error_end echo "*** please ensure cmake.exe is on the PATH ***"
) GOTO error_end
)
rem ----
call:echo testing work directory _WORK_ = %_WORK_% rem ----
if defined _REBUILD_ if EXIST "%_WORK_%" rmdir/s/q "%_WORK_%" call:echo testing work directory _WORK_ = %_WORK_%
if defined _REBUILD_ del/s CMakeCache.txt >NUL 2>NUL if defined _REBUILD_ if EXIST "%_WORK_%" rmdir/s/q "%_WORK_%"
IF NOT EXIST "%_WORK_%" mkdir "%_WORK_%" if defined _REBUILD_ del/s CMakeCache.txt >NUL 2>NUL
pushd "%_WORK_%" IF NOT EXIST "%_WORK_%" mkdir "%_WORK_%"
set "_WORK_=%CD%" pushd "%_WORK_%"
popd set "_WORK_=%CD%"
call:echo _WORK_ = %_WORK_% popd
call:echo _WORK_ = %_WORK_%
rem ----
call:echo testing INSTALL rem ----
SET _INSTALL_=dist\%_VS_%\%Platform%\%_MODE_%\%_CONFIG_% call:echo testing INSTALL
if NOT EXIST %_INSTALL_% mkdir %_INSTALL_% SET _INSTALL_=dist\%_VS_%\%Platform%\%_MODE_%\%_CONFIG_%
IF NOT EXIST %_INSTALL_% mkdir %_INSTALL_% if NOT EXIST %_INSTALL_% mkdir %_INSTALL_%
pushd %_INSTALL_% IF NOT EXIST %_INSTALL_% mkdir %_INSTALL_%
set "_INSTALL_=%CD%" pushd %_INSTALL_%
popd set "_INSTALL_=%CD%"
call:echo _INSTALL_ = %_INSTALL_% popd
call:echo _INSTALL_ = %_INSTALL_%
set "_LIBPATH_=%_INSTALL_%\bin"
set "_INCPATH_=%_INSTALL_%\include" set "_LIBPATH_=%_INSTALL_%\bin"
set "_BINPATH_=%_INSTALL_%\bin" set "_INCPATH_=%_INSTALL_%\include"
set "_ONCPATH_=%_INCPATH_%" set "_BINPATH_=%_INSTALL_%\bin"
set _LIBPATH_=%_LIBPATH_:\=/% set "_ONCPATH_=%_INCPATH_%"
set _INCPATH_=%_INCPATH_:\=/% set _LIBPATH_=%_LIBPATH_:\=/%
set _BINPATH_=%_BINPATH_:\=/% set _INCPATH_=%_INCPATH_:\=/%
set _BINPATH_=%_BINPATH_:\=/%
if defined _TEST_ if NOT EXIST "%_BASH_%" (
echo "*** bash does not exist %_BASH_% ***" if defined _TEST_ if NOT EXIST "%_BASH_%" (
GOTO error_end echo "*** bash does not exist %_BASH_% ***"
) GOTO error_end
)
if NOT DEFINED _GENERATOR_ set "_GENERATOR_=%VS_CMAKE%"
if /I "%_GENERATOR_%" == "NMake" set "_GENERATOR_=NMake Makefiles" if NOT DEFINED _GENERATOR_ set "_GENERATOR_=%VS_CMAKE%"
if /I "%_GENERATOR_%" == "NMake" set "_GENERATOR_=NMake Makefiles"
if /I "%_MODE_%" == "static" "_LINK_=-DCMAKE_LINK=static"
if /I "%_MODE_%" == "static" "_LINK_=-DCMAKE_LINK=static"
call:cltest
call:report call:cltest
call:report
IF DEFINED _DRYRUN_ goto end
IF DEFINED _PAUSE_ pause IF DEFINED _DRYRUN_ goto end
IF DEFINED _PAUSE_ pause
echo ---------- ZLIB building with cmake ------------------
call:buildLib %_ZLIB_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% echo ---------- ZLIB building with cmake ------------------
call:buildLib %_ZLIB_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_%
echo ---------- EXPAT building with cmake -----------------
set "_TARGET_=--target expat" echo ---------- EXPAT building with cmake -----------------
call:buildLib %_EXPAT_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% set "_TARGET_=--target expat"
set _TARGET_= if /I "%_MODE_%" == "static" (
call:buildLib %_EXPAT_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% -DBUILD_shared=0 -DCMAKE_C_FLAGS_RELEASE=/MT -DBUILD_examples=0 -DBUILD_tests=0
if DEFINED _WEBREADY_ ( ) else (
echo ---------- OPENSSL installing pre-built binaries ----------------- call:buildLib %_EXPAT_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_%
call:getOPENSSL %_OPENSSL_% )
if errorlevel 1 set _OPENSSL_= && set _WEBREADY_= set _TARGET_=
)
if DEFINED _WEBREADY_ (
if DEFINED _WEBREADY_ ( echo ---------- OPENSSL installing pre-built binaries -----------------
echo ---------- LIBSSH building with cmake ----------------- call:getOPENSSL %_OPENSSL_%
call:buildLib %_LIBSSH_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% -DCMAKE_LIBRARY_PATH=%_LIBPATH_% -DCMAKE_INCLUDE_PATH=%_INCPATH_% -DWITH_GSSAPI=OFF -DWITH_ZLIB=ON -DWITH_SFTP=ON -DWITH_SERVER=OFF -DWITH_EXAMPLES=OFF -DWITH_NACL=OFF -DWITH_PCAP=OFF if errorlevel 1 set _OPENSSL_= && set _WEBREADY_=
if errorlevel 1 set _LIBSSH_= && set _WEBREADY_= )
)
if DEFINED _WEBREADY_ (
if DEFINED _WEBREADY_ ( echo ---------- LIBSSH building with cmake -----------------
set CURL_CMAKE= call:buildLib %_LIBSSH_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% -DCMAKE_LIBRARY_PATH=%_LIBPATH_% -DCMAKE_INCLUDE_PATH=%_INCPATH_% -DWITH_GSSAPI=OFF -DWITH_ZLIB=ON -DWITH_SFTP=ON -DWITH_SERVER=OFF -DWITH_EXAMPLES=OFF -DWITH_NACL=OFF -DWITH_PCAP=OFF
if DEFINED CURL_CMAKE ( if errorlevel 1 set _LIBSSH_= && set _WEBREADY_=
echo ---------- CURL building with cmake ----------------- )
call:buildLib %_CURL_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% -DCMAKE_LIBRARY_PATH=%_LIBPATH_% -DCMAKE_INCLUDE_PATH=%_INCPATH_% -DWITH_GSSAPI=OFF -DWITH_ZLIB=OFF -DWITH_SFTP=OFF -DWITH_SERVER=OFF -DWITH_EXAMPLES=OFF -DWITH_NACL=OFF -DWITH_PCAP=OFF -DCMAKE_USE_LIBSSH2=OFF -DCMAKE_USE_LIBSSH=OFF
if errorlevel 1 set _WEBREADY_= if DEFINED _WEBREADY_ (
) ELSE ( set CURL_CMAKE=
if defined _REBUILD_ rmdir/s/q "%_ONCPATH_%\curl" >NUL 2>NUL if DEFINED CURL_CMAKE (
if NOT EXIST "%_ONCPATH_%"\curl ( echo ---------- CURL building with cmake -----------------
echo ---------- CURL building with nmake ----------------- call:buildLib %_CURL_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% -DCMAKE_LIBRARY_PATH=%_LIBPATH_% -DCMAKE_INCLUDE_PATH=%_INCPATH_% -DWITH_GSSAPI=OFF -DWITH_ZLIB=OFF -DWITH_SFTP=OFF -DWITH_SERVER=OFF -DWITH_EXAMPLES=OFF -DWITH_NACL=OFF -DWITH_PCAP=OFF -DCMAKE_USE_LIBSSH2=OFF -DCMAKE_USE_LIBSSH=OFF
IF NOT EXIST %_CURL_%.tar.gz svn export svn://dev.exiv2.org/svn/team/libraries/%_CURL_%.tar.gz >NUL if errorlevel 1 set _WEBREADY_=
pushd "%_WORK_%" ) ELSE (
if defined _REBUILD_ rmdir/s/q "%_ONCPATH_%\curl" >NUL 2>NUL
IF EXIST %_CURL_% rmdir/s/q %_CURL_% if NOT EXIST "%_ONCPATH_%"\curl (
IF NOT EXIST %_CURL_%.tar.gz copy "%_BUILDDIR_%\%_CURL_%.tar.gz" >NUL echo ---------- CURL building with nmake -----------------
IF NOT EXIST %_CURL_%.tar 7z x %_CURL_%.tar.gz IF NOT EXIST %_CURL_%.tar.gz svn export svn://dev.exiv2.org/svn/team/libraries/%_CURL_%.tar.gz >NUL
7z x %_CURL_%.tar pushd "%_WORK_%"
cd "%_CURL_%\winbuild" IF EXIST %_CURL_% rmdir/s/q %_CURL_%
call:run nmake /f Makefile.vc mode=%_MODE_% vc=%_VC_% machine=%RawPlatform% "WITH_DEVEL=%_INSTALL_%" WITH_ZLIB=%_MODE_% ENABLE_WINSSL=yes ENABLE_IDN=no IF NOT EXIST %_CURL_%.tar.gz copy "%_BUILDDIR_%\%_CURL_%.tar.gz" >NUL
if errorlevel 1 set _CURL_= && set _WEBREADY_= IF NOT EXIST %_CURL_%.tar 7z x %_CURL_%.tar.gz
if DEFINED _WEBREADY_ ( 7z x %_CURL_%.tar
cd ..
call:run copy builds\libcurl-vc%_VC_%-%RawPlatform%-release-%_MODE_%-zlib-%_MODE_%-ipv6-sspi-winssl\lib\* "%_LIBPATH_%" cd "%_CURL_%\winbuild"
call:run copy builds\libcurl-vc%_VC_%-%RawPlatform%-release-%_MODE_%-zlib-%_MODE_%-ipv6-sspi-winssl\bin\* "%_BINPATH_%" call:run nmake /f Makefile.vc mode=%_MODE_% vc=%_VC_% machine=%RawPlatform% "WITH_DEVEL=%_INSTALL_%" WITH_ZLIB=%_MODE_% ENABLE_WINSSL=yes ENABLE_IDN=no
call:run xcopy/yesihq builds\libcurl-vc%_VC_%-%RawPlatform%-release-%_MODE_%-zlib-%_MODE_%-ipv6-sspi-winssl\include\curl "%_ONCPATH_%"\curl if errorlevel 1 set _CURL_= && set _WEBREADY_=
) if DEFINED _WEBREADY_ (
popd cd ..
) call:run copy builds\libcurl-vc%_VC_%-%RawPlatform%-release-%_MODE_%-zlib-%_MODE_%-ipv6-sspi-winssl\lib\* "%_LIBPATH_%"
) call:run copy builds\libcurl-vc%_VC_%-%RawPlatform%-release-%_MODE_%-zlib-%_MODE_%-ipv6-sspi-winssl\bin\* "%_BINPATH_%"
) call:run xcopy/yesihq builds\libcurl-vc%_VC_%-%RawPlatform%-release-%_MODE_%-zlib-%_MODE_%-ipv6-sspi-winssl\include\curl "%_ONCPATH_%"\curl
)
if NOT DEFINED _WEBREADY_ set _CURL_= && set _LIBSSH_= popd
)
echo ---------- EXIV2 building with cmake ------------------ )
set "EXIV_B=%_WORK_%\exiv2" )
if defined _REBUILD_ IF EXIST "%EXIV_B%" rmdir/s/q "%EXIV_B%"
IF NOT EXIST "%EXIV_B%" mkdir "%EXIV_B%" if NOT DEFINED _WEBREADY_ set _CURL_= && set _LIBSSH_=
pushd "%EXIV_B%" echo ---------- EXIV2 building with cmake ------------------
set ENABLE_CURL=-DEXIV2_ENABLE_CURL=OFF set "EXIV_B=%_WORK_%\exiv2"
set ENABLE_LIBSSH=-DEXIV2_ENABLE_SSH=OFF if defined _REBUILD_ IF EXIST "%EXIV_B%" rmdir/s/q "%EXIV_B%"
set ENABLE_WEBREADY=-DEXIV2_ENABLE_WEBREADY=OFF IF NOT EXIST "%EXIV_B%" mkdir "%EXIV_B%"
set ENABLE_VIDEO=-DEXIV2_ENABLE_VIDEO=OFF
set ENABLE_SHARED=ON pushd "%EXIV_B%"
set ENABLE_DYNAMIC=ON set ENABLE_CURL=-DEXIV2_ENABLE_CURL=OFF
set ENABLE_LIBSSH=-DEXIV2_ENABLE_SSH=OFF
if defined _CURL_ set ENABLE_CURL=-DEXIV2_ENABLE_CURL=ON set ENABLE_WEBREADY=-DEXIV2_ENABLE_WEBREADY=OFF
if defined _LIBSSH_ set ENABLE_SSH=-DEXIV2_ENABLE_SSH=ON set ENABLE_VIDEO=-DEXIV2_ENABLE_VIDEO=OFF
if defined _WEBREADY_ set ENABLE_WEBREADY=-DEXIV2_ENABLE_WEBREADY=ON set ENABLE_SHARED=ON
if defined _VIDEO_ set ENABLE_VIDEO=-DEXIV2_ENABLE_VIDEO=ON set ENABLE_DYNAMIC=ON
if /I "%_MODE_%" == "static" (
set ENABLE_SHARED=OFF if defined _CURL_ set ENABLE_CURL=-DEXIV2_ENABLE_CURL=ON
set ENABLE_DYNAMIC=OFF if defined _LIBSSH_ set ENABLE_SSH=-DEXIV2_ENABLE_SSH=ON
) if defined _WEBREADY_ set ENABLE_WEBREADY=-DEXIV2_ENABLE_WEBREADY=ON
if defined _VIDEO_ set ENABLE_VIDEO=-DEXIV2_ENABLE_VIDEO=ON
call:run cmake -G "%_GENERATOR_%" -DCMAKE_BUILD_TYPE=%_CONFIG_% %_LINK_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% -DCMAKE_LIBRARY_PATH=%_LIBPATH_% -DCMAKE_INCLUDE_PATH=%_INCPATH_% ^ if /I "%_MODE_%" == "static" (
-DEXIV2_ENABLE_NLS=OFF -DEXIV2_ENABLE_BUILD_SAMPLES=ON ^ set ENABLE_SHARED=OFF
-DEXIV2_ENABLE_WIN_UNICODE=OFF -DEXIV2_ENABLE_SHARED=%ENABLE_SHARED% ^ set ENABLE_DYNAMIC=OFF
-DEXIV2_ENABLE_DYNAMIC_RUNTIME=%ENABLE_DYNAMIC% ^ )
%ENABLE_WEBREADY% %ENABLE_CURL% %ENABLE_LIBSSH% %ENABLE_VIDEO% ^ set BUILD_SAMPLES=ON
"%_EXIV2_%" if DEFINED _NOSAMPLES_ set BUILD_SAMPLES=OFF
IF errorlevel 1 ( call:run cmake -G "%_GENERATOR_%" -DCMAKE_BUILD_TYPE=%_CONFIG_% %_LINK_% -DCMAKE_INSTALL_PREFIX=%_INSTALL_% -DCMAKE_LIBRARY_PATH=%_LIBPATH_% -DCMAKE_INCLUDE_PATH=%_INCPATH_% ^
echo "*** cmake errors in EXIV2 ***" >&2 -DEXIV2_ENABLE_NLS=OFF -DEXIV2_ENABLE_BUILD_SAMPLES=%BUILD_SAMPLES% ^
popd -DEXIV2_ENABLE_WIN_UNICODE=OFF -DEXIV2_ENABLE_SHARED=%ENABLE_SHARED% ^
goto error_end -DEXIV2_ENABLE_DYNAMIC_RUNTIME=%ENABLE_DYNAMIC% ^
) %ENABLE_WEBREADY% %ENABLE_CURL% %ENABLE_LIBSSH% %ENABLE_VIDEO% ^
"%_EXIV2_%"
call:run cmake --build . --config %_CONFIG_%
IF errorlevel 1 ( IF errorlevel 1 (
echo "*** build errors in EXIV2 ***" >&2 echo "*** cmake errors in EXIV2 ***" >&2
popd popd
goto error_end goto error_end
) )
call:run cmake --build . --config %_CONFIG_% --target install call:run cmake --build . --config %_CONFIG_%
IF errorlevel 1 ( IF errorlevel 1 (
echo "*** install errors in EXIV2 ***" >&2 echo "*** build errors in EXIV2 ***" >&2
popd popd
goto error_end goto error_end
) )
popd
call:run cmake --build . --config %_CONFIG_% --target install
if defined _TEST_ ( IF errorlevel 1 (
pushd "%_EXIV2_%\test" echo "*** install errors in EXIV2 ***" >&2
"%_BASH_%" -c "export 'PATH=/usr/bin:$PATH' ; ./testMSVC.sh $(cygpath -au '%_BINPATH_%')" popd
popd goto error_end
exit /b 0 )
) popd
rem ----------------------------------------- if defined _TEST_ (
rem Exit pushd "%_EXIV2_%\test"
rem end syntax: goto end "%_BASH_%" -c "export 'PATH=/usr/bin:$PATH' ; ./testMSVC.sh $(cygpath -au '%_BINPATH_%')"
:end popd
endlocal exit /b 0
exit /b 0 )
rem end with an error syntax: call:error_end rem -----------------------------------------
:error_end rem Exit
endlocal rem end syntax: goto end
exit /b 1 :end
endlocal
rem ----------------------------------------- exit /b 0
rem Functions
rem echo (or don't if --silent). syntax: call:echo args ... rem end with an error syntax: call:error_end
:echo :error_end
if NOT DEFINED _SILENT_ echo %*% endlocal
exit /b 0 exit /b 1
rem run a command. syntax call:run args rem -----------------------------------------
:run rem Functions
if defined _VERBOSE_ ( rem echo (or don't if --silent). syntax: call:echo args ...
echo. :echo
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ if NOT DEFINED _SILENT_ echo %*%
echo CD = %CD% exit /b 0
echo %*%
if DEFINED _PAUSE_ pause rem run a command. syntax call:run args
) :run
if defined _SILENT_ %*% >nul 2>nul if defined _VERBOSE_ (
if NOT defined _SILENT_ %*% echo.
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
set _RESULT_=%ERRORLEVEL% echo CD = %CD%
if DEFINED _PAUSE_ pause echo %*%
exit /b %_RESULT_% if DEFINED _PAUSE_ pause
)
rem ----------------------------------------- if defined _SILENT_ %*% >nul 2>nul
rem build a library with CMake. syntax: call:buildLib name cmake-args ... if NOT defined _SILENT_ %*%
:buildLib
cd "%_BUILDDIR_%" set _RESULT_=%ERRORLEVEL%
set "LOB=%1" if DEFINED _PAUSE_ pause
shift exit /b %_RESULT_%
set "LOB_B=%_WORK_%\%LOB%" rem -----------------------------------------
set "LOB_TAR=%LOB%.tar" rem build a library with CMake. syntax: call:buildLib name cmake-args ...
set "LOB_TAR_GZ=%LOB_TAR%.gz" :buildLib
cd "%_BUILDDIR_%"
IF NOT EXIST "%LOB_TAR_GZ%" svn export svn://dev.exiv2.org/svn/team/libraries/%LOB_TAR_GZ% >NUL set "LOB=%1"
IF NOT EXIST "%LOB_TAR%" 7z x "%LOB_TAR_GZ%" shift
IF NOT EXIST "%LOB%" 7z x "%LOB_TAR%"
if NOT EXIST "%LOB_B%" mkdir "%LOB_B%" set "LOB_B=%_WORK_%\%LOB%"
set "LOB_TAR=%LOB%.tar"
pushd "%LOB_B%" set "LOB_TAR_GZ=%LOB_TAR%.gz"
call:run cmake -G "%_GENERATOR_%" -DCMAKE_BUILD_TYPE=%_CONFIG_% %_LINK_% %* ..\..\%LOB%
IF errorlevel 1 ( IF NOT EXIST "%LOB_TAR_GZ%" svn export svn://dev.exiv2.org/svn/team/libraries/%LOB_TAR_GZ% >NUL
echo "*** cmake errors in %LOB% ***" IF NOT EXIST "%LOB_TAR%" 7z x "%LOB_TAR_GZ%"
popd IF NOT EXIST "%LOB%" 7z x "%LOB_TAR%"
exit /b 1 if NOT EXIST "%LOB_B%" mkdir "%LOB_B%"
)
pushd "%LOB_B%"
call:run cmake --build . --config %_CONFIG_% %_TARGET_% call:run cmake -G "%_GENERATOR_%" -DCMAKE_BUILD_TYPE=%_CONFIG_% %_LINK_% %* ..\..\%LOB%
IF errorlevel 1 ( IF errorlevel 1 (
echo "*** warning: build errors in %LOB% ***" echo "*** cmake errors in %LOB% ***"
) popd
exit /b 1
call:run cmake --build . --config %_CONFIG_% --target install )
IF errorlevel 1 (
echo "*** warning: install errors in %LOB% ***" call:run cmake --build . --config %_CONFIG_% %_TARGET_%
) IF errorlevel 1 (
popd echo "*** warning: build errors in %LOB% ***"
exit /b 0 )
rem ----------------------------------------- call:run cmake --build . --config %_CONFIG_% --target install
rem get pre-built openssl binaries syntax: call:getOPENSSL version IF errorlevel 1 (
:getOPENSSL echo "*** warning: install errors in %LOB% ***"
cd "%_BUILDDIR_%" )
popd
set "LOB=%1-vs%_VS_%" exit /b 0
set "LOB_7Z=%LOB%.7z"
rem -----------------------------------------
IF NOT EXIST "%LOB_7Z%" svn export svn://dev.exiv2.org/svn/team/libraries/%LOB_7Z% >NUL rem get pre-built openssl binaries syntax: call:getOPENSSL version
IF NOT EXIST "%LOB%" 7z x "%LOB_7Z%" >nul :getOPENSSL
cd "%_BUILDDIR_%"
set _BINARY_=bin
set _LIBRARY_=lib set "LOB=%1-vs%_VS_%"
set _INCLUDE_=include set "LOB_7Z=%LOB%.7z"
if /I "%Platform%" == "x64" (
set "_BINARY_=bin64" IF NOT EXIST "%LOB_7Z%" svn export svn://dev.exiv2.org/svn/team/libraries/%LOB_7Z% >NUL
set "_LIBRARY_=lib64" IF NOT EXIST "%LOB%" 7z x "%LOB_7Z%" >nul
set "_INCLUDE_=include64"
) set _BINARY_=bin
set _LIBRARY_=lib
xcopy/yesihq "%LOB%\%_BINARY_%" "%_INSTALL_%\bin" set _INCLUDE_=include
xcopy/yesihq "%LOB%\%_LIBRARY_%" "%_INSTALL_%\lib" if /I "%Platform%" == "x64" (
xcopy/yesihq "%LOB%\%_INCLUDE_%" "%_INSTALL_%\include" set "_BINARY_=bin64"
set "_LIBRARY_=lib64"
rem curl requires libeay32 and ssleay32 (and not libeay32MD and ssleay32MD) set "_INCLUDE_=include64"
pushd "%_INSTALL_%\lib" )
copy libeay32MD.lib libeay32.lib
copy ssleay32MD.lib ssleay32.lib xcopy/yesihq "%LOB%\%_BINARY_%" "%_INSTALL_%\bin"
popd xcopy/yesihq "%LOB%\%_LIBRARY_%" "%_INSTALL_%\lib"
pushd "%_INSTALL_%\bin" xcopy/yesihq "%LOB%\%_INCLUDE_%" "%_INSTALL_%\include"
copy libeay32MD.dll libeay32.dll
copy ssleay32MD.dll ssleay32.dll rem curl requires libeay32 and ssleay32 (and not libeay32MD and ssleay32MD)
popd pushd "%_INSTALL_%\lib"
copy libeay32MD.lib libeay32.lib
exit /b 0 copy ssleay32MD.lib ssleay32.lib
popd
rem ----------------------------------------- pushd "%_INSTALL_%\bin"
rem this runs the compiler and reports _MSC_VER and sizeof(void*) copy libeay32MD.dll libeay32.dll
:cltest copy ssleay32MD.dll ssleay32.dll
pushd "%_EXIV2_%\contrib\cmake\msvc" popd
nmake -a cltest.exe
cltest.exe exit /b 0
popd
exit /b %ERRORLEVEL% rem -----------------------------------------
rem this runs the compiler and reports _MSC_VER and sizeof(void*)
rem That's all Folks! :cltest
rem ----------------------------------------- pushd "%_EXIV2_%\contrib\cmake\msvc"
nmake -a cltest.exe
cltest.exe
popd
exit /b %ERRORLEVEL%
rem That's all Folks!
rem -----------------------------------------

@ -1,33 +1,33 @@
@echo off @echo off
rem set up some defaults to be used by cmakeBuild.cmd and related scripts rem set up some defaults to be used by cmakeBuild.cmd and related scripts
rem use environment strings to set defaults which will not be clobbered by this script rem use environment strings to set defaults which will not be clobbered by this script
if not defined _CONFIG_ SET _CONFIG_=Release if not defined _CONFIG_ SET _CONFIG_=Release
if NOT DEFINED _WORK_ SET _WORK_=work if NOT DEFINED _WORK_ SET _WORK_=work
if NOT DEFINED _EXIV2_ SET _EXIV2_=..\trunk if NOT DEFINED _EXIV2_ SET _EXIV2_=..\..\..
if NOT DEFINED _CURL_ SET _CURL_=curl-7.45.0 if NOT DEFINED _CURL_ SET _CURL_=curl-7.45.0
if NOT DEFINED _LIBSSH_ SET _LIBSSH_=libssh-0.7.2 if NOT DEFINED _LIBSSH_ SET _LIBSSH_=libssh-0.7.2
if NOT DEFINED _OPENSSL_ SET _OPENSSL_=openssl-1.0.1p if NOT DEFINED _OPENSSL_ SET _OPENSSL_=openssl-1.0.1p
if NOT DEFINED _ZLIB_ SET _ZLIB_=zlib-1.2.8 if NOT DEFINED _ZLIB_ SET _ZLIB_=zlib-1.2.8
if NOT DEFINED _EXPAT_ SET _EXPAT_=expat-2.1.0 if NOT DEFINED _EXPAT_ SET _EXPAT_=expat-2.1.0
if NOT DEFINED _BASH_ SET _BASH_=c:\cygwin64\bin\bash.exe if NOT DEFINED _BASH_ SET _BASH_=c:\cygwin64\bin\bash.exe
if NOT DEFINED _MODE_ SET _MODE_=dll if NOT DEFINED _MODE_ SET _MODE_=dll
if NOT DEFINED COPYCMD SET COPYCMD=/Y if NOT DEFINED COPYCMD SET COPYCMD=/Y
rem ---------- check that EXIV2 exists rem ---------- check that EXIV2 exists
echo checking that %_EXIV2_% exists echo checking that %_EXIV2_% exists
if NOT EXIST %_EXIV2_% ( if NOT EXIST %_EXIV2_% (
echo "_EXIV2_ = %_EXIV2_% does not exist ***" >&2 echo "_EXIV2_ = %_EXIV2_% does not exist ***" >&2
exit /b 1 exit /b 1
) )
pushd %_EXIV2_% pushd %_EXIV2_%
set _EXIV2_=%CD% set _EXIV2_=%CD%
popd popd
if NOT EXIST %_EXIV2_%\src\version.cpp ( if NOT EXIST %_EXIV2_%\src\version.cpp (
echo "_EXIV2_ = %_EXIV2_% %_EXIV2_%\src\version.cpp does not exist ***" >&2 echo "_EXIV2_ = %_EXIV2_% %_EXIV2_%\src\version.cpp does not exist ***" >&2
exit /b 1 exit /b 1
) )
rem That's all Folks! rem That's all Folks!
rem rem

@ -257,6 +257,11 @@ ENDIF()
target_include_directories(exiv2lib PRIVATE ${CMAKE_SOURCE_DIR}/xmpsdk/include) target_include_directories(exiv2lib PRIVATE ${CMAKE_SOURCE_DIR}/xmpsdk/include)
if ( MSVC ) if ( MSVC )
if ( EXIV2_ENABLE_STATIC )
TARGET_LINK_LIBRARIES( exiv2lib zlibstatic ${ZLIB_LIBRARIES} )
else()
TARGET_LINK_LIBRARIES( exiv2lib ${PRIVATE_VAR} ${ZLIB_LIBRARIES} )
endif()
source_group("Header Files" FILES ${LIBEXIV2_HDR} ) source_group("Header Files" FILES ${LIBEXIV2_HDR} )
TARGET_LINK_LIBRARIES( exiv2lib ${PRIVATE_VAR} ${ZLIB_LIBRARIES} ) TARGET_LINK_LIBRARIES( exiv2lib ${PRIVATE_VAR} ${ZLIB_LIBRARIES} )
TARGET_LINK_LIBRARIES( exiv2lib ${PRIVATE_VAR} ${EXPAT_LIBRARIES} ) TARGET_LINK_LIBRARIES( exiv2lib ${PRIVATE_VAR} ${EXPAT_LIBRARIES} )

Loading…
Cancel
Save