2012-09-04 02:09:56 +00:00
|
|
|
# synergy -- mouse and keyboard sharing utility
|
2014-11-02 12:12:05 +00:00
|
|
|
# Copyright (C) 2012 Synergy Si Ltd.
|
2012-09-04 02:09:56 +00:00
|
|
|
# Copyright (C) 2009 Nick Bolton
|
|
|
|
#
|
|
|
|
# This package is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
2015-05-03 02:33:52 +00:00
|
|
|
# found in the file LICENSE that should have accompanied this file.
|
2012-09-04 02:09:56 +00:00
|
|
|
#
|
|
|
|
# This package is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2012-06-10 16:50:54 +00:00
|
|
|
class Generator(object):
|
|
|
|
def __init__(self, cmakeName, buildDir='build', sourceDir='..', binDir='bin'):
|
|
|
|
self.cmakeName = cmakeName
|
|
|
|
self.buildDir = buildDir
|
|
|
|
self.sourceDir = sourceDir
|
|
|
|
self.binDir = binDir
|
|
|
|
|
|
|
|
def getBuildDir(self, target):
|
|
|
|
return self.buildDir
|
|
|
|
|
|
|
|
def getBinDir(self, target=''):
|
|
|
|
return self.binDir
|
|
|
|
|
|
|
|
def getSourceDir(self):
|
|
|
|
return self.sourceDir
|
|
|
|
|
|
|
|
class MakefilesGenerator(Generator):
|
|
|
|
def __init__(self):
|
2014-02-14 16:21:02 +00:00
|
|
|
super(MakefilesGenerator, self).__init__('Unix Makefiles')
|
2012-06-10 16:50:54 +00:00
|
|
|
|
|
|
|
def getBuildDir(self, target):
|
|
|
|
return super(MakefilesGenerator, self).getBuildDir(target) + '/' + target
|
|
|
|
|
|
|
|
def getBinDir(self, target=''):
|
|
|
|
workingDir = super(MakefilesGenerator, self).getBinDir(target)
|
|
|
|
|
|
|
|
# only put debug files in separate bin dir
|
|
|
|
if target == 'debug':
|
|
|
|
workingDir += '/debug'
|
|
|
|
|
|
|
|
return workingDir
|
|
|
|
|
|
|
|
def getSourceDir(self):
|
|
|
|
return super(MakefilesGenerator, self).getSourceDir() + '/..'
|
2014-02-14 16:21:02 +00:00
|
|
|
|
|
|
|
class XcodeGenerator(Generator):
|
|
|
|
def __init__(self):
|
|
|
|
super(XcodeGenerator, self).__init__('Xcode')
|
|
|
|
|
|
|
|
def getBinDir(self, target=''):
|
2014-02-14 17:01:47 +00:00
|
|
|
if target == "":
|
|
|
|
return super(XcodeGenerator, self).getBinDir(target)
|
|
|
|
|
2014-02-14 16:21:02 +00:00
|
|
|
xcodeTarget = target[0].upper() + target[1:]
|
|
|
|
return super(XcodeGenerator, self).getBinDir(target) + '/' + xcodeTarget
|
2012-06-10 16:50:54 +00:00
|
|
|
|
|
|
|
class EclipseGenerator(Generator):
|
|
|
|
def __init__(self):
|
|
|
|
super(EclipseGenerator, self).__init__('Eclipse CDT4 - Unix Makefiles', '', '')
|
|
|
|
|
|
|
|
def getBuildDir(self, target):
|
|
|
|
# eclipse only works with in-source build.
|
|
|
|
return ''
|
|
|
|
|
|
|
|
def getBinDir(self, target=''):
|
|
|
|
# eclipse only works with in-source build.
|
|
|
|
return 'bin'
|
|
|
|
|
|
|
|
def getSourceDir(self):
|
|
|
|
return ''
|
|
|
|
|