From 7dd72b33b5f623a2fb6d16dfd68a283c4b00c0f0 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Sun, 2 Jan 2011 20:48:21 +0000 Subject: [PATCH] msvc64: added setbuild.py script to simplify building Win32 (or x64) only. --- msvc64/ReadMe.txt | 30 +- msvc64/exiv2lib/exiv2lib.vcproj | 16 - msvc64/expat/expat.vcproj | 322 ------------- msvc64/setbuild.py | 187 ++++++++ msvc64/zlib/zlib.vcproj | 720 ------------------------------ msvc64/zlib123/zlib.vcproj | 768 -------------------------------- msvc64/zlib125/zlib.vcproj | 720 ------------------------------ 7 files changed, 205 insertions(+), 2558 deletions(-) create mode 100644 msvc64/setbuild.py 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 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - =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 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -