LEFT | RIGHT |
(no file at all) | |
| 1 #!/bin/sh |
| 2 |
| 3 #BRANCH="keir" |
| 4 BRANCH="Matthias-Fauconneau" |
| 5 |
| 6 if [ -d ./.svn ]; then |
| 7 echo "This script is supposed to work only when using git-svn" |
| 8 exit 1 |
| 9 fi |
| 10 |
| 11 repo="git://github.com/${BRANCH}/libmv.git" |
| 12 tmp=`mktemp -d` |
| 13 |
| 14 git clone $repo $tmp/libmv |
| 15 |
| 16 #git --git-dir $tmp/libmv/.git --work-tree $tmp/libmv log --since="1 month ago"
> ChangeLog |
| 17 git --git-dir $tmp/libmv/.git --work-tree $tmp/libmv log -n 50 > ChangeLog |
| 18 |
| 19 for p in `cat ./patches/series`; do |
| 20 echo "Applying patch $p..." |
| 21 cat ./patches/$p | patch -d $tmp/libmv -p1 |
| 22 done |
| 23 |
| 24 rm -rf libmv |
| 25 rm -rf third_party |
| 26 |
| 27 cat "files.txt" | while f=`line`; do |
| 28 mkdir -p `dirname $f` |
| 29 cp $tmp/libmv/src/$f $f |
| 30 done |
| 31 |
| 32 rm -rf $tmp |
| 33 |
| 34 chmod 664 ./third_party/glog/src/windows/*.cc ./third_party/glog/src/windows/*.h
./third_party/glog/src/windows/glog/*.h |
| 35 |
| 36 sources=`find ./libmv -type f -iname '*.cc' -or -iname '*.cpp' -or -iname '*.c'
| sed -r 's/^\.\//\t/'` |
| 37 headers=`find ./libmv -type f -iname '*.h' | sed -r 's/^\.\//\t/'` |
| 38 |
| 39 third_sources=`find ./third_party -type f -iname '*.cc' -or -iname '*.cpp' -or -
iname '*.c' | grep -v glog | sed -r 's/^\.\//\t/'` |
| 40 third_headers=`find ./third_party -type f -iname '*.h' | grep -v glog | sed -r '
s/^\.\//\t/'` |
| 41 |
| 42 third_glog_sources=`find ./third_party -type f -iname '*.cc' -or -iname '*.cpp'
-or -iname '*.c' | grep glog | grep -v windows | sed -r 's/^\.\//\t\t/'` |
| 43 third_glog_headers=`find ./third_party -type f -iname '*.h' | grep glog | grep -
v windows | sed -r 's/^\.\//\t\t/'` |
| 44 |
| 45 src_dir=`find ./libmv -type f -iname '*.cc' -exec dirname {} \; -or -iname '*.cp
p' -exec dirname {} \; -or -iname '*.c' -exec dirname {} \; | sed -r 's/^\.\//\t
/' | sort | uniq` |
| 46 src_third_dir=`find ./third_party -type f -iname '*.cc' -exec dirname {} \; -or
-iname '*.cpp' -exec dirname {} \; -or -iname '*.c' -exec dirname {} \; | sed -r
's/^\.\//\t/' | sort | uniq` |
| 47 src="" |
| 48 win_src="" |
| 49 for x in $src_dir $src_third_dir; do |
| 50 t="" |
| 51 |
| 52 if test `echo "$x" | grep -c glog ` -eq 1; then |
| 53 continue; |
| 54 fi |
| 55 |
| 56 if stat $x/*.cpp > /dev/null 2>&1; then |
| 57 t="src += env.Glob('`echo $x'/*.cpp'`')" |
| 58 fi |
| 59 |
| 60 if stat $x/*.c > /dev/null 2>&1; then |
| 61 if [ -z "$t" ]; then |
| 62 t="src += env.Glob('`echo $x'/*.c'`')" |
| 63 else |
| 64 t="$t + env.Glob('`echo $x'/*.c'`')" |
| 65 fi |
| 66 fi |
| 67 |
| 68 if stat $x/*.cc > /dev/null 2>&1; then |
| 69 if [ -z "$t" ]; then |
| 70 t="src += env.Glob('`echo $x'/*.cc'`')" |
| 71 else |
| 72 t="$t + env.Glob('`echo $x'/*.cc'`')" |
| 73 fi |
| 74 fi |
| 75 |
| 76 if test `echo $x | grep -c windows ` -eq 0; then |
| 77 if [ -z "$src" ]; then |
| 78 src=$t |
| 79 else |
| 80 src=`echo "$src\n$t"` |
| 81 fi |
| 82 else |
| 83 if [ -z "$win_src" ]; then |
| 84 win_src=`echo " $t"` |
| 85 else |
| 86 win_src=`echo "$win_src\n $t"` |
| 87 fi |
| 88 fi |
| 89 done |
| 90 |
| 91 cat > CMakeLists.txt << EOF |
| 92 # \$Id\$ |
| 93 # ***** BEGIN GPL LICENSE BLOCK ***** |
| 94 # |
| 95 # This program is free software; you can redistribute it and/or |
| 96 # modify it under the terms of the GNU General Public License |
| 97 # as published by the Free Software Foundation; either version 2 |
| 98 # of the License, or (at your option) any later version. |
| 99 # |
| 100 # This program is distributed in the hope that it will be useful, |
| 101 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 102 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 103 # GNU General Public License for more details. |
| 104 # |
| 105 # You should have received a copy of the GNU General Public License |
| 106 # along with this program; if not, write to the Free Software Foundation, |
| 107 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 108 # |
| 109 # The Original Code is Copyright (C) 2011, Blender Foundation |
| 110 # All rights reserved. |
| 111 # |
| 112 # Contributor(s): Blender Foundation, |
| 113 # Sergey Sharybin |
| 114 # |
| 115 # ***** END GPL LICENSE BLOCK ***** |
| 116 |
| 117 set(INC |
| 118 . |
| 119 ../Eigen3 |
| 120 ./third_party/ssba |
| 121 ./third_party/ldl/Include |
| 122 ../colamd/Include |
| 123 ) |
| 124 |
| 125 set(INC_SYS |
| 126 |
| 127 ) |
| 128 |
| 129 set(SRC |
| 130 libmv-capi.cpp |
| 131 ${sources} |
| 132 |
| 133 ${third_sources} |
| 134 |
| 135 libmv-capi.h |
| 136 ${headers} |
| 137 |
| 138 ${third_headers} |
| 139 ) |
| 140 |
| 141 IF(WIN32) |
| 142 list(APPEND SRC |
| 143 third_party/glog/src/logging.cc |
| 144 third_party/glog/src/raw_logging.cc |
| 145 third_party/glog/src/utilities.cc |
| 146 third_party/glog/src/vlog_is_on.cc |
| 147 third_party/glog/src/windows/port.cc |
| 148 |
| 149 third_party/glog/src/utilities.h |
| 150 third_party/glog/src/stacktrace_generic-inl.h |
| 151 third_party/glog/src/stacktrace.h |
| 152 third_party/glog/src/stacktrace_x86_64-inl.h |
| 153 third_party/glog/src/base/googleinit.h |
| 154 third_party/glog/src/base/mutex.h |
| 155 third_party/glog/src/base/commandlineflags.h |
| 156 third_party/glog/src/stacktrace_powerpc-inl.h |
| 157 third_party/glog/src/stacktrace_x86-inl.h |
| 158 third_party/glog/src/config.h |
| 159 third_party/glog/src/stacktrace_libunwind-inl.h |
| 160 third_party/glog/src/windows/glog/raw_logging.h |
| 161 third_party/glog/src/windows/glog/vlog_is_on.h |
| 162 third_party/glog/src/windows/glog/logging.h |
| 163 third_party/glog/src/windows/glog/log_severity.h |
| 164 third_party/glog/src/windows/port.h |
| 165 third_party/glog/src/windows/config.h |
| 166 ) |
| 167 |
| 168 list(APPEND INC |
| 169 ./third_party/glog/src/windows |
| 170 ./third_party/msinttypes |
| 171 ) |
| 172 |
| 173 IF(MSVC) |
| 174 set(MSVC_OFLAGS O1 O2 Ox) |
| 175 foreach(FLAG ${MSVC_OFLAGS}) |
| 176 string(REPLACE "${FLAG}" "Od" CMAKE_CXX_FLAGS_RELEASE "$
{CMAKE_CXX_FLAGS_RELEASE}") |
| 177 string(REPLACE "${FLAG}" "Od" CMAKE_C_FLAGS_RELWITHDEBIN
FO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") |
| 178 endforeach() |
| 179 ENDIF(MSVC) |
| 180 ELSE(WIN32) |
| 181 list(APPEND SRC |
| 182 ${third_glog_sources} |
| 183 |
| 184 ${third_glog_headers} |
| 185 ) |
| 186 |
| 187 list(APPEND INC |
| 188 ./third_party/glog/src |
| 189 ) |
| 190 ENDIF(WIN32) |
| 191 |
| 192 add_definitions(-DV3DLIB_ENABLE_SUITESPARSE -DGOOGLE_GLOG_DLL_DECL=) |
| 193 |
| 194 blender_add_lib(extern_libmv "\${SRC}" "\${INC}" "\${INC_SYS}") |
| 195 EOF |
| 196 |
| 197 cat > SConscript << EOF |
| 198 #!/usr/bin/python |
| 199 import sys |
| 200 import os |
| 201 |
| 202 Import('env') |
| 203 |
| 204 defs = [] |
| 205 |
| 206 cflags_libmv = Split(env['CFLAGS']) |
| 207 ccflags_libmv = Split(env['CCFLAGS']) |
| 208 cxxflags_libmv = Split(env['CXXFLAGS']) |
| 209 |
| 210 defs.append('V3DLIB_ENABLE_SUITESPARSE') |
| 211 defs.append('GOOGLE_GLOG_DLL_DECL=') |
| 212 |
| 213 src = env.Glob("*.cpp") |
| 214 $src |
| 215 |
| 216 incs = '. ../Eigen3' |
| 217 |
| 218 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): |
| 219 incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog
./third_party/msinttypes' |
| 220 ${win_src} |
| 221 src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_log
ging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is
_on.cc'] |
| 222 src += ['./third_party/glog/src/windows/port.cc'] |
| 223 |
| 224 if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): |
| 225 cflags_libmv.append('/Od') |
| 226 ccflags_libmv.append('/Od') |
| 227 cxxflags_libmv.append('/Od') |
| 228 |
| 229 if not env['BF_DEBUG']: |
| 230 defs.append('NDEBUG') |
| 231 else: |
| 232 if not env['BF_DEBUG']: |
| 233 cflags_libmv = Split(env['REL_CFLAGS']) |
| 234 ccflags_libmv = Split(env['REL_CCFLAGS']) |
| 235 cxxflags_libmv = Split(env['REL_CXXFLAGS']) |
| 236 else: |
| 237 src += env.Glob("third_party/glog/src/*.cc") |
| 238 incs += ' ./third_party/glog/src' |
| 239 if not env['BF_DEBUG']: |
| 240 cflags_libmv = Split(env['REL_CFLAGS']) |
| 241 ccflags_libmv = Split(env['REL_CCFLAGS']) |
| 242 cxxflags_libmv = Split(env['REL_CXXFLAGS']) |
| 243 |
| 244 incs += ' ./third_party/ssba ./third_party/ldl/Include ../colamd/Include' |
| 245 |
| 246 env.BlenderLib ( libname = 'extern_libmv', sources=src, includes=Split(incs), de
fines=defs, libtype=['extern', 'player'], priority=[20,137], compileflags=cflags
_libmv, cc_compileflags=ccflags_libmv, cxx_compileflags=cxxflags_libmv ) |
| 247 EOF |
LEFT | RIGHT |