-def appExists(apppath, appname):
- ''' Check whether or not application already exists'''
- return os.path.isfile(File(env.subst('$BUILDDIR/common/%s/${PROGPREFIX}%s$PROGSUFFIX' % (apppath, appname))).abspath)
-
-targets = BUILD_TARGETS
-build_install = 'install' in targets or 'installer' in targets
-build_installer = 'installer' in targets
-# msvc need to pass full target name, so I have to look for path/lyx etc
-build_lyx = build_installer or targets == [] or True in ['lyx' in x for x in targets] \
- or build_install or 'all' in targets
-build_boost = (included_boost and not libExists('boost_regex')) or 'boost' in targets
-build_intl = (included_gettext and not libExists('included_intl')) or 'intl' in targets
-build_support = build_lyx or True in [x in targets for x in ['support', 'client', 'tex2lyx']]
-build_mathed = build_lyx or 'mathed' in targets
-build_insets = build_lyx or 'insets' in targets
-build_frontends = build_lyx or 'frontends' in targets
-build_graphics = build_lyx or 'graphics' in targets
-build_controllers = build_lyx or 'controllers' in targets
-build_client = True in ['client' in x for x in targets] \
- or build_install or 'all' in targets or build_installer
-build_tex2lyx = True in ['tex2lyx' in x for x in targets] \
- or build_install or 'all' in targets or build_installer
-build_lyxbase = build_lyx or 'lyxbase' in targets
-update_po = 'update_po' in targets
-update_manifest = 'update_manifest' in targets
-build_po = 'po' in targets or build_install or 'all' in targets
-build_qt4 = (build_lyx and frontend == 'qt4') or 'qt4' in targets
-build_msvs_projects = use_vc and 'msvs_projects' in targets
-
-
-# now, if rebuild_targets is specified, do not rebuild some targets
-if rebuild_targets is not None:
- #
- def ifBuildLib(name, libname, old_value):
- # explicitly asked to rebuild
- if name in rebuild_targets:
- return True
- # else if not rebuild, and if the library already exists
- elif libExists(libname):
- return False
- # do not change the original value
- else:
- return old_value
- build_boost = ifBuildLib('boost', 'included_boost_filesystem', build_boost)
- build_intl = ifBuildLib('intl', 'included_intl', build_intl)
- build_support = ifBuildLib('support', 'support', build_support)
- build_mathed = ifBuildLib('mathed', 'mathed', build_mathed)
- build_insets = ifBuildLib('insets', 'insets', build_insets)
- build_frontends = ifBuildLib('frontends', 'frontends', build_frontends)
- build_graphics = ifBuildLib('graphics', 'graphics', build_graphics)
- build_controllers = ifBuildLib('controllers', 'controllers', build_controllers)
- build_lyxbase = ifBuildLib('lyxbase', 'lyxbase_pre', build_lyxbase)
- build_qt4 = ifBuildLib('qt4', 'qt4', build_qt4)
- #
- def ifBuildApp(name, appname, old_value):
- # explicitly asked to rebuild
- if name in rebuild_targets:
- return True
- # else if not rebuild, and if the library already exists
- elif appExists(name, appname):
- return False
- # do not change the original value
- else:
- return old_value
- build_tex2lyx = ifBuildApp('tex2lyx', 'tex2lyx', build_tex2lyx)
- build_client = ifBuildApp('client', 'lyxclient', build_client)