updated toolchain to extract crypto++ zip.

This commit is contained in:
Nick Bolton 2013-04-04 17:16:01 +00:00
parent 3aaebd9e50
commit 6add1be405
1 changed files with 25 additions and 2 deletions

View File

@ -16,7 +16,7 @@
# TODO: split this file up, it's too long! # TODO: split this file up, it's too long!
import sys, os, ConfigParser, shutil, re, ftputil import sys, os, ConfigParser, shutil, re, ftputil, zipfile
from generators import Generator, EclipseGenerator, MakefilesGenerator from generators import Generator, EclipseGenerator, MakefilesGenerator
if sys.version_info >= (2, 4): if sys.version_info >= (2, 4):
@ -40,6 +40,7 @@ class InternalCommands:
cmake_dir = 'res' cmake_dir = 'res'
gui_dir = 'src/gui' gui_dir = 'src/gui'
doc_dir = 'doc' doc_dir = 'doc'
toolsDir = 'tools'
sln_filename = '%s.sln' % project sln_filename = '%s.sln' % project
xcodeproj_filename = '%s.xcodeproj' % project xcodeproj_filename = '%s.xcodeproj' % project
@ -71,6 +72,9 @@ class InternalCommands:
# by default, let cmake decide # by default, let cmake decide
macSdk = None macSdk = None
# cryptoPP dir with version number
cryptoPPDir = 'cryptopp562'
win32_generators = { win32_generators = {
1 : Generator('Visual Studio 10'), 1 : Generator('Visual Studio 10'),
2 : Generator('Visual Studio 10 Win64'), 2 : Generator('Visual Studio 10 Win64'),
@ -135,6 +139,22 @@ class InternalCommands:
for target in targets: for target in targets:
self.configure(target) self.configure(target)
def checkCryptoPP(self):
dir = self.toolsDir + '/' + self.cryptoPPDir
if (os.path.isdir(dir)):
return
zipFilename = dir + '.zip'
if (not os.path.exists(zipFilename)):
raise Exception('Crypto++ zip not found at: ' + zipFilename)
if not os.path.exists(dir):
os.mkdir(dir)
zip = zipfile.ZipFile(zipFilename)
zip.extractall(dir)
def configure(self, target='', extraArgs=''): def configure(self, target='', extraArgs=''):
cmake_args = '' cmake_args = ''
@ -191,6 +211,9 @@ class InternalCommands:
# if not visual studio, use parent dir # if not visual studio, use parent dir
sourceDir = generator.getSourceDir() sourceDir = generator.getSourceDir()
# ensure that the cryptopp source exists
self.checkCryptoPP()
if extraArgs != '': if extraArgs != '':
cmake_args += ' ' + extraArgs cmake_args += ' ' + extraArgs