2012-01-16 16:46:00 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2012-05-10 11:08:25 +00:00
|
|
|
if [ "x$1" = "x--i-really-know-what-im-doing" ] ; then
|
2012-05-10 11:17:15 +00:00
|
|
|
echo Proceeding as requested by command line ...
|
2012-05-10 11:08:25 +00:00
|
|
|
else
|
2012-05-10 11:17:15 +00:00
|
|
|
echo "*** Please run again with --i-really-know-what-im-doing ..."
|
|
|
|
exit 1
|
2012-01-16 16:46:00 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
tmp=`mktemp -d`
|
|
|
|
|
|
|
|
hg clone https://code.google.com/p/carve/ $tmp/carve
|
|
|
|
|
|
|
|
for p in `cat ./patches/series`; do
|
|
|
|
echo "Applying patch $p..."
|
|
|
|
cat ./patches/$p | patch -d $tmp/carve -p1
|
|
|
|
done
|
|
|
|
|
2012-05-10 11:08:25 +00:00
|
|
|
find include -type f -not -iwholename '*.svn*' -exec rm -rf {} \;
|
|
|
|
find lib -type f -not -iwholename '*.svn*' -exec rm -rf {} \;
|
2012-01-16 16:46:00 +00:00
|
|
|
|
2012-01-30 08:45:12 +00:00
|
|
|
cat "files.txt" | while read f; do
|
2012-01-16 16:46:00 +00:00
|
|
|
mkdir -p `dirname $f`
|
|
|
|
cp $tmp/carve/$f $f
|
|
|
|
done
|
|
|
|
|
|
|
|
rm -rf $tmp
|
|
|
|
|
2012-05-10 11:08:25 +00:00
|
|
|
sources=`find ./lib -type f -iname '*.cc' -or -iname '*.cpp' -or -iname '*.c' | sed -r 's/^\.\//\t/' | sort -d`
|
|
|
|
headers=`find ./lib -type f -iname '*.h' -or -iname '*.hpp' | sed -r 's/^\.\//\t/' | sort -d`
|
|
|
|
includes=`find ./include -type f -iname '*.h' -or -iname '*.hpp' | sed -r 's/^\.\//\t/' | sort -d`
|
2012-01-16 16:46:00 +00:00
|
|
|
|
|
|
|
cp patches/files/config.h include/carve/config.h
|
|
|
|
|
|
|
|
cat > CMakeLists.txt << EOF
|
|
|
|
# ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program 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, write to the Free Software Foundation,
|
2012-03-12 21:18:28 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2012-01-16 16:46:00 +00:00
|
|
|
#
|
|
|
|
# The Original Code is Copyright (C) 2006, Blender Foundation
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# The Original Code is: all of this file.
|
|
|
|
#
|
|
|
|
# Contributor(s): Jacques Beaurai, Erwin Coumans
|
|
|
|
#
|
|
|
|
# ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
|
|
|
# NOTE: This file is automatically generated by bundle.sh script
|
|
|
|
# If you're doing changes in this file, please update template
|
|
|
|
# in that script too
|
|
|
|
|
|
|
|
set(INC
|
|
|
|
include
|
|
|
|
)
|
|
|
|
|
|
|
|
set(INC_SYS
|
|
|
|
)
|
|
|
|
|
|
|
|
set(SRC
|
2014-01-30 12:32:23 +00:00
|
|
|
carve-capi.cc
|
|
|
|
carve-util.cc
|
2012-01-16 16:46:00 +00:00
|
|
|
${sources}
|
|
|
|
|
2014-01-30 12:32:23 +00:00
|
|
|
carve-capi.h
|
|
|
|
carve-util.h
|
2012-01-16 16:46:00 +00:00
|
|
|
${headers}
|
|
|
|
|
|
|
|
${includes}
|
|
|
|
)
|
|
|
|
|
|
|
|
if(WITH_BOOST)
|
|
|
|
if(NOT MSVC)
|
|
|
|
# Boost is setting as preferred collections library in the Carve code when using MSVC compiler
|
|
|
|
add_definitions(
|
|
|
|
-DHAVE_BOOST_UNORDERED_COLLECTIONS
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_definitions(
|
|
|
|
-DCARVE_SYSTEM_BOOST
|
|
|
|
)
|
|
|
|
|
2013-02-25 10:02:43 +00:00
|
|
|
list(APPEND INC_SYS
|
2012-01-16 16:46:00 +00:00
|
|
|
\${BOOST_INCLUDE_DIR}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
blender_add_lib(extern_carve "\${SRC}" "\${INC}" "\${INC_SYS}")
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat > SConscript << EOF
|
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
# NOTE: This file is automatically generated by bundle.sh script
|
|
|
|
# If you're doing changes in this file, please update template
|
|
|
|
# in that script too
|
|
|
|
|
|
|
|
Import ('env')
|
|
|
|
|
|
|
|
sources = env.Glob('lib/*.cpp')
|
2014-02-24 11:58:56 +00:00
|
|
|
sources += env.Glob('*.cc')
|
2012-01-16 16:46:00 +00:00
|
|
|
|
|
|
|
defs = []
|
|
|
|
incs = ['include']
|
|
|
|
|
|
|
|
if env['WITH_BF_BOOST']:
|
|
|
|
if env['OURPLATFORM'] not in ('win32-vc', 'win64-vc'):
|
|
|
|
# Boost is setting as preferred collections library in the Carve code when using MSVC compiler
|
2012-04-24 12:57:58 +00:00
|
|
|
if env['OURPLATFORM'] not in ('win32-mingw', 'win64-mingw'):
|
2012-01-17 18:47:02 +00:00
|
|
|
defs.append('HAVE_BOOST_UNORDERED_COLLECTIONS')
|
2012-01-16 16:46:00 +00:00
|
|
|
|
|
|
|
defs.append('CARVE_SYSTEM_BOOST')
|
|
|
|
incs.append(env['BF_BOOST_INC'])
|
|
|
|
|
|
|
|
env.BlenderLib ('extern_carve', Split(sources), incs, defs, libtype=['extern'], priority=[40] )
|
|
|
|
EOF
|