diff --git a/msvc64/ReadMe.txt b/msvc64/ReadMe.txt
index 0f662995..aec6bb1f 100644
--- a/msvc64/ReadMe.txt
+++ b/msvc64/ReadMe.txt
@@ -1,7 +1,7 @@
exiv2\msvc64\ReadMe.txt
-----------------------
-Updated: 2010-12-24
+Updated: 2011-01-02
This is work in progress.
However this is sufficiently robust to be in current use by a commercial licensee of exiv2.
@@ -10,12 +10,12 @@ However this is sufficiently robust to be in current use by a commercial license
Builds with VS2005, 2008 and 2010.
Supports zlib-1.2.5 or zlib-1.2.3
Notes added about building with VS2010 Express
+ setbuild.py "doctors" the project files for DevStudio Express
2) TODO (in priority order)
a) Provide a "runner.bat" build verification test script
b) Build sample/test applications (exifprint etc)
c) Use .vsprop files to hold "common" project settings
- d) python script to "doctor" the project files for DevStudio Express
Assistance appreciated if you wish to become involved.
@@ -32,7 +32,7 @@ T A B L E o f C O N T E N T S
1.3 Open exiv2\msvc64\exiv2.sln
1.4 What is build
1.5 Building with zlib1.2.3
-1.6 Express editions of DevStudio
+1.6 Express editions of DevStudio (or 32 bit only builds, or 64 bit only builds)
2 Design
2.1 Architecture
@@ -51,7 +51,7 @@ T A B L E o f C O N T E N T S
This has been tested with the "Pro" versions of VS 2005/08/10
Express editions dont support 64 bit builds, however it is
possible to build 32 bit libraries with "Express".
- See notes below about DevStudio Express.
+ See notes below about DevStudio Express and building only Win32 or x64 builds
1.2 Install zlib and expat sources.
I use the directory c:\gnu for this purpose, however the name isn't important.
@@ -103,11 +103,20 @@ T A B L E o f C O N T E N T S
c:\gnu>
Please see exiv2\msvc\README-MSVC.txt for information about obtaining zlib-1.2.3
-1.6 Express editions of DevStudio
+1.6 Express editions of DevStudio (or 32 bit only builds, or 64 bit only builds)
Express does not provide a 64bit compiler.
- You can build 32 bit libraries with DevStudio Express (with a little effort)
- The project conversion wizard will fail on any mention of 64 bit configurations.
- You can "doctor" to project files to remove this using a editor:
+ You can build 32 bit libraries with DevStudio Express (with a little effort)
+
+ Before loading the project, use the python script setbuild.py to select Win32:
+
+ c:\gnu\exiv2\msvc64>setbuild Win32
+
+ setbuild.py is none destructive. If you have a 64 bit compiler, you can:
+ 1) Restore the build environment with: setbuild all
+ 2) Select x64 bit builds only with: setbuild.py x64
+
+ If you don't have python available (it's a free download from ActiveState.com),
+ you can "doctor" to project files manually to remove mentiosn of X64 using an editor:
Cleanup your tree and edit the files.
cd exiv2\msvc64
@@ -116,16 +125,13 @@ T A B L E o f C O N T E N T S
for /r %f in (*.sln) do notepad %f
I personally don't recomment notepad for any purpose at all.
- I use TextPad http://www.textpad.com/
+ I use TextPad http://www.textpad.com/ Notepad++ is also good.
DevStudio Express 2010 (and presumably 2005 and 2008) do not have the "Batch Build" feature.
Select "exiv2" right-click "Set as Startup Project" and
Select Platform="Win32" Configuration="Debug|DebugDLL|Release|ReleaseDLL" Build.
Build the Configurations you need. Build time is about 2 minutes/Configuration.
- I don't want to create an msvc32 directory with seperate project files as this introduces
- more maintenance work. I might (no promises) write a python script to edit the project files.
-
2 Design
expat and zlib do not provide 64bit builds for DevStudio,
diff --git a/msvc64/exiv2lib/exiv2lib.vcproj b/msvc64/exiv2lib/exiv2lib.vcproj
index e0e4f651..c21063ac 100644
--- a/msvc64/exiv2lib/exiv2lib.vcproj
+++ b/msvc64/exiv2lib/exiv2lib.vcproj
@@ -764,22 +764,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
"
+__date__ = "$Date"
+__version__ = "$Id: //depot/bin/setbuild.py#17 $"
+__credits__ = """Everybody who contributed to Python.
+Especially: Guido van Rossum for creating the language.
+And: Mark Lutz (and David Ascher) for the O'Reilly Books which explain it.
+"""
+
+
+##
+# import modules
+import os.path
+import sys
+import xml.dom.minidom
+from xml.sax.saxutils import escape
+
+##
+# from PP3E/System/Filetools/cpall.py
+maxfileload = 5 * 1024 * 1024
+blksize = 100 * 1024
+
+##
+def cp(pathFrom, pathTo, maxfileload=maxfileload):
+ """
+ copy file pathFrom to pathTo, byte for byte
+ """
+ if os.path.getsize(pathFrom) <= maxfileload:
+ bytesFrom = open(pathFrom, 'rb').read() # read small file all at once
+ open(pathTo, 'wb').write(bytesFrom) # need b mode on Windows
+ else:
+ fileFrom = open(pathFrom, 'rb') # read big files in chunks
+ fileTo = open(pathTo, 'wb') # need b mode here too
+ while 1:
+ bytesFrom = fileFrom.read(blksize) # get one block, less at end
+ if not bytesFrom: break # empty after last chunk
+ fileTo.write(bytesFrom)
+##
+
+##
+def save(path):
+ """save - make a backup (or restore the backup)"""
+ orig = path+'.orig'
+ if os.path.exists(orig):
+ cp(orig,path)
+ else:
+ cp(path,orig)
+##
+
+##
+def sln(path,remove):
+ """sln - remove the x64 stuff from a sln"""
+
+ save(path)
+
+ if remove:
+ f = open(path, 'r')
+ lines = []
+ for line in f:
+ if line.find(remove)<0:
+ lines.append(line)
+ f.close()
+
+ f = open(path,'w')
+ for line in lines:
+ f.write(line)
+ f.close()
+##
+
+##
+def vcproj(path,remove):
+ """vcproj - remove the x64 stuff from a vcproj"""
+
+ save(path)
+
+ if remove:
+ f = open(path,'r')
+ dom = xml.dom.minidom.parseString(f.read())
+ f.close()
+
+ for tag in [ 'Platform','Configuration' ]:
+ tags = dom.getElementsByTagName(tag)
+ kills = []
+ for t in tags:
+ if t.getAttribute("Name").find(remove)>=0:
+ kills.append(t)
+
+ for kill in kills:
+ kill.parentNode.removeChild(kill)
+
+ # repair the command lines!
+ for tool in dom.getElementsByTagName('Tool'):
+ cl=tool.getAttribute('CommandLine')
+ if cl:
+ cl=escape(cl)
+ cl=cl.replace('\r','__CR__')
+ cl=cl.replace('\n','__LF__')
+ tool.setAttribute('CommandLine',cl)
+ # print '-----------',cl,'----------'
+
+ code=dom.toxml()
+ code=code.replace('__CR__','
')
+ code=code.replace('__LF__','
')
+ f = open(path,'w')
+ f.write(code)
+ f.close()
+##
+
+##
+def visit(myData, directoryName, filesInDirectory): # called for each dir
+ """visit - called by os.path.walk"""
+ # print "in visitor",directoryName, "myData = ",myData
+ # print "filesInDirectory => ",filesInDirectory
+ for filename in filesInDirectory: # do non-dir files here
+ pathname = os.path.join(directoryName, filename)
+ if not os.path.isdir(pathname):
+ global paths
+ paths.append(pathname)
+##
+
+##
+def setbuild(remove):
+ """setbuild - remove == None, means both x64 and Win32"""
+ if remove in set(['x64','Win32',None]):
+ directory = os.path.abspath(os.path.dirname(sys.argv[0]))
+ print "directory = ",directory
+ global paths
+
+ paths=[]
+ os.path.walk(directory, visit, None)
+ for path in paths:
+ # print path
+ handlers = { '.sln' : sln
+ , '.vcproj' : vcproj
+ } ;
+ ext=os.path.splitext(path)[1]
+ if handlers.has_key(ext):
+ handlers[ext](path,remove)
+ else:
+ syntax()
+##
+
+##
+if __name__ == '__main__':
+
+ argc = len(sys.argv)
+ syntaxError = argc < 2
+
+ if not syntaxError:
+ option=sys.argv[1].lower()
+ removes = { 'x64' : 'Win32'
+ , 'win32' : 'x64'
+ , 'all' : None
+ }
+ syntaxError = not removes.has_key(option)
+ if not syntaxError:
+ setbuild(removes[option])
+
+ if syntaxError:
+ syntax()
+
+# That's all Folks!
+##
diff --git a/msvc64/zlib/zlib.vcproj b/msvc64/zlib/zlib.vcproj
index bff2505c..feeac49e 100644
--- a/msvc64/zlib/zlib.vcproj
+++ b/msvc64/zlib/zlib.vcproj
@@ -655,274 +655,18 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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