# HG changeset patch
# User mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
# Date 1215948039 0
# Node ID b3838661971fec7dfa2e56786cadc89aaec861ea
# Parent 90005975cdbb3b21e5973471c810ec63dcdd1397
* Applying code::blocks for linux support patch by amo-ej1
* Close #224
* Close #326
diff -r 90005975cdbb -r b3838661971f build/linux/code_blocks/engine_template.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/build/linux/code_blocks/engine_template.xml Sun Jul 13 11:20:39 2008 +0000
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+__FILE_INSERTION_POINT__
+
+
+
+
+
+
+
diff -r 90005975cdbb -r b3838661971f build/linux/code_blocks/fife lib.cbp
--- a/build/linux/code_blocks/fife lib.cbp Sun Jul 13 11:05:12 2008 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,317 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff -r 90005975cdbb -r b3838661971f engine/SConscript
--- a/engine/SConscript Sun Jul 13 11:05:12 2008 +0000
+++ b/engine/SConscript Sun Jul 13 11:20:39 2008 +0000
@@ -195,9 +195,9 @@
msvc_project_builder9 = Builder(action = generate_msvc_project9, suffix = '.vcproj')
env.Append(BUILDERS = {'MSVCProject9': msvc_project_builder9})
-cbbuildpath = joinpath('build', 'win32', 'build_environments', 'code_blocks')
+cbbuildpath_win32 = joinpath('build', 'win32', 'build_environments', 'code_blocks')
-def generate_codeblocks_project(target, source, env):
+def generate_codeblocks_project_win32(target, source, env):
codeblocksHeaderDef = \
'''
@@ -219,13 +219,47 @@
xmlstr.append(codeblocksHeaderDef % newf)
else:
xmlstr.append(codeblocksCppDef % newf)
- projtxt = open(joinpath(cbbuildpath, 'engine_template.xml'), 'r').read()
+ projtxt = open(joinpath(cbbuildpath_win32, 'engine_template.xml'), 'r').read()
projtxt = projtxt.replace('__FILE_INSERTION_POINT__', '\n'.join(xmlstr))
open(str(target[0]), 'w').write(projtxt)
print "FIFE code::blocks project file succesfully created (%s)" % os.path.abspath(str(target[0]))
-codeblocks_project_builder = Builder(action = generate_codeblocks_project, suffix = '.cbp')
-env.Append(BUILDERS = {'CodeblocksProject': codeblocks_project_builder})
+codeblocks_project_builder_win32 = Builder(action = generate_codeblocks_project_win32, suffix = '.cbp')
+env.Append(BUILDERS = {'CodeblocksProject': codeblocks_project_builder_win32})
+
+
+cbbuildpath_linux = joinpath('build', 'linux', 'code_blocks')
+
+def generate_codeblocks_project_linux(target, source, env):
+ codeblocksHeaderDef = \
+ '''
+
+
+
+
+ '''
+
+ codeblocksCppDef = \
+ '''
+
+
+ '''
+ xmlstr = []
+ for f in source:
+ newf = os.path.abspath(str(f)).split('%sengine%s' % (_sep, _sep))[-1]
+ newf = newf.replace('/', '\\')
+ if str(f) in headerfiles:
+ xmlstr.append(codeblocksHeaderDef % newf)
+ else:
+ xmlstr.append(codeblocksCppDef % newf)
+ projtxt = open(joinpath(cbbuildpath_linux, 'engine_template.xml'), 'r').read()
+ projtxt = projtxt.replace('__FILE_INSERTION_POINT__', '\n'.join(xmlstr))
+ open(str(target[0]), 'w').write(projtxt)
+ print "FIFE code::blocks project file succesfully created (%s)" % os.path.abspath(str(target[0]))
+
+codeblocks_project_builder_linux = Builder(action = generate_codeblocks_project_linux, suffix = '.cbp')
+env.Append(BUILDERS = {'CodeblocksProject': codeblocks_project_builder_linux})
+
variated_dirs = eval(open(joinpath('config', 'variated_dirs'), 'r').read())
# filter out swigwrappers. fife_wrap.cxx is appended manually
@@ -262,7 +296,8 @@
msvcproj = env.MSVCProject(joinpath('..', msvcbuildpath, 'fife'), projectfiles)
msvcproj9 = env.MSVCProject9(joinpath('..', msvcbuildpath9, 'fife'), projectfiles)
-cbproj = env.CodeblocksProject(joinpath('..', cbbuildpath, 'fife_engine'), projectfiles)
+cbproj_win32 = env.CodeblocksProject(joinpath('..', cbbuildpath_win32, 'fife_engine'), projectfiles)
+cbproj_linux = env.CodeblocksProject(joinpath('..', cbbuildpath_linux, 'fife_engine'), projectfiles)
if not env['projectfiles_only']:
env.Append(CPPPATH = ['#/engine/core', '#/engine/swigwrappers'])