bundle.sh 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. #!/bin/sh
  2. if [ "x$1" = "x--i-really-know-what-im-doing" ] ; then
  3. echo Proceeding as requested by command line ...
  4. else
  5. echo "*** Please run again with --i-really-know-what-im-doing ..."
  6. exit 1
  7. fi
  8. BRANCH="master"
  9. repo="git://git.blender.org/libmv.git"
  10. tmp=`mktemp -d`
  11. git clone -b $BRANCH $repo $tmp/libmv
  12. git --git-dir $tmp/libmv/.git --work-tree $tmp/libmv log -n 50 > ChangeLog
  13. find libmv -type f -exec rm -rf {} \;
  14. find third_party -type f -exec rm -rf {} \;
  15. cat "files.txt" | while read f; do
  16. mkdir -p `dirname $f`
  17. cp $tmp/libmv/src/$f $f
  18. done
  19. rm -rf $tmp
  20. sources=`find ./libmv -type f -iname '*.cc' -or -iname '*.cpp' -or -iname '*.c' | grep -v _test.cc | grep -v test_data_sets | sed -r 's/^\.\//\t\t/' | sort -d`
  21. headers=`find ./libmv -type f -iname '*.h' | grep -v test_data_sets | sed -r 's/^\.\//\t\t/' | sort -d`
  22. third_sources=`find ./third_party -type f -iname '*.cc' -or -iname '*.cpp' -or -iname '*.c' | sed -r 's/^\.\//\t\t/' | sort -d`
  23. third_headers=`find ./third_party -type f -iname '*.h' | sed -r 's/^\.\//\t\t/' | sort -d`
  24. tests=`find ./libmv -type f -iname '*_test.cc' | sort -d | awk ' { name=gensub(".*/([A-Za-z_]+)_test.cc", "\\\\1", $1); printf("\t\tBLENDER_SRC_GTEST(\"libmv_%s\" \"%s\" \"libmv_test_dataset;bf_intern_libmv;extern_ceres\")\n", name, $1) } '`
  25. src_dir=`find ./libmv -type f -iname '*.cc' -exec dirname {} \; -or -iname '*.cpp' -exec dirname {} \; -or -iname '*.c' -exec dirname {} \; | sed -r 's/^\.\//\t\t/' | sort -d | uniq`
  26. 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\t/' | sort -d | uniq`
  27. src=""
  28. win_src=""
  29. for x in $src_dir $src_third_dir; do
  30. t=""
  31. if stat $x/*.cpp > /dev/null 2>&1; then
  32. t=" src += env.Glob('`echo $x'/*.cpp'`')"
  33. fi
  34. if stat $x/*.c > /dev/null 2>&1; then
  35. if [ -z "$t" ]; then
  36. t=" src += env.Glob('`echo $x'/*.c'`')"
  37. else
  38. t="$t + env.Glob('`echo $x'/*.c'`')"
  39. fi
  40. fi
  41. if stat $x/*.cc > /dev/null 2>&1; then
  42. if [ -z "$t" ]; then
  43. t=" src += env.Glob('`echo $x'/*.cc'`')"
  44. else
  45. t="$t + env.Glob('`echo $x'/*.cc'`')"
  46. fi
  47. fi
  48. if test `echo $x | grep -c "windows\|gflags" ` -eq 0; then
  49. if [ -z "$src" ]; then
  50. src=$t
  51. else
  52. src=`echo "$src\n$t"`
  53. fi
  54. else
  55. if [ -z "$win_src" ]; then
  56. win_src=`echo " $t"`
  57. else
  58. win_src=`echo "$win_src\n $t"`
  59. fi
  60. fi
  61. done
  62. cat > CMakeLists.txt << EOF
  63. # ***** BEGIN GPL LICENSE BLOCK *****
  64. #
  65. # This program is free software; you can redistribute it and/or
  66. # modify it under the terms of the GNU General Public License
  67. # as published by the Free Software Foundation; either version 2
  68. # of the License, or (at your option) any later version.
  69. #
  70. # This program is distributed in the hope that it will be useful,
  71. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  72. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  73. # GNU General Public License for more details.
  74. #
  75. # You should have received a copy of the GNU General Public License
  76. # along with this program; if not, write to the Free Software Foundation,
  77. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  78. #
  79. # The Original Code is Copyright (C) 2011, Blender Foundation
  80. # All rights reserved.
  81. #
  82. # Contributor(s): Blender Foundation,
  83. # Sergey Sharybin
  84. #
  85. # ***** END GPL LICENSE BLOCK *****
  86. # NOTE: This file is automatically generated by bundle.sh script
  87. # If you're doing changes in this file, please update template
  88. # in that script too
  89. set(INC
  90. .
  91. )
  92. set(INC_SYS
  93. )
  94. set(SRC
  95. libmv-capi.h
  96. )
  97. if(WITH_LIBMV)
  98. add_definitions(\${GFLAGS_DEFINES})
  99. add_definitions(\${GLOG_DEFINES})
  100. add_definitions(\${CERES_DEFINES})
  101. add_definitions(-DLIBMV_GFLAGS_NAMESPACE=\${GFLAGS_NAMESPACE})
  102. list(APPEND INC
  103. \${GFLAGS_INCLUDE_DIRS}
  104. ../../extern/glog/src
  105. ../../extern/ceres/include
  106. ../../extern/ceres/config
  107. ../guardedalloc
  108. )
  109. list(APPEND INC_SYS
  110. \${EIGEN3_INCLUDE_DIRS}
  111. \${PNG_INCLUDE_DIRS}
  112. \${ZLIB_INCLUDE_DIRS}
  113. )
  114. add_definitions(
  115. -DWITH_LIBMV_GUARDED_ALLOC
  116. -DLIBMV_NO_FAST_DETECTOR=
  117. )
  118. list(APPEND SRC
  119. intern/autotrack.cc
  120. intern/camera_intrinsics.cc
  121. intern/detector.cc
  122. intern/frame_accessor.cc
  123. intern/homography.cc
  124. intern/image.cc
  125. intern/logging.cc
  126. intern/reconstruction.cc
  127. intern/track_region.cc
  128. intern/tracks.cc
  129. intern/tracksN.cc
  130. ${sources}
  131. ${third_sources}
  132. intern/autotrack.h
  133. intern/camera_intrinsics.h
  134. intern/detector.h
  135. intern/frame_accessor.h
  136. intern/homography.h
  137. intern/image.h
  138. intern/logging.h
  139. intern/reconstruction.h
  140. intern/track_region.h
  141. intern/tracks.h
  142. intern/tracksN.h
  143. ${headers}
  144. ${third_headers}
  145. )
  146. if(WITH_GTESTS)
  147. blender_add_lib(libmv_test_dataset "./libmv/multiview/test_data_sets.cc" "${INC}" "${INC_SYS}")
  148. ${tests}
  149. endif()
  150. else()
  151. list(APPEND SRC
  152. intern/stub.cc
  153. )
  154. endif()
  155. blender_add_lib(bf_intern_libmv "\${SRC}" "\${INC}" "\${INC_SYS}")
  156. EOF