]> git.lyx.org Git - lyx.git/blobdiff - development/scons/SConscript
remove second QT_NO_STL, it was already there
[lyx.git] / development / scons / SConscript
index 62ab097458acc900044684f758021aa9f34a495f..3e6ab19458e6b67ed914d29565aa0a0a8691accf 100644 (file)
@@ -18,7 +18,7 @@ targets = env['BUILD_TARGETS']
 build_lyx = (targets == [] or 'lyx' in targets or 'install' in targets or 'all' in targets)
 build_boost = env['INCLUDED_BOOST'] or 'boost' in targets
 build_intl = env['INCLUDED_GETTEXT'] or 'intl' in targets
-build_supports = build_lyx or True in [x in targets for x in ['supports', 'client', 'tex2lyx']]
+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
@@ -30,7 +30,7 @@ build_lyxbase = build_lyx or 'lyxbase' in targets
 build_po = 'po' in targets or 'install' in targets or 'all' in targets
 build_qt3 = (build_lyx and env['frontend'] == 'qt3') or 'qt3' in targets
 build_qt4 = (build_lyx and env['frontend'] == 'qt4') or 'qt4' in targets
-build_msvc_projects = env['USE_VC'] and 'msvc_projects' in targets
+build_msvs_projects = env['USE_VC'] and 'msvs_projects' in targets
 
 
 # now, if rebuild_targets is specified, do not rebuild some targets
@@ -48,7 +48,7 @@ if rebuild_targets:
       return old_value
   build_boost = ifBuildLib('boost', 'included_boost_filesystem', build_boost)
   build_intl = ifBuildLib('intl', 'included_intl', build_intl)
-  build_supports = ifBuildLib('supports', 'supports', build_supports)
+  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)
@@ -91,24 +91,24 @@ if build_boost:
 
   regex = boostenv.StaticLibrary(
     target = '$LOCALLIBPATH/included_boost_regex',
-    source = globSource(dir = env.subst('$TOP_SRC_DIR/boost/libs/regex/src'), pattern = '*.cpp',
-      build_dir = '$BUILDDIR/boost/regex/src')
+    source = globSource(dir = env.subst('$TOP_SRC_DIR/boost/libs/regex/src'), 
+      pattern = '*.cpp', build_dir = '$BUILDDIR/boost/regex/src')
   )
 
   print 'Processing files in boost/libs/signals/src...'
 
   signals = boostenv.StaticLibrary(
     target = '$LOCALLIBPATH/included_boost_signals',
-    source = globSource(dir = env.subst('$TOP_SRC_DIR/boost/libs/signals/src'), pattern = '*.cpp',
-      build_dir = '$BUILDDIR/boost/signals/src')
+    source = globSource(dir = env.subst('$TOP_SRC_DIR/boost/libs/signals/src'), 
+      pattern = '*.cpp', build_dir = '$BUILDDIR/boost/signals/src')
   )
 
   print 'Processing files in boost/libs/iostreams/src...'
 
   iostreams = boostenv.StaticLibrary(
     target = '$LOCALLIBPATH/included_boost_iostreams',
-    source = globSource(dir = env.subst('$TOP_SRC_DIR/boost/libs/iostreams/src'), pattern = '*.cpp',
-      build_dir = '$BUILDDIR/boost/iostreams/src')
+    source = globSource(dir = env.subst('$TOP_SRC_DIR/boost/libs/iostreams/src'), 
+      pattern = '*.cpp', build_dir = '$BUILDDIR/boost/iostreams/src')
   )
   Alias('boost', filesystem)
   Alias('boost', regex)
@@ -160,13 +160,14 @@ if build_intl:
   )
   Alias('intl', intl)
 
+
 #
 # Now, src code under src/
 #
 env.BuildDir('$BUILDDIR/common', '$TOP_SRC_DIR/src', duplicate = 0)
 
 
-if build_supports:
+if build_support:
   #
   # src/support
   #
@@ -174,13 +175,13 @@ if build_supports:
 
   env.substFile('$BUILDDIR/common/support/package.C', '$TOP_SRC_DIR/src/support/package.C.in')
 
-  supports = env.StaticLibrary(
-    target = '$LOCALLIBPATH/supports',
-    source =  globSource(dir = env.subst('$TOP_SRC_DIR/src/support'), pattern = env['LYX_EXT'], 
+  support = env.StaticLibrary(
+    target = '$LOCALLIBPATH/support',
+    source = globSource(dir = env.subst('$TOP_SRC_DIR/src/support'), pattern = env['LYX_EXT'], 
       exclude = ['os_win32.C', 'os_unix.C', 'os_cygwin.C', 'atexit.c'],
       include = ['package.C'], build_dir = '$BUILDDIR/common/support')
   )
-  Alias('supports', supports)
+  Alias('support', support)
 
 
 if build_mathed:
@@ -472,7 +473,7 @@ if build_qt4:
   qt4 = qt4env.StaticLibrary(
     target = '$LOCALLIBPATH/qt4',
     LIBS = qt4env['QT_LIB'],
-    source =  globSource(dir = env.subst('$TOP_SRC_DIR/src/frontends/qt4'), pattern = env['LYX_EXT'],
+    source = globSource(dir = env.subst('$TOP_SRC_DIR/src/frontends/qt4'), pattern = env['LYX_EXT'],
       exclude = ['QBrowseBox.C'], build_dir = '$BUILDDIR/common/frontends/qt4')
   )
   Alias('qt4', qt4)
@@ -489,7 +490,7 @@ if build_client:
   if env['HAVE_FCNTL']:
     client = env.Program(
       target = '$BUILDDIR/common/client/lyxclient',
-      LIBS = ['supports'] + env['INTL_LIBS'] + env['SYSTEM_LIBS'] + 
+      LIBS = ['support'] + env['INTL_LIBS'] + env['SYSTEM_LIBS'] + 
         env['SOCKET_LIBS'] + env['BOOST_LIBRARIES'],
       source = globSource(dir = env.subst('$TOP_SRC_DIR/src/client'), pattern = env['LYX_EXT'],
         build_dir = '$BUILDDIR/common/client')
@@ -519,7 +520,7 @@ if build_tex2lyx:
 
   tex2lyx = tex2lyx_env.Program(
     target = '$BUILDDIR/common/tex2lyx/tex2lyx',
-    LIBS = ['supports'] + env['BOOST_LIBRARIES'] + env['SYSTEM_LIBS'],
+    LIBS = ['support'] + env['BOOST_LIBRARIES'] + env['SYSTEM_LIBS'],
     source = globSource(dir = env.subst('$TOP_SRC_DIR/src/tex2lyx'), pattern = env['LYX_EXT'], 
       include = ['FloatList.C', 'Floating.C', 'counters.C', 'lyxlayout.C', 
         'lyxtextclass.C', 'lyxlex.C', 'lyxlex_pimpl.C'],
@@ -562,7 +563,7 @@ if build_lyxbase:
   
   lyxbase_pre = env.StaticLibrary(
     target = '$LOCALLIBPATH/lyxbase_pre',
-    source =  globSource(dir = env.subst('$TOP_SRC_DIR/src'), pattern = env['LYX_EXT'], 
+    source = globSource(dir = env.subst('$TOP_SRC_DIR/src'), pattern = env['LYX_EXT'], 
       exclude = lyx_post_source + ['main.C', 'aspell.C', 'pspell.C', 'ispell.C', 'Variables.C', 'Sectioning.C'],
       include = ['version.C'] + main_source, build_dir = '$BUILDDIR/common')
   )
@@ -594,7 +595,7 @@ if build_lyx:
       env['frontend'],
       'controllers',
       'graphics',
-      'supports',
+      'support',
       'lyxbase_post',
       ] +
       env['BOOST_LIBRARIES'] +
@@ -608,7 +609,72 @@ if build_lyx:
   Alias('lyx', env.Command(os.path.join('$BUILDDIR', target_name), lyx,
     [Copy('$TARGET', '$SOURCE')]))
   Alias('lyx', lyx)
-
+
+if build_msvs_projects:
+  def build_project(target, dir, src_pattern = env['LYX_EXT'], include=[], 
+    resource=None, rebuild=True):
+    if resource is not None:
+      res = globSource(dir = env.subst('$TOP_SRC_DIR/'+resource), pattern = '*.ui', 
+        build_dir = env.subst('$TOP_SRC_DIR/'+resource))
+    else:
+      res = []
+    if rebuild:
+      cmds = 'faststart=yes rebuild='+target
+    else:
+      cmds = 'faststart=yes'
+    if type(dir) == type([]):
+      src = []
+      inc = []
+      for d in dir:
+        src.extend(globSource(dir = env.subst('$TOP_SRC_DIR/' + d), 
+          pattern = src_pattern, include = include,
+          build_dir = boostenv.subst('$TOP_SRC_DIR/' + d) ))
+        inc.extend(globSource(dir = env.subst('$TOP_SRC_DIR/' + d), 
+          pattern = '*.h', 
+          build_dir = env.subst('$TOP_SRC_DIR/' + d) ))
+    else:
+      src = globSource(dir = env.subst('$TOP_SRC_DIR/' + dir), 
+        pattern = src_pattern, include = include,
+        build_dir = boostenv.subst('$TOP_SRC_DIR/' + dir) )
+      inc = globSource(dir = env.subst('$TOP_SRC_DIR/' + dir), 
+        pattern = '*.h', 
+        build_dir = env.subst('$TOP_SRC_DIR/' + dir) )
+    # project
+    proj = boostenv.MSVSProject(
+      target = '$MSVSPATH/' + target + env['MSVSPROJECTSUFFIX'],
+      srcs = src,
+      incs = [boostenv.subst('$TOP_SRC_DIR/src/config.h')],
+      localincs = inc,
+      resources = res,
+      buildtarget = target,
+      cmdargs = cmds,
+      variant = 'Release'
+    )
+    Alias('msvs_projects', proj)
+  build_project('boost', ['boost/libs/filesystem/src',
+    'boost/libs/regex/src', 'boost/libs/signals/src',
+    'boost/libs/iostreams/src'], src_pattern = '*.cpp')
+  build_project('intl', 'intl', src_pattern = '*.c')
+  build_project('support', 'src/support', include=['package.C.in'])
+  build_project('mathed', 'src/mathed')
+  build_project('insets', 'src/insets')
+  build_project('frontends', 'src/frontends')
+  build_project('graphics', 'src/graphics')
+  build_project('controllers', 'src/frontends/controllers')
+  build_project('qt3', 'src/frontends/qt3', resource = 'src/frontends/qt3/ui')
+  build_project('qt4', 'src/frontends/qt4', resource = 'src/frontends/qt4/ui')
+  build_project('client', 'src/client', rebuild=False)
+  build_project('tex2lyx', 'src/tex2lyx', rebuild=False)
+  build_project('lyxbase', 'src')
+  if frontend == 'qt3':
+    build_project('lyx', ['src', 'src/support', 'src/mathed', 'src/insets',
+      'src/frontends', 'src/graphics', 'src/frontends/controllers', 
+      'src/frontends/qt3'], resource = 'src/frontends/qt3/ui')
+  else:
+    build_project('lyx', ['src', 'src/support', 'src/mathed', 'src/insets',
+      'src/frontends', 'src/graphics', 'src/frontends/controllers', 
+      'src/frontends/qt4'], resource = 'src/frontends/qt4/ui')
 
 
 if build_po: