bundle.sh 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. tmp=`mktemp -d`
  9. hg clone https://code.google.com/p/carve/ $tmp/carve
  10. for p in `cat ./patches/series`; do
  11. echo "Applying patch $p..."
  12. cat ./patches/$p | patch -d $tmp/carve -p1
  13. done
  14. find include -type f -not -iwholename '*.svn*' -exec rm -rf {} \;
  15. find lib -type f -not -iwholename '*.svn*' -exec rm -rf {} \;
  16. cat "files.txt" | while read f; do
  17. mkdir -p `dirname $f`
  18. cp $tmp/carve/$f $f
  19. done
  20. rm -rf $tmp
  21. sources=`find ./lib -type f -iname '*.cc' -or -iname '*.cpp' -or -iname '*.c' | sed -r 's/^\.\//\t/' | sort -d`
  22. headers=`find ./lib -type f -iname '*.h' -or -iname '*.hpp' | sed -r 's/^\.\//\t/' | sort -d`
  23. includes=`find ./include -type f -iname '*.h' -or -iname '*.hpp' | sed -r 's/^\.\//\t/' | sort -d`
  24. cp patches/files/config.h include/carve/config.h
  25. mkdir -p include/carve/random
  26. cp patches/files/random.h include/carve/random/random.h
  27. cat > CMakeLists.txt << EOF
  28. # ***** BEGIN GPL LICENSE BLOCK *****
  29. #
  30. # This program is free software; you can redistribute it and/or
  31. # modify it under the terms of the GNU General Public License
  32. # as published by the Free Software Foundation; either version 2
  33. # of the License, or (at your option) any later version.
  34. #
  35. # This program is distributed in the hope that it will be useful,
  36. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  37. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  38. # GNU General Public License for more details.
  39. #
  40. # You should have received a copy of the GNU General Public License
  41. # along with this program; if not, write to the Free Software Foundation,
  42. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  43. #
  44. # The Original Code is Copyright (C) 2006, Blender Foundation
  45. # All rights reserved.
  46. #
  47. # The Original Code is: all of this file.
  48. #
  49. # Contributor(s): Jacques Beaurai, Erwin Coumans
  50. #
  51. # ***** END GPL LICENSE BLOCK *****
  52. # NOTE: This file is automatically generated by bundle.sh script
  53. # If you're doing changes in this file, please update template
  54. # in that script too
  55. set(INC
  56. include
  57. )
  58. set(INC_SYS
  59. )
  60. set(SRC
  61. carve-capi.cc
  62. carve-util.cc
  63. ${sources}
  64. carve-capi.h
  65. carve-util.h
  66. ${headers}
  67. ${includes}
  68. )
  69. if(WITH_BOOST)
  70. if(NOT MSVC)
  71. # Boost is setting as preferred collections library in the Carve code when using MSVC compiler
  72. add_definitions(
  73. -DHAVE_BOOST_UNORDERED_COLLECTIONS
  74. )
  75. endif()
  76. add_definitions(
  77. -DCARVE_SYSTEM_BOOST
  78. -DHAVE_BOOST_LIBRARY
  79. )
  80. list(APPEND INC_SYS
  81. \${BOOST_INCLUDE_DIR}
  82. )
  83. endif()
  84. blender_add_lib(extern_carve "\${SRC}" "\${INC}" "\${INC_SYS}")
  85. EOF