Kaynağa Gözat

Revised building instructions. Some fixes in CMakeLists. Deleted unused files.

Iñigo Valentin 3 yıl önce
ebeveyn
işleme
d926109279
100 değiştirilmiş dosya ile 4217 ekleme ve 11569 silme
  1. 0 172
      .travis.yml
  2. 0 1
      CIBuild/linux/dependencies.sh
  3. 0 29
      CIBuild/osx/dependencies.sh
  4. 0 58
      CIBuild/osx/fix_lib_paths.sh
  5. 0 19
      CIBuild/windows/build.bat
  6. 0 21
      CIBuild/windows/build64.bat
  7. 0 16
      CIBuild/windows/build64_init.bat
  8. 0 16
      CIBuild/windows/build_init.bat
  9. 4212 0
      CMake/cotire.cmake
  10. 3 3
      CMakeLists.txt
  11. 0 1
      SupportedGames/CMakeLists.txt
  12. 0 37
      SupportedGames/FinalFantasy7/CMakeLists.txt
  13. 1 2
      V-Gears-Installer/CMakeLists.txt
  14. 0 101
      V-Gears-Installer/include/decompiler/doc/cfg.tex
  15. 0 145
      V-Gears-Installer/include/decompiler/doc/codegen.tex
  16. 0 315
      V-Gears-Installer/include/decompiler/doc/disassembler.tex
  17. 0 20
      V-Gears-Installer/include/decompiler/doc/doc.tex
  18. 0 71
      V-Gears-Installer/include/decompiler/doc/engine.tex
  19. 0 31
      V-Gears-Installer/include/decompiler/doc/overview.tex
  20. 0 123
      V-Gears-Installer/include/decompiler/doc/preamble.tex
  21. 0 12
      V-Gears-Installer/include/decompiler/doc/restrictions.tex
  22. 0 38
      V-Gears-Installer/include/decompiler/doc/todo.tex
  23. 0 1
      V-Gears-Installer/src/CMakeLists.txt
  24. 1 3
      doc/BUILD.md
  25. 0 8
      lib/cotire/.gitattributes
  26. 0 5
      lib/cotire/.gitignore
  27. 0 20
      lib/cotire/CMakeLists.txt
  28. 0 360
      lib/cotire/HISTORY.md
  29. 0 791
      lib/cotire/MANUAL.md
  30. 0 299
      lib/cotire/Patches/OpenCV-2.3.1.patch
  31. 0 24
      lib/cotire/Patches/README.md
  32. 0 389
      lib/cotire/Patches/bullet-2.80-rev2531.patch
  33. 0 35
      lib/cotire/Patches/clang-3.0.src.patch
  34. 0 35
      lib/cotire/Patches/clang-3.1.src.patch
  35. 0 46
      lib/cotire/Patches/clang-3.3.src.patch
  36. 0 48
      lib/cotire/Patches/clang-3.4.src.patch
  37. 0 39
      lib/cotire/Patches/clang-3.5.src.patch
  38. 0 93
      lib/cotire/Patches/clapack-3.2.1-CMAKE.patch
  39. 0 218
      lib/cotire/Patches/cmake-2.8.7.patch
  40. 0 18
      lib/cotire/Patches/cminpack-1.1.4.patch
  41. 0 118
      lib/cotire/Patches/hdf5-1.8.8.patch
  42. 0 38
      lib/cotire/Patches/libpng-1.5.9.patch
  43. 0 69
      lib/cotire/Patches/llvm-3.0.src.patch
  44. 0 69
      lib/cotire/Patches/llvm-3.1.src.patch
  45. 0 128
      lib/cotire/Patches/llvm-3.3.src.patch
  46. 0 100
      lib/cotire/Patches/llvm-3.4.src.patch
  47. 0 99
      lib/cotire/Patches/llvm-3.5.src.patch
  48. 0 37
      lib/cotire/Patches/yaml-cpp.patch
  49. 0 23
      lib/cotire/Patches/zlib-1.2.6.patch
  50. 0 144
      lib/cotire/README.md
  51. 0 22
      lib/cotire/license
  52. 0 31
      lib/cotire/src/CMakeLists.txt
  53. 0 24
      lib/cotire/src/example.cpp
  54. 0 10
      lib/cotire/src/example.h
  55. 0 17
      lib/cotire/src/log.cpp
  56. 0 10
      lib/cotire/src/log.h
  57. 0 12
      lib/cotire/src/main.cpp
  58. 0 48
      lib/luabind/doc/adopt.rst
  59. 0 93
      lib/luabind/doc/building.rst
  60. 0 153
      lib/luabind/doc/changes.txt
  61. 0 53
      lib/luabind/doc/copy.rst
  62. 0 50
      lib/luabind/doc/dependency.rst
  63. 0 46
      lib/luabind/doc/discard_result.rst
  64. 0 2629
      lib/luabind/doc/docs.rst
  65. 0 210
      lib/luabind/doc/luabind-logo-label.ps
  66. BIN
      lib/luabind/doc/luabind.png
  67. 0 60
      lib/luabind/doc/out_value.rst
  68. 0 58
      lib/luabind/doc/pure_out_value.rst
  69. 0 59
      lib/luabind/doc/raw.rst
  70. 0 79
      lib/luabind/doc/return_reference_to.rst
  71. 0 49
      lib/luabind/doc/return_stl_iterator.rst
  72. 0 292
      lib/luabind/doc/style.css
  73. 0 39
      lib/luabind/doc/yield.rst
  74. 0 7
      lib/luabind/examples/any_converter/Jamfile
  75. 0 97
      lib/luabind/examples/any_converter/any_converter.cpp
  76. 0 4
      lib/luabind/examples/cln/README
  77. 0 122
      lib/luabind/examples/cln/cln_test.cpp
  78. 0 21
      lib/luabind/examples/cln/cln_test.lua
  79. 0 12
      lib/luabind/examples/filesystem/Jamfile
  80. 0 119
      lib/luabind/examples/filesystem/directory_iterator.hpp
  81. 0 115
      lib/luabind/examples/filesystem/filesystem.cpp
  82. 0 180
      lib/luabind/examples/filesystem/inspect.lua
  83. 0 14
      lib/luabind/examples/glut/Jamfile
  84. 0 182
      lib/luabind/examples/glut/glut_bind.cpp
  85. 0 79
      lib/luabind/examples/glut/glut_bindings.lua
  86. 0 9
      lib/luabind/examples/hello_world/Jamfile
  87. 0 9
      lib/luabind/examples/hello_world/README
  88. 0 51
      lib/luabind/examples/hello_world/hello_world.cpp
  89. 0 0
      lib/luabind/examples/hello_world/project-root.jam
  90. 0 9
      lib/luabind/examples/intrusive_ptr/Jamfile
  91. 0 166
      lib/luabind/examples/intrusive_ptr/intrusive_ptr.cpp
  92. 0 12
      lib/luabind/examples/regexp/Jamfile
  93. 0 12
      lib/luabind/examples/regexp/regex.lua
  94. 0 58
      lib/luabind/examples/regexp/regex_wrap.cpp
  95. 0 51
      lib/luajit/.travis.yml
  96. 0 166
      lib/luajit/doc/bluequad-print.css
  97. 0 325
      lib/luajit/doc/bluequad.css
  98. 0 928
      lib/luajit/doc/changes.html
  99. 0 102
      lib/luajit/doc/contact.html
  100. 0 187
      lib/luajit/doc/ext_c_api.html

+ 0 - 172
.travis.yml

@@ -1,172 +0,0 @@
-os:
- - linux
- - osx
-
-matrix:
- allow_failures:
-  - env: COVERAGE=1
- exclude:
-# Don't build using gcc on mac
-  - os: osx
-    compiler: gcc
-# Don't try to do Coverity or coverage builds on mac
-  - os: osx
-    env: COVERITY=1
-    env: COVERAGE=1
-# Only do coverity or coverage build on Linux when the compiler is gcc
-  - os: linux
-    compiler: clang
-    env: COVERITY=1
-    env: COVERAGE=1
-# Don't build with clang on Linux
-  - os: linux
-    compiler: clang
-compiler: 
-- gcc
-- clang
-
-before_script: 
-- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y; fi
-- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository ppa:boost-latest/ppa -y; fi
-- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update; fi
-- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo apt-get install gcc-4.9; fi
-- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo apt-get install g++-4.9; fi
-- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 20; fi
-- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20; fi
-- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-4.9 90; fi
-- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo update-alternatives --config gcc; fi
-- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo update-alternatives --config g++; fi
-- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" && "$COVERAGE" == 1 ]]; then wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz; fi
-- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" && "$COVERAGE" == 1 ]]; then tar xf lcov_1.11.orig.tar.gz; fi
-- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" && "$COVERAGE" == 1 ]]; then sudo make -C lcov-1.11/ install; fi
-- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" && "$COVERAGE" == 1 ]]; then sudo apt-get install ruby1.9.1 ruby1.9.1-dev; fi
-- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" && "$COVERAGE" == 1 ]]; then sudo apt-get install rubygems1.9.1 irb1.9.1 ri1.9.1; fi
-- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" && "$COVERAGE" == 1 ]]; then rvmsudo  gem install coveralls-lcov; fi
-- if [ "$TRAVIS_OS_NAME" == "linux" ]; then chmod +x ./CIBuild/linux/dependencies.sh; fi
-- if [ "$TRAVIS_OS_NAME" == "osx" ]; then chmod +x ./CIBuild/osx/dependencies.sh; fi
-- if [ "$TRAVIS_OS_NAME" == "osx" ]; then chmod +x ./CIBuild/osx/fix_lib_paths.sh; fi
-- if [ "$TRAVIS_OS_NAME" == "osx" ]; then ./CIBuild/osx/dependencies.sh; fi
-- if [ "$TRAVIS_OS_NAME" == "linux" ]; then ./CIBuild/linux/dependencies.sh; fi
-- $CXX --version
-
-before_install: 
-script: 
-- mkdir build_qgears
-- cd build_qgears
-
-- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export OGRE_HOME=/Users/travis/build/q-gears/q-gears/OgreSDK; fi
-- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export OGRE_SDK=/Users/travis/build/q-gears/q-gears/OgreSDK; fi
-- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export OIS_HOME=/Users/travis/build/q-gears/q-gears/Dependencies; fi
-
-# Debug code coverage Linux build
-- if [[ "$TRAVIS_OS_NAME" == "linux" && "${COVERAGE}" == 1 ]]; then cmake -G"Unix Makefiles" .. -DCMAKE_BUILD_TYPE=Debug; fi
-
-# Release Linux build
-- if [[ "$TRAVIS_OS_NAME" == "linux" && "${COVERAGE}" != 1 ]]; then cmake -G"Unix Makefiles" .. -DCMAKE_BUILD_TYPE=Release; fi
-
-# Release OSX build
-- if [ "$TRAVIS_OS_NAME" == "osx" ]; then cmake -Wno-dev -G"Unix Makefiles" .. -DBOOST_ROOT=${PWD}/../boost/1.55.0_1 -DCMAKE_BUILD_TYPE=Release; fi
-
-# Do the compile
-- if [[ "${COVERITY_SCAN_BRANCH}" != 1 ]]; then make -j2; fi
-
-# Fix dylib paths on OSX to be relative to the main binary
-- if [[ "${COVERITY_SCAN_BRANCH}" != 1 && "$TRAVIS_OS_NAME" == "osx" ]]; then ../CIBuild/osx/fix_lib_paths.sh ./bin_release; fi
-
-# Run unit tests
-- if [[ "${COVERITY_SCAN_BRANCH}" != 1 ]]; then ctest --verbose; fi
-
-# Generate installers
-- if [[ "${COVERITY_SCAN_BRANCH}" != 1 && "${COVERAGE}" != 1 ]]; then cpack -C Release; fi
-
-language: cpp
-after_success: 
-- if [[ "$CXX" == "g++" && "${COVERAGE}" == 1 && "$TRAVIS_OS_NAME" == "linux" ]]; then lcov --directory . --capture --output-file coverage.info; fi
-- if [[ "$CXX" == "g++" && "${COVERAGE}" == 1 && "$TRAVIS_OS_NAME" == "linux" ]]; then lcov --remove coverage.info '*/dependencies/*' '/usr/*' --output-file coverage.info; fi
-- if [[ "$CXX" == "g++" && "${COVERAGE}" == 1 && "$TRAVIS_OS_NAME" == "linux" ]]; then lcov --list coverage.info; fi
-- if [[ "$CXX" == "g++" && "${COVERAGE}" == 1 && "$TRAVIS_OS_NAME" == "linux" ]]; then coveralls-lcov coverage.info; fi
-- hash=`git rev-parse HEAD`
-- rm ~/.ssh/known_hosts
-- rm ~/.ssh/config
-- echo "-----BEGIN RSA PRIVATE KEY-----" >  ~/.ssh/id_rsa
-- echo $KEY01 >> ~/.ssh/id_rsa
-- echo $KEY02 >> ~/.ssh/id_rsa
-- echo $KEY03 >> ~/.ssh/id_rsa
-- echo $KEY04 >> ~/.ssh/id_rsa
-- echo $KEY05 >> ~/.ssh/id_rsa
-- echo $KEY06 >> ~/.ssh/id_rsa
-- echo $KEY07 >> ~/.ssh/id_rsa
-- echo $KEY08 >> ~/.ssh/id_rsa
-- echo $KEY09 >> ~/.ssh/id_rsa
-- echo $KEY10 >> ~/.ssh/id_rsa
-- echo $KEY11 >> ~/.ssh/id_rsa
-- echo $KEY12 >> ~/.ssh/id_rsa
-- echo $KEY13 >> ~/.ssh/id_rsa
-- echo $KEY14 >> ~/.ssh/id_rsa
-- echo $KEY15 >> ~/.ssh/id_rsa
-- echo $KEY16 >> ~/.ssh/id_rsa
-- echo $KEY17 >> ~/.ssh/id_rsa
-- echo $KEY18 >> ~/.ssh/id_rsa
-- echo $KEY19 >> ~/.ssh/id_rsa
-- echo $KEY20 >> ~/.ssh/id_rsa
-- echo $KEY21 >> ~/.ssh/id_rsa
-- echo $KEY22 >> ~/.ssh/id_rsa
-- echo $KEY23 >> ~/.ssh/id_rsa
-- echo $KEY24 >> ~/.ssh/id_rsa
-- echo $KEY25 >> ~/.ssh/id_rsa
-- echo "-----END RSA PRIVATE KEY-----" >>  ~/.ssh/id_rsa
-- chmod 400 ~/.ssh/id_rsa
-- chmod 700 ~/.ssh
-- md5sum ~/.ssh/id_rsa
-
-- if [[ "$TRAVIS_PULL_REQUEST" == 'false' && "${COVERITY_SCAN_BRANCH}" != 1 && "${COVERAGE}" != 1 && "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then ssh -o StrictHostKeyChecking=no paul@itscovarr.com mkdir -p /var/www/storage/qgears/$hash/linux/; fi
-- if [[ "$TRAVIS_PULL_REQUEST" == 'false' && "${COVERITY_SCAN_BRANCH}" != 1 && "${COVERAGE}" != 1 && "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then scp -o StrictHostKeyChecking=no ~/build/q-gears/q-gears/build_qgears/*.deb paul@itscovarr.com:/var/www/storage/qgears/$hash/linux/; fi
-- if [[ "$TRAVIS_PULL_REQUEST" == 'false' && "${COVERITY_SCAN_BRANCH}" != 1 && "${COVERAGE}" != 1 && "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then scp -o StrictHostKeyChecking=no ~/build/q-gears/q-gears/build_qgears/*.tar.gz paul@itscovarr.com:/var/www/storage/qgears/$hash/linux/; fi
-- if [[ "$TRAVIS_PULL_REQUEST" == 'false' && "${COVERITY_SCAN_BRANCH}" != 1 && "${COVERAGE}" != 1 && "$TRAVIS_OS_NAME" == "osx" ]]; then ssh -o StrictHostKeyChecking=no paul@itscovarr.com mkdir -p /var/www/storage/qgears/$hash/mac/; fi
-- if [[ "$TRAVIS_PULL_REQUEST" == 'false' && "${COVERITY_SCAN_BRANCH}" != 1 && "${COVERAGE}" != 1 && "$TRAVIS_OS_NAME" == "osx" ]]; then scp -o StrictHostKeyChecking=no ~/build/q-gears/q-gears/build_qgears/*.dmg paul@itscovarr.com:/var/www/storage/qgears/$hash/mac/; fi
-
-notifications: 
-  on_failure: always
-  irc: irc.esper.net#qhimm.com
-  on_success: change
-  skip_join: true
-addons:
-  coverity_scan:
-    project:
-      name: "q-gears/q-gears"
-      description: "Build submitted via Travis CI"
-    notification_email: coverityscan@paulsapps.com
-    build_command_prepend: "mkdir qgears_build; cd qgears_build; cmake .. -DCMAKE_BUILD_TYPE=Release"
-    build_command: "make -j4"
-    branch_pattern: coverity_scan
-env: 
-  matrix:
-  - COVERAGE=1
-  - COVERAGE=0
-  global: 
-  - secure: "PUtlviIMOxgXYfBiAW+tsDHQPq+XfftHy2Te1qFvkzkqfGtHQMiCM5an1tZW8LuuYLhuRo+piG+XsK5A8THW4At+hsQZFRPK4b952aHGTQNimTPFr3COccKOlGsLDJD+iKEBJbME1u/Kml9IvwVFBLoL6UtjEWPUJ3jVOitfnoA="
-  - secure: pc5w4v8EzEtKD+iSZaao9Qq7FoPz2a65cpubHQjD36IN7g4gNaUcv2i/9cgqWk8+au7jKbJg0lFnkXRA/ldzBd30xsXubKWSmvcKt2dQRNJkKVBWsKW2ZiAtID/uibu5kwxdGn1zi4uO+WXygmu/fWSvOkToq87NsGrQYGU+Ahs=
-  - secure: fqca/ai9xM7M0TLcZHwr8YqWB2+/+k5Bg5D9C/gTaZQgQvvTbXRdI8LFUTgUYCHiFu/QphvzvXyVHPTVL1xB3xZIMC5G8Cqe2T+Zy+UprK0A8Fmxk/V/qTTMgigAevtCXeVYH7+I0M+LNZrz4oYYa6FRJY79OPv+T1QQ8FUGTqc=
-  - secure: kbpP9dDfBy3n8uaEHw1ULJZDpNRosgb1wGGguuSgPGTKjnSyVeOTJHkQb48+scIcmRUdxb9xNtBHcC/W2xg0AW06oZMAegUjHQcIWO1J2s24IgXgizvXIiUlm2bVn53yqyYHTJ1DYN6KsWJt+E8c+fbszPfOzCs73i9pnnUt+1A=
-  - secure: Vxsez9G9E7LfM3AYJ9X/tdhUJdyF2Joy67HvFtPo1HM8C+pTa2NOvs3w3rwhEowcWcMXUzLC26c2S6nqpcCK7SMD1CkIiNdBGAjh5wbjj0/36ATYJfqJ3cv8w+wtsfS7zbZEdf7qay7k+zSAXOu1Mdu4IFWrcy/175iyRvXaNRg=
-  - secure: FjdNNoLJgnqopNBrvoLUTRd+kpGPfl6BX4ZSvFDBg5m2DGV6gRuNHDLB2xfJvjtnXC+nYbYgtvM/MZb527pLYzy6aPdmUlLWJKIVsjmL6KY8QHwscgI2uDAvJ/MkcV7xvz5z1vfUfhVQvTAdvZsAeQwP9dxOTQOinzAswh01ZXI=
-  - secure: IIdpI5s5ea6fJS8NJii6JEDsJPefzDr8ASJBOCeGcWb258RUhlBj++P7pM3q1qwHtFe1oZ1u0wbrhB7ibU9u5v6KqicsYiS1JrczIvoh2w/aVH8myfAoDQV+Zohr3unFazf7y/dIIGo5qHcPFp4QbIeZ47/mBo9gehSXbKDZlpI=
-  - secure: bhRdtWUUGgUV/OTTwFiLSpCXB/4xTCx0Vq/fbZ0VzpiQNbeMhH7Ihee0stJ34+/htnTOz2xK0uSAVpqEFwGCCzHhaHpFiszPcL7T2Dg4FWDEjRwT91zn4LlgAW56beXJpupPlxTpmZQg6/ERmwThqbCoXuV3JZ7fAHpDxoALM1g=
-  - secure: eTnHo1K4b0v1FnB6SrqYC9Aw3Cd9nGCKSwHpTedocqrrjIjRmIc0V2euCAELjMN3qgK1DkuDJKE685A9enUz1xsYUWOC2gTPvYCm3W25SpLbJazYpS9v0EyBZXW6G9E7Iz8mb0m2Lw3UGZ3wvQqbMDIQtW10Kb1OosssfElox3Y=
-  - secure: pDsmHjkohOQMtNu3h1q8Gfxe4FfSFoZudNY0Yv5TmCHPl9TQSX6nbvfrOqtBzONWouDuwIblwBpHOBYBZJsNvKza2up7qfZ1JXg+zq1SuCY3dh8so2WBlcwQf4TokM6HMUB0NpvMBE8J7wfqYM2weIslKDJE7S8LjDrUsBqFx3U=
-  - secure: jfKbAJ9p32WsxP/WKt3tfJadNRTPxPFVs7gpyWHxaUIBHWT4eldqF2mM0/fIKsODcRLO2iFZlIC3xJ+v/I7SzDAXyCQu+Wi+8k6DJdesOVSLW8fjUzS5vAmvuaKL0XZYwJUJVpzy8phmaS1swL+R/GUbHPjmspkm8eyN2ZXMbvI=
-  - secure: GeFOhQ6WF2rAA83SBJm+CA0RBeXKCVR50y2IlNfRbnBlFR2nAR8ZiOMv8N12WanGc777Wu29SXhr2TGgjwQWbTKUN4OO7ZOZimb/FufwqcqJke2RqIHF/uJl2NJqhSGdTe1wYMBZKubwgmz1B9KC9h/89iCtrD02qtZHE7qSSFs=
-  - secure: LE8JaorkdYXBmdovN42EkU4Kht2hPxF8XhH0+N+aG5Dog1PMrH8mi44naFYWEwiCmJpLlfUadrzQYJFx3iz59smziO1Sq798B41TuzkC9YuS0EzVZCgxTu1da9mkYga8FY3nCIBe0olIHcAhz88qMGLGPeblRmlQw4W/WJDN9JI=
-  - secure: UX0Prs5JaTo/udYhwp3XS1End+1fwURwm0+FEfbEGcM/hLtA8K5we/miT6+fWFoyIlLFxKbZqzkc3zOXT5fBMTN70JBnPpig9nEaTRTyX9ZRt3aNDKTREpUinXVLbS1GDRPz3+/UALyhyS9J57pPGyHYMygLA+4ldsDIbyqd6W8=
-  - secure: SYxqLMdBCv0eqQ7GmGu6jDTa3uP3ZJKxg2mttjlRmHu8ynlCI/iJCd17Sa/snds4rDFEekmHy/NGlsh258Kdo6y0DR5Upobin0ogjchmDtC7qjqRMbiDjmUnaY9s6Krg8B+FXgKHXKimSQbl7z6vSISxf/o1AGRPqOKeqGB0yzM=
-  - secure: QJMo4Ai/j9fFC3HsX3FvZG43qovrjn/enXuC3+MrBIZuZ1AqZtLUg482jIC1TGLgV6u1YPU6REgd1b/rbc1U6EZjxVQz2YRT39LhT9wfYh7XVYdRc1IjggLQRVZ7POb1QfPFL1AJO0enPfevN3Zl0kYIOh/WEvhIq1JeuG3tuaQ=
-  - secure: IS0n9WbkPcAnWB/nsUCY2boBaRECNJHSUAeJ0oUqCJ6sUKeMi76q/DO3YmVRs4T/gh9rhe/qVhToPjfauiowFYRb4Rnuk4qbXuxKMUzbhd8v9fyM/JyU3Wt40xVK3gTgZTipUjWxp57MF4lr36MYelJ9f3VNtd7TYsgRNn0faoE=
-  - secure: d+7dyvidKn9i5n7BJfibes6dpE4dlzjZRnw6AmVFwxVFfbpgMHyZvIDA7WTfzYXfjnfQ+qWHDS/7+pLjWOWfz3z0Pp0W6P5j9xckQKA/f2yTSEAgYtBJkkXRS/iYnnAHACFy1LU05pnD9xUH8gaMyFZyU7mDCT+ktu7ueNmBY4g=
-  - secure: V+T/3nvn248auq15/ef7xUNBtgoJvJXxzRoT0VW6vZswsunDkMAPaJfpbnJU4IvxbsuRVskyr3mcUUa7Ufm8N0ibzeu4eTgmrydDU8W9LfQsPwIoVs3PM1ylW/rH0FRZWoGB6zWpSzpBG3hYSnqVN5DKLFEZprPQiRoMSR4NEto=
-  - secure: NE7CFzd7fmdNQGtAdUkNb1p/T3anKMdEVyMT0GUV4PzEEB145vq6ndXnNqslARgA7ZHqL+65Ah/NB51UDkCgbxcb3exweTi6fmZ9zd4S2ygoTVfMfmoyHyMn1kCIrPkM1E7E6EMIqRFEM6C0b8KPogN0aEuXpPuNmQ6ZaG1WkzU=
-  - secure: ZGXYi082K0calf9fNL5A+Hq8FY16VKIlA++hk76vJpcqRK2bkEB3qiFKXGCTsMNmV04qQ9t+rF/O0Qt1folyP7B5AXpTbpV63pXe4v0HPXJ7yA2Iyqo9uyXmd7ylBqdwNZvXxrDqdRp4S9dS7YFjGm0LwKNVJmWSjZPhLueKUlM=
-  - secure: DYk5JUgr23giSS1wLktj0dLA2zYBJlgBkeETUZyBdFFkXiep3q91kcxjcy/MTZX/w8zuQHezNFUadBskmGdFQTZSnHgqnvgdtAav+mgD/ezHqRdIVNAuUWk/jX4M8FLzWqfJO59CbJs4fHkR6UsG4r4HMzc3LyyiyZfn0ajgZQ0=
-  - secure: N5MdYyZ61eafm4rWGG437phkGY7MezIy3tD+f0f5X4fC4FnxkPJ5WNuHsBk3m0RGlzTZMq1JrSMWYmbq0WN3BozaZNSAhuI4IRZoOjNshcaZo/K8J/VipxMOwalyjCry2RRmGOLvRdcGYJwLHgSIzxBS0GedrGC0XDoHHrz7/W8=
-  - secure: brRxgShHzgYK73CHCJlkXds1cCt8ufN4Q98TW4iNVqH8Iu9cctGTfAsc97OSLB5UupvuTOhs1ADn5XU7ZXQvxm83W0Q06vrcR/3irgmFJtBQGBjrbdoAi/BhRF6/DYZ7TZOMrl4JRncAhZhCXRFKYO3NytF/yk6PnM128Fu7pVM=
-  - secure: AefxGPUU9X2+2OjZ2C04Zy0cII+3BuVD9YTc9kgLpCDwtIrd4WXWEBTnZFX2cd6QxS+AgMHXJJTlsKY4Lv9C+PonLUZch9qV8o2ttDidb3xkcvKtH8UPGbOPkQfOwc02csVfV311psXY7lEYPSHIxbYswQ2MaV+l0O922R7xxog=
-  - secure: NnCbqOSir3CDK1cqHkQ28u6xzWKWCmDffoeKaB6OMyAmdOaYnP0Imw/h4QGDP6+yw6tyZ7jVWSmbjQzIwYFviVMl27e9fJlcS7UoKeT1Q/2qFfQNIY0CAmTYaQWElN9UYqZxdKwQH1AuhQxiEZWDZEP9KEJ6ypcRsC6zzz9oe9k=

+ 0 - 1
CIBuild/linux/dependencies.sh

@@ -1 +0,0 @@
-sudo apt-get install libogre-1.12-dev libtinyxml-dev boost1.55 libvorbis-dev libalut-dev libfreetype6-dev libfreeimage-dev zlib1g-dev libzzip-dev libois-dev libglu-dev libqt5core5a libqt5widgets5 libpng

+ 0 - 29
CIBuild/osx/dependencies.sh

@@ -1,29 +0,0 @@
-brew update
-# brew doctor
-# brew outdated wget || brew upgrade wget
-echo "Download deps"
-brew install qt
-wget https://github.com/paulsapps/Ogre1.9/releases/download/1.9.0/OgreDependencies_OSX_libc._20130610.zip
-wget https://github.com/paulsapps/Ogre1.9/releases/download/1.9.0/NVIDIA_Cg.tgz
-wget https://github.com/paulsapps/Ogre1.9/releases/download/1.9.0/OgreSDK.zip
-echo "Install deps"
-unzip OgreSDK.zip >> OgreSDK_extract.log
-sudo tar xfzC NVIDIA_Cg.tgz /
-unzip OgreDependencies_OSX_libc._20130610.zip >> extract.log
-echo "Setup env vars"
-#export OGRE_HOME="${PWD}/../OgreSDK"
-#export OGRE_SDK="${PWD}/../OgreSDK"
-export OGRE_HOME="/Users/travis/build/v-gears/v-gears/OgreSDK"
-export OGRE_SDK="/Users/travis/build/v-gears/v-gears/OgreSDK"
-export OIS_HOME="/Users/travis/build/v-gears/v-gears/Dependencies"
-
-# /Users/travis/build/v-gears/v-gears/Dependencies;
-# /Users/travis/build/v-gears/v-gears/../Dependencies
-
-echo "Env vars are $OGRE_SDK and $OIS_HOME"
-# Overwrite broken symlink with actual file
-ls
-ls ./Dependencies
-
-cp ${PWD}/OgreSDK/lib/macosx/Release/Ogre.framework/Versions/1.9.0/Ogre ${PWD}/OgreSDK/lib/macosx/Release/Ogre.framework/Ogre
-cp ${PWD}/OgreSDK/lib/macosx/Release/OgreOverlay.framework/Versions/1.9.0/OgreOverlay ${PWD}/OgreSDK/lib/macosx/Release/OgreOverlay.framework/OgreOverlay

+ 0 - 58
CIBuild/osx/fix_lib_paths.sh

@@ -1,58 +0,0 @@
-# fix permissions on anything already there
-for file in $1/*
-do
-    chmod +rwx "$file" 
-done
-
-# Copy required dylibs
-cp "${OGRE_SDK}/lib/macosx/Release/Ogre.framework/Ogre" ./bin_release
-cp "${OGRE_SDK}/lib/macosx/Release/RenderSystem_GL.framework/Versions/1.9.0/RenderSystem_GL" ./bin_release/
-cp "${OGRE_SDK}/lib/macosx/Release/OgreOverlay.framework/Versions/1.9.0/OgreOverlay" ./bin_release/
-cp /usr/local/lib/libboost_thread-mt.dylib ./bin_release/
-cp /usr/local/lib/libboost_date_time-mt.dylib ./bin_release/
-cp /usr/local/lib/libboost_system-mt.dylib ./bin_release/
-cp /usr/local/lib/libboost_atomic-mt.dylib ./bin_release/
-cp /usr/local/lib/libboost_chrono-mt.dylib ./bin_release/
-cp /usr/local/lib/libboost_program_options-mt.dylib ./bin_release/
-cp /usr/local/lib/libboost_filesystem-mt.dylib ./bin_release/
-cp /usr/local/lib/libboost_unit_test_framework-mt.dylib ./bin_release/
-cp /usr/local/lib/QtCore.framework/Versions/4/QtCore ./bin_release/
-cp /usr/local/lib/QtGui.framework/Versions/4/QtGui ./bin_release/
-
-# fix permissions on anything we just copied
-for file in $1/*
-do
-    chmod +rwx "$file" 
-done
-
-# Update dylib paths in all binaries
-for file in $1/*
-do
-   install_name_tool "$file" -change @executable_path/../Frameworks/Ogre.framework/Versions/1.9.0/Ogre @executable_path/Ogre
-   install_name_tool "$file" -change @executable_path/../Frameworks/OgreOverlay.framework/Versions/1.9.0/OgreOverlay @executable_path/OgreOverlay
-   install_name_tool "$file" -change @@HOMEBREW_PREFIX@@/lib/libboost_thread-mt.dylib @executable_path/libboost_thread-mt.dylib
-   install_name_tool "$file" -change @@HOMEBREW_PREFIX@@/lib/libboost_date_time-mt.dylib @executable_path/libboost_date_time-mt.dylib
-   install_name_tool "$file" -change @@HOMEBREW_PREFIX@@/lib/libboost_system-mt.dylib @executable_path/libboost_system-mt.dylib
-   install_name_tool "$file" -change @@HOMEBREW_PREFIX@@/lib/libboost_atomic-mt.dylib @executable_path/libboost_atomic-mt.dylib
-   install_name_tool "$file" -change @@HOMEBREW_PREFIX@@/lib/libboost_chrono-mt.dylib @executable_path/libboost_chrono-mt.dylib
-   install_name_tool "$file" -change @@HOMEBREW_PREFIX@@/lib/libboost_program_options-mt.dylib @executable_path/libboost_program_options-mt.dylib
-   install_name_tool "$file" -change @@HOMEBREW_PREFIX@@/lib/libboost_filesystem-mt.dylib @executable_path/libboost_filesystem-mt.dylib
-   install_name_tool "$file" -change @@HOMEBREW_PREFIX@@/lib/libboost_unit_test_framework-mt.dylib @executable_path/libboost_unit_test_framework-mt.dylib
-   install_name_tool "$file" -change @@HOMEBREW_PREFIX@@/lib/libboost_chrono-mt.dylib @executable_path/libboost_chrono-mt.dylib
-   
-   install_name_tool "$file" -change /usr/local/lib/libboost_thread-mt.dylib @executable_path/libboost_thread-mt.dylib
-   install_name_tool "$file" -change /usr/local/lib/libboost_date_time-mt.dylib @executable_path/libboost_date_time-mt.dylib
-   install_name_tool "$file" -change /usr/local/lib/libboost_system-mt.dylib @executable_path/libboost_system-mt.dylib
-   install_name_tool "$file" -change /usr/local/lib/libboost_atomic-mt.dylib @executable_path/libboost_atomic-mt.dylib
-   install_name_tool "$file" -change /usr/local/lib/libboost_chrono-mt.dylib @executable_path/libboost_chrono-mt.dylib
-   install_name_tool "$file" -change /usr/local/lib/libboost_program_options-mt.dylib @executable_path/libboost_program_options-mt.dylib
-   install_name_tool "$file" -change /usr/local/lib/libboost_filesystem-mt.dylib @executable_path/libboost_filesystem-mt.dylib
-   install_name_tool "$file" -change /usr/local/lib/libboost_unit_test_framework-mt.dylib @executable_path/libboost_unit_test_framework-mt.dylib
-   install_name_tool "$file" -change /usr/local/lib/libboost_chrono-mt.dylib @executable_path/libboost_chrono-mt.dylib
-   
-   
-   install_name_tool "$file" -change ${PWD}/bin_release/liblua.dylib  @executable_path/liblua.dylib
-   install_name_tool "$file" -change /usr/local/lib/QtCore.framework/Versions/4/QtCore @executable_path/QtCore
-   install_name_tool "$file" -change /usr/local/lib/QtGui.framework/Versions/4/QtGui @executable_path/QtGui
-   otool "$file" -L
-done

+ 0 - 19
CIBuild/windows/build.bat

@@ -1,19 +0,0 @@
-msbuild /m VGears.sln /p:Configuration=Release
-if %errorlevel% neq 0 exit /b %errorlevel%
-
-cpack -C "Release"
-if %errorlevel% neq 0 exit /b %errorlevel%
-
-set path=%path%;C:\boost_1_55_0_32\lib32-msvc-12.0;C:\qt-everywhere-opensource-src-4.8.6_32\bin\release;C:\Ogre\Build\bin\relwithdebinfo
-ctest -C "Release" --verbose
-if %errorlevel% neq 0 exit /b %errorlevel%
-
-cd ..
-cd ..
-mkdir %CURRENT%
-cd %CURRENT%
-mkdir windows
-cd .. 
-dir
-move v-gears\build\*.msi %CURRENT%\windows
-upload %CURRENT%

+ 0 - 21
CIBuild/windows/build64.bat

@@ -1,21 +0,0 @@
-msbuild /m VGears.sln /p:Configuration=Release
-if %errorlevel% neq 0 exit /b %errorlevel%
-
-cpack -C "Release"
-if %errorlevel% neq 0 exit /b %errorlevel%
-
-set path=%path%;C:\boost_1_55_0_64\lib64-msvc-12.0;C:\qt-everywhere-opensource-src-4.8.6_64\bin\release;C:\Ogre64\Build\bin\relwithdebinfo
-ctest -C "Release" --verbose
-if %errorlevel% neq 0 exit /b %errorlevel%
-
-cd ..
-cd ..
-mkdir %CURRENT%
-cd %CURRENT%
-mkdir windows
-cd .. 
-dir
-move v-gears\build\*.msi %CURRENT%\windows
-upload %CURRENT%
-
-

+ 0 - 16
CIBuild/windows/build64_init.bat

@@ -1,16 +0,0 @@
-git rev-parse HEAD>current_version.txt
-set /P CURRENT=<current_version.txt
-echo %CURRENT%
-
-mkdir build
-::if %errorlevel% neq 0 exit /b %errorlevel%
-
-cd build
-if %errorlevel% neq 0 exit /b %errorlevel%
-
-set QTDIR=C:\qt-everywhere-opensource-src-4.8.6_64
-set OGRE_HOME=C:\Ogre64\Build\sdk
-call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat"
-
-cmake .. -G"Visual Studio 12 2013 Win64" -T v120_xp -DZLIB_INCLUDE_DIR=C:/zlib-1.2.8 -DBOOST_ROOT=C:\boost_1_55_0_64 -DBOOST_LIBRARYDIR=C:\boost_1_55_0_64\lib64-msvc-12.0 -DOGRE_DIR=C:\Ogre64\Build\sdk -DOIS_HOME=C:\Ogre64\Dependencies\Build\ogredeps -DZLIB_LIBRARY=C:/zlib-1.2.8/contrib/vstudio/vc11/x64/ZlibDllReleaseWithoutAsm/zlibwapi.lib
-if %errorlevel% neq 0 exit /b %errorlevel%

+ 0 - 16
CIBuild/windows/build_init.bat

@@ -1,16 +0,0 @@
-git rev-parse HEAD>current_version.txt
-set /P CURRENT=<current_version.txt
-echo %CURRENT%
-
-mkdir build
-::if %errorlevel% neq 0 exit /b %errorlevel%
-
-cd build
-if %errorlevel% neq 0 exit /b %errorlevel%
-
-set QTDIR=C:\qt-everywhere-opensource-src-4.8.6_32
-set OGRE_HOME=C:\Ogre\Build\sdk
-call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat"
-
-cmake .. -T v120_xp -DZLIB_INCLUDE_DIR=C:/zlib-1.2.8 -DBOOST_ROOT=C:\boost_1_55_0_32 -DBOOST_LIBRARYDIR=C:\boost_1_55_0_32\lib32-msvc-12.0 -DOGRE_DIR=C:\Ogre\Build\sdk -DOIS_HOME=C:\Ogre\Dependencies\Build\ogredeps -DZLIB_LIBRARY=C:/zlib-1.2.8/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.lib
-if %errorlevel% neq 0 exit /b %errorlevel%

+ 4212 - 0
CMake/cotire.cmake

@@ -0,0 +1,4212 @@
+# - cotire (compile time reducer)
+#
+# See the cotire manual for usage hints.
+#
+#=============================================================================
+# Copyright 2012-2018 Sascha Kratky
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following
+# conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+#=============================================================================
+
+if(__COTIRE_INCLUDED)
+	return()
+endif()
+set(__COTIRE_INCLUDED TRUE)
+
+# call cmake_minimum_required, but prevent modification of the CMake policy stack in include mode
+# cmake_minimum_required also sets the policy version as a side effect, which we have to avoid
+if (NOT CMAKE_SCRIPT_MODE_FILE)
+	cmake_policy(PUSH)
+endif()
+cmake_minimum_required(VERSION 2.8.12)
+if (NOT CMAKE_SCRIPT_MODE_FILE)
+	cmake_policy(POP)
+endif()
+
+set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}")
+set (COTIRE_CMAKE_MODULE_VERSION "1.8.1")
+
+# activate select policies
+if (POLICY CMP0025)
+	# Compiler id for Apple Clang is now AppleClang
+	cmake_policy(SET CMP0025 NEW)
+endif()
+
+if (POLICY CMP0026)
+	# disallow use of the LOCATION target property
+	cmake_policy(SET CMP0026 NEW)
+endif()
+
+if (POLICY CMP0038)
+	# targets may not link directly to themselves
+	cmake_policy(SET CMP0038 NEW)
+endif()
+
+if (POLICY CMP0039)
+	# utility targets may not have link dependencies
+	cmake_policy(SET CMP0039 NEW)
+endif()
+
+if (POLICY CMP0040)
+	# target in the TARGET signature of add_custom_command() must exist
+	cmake_policy(SET CMP0040 NEW)
+endif()
+
+if (POLICY CMP0045)
+	# error on non-existent target in get_target_property
+	cmake_policy(SET CMP0045 NEW)
+endif()
+
+if (POLICY CMP0046)
+	# error on non-existent dependency in add_dependencies
+	cmake_policy(SET CMP0046 NEW)
+endif()
+
+if (POLICY CMP0049)
+	# do not expand variables in target source entries
+	cmake_policy(SET CMP0049 NEW)
+endif()
+
+if (POLICY CMP0050)
+	# disallow add_custom_command SOURCE signatures
+	cmake_policy(SET CMP0050 NEW)
+endif()
+
+if (POLICY CMP0051)
+	# include TARGET_OBJECTS expressions in a target's SOURCES property
+	cmake_policy(SET CMP0051 NEW)
+endif()
+
+if (POLICY CMP0053)
+	# simplify variable reference and escape sequence evaluation
+	cmake_policy(SET CMP0053 NEW)
+endif()
+
+if (POLICY CMP0054)
+	# only interpret if() arguments as variables or keywords when unquoted
+	cmake_policy(SET CMP0054 NEW)
+endif()
+
+if (POLICY CMP0055)
+	# strict checking for break() command
+	cmake_policy(SET CMP0055 NEW)
+endif()
+
+include(CMakeParseArguments)
+include(ProcessorCount)
+
+function (cotire_get_configuration_types _configsVar)
+	set (_configs "")
+	if (CMAKE_CONFIGURATION_TYPES)
+		list (APPEND _configs ${CMAKE_CONFIGURATION_TYPES})
+	endif()
+	if (CMAKE_BUILD_TYPE)
+		list (APPEND _configs "${CMAKE_BUILD_TYPE}")
+	endif()
+	if (_configs)
+		list (REMOVE_DUPLICATES _configs)
+		set (${_configsVar} ${_configs} PARENT_SCOPE)
+	else()
+		set (${_configsVar} "None" PARENT_SCOPE)
+	endif()
+endfunction()
+
+function (cotire_get_source_file_extension _sourceFile _extVar)
+	# get_filename_component returns extension from first occurrence of . in file name
+	# this function computes the extension from last occurrence of . in file name
+	string (FIND "${_sourceFile}" "." _index REVERSE)
+	if (_index GREATER -1)
+		math (EXPR _index "${_index} + 1")
+		string (SUBSTRING "${_sourceFile}" ${_index} -1 _sourceExt)
+	else()
+		set (_sourceExt "")
+	endif()
+	set (${_extVar} "${_sourceExt}" PARENT_SCOPE)
+endfunction()
+
+macro (cotire_check_is_path_relative_to _path _isRelativeVar)
+	set (${_isRelativeVar} FALSE)
+	if (IS_ABSOLUTE "${_path}")
+		foreach (_dir ${ARGN})
+			file (RELATIVE_PATH _relPath "${_dir}" "${_path}")
+			if (NOT _relPath OR (NOT IS_ABSOLUTE "${_relPath}" AND NOT "${_relPath}" MATCHES "^\\.\\."))
+				set (${_isRelativeVar} TRUE)
+				break()
+			endif()
+		endforeach()
+	endif()
+endmacro()
+
+function (cotire_filter_language_source_files _language _target _sourceFilesVar _excludedSourceFilesVar _cotiredSourceFilesVar)
+	if (CMAKE_${_language}_SOURCE_FILE_EXTENSIONS)
+		set (_languageExtensions "${CMAKE_${_language}_SOURCE_FILE_EXTENSIONS}")
+	else()
+		set (_languageExtensions "")
+	endif()
+	if (CMAKE_${_language}_IGNORE_EXTENSIONS)
+		set (_ignoreExtensions "${CMAKE_${_language}_IGNORE_EXTENSIONS}")
+	else()
+		set (_ignoreExtensions "")
+	endif()
+	if (COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS)
+		set (_excludeExtensions "${COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS}")
+	else()
+		set (_excludeExtensions "")
+	endif()
+	if (COTIRE_DEBUG AND _languageExtensions)
+		message (STATUS "${_language} source file extensions: ${_languageExtensions}")
+	endif()
+	if (COTIRE_DEBUG AND _ignoreExtensions)
+		message (STATUS "${_language} ignore extensions: ${_ignoreExtensions}")
+	endif()
+	if (COTIRE_DEBUG AND _excludeExtensions)
+		message (STATUS "${_language} exclude extensions: ${_excludeExtensions}")
+	endif()
+	if (CMAKE_VERSION VERSION_LESS "3.1.0")
+		set (_allSourceFiles ${ARGN})
+	else()
+		# as of CMake 3.1 target sources may contain generator expressions
+		# since we cannot obtain required property information about source files added
+		# through generator expressions at configure time, we filter them out
+		string (GENEX_STRIP "${ARGN}" _allSourceFiles)
+	endif()
+	set (_filteredSourceFiles "")
+	set (_excludedSourceFiles "")
+	foreach (_sourceFile ${_allSourceFiles})
+		get_source_file_property(_sourceIsHeaderOnly "${_sourceFile}" HEADER_FILE_ONLY)
+		get_source_file_property(_sourceIsExternal "${_sourceFile}" EXTERNAL_OBJECT)
+		get_source_file_property(_sourceIsSymbolic "${_sourceFile}" SYMBOLIC)
+		if (NOT _sourceIsHeaderOnly AND NOT _sourceIsExternal AND NOT _sourceIsSymbolic)
+			cotire_get_source_file_extension("${_sourceFile}" _sourceExt)
+			if (_sourceExt)
+				list (FIND _ignoreExtensions "${_sourceExt}" _ignoreIndex)
+				if (_ignoreIndex LESS 0)
+					list (FIND _excludeExtensions "${_sourceExt}" _excludeIndex)
+					if (_excludeIndex GREATER -1)
+						list (APPEND _excludedSourceFiles "${_sourceFile}")
+					else()
+						list (FIND _languageExtensions "${_sourceExt}" _sourceIndex)
+						if (_sourceIndex GREATER -1)
+							# consider source file unless it is excluded explicitly
+							get_source_file_property(_sourceIsExcluded "${_sourceFile}" COTIRE_EXCLUDED)
+							if (_sourceIsExcluded)
+								list (APPEND _excludedSourceFiles "${_sourceFile}")
+							else()
+								list (APPEND _filteredSourceFiles "${_sourceFile}")
+							endif()
+						else()
+							get_source_file_property(_sourceLanguage "${_sourceFile}" LANGUAGE)
+							if ("${_sourceLanguage}" STREQUAL "${_language}")
+								# add to excluded sources, if file is not ignored and has correct language without having the correct extension
+								list (APPEND _excludedSourceFiles "${_sourceFile}")
+							endif()
+						endif()
+					endif()
+				endif()
+			endif()
+		endif()
+	endforeach()
+	# separate filtered source files from already cotired ones
+	# the COTIRE_TARGET property of a source file may be set while a target is being processed by cotire
+	set (_sourceFiles "")
+	set (_cotiredSourceFiles "")
+	foreach (_sourceFile ${_filteredSourceFiles})
+		get_source_file_property(_sourceIsCotired "${_sourceFile}" COTIRE_TARGET)
+		if (_sourceIsCotired)
+			list (APPEND _cotiredSourceFiles "${_sourceFile}")
+		else()
+			get_source_file_property(_sourceCompileFlags "${_sourceFile}" COMPILE_FLAGS)
+			if (_sourceCompileFlags)
+				# add to excluded sources, if file has custom compile flags
+				list (APPEND _excludedSourceFiles "${_sourceFile}")
+			else()
+				get_source_file_property(_sourceCompileOptions "${_sourceFile}" COMPILE_OPTIONS)
+				if (_sourceCompileOptions)
+					# add to excluded sources, if file has list of custom compile options
+					list (APPEND _excludedSourceFiles "${_sourceFile}")
+				else()
+					list (APPEND _sourceFiles "${_sourceFile}")
+				endif()
+			endif()
+		endif()
+	endforeach()
+	if (COTIRE_DEBUG)
+		if (_sourceFiles)
+			message (STATUS "Filtered ${_target} ${_language} sources: ${_sourceFiles}")
+		endif()
+		if (_excludedSourceFiles)
+			message (STATUS "Excluded ${_target} ${_language} sources: ${_excludedSourceFiles}")
+		endif()
+		if (_cotiredSourceFiles)
+			message (STATUS "Cotired ${_target} ${_language} sources: ${_cotiredSourceFiles}")
+		endif()
+	endif()
+	set (${_sourceFilesVar} ${_sourceFiles} PARENT_SCOPE)
+	set (${_excludedSourceFilesVar} ${_excludedSourceFiles} PARENT_SCOPE)
+	set (${_cotiredSourceFilesVar} ${_cotiredSourceFiles} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_objects_with_property_on _filteredObjectsVar _property _type)
+	set (_filteredObjects "")
+	foreach (_object ${ARGN})
+		get_property(_isSet ${_type} "${_object}" PROPERTY ${_property} SET)
+		if (_isSet)
+			get_property(_propertyValue ${_type} "${_object}" PROPERTY ${_property})
+			if (_propertyValue)
+				list (APPEND _filteredObjects "${_object}")
+			endif()
+		endif()
+	endforeach()
+	set (${_filteredObjectsVar} ${_filteredObjects} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_objects_with_property_off _filteredObjectsVar _property _type)
+	set (_filteredObjects "")
+	foreach (_object ${ARGN})
+		get_property(_isSet ${_type} "${_object}" PROPERTY ${_property} SET)
+		if (_isSet)
+			get_property(_propertyValue ${_type} "${_object}" PROPERTY ${_property})
+			if (NOT _propertyValue)
+				list (APPEND _filteredObjects "${_object}")
+			endif()
+		endif()
+	endforeach()
+	set (${_filteredObjectsVar} ${_filteredObjects} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_source_file_property_values _valuesVar _property)
+	set (_values "")
+	foreach (_sourceFile ${ARGN})
+		get_source_file_property(_propertyValue "${_sourceFile}" ${_property})
+		if (_propertyValue)
+			list (APPEND _values "${_propertyValue}")
+		endif()
+	endforeach()
+	set (${_valuesVar} ${_values} PARENT_SCOPE)
+endfunction()
+
+function (cotire_resolve_config_properties _configurations _propertiesVar)
+	set (_properties "")
+	foreach (_property ${ARGN})
+		if ("${_property}" MATCHES "<CONFIG>")
+			foreach (_config ${_configurations})
+				string (TOUPPER "${_config}" _upperConfig)
+				string (REPLACE "<CONFIG>" "${_upperConfig}" _configProperty "${_property}")
+				list (APPEND _properties ${_configProperty})
+			endforeach()
+		else()
+			list (APPEND _properties ${_property})
+		endif()
+	endforeach()
+	set (${_propertiesVar} ${_properties} PARENT_SCOPE)
+endfunction()
+
+function (cotire_copy_set_properties _configurations _type _source _target)
+	cotire_resolve_config_properties("${_configurations}" _properties ${ARGN})
+	foreach (_property ${_properties})
+		get_property(_isSet ${_type} ${_source} PROPERTY ${_property} SET)
+		if (_isSet)
+			get_property(_propertyValue ${_type} ${_source} PROPERTY ${_property})
+			set_property(${_type} ${_target} PROPERTY ${_property} "${_propertyValue}")
+		endif()
+	endforeach()
+endfunction()
+
+function (cotire_get_target_usage_requirements _target _config _targetRequirementsVar)
+	set (_targetRequirements "")
+	get_target_property(_librariesToProcess ${_target} LINK_LIBRARIES)
+	while (_librariesToProcess)
+		# remove from head
+		list (GET _librariesToProcess 0 _library)
+		list (REMOVE_AT _librariesToProcess 0)
+		if (_library MATCHES "^\\$<\\$<CONFIG:${_config}>:([A-Za-z0-9_:-]+)>$")
+			set (_library "${CMAKE_MATCH_1}")
+		elseif (_config STREQUAL "None" AND _library MATCHES "^\\$<\\$<CONFIG:>:([A-Za-z0-9_:-]+)>$")
+			set (_library "${CMAKE_MATCH_1}")
+		endif()
+		if (TARGET ${_library})
+			list (FIND _targetRequirements ${_library} _index)
+			if (_index LESS 0)
+				list (APPEND _targetRequirements ${_library})
+				# BFS traversal of transitive libraries
+				get_target_property(_libraries ${_library} INTERFACE_LINK_LIBRARIES)
+				if (_libraries)
+					list (APPEND _librariesToProcess ${_libraries})
+					list (REMOVE_DUPLICATES _librariesToProcess)
+				endif()
+			endif()
+		endif()
+	endwhile()
+	set (${_targetRequirementsVar} ${_targetRequirements} PARENT_SCOPE)
+endfunction()
+
+function (cotire_filter_compile_flags _language _flagFilter _matchedOptionsVar _unmatchedOptionsVar)
+	if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
+		set (_flagPrefix "[/-]")
+	else()
+		set (_flagPrefix "--?")
+	endif()
+	set (_optionFlag "")
+	set (_matchedOptions "")
+	set (_unmatchedOptions "")
+	foreach (_compileFlag ${ARGN})
+		if (_compileFlag)
+			if (_optionFlag AND NOT "${_compileFlag}" MATCHES "^${_flagPrefix}")
+				# option with separate argument
+				list (APPEND _matchedOptions "${_compileFlag}")
+				set (_optionFlag "")
+			elseif ("${_compileFlag}" MATCHES "^(${_flagPrefix})(${_flagFilter})$")
+				# remember option
+				set (_optionFlag "${CMAKE_MATCH_2}")
+			elseif ("${_compileFlag}" MATCHES "^(${_flagPrefix})(${_flagFilter})(.+)$")
+				# option with joined argument
+				list (APPEND _matchedOptions "${CMAKE_MATCH_3}")
+				set (_optionFlag "")
+			else()
+				# flush remembered option
+				if (_optionFlag)
+					list (APPEND _matchedOptions "${_optionFlag}")
+					set (_optionFlag "")
+				endif()
+				# add to unfiltered options
+				list (APPEND _unmatchedOptions "${_compileFlag}")
+			endif()
+		endif()
+	endforeach()
+	if (_optionFlag)
+		list (APPEND _matchedOptions "${_optionFlag}")
+	endif()
+	if (COTIRE_DEBUG AND _matchedOptions)
+		message (STATUS "Filter ${_flagFilter} matched: ${_matchedOptions}")
+	endif()
+	if (COTIRE_DEBUG AND _unmatchedOptions)
+		message (STATUS "Filter ${_flagFilter} unmatched: ${_unmatchedOptions}")
+	endif()
+	set (${_matchedOptionsVar} ${_matchedOptions} PARENT_SCOPE)
+	set (${_unmatchedOptionsVar} ${_unmatchedOptions} PARENT_SCOPE)
+endfunction()
+
+function (cotire_is_target_supported _target _isSupportedVar)
+	if (NOT TARGET "${_target}")
+		set (${_isSupportedVar} FALSE PARENT_SCOPE)
+		return()
+	endif()
+	get_target_property(_imported ${_target} IMPORTED)
+	if (_imported)
+		set (${_isSupportedVar} FALSE PARENT_SCOPE)
+		return()
+	endif()
+	get_target_property(_targetType ${_target} TYPE)
+	if (NOT _targetType MATCHES "EXECUTABLE|(STATIC|SHARED|MODULE|OBJECT)_LIBRARY")
+		set (${_isSupportedVar} FALSE PARENT_SCOPE)
+		return()
+	endif()
+	set (${_isSupportedVar} TRUE PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_target_compile_flags _config _language _target _flagsVar)
+	string (TOUPPER "${_config}" _upperConfig)
+	# collect options from CMake language variables
+	set (_compileFlags "")
+	if (CMAKE_${_language}_FLAGS)
+		set (_compileFlags "${_compileFlags} ${CMAKE_${_language}_FLAGS}")
+	endif()
+	if (CMAKE_${_language}_FLAGS_${_upperConfig})
+		set (_compileFlags "${_compileFlags} ${CMAKE_${_language}_FLAGS_${_upperConfig}}")
+	endif()
+	if (_target)
+		# add target compile flags
+		get_target_property(_targetflags ${_target} COMPILE_FLAGS)
+		if (_targetflags)
+			set (_compileFlags "${_compileFlags} ${_targetflags}")
+		endif()
+	endif()
+	if (UNIX)
+		separate_arguments(_compileFlags UNIX_COMMAND "${_compileFlags}")
+	elseif(WIN32)
+		separate_arguments(_compileFlags WINDOWS_COMMAND "${_compileFlags}")
+	else()
+		separate_arguments(_compileFlags)
+	endif()
+	# target compile options
+	if (_target)
+		get_target_property(_targetOptions ${_target} COMPILE_OPTIONS)
+		if (_targetOptions)
+			list (APPEND _compileFlags ${_targetOptions})
+		endif()
+	endif()
+	# interface compile options from linked library targets
+	if (_target)
+		set (_linkedTargets "")
+		cotire_get_target_usage_requirements(${_target} ${_config} _linkedTargets)
+		foreach (_linkedTarget ${_linkedTargets})
+			get_target_property(_targetOptions ${_linkedTarget} INTERFACE_COMPILE_OPTIONS)
+			if (_targetOptions)
+				list (APPEND _compileFlags ${_targetOptions})
+			endif()
+		endforeach()
+	endif()
+	# handle language standard properties
+	if (CMAKE_${_language}_STANDARD_DEFAULT)
+		# used compiler supports language standard levels
+		if (_target)
+			get_target_property(_targetLanguageStandard ${_target} ${_language}_STANDARD)
+			if (_targetLanguageStandard)
+				set (_type "EXTENSION")
+				get_property(_isSet TARGET ${_target} PROPERTY ${_language}_EXTENSIONS SET)
+				if (_isSet)
+					get_target_property(_targetUseLanguageExtensions ${_target} ${_language}_EXTENSIONS)
+					if (NOT _targetUseLanguageExtensions)
+						set (_type "STANDARD")
+					endif()
+				endif()
+				if (CMAKE_${_language}${_targetLanguageStandard}_${_type}_COMPILE_OPTION)
+					list (APPEND _compileFlags "${CMAKE_${_language}${_targetLanguageStandard}_${_type}_COMPILE_OPTION}")
+				endif()
+			endif()
+		endif()
+	endif()
+	# handle the POSITION_INDEPENDENT_CODE target property
+	if (_target)
+		get_target_property(_targetPIC ${_target} POSITION_INDEPENDENT_CODE)
+		if (_targetPIC)
+			get_target_property(_targetType ${_target} TYPE)
+			if (_targetType STREQUAL "EXECUTABLE" AND CMAKE_${_language}_COMPILE_OPTIONS_PIE)
+				list (APPEND _compileFlags "${CMAKE_${_language}_COMPILE_OPTIONS_PIE}")
+			elseif (CMAKE_${_language}_COMPILE_OPTIONS_PIC)
+				list (APPEND _compileFlags "${CMAKE_${_language}_COMPILE_OPTIONS_PIC}")
+			endif()
+		endif()
+	endif()
+	# handle visibility target properties
+	if (_target)
+		get_target_property(_targetVisibility ${_target} ${_language}_VISIBILITY_PRESET)
+		if (_targetVisibility AND CMAKE_${_language}_COMPILE_OPTIONS_VISIBILITY)
+			list (APPEND _compileFlags "${CMAKE_${_language}_COMPILE_OPTIONS_VISIBILITY}${_targetVisibility}")
+		endif()
+		get_target_property(_targetVisibilityInlines ${_target} VISIBILITY_INLINES_HIDDEN)
+		if (_targetVisibilityInlines AND CMAKE_${_language}_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN)
+			list (APPEND _compileFlags "${CMAKE_${_language}_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN}")
+		endif()
+	endif()
+	# platform specific flags
+	if (APPLE)
+		get_target_property(_architectures ${_target} OSX_ARCHITECTURES_${_upperConfig})
+		if (NOT _architectures)
+			get_target_property(_architectures ${_target} OSX_ARCHITECTURES)
+		endif()
+		if (_architectures)
+			foreach (_arch ${_architectures})
+				list (APPEND _compileFlags "-arch" "${_arch}")
+			endforeach()
+		endif()
+		if (CMAKE_OSX_SYSROOT)
+			if (CMAKE_${_language}_SYSROOT_FLAG)
+				list (APPEND _compileFlags "${CMAKE_${_language}_SYSROOT_FLAG}" "${CMAKE_OSX_SYSROOT}")
+			else()
+				list (APPEND _compileFlags "-isysroot" "${CMAKE_OSX_SYSROOT}")
+			endif()
+		endif()
+		if (CMAKE_OSX_DEPLOYMENT_TARGET)
+			if (CMAKE_${_language}_OSX_DEPLOYMENT_TARGET_FLAG)
+				list (APPEND _compileFlags "${CMAKE_${_language}_OSX_DEPLOYMENT_TARGET_FLAG}${CMAKE_OSX_DEPLOYMENT_TARGET}")
+			else()
+				list (APPEND _compileFlags "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
+			endif()
+		endif()
+	endif()
+	if (COTIRE_DEBUG AND _compileFlags)
+		message (STATUS "Target ${_target} compile flags: ${_compileFlags}")
+	endif()
+	set (${_flagsVar} ${_compileFlags} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_target_include_directories _config _language _target _includeDirsVar _systemIncludeDirsVar)
+	set (_includeDirs "")
+	set (_systemIncludeDirs "")
+	# default include dirs
+	if (CMAKE_INCLUDE_CURRENT_DIR)
+		list (APPEND _includeDirs "${CMAKE_CURRENT_BINARY_DIR}")
+		list (APPEND _includeDirs "${CMAKE_CURRENT_SOURCE_DIR}")
+	endif()
+	set (_targetFlags "")
+	cotire_get_target_compile_flags("${_config}" "${_language}" "${_target}" _targetFlags)
+	# parse additional include directories from target compile flags
+	if (CMAKE_INCLUDE_FLAG_${_language})
+		string (STRIP "${CMAKE_INCLUDE_FLAG_${_language}}" _includeFlag)
+		string (REGEX REPLACE "^[-/]+" "" _includeFlag "${_includeFlag}")
+		if (_includeFlag)
+			set (_dirs "")
+			cotire_filter_compile_flags("${_language}" "${_includeFlag}" _dirs _ignore ${_targetFlags})
+			if (_dirs)
+				list (APPEND _includeDirs ${_dirs})
+			endif()
+		endif()
+	endif()
+	# parse additional system include directories from target compile flags
+	if (CMAKE_INCLUDE_SYSTEM_FLAG_${_language})
+		string (STRIP "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}" _includeFlag)
+		string (REGEX REPLACE "^[-/]+" "" _includeFlag "${_includeFlag}")
+		if (_includeFlag)
+			set (_dirs "")
+			cotire_filter_compile_flags("${_language}" "${_includeFlag}" _dirs _ignore ${_targetFlags})
+			if (_dirs)
+				list (APPEND _systemIncludeDirs ${_dirs})
+			endif()
+		endif()
+	endif()
+	# target include directories
+	get_directory_property(_dirs DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" INCLUDE_DIRECTORIES)
+	if (_target)
+		get_target_property(_targetDirs ${_target} INCLUDE_DIRECTORIES)
+		if (_targetDirs)
+			list (APPEND _dirs ${_targetDirs})
+		endif()
+		get_target_property(_targetDirs ${_target} INTERFACE_SYSTEM_INCLUDE_DIRECTORIES)
+		if (_targetDirs)
+			list (APPEND _systemIncludeDirs ${_targetDirs})
+		endif()
+	endif()
+	# interface include directories from linked library targets
+	if (_target)
+		set (_linkedTargets "")
+		cotire_get_target_usage_requirements(${_target} ${_config} _linkedTargets)
+		foreach (_linkedTarget ${_linkedTargets})
+			get_target_property(_linkedTargetType ${_linkedTarget} TYPE)
+			if (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE AND NOT CMAKE_VERSION VERSION_LESS "3.4.0" AND
+				_linkedTargetType MATCHES "(STATIC|SHARED|MODULE|OBJECT)_LIBRARY")
+				# CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE refers to CMAKE_CURRENT_BINARY_DIR and CMAKE_CURRENT_SOURCE_DIR
+				# at the time, when the target was created. These correspond to the target properties BINARY_DIR and SOURCE_DIR
+				# which are only available with CMake 3.4 or later.
+				get_target_property(_targetDirs ${_linkedTarget} BINARY_DIR)
+				if (_targetDirs)
+					list (APPEND _dirs ${_targetDirs})
+				endif()
+				get_target_property(_targetDirs ${_linkedTarget} SOURCE_DIR)
+				if (_targetDirs)
+					list (APPEND _dirs ${_targetDirs})
+				endif()
+			endif()
+			get_target_property(_targetDirs ${_linkedTarget} INTERFACE_INCLUDE_DIRECTORIES)
+			if (_targetDirs)
+				list (APPEND _dirs ${_targetDirs})
+			endif()
+			get_target_property(_targetDirs ${_linkedTarget} INTERFACE_SYSTEM_INCLUDE_DIRECTORIES)
+			if (_targetDirs)
+				list (APPEND _systemIncludeDirs ${_targetDirs})
+			endif()
+		endforeach()
+	endif()
+	if (dirs)
+		list (REMOVE_DUPLICATES _dirs)
+	endif()
+	list (LENGTH _includeDirs _projectInsertIndex)
+	foreach (_dir ${_dirs})
+		if (CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE)
+			cotire_check_is_path_relative_to("${_dir}" _isRelative "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}")
+			if (_isRelative)
+				list (LENGTH _includeDirs _len)
+				if (_len EQUAL _projectInsertIndex)
+					list (APPEND _includeDirs "${_dir}")
+				else()
+					list (INSERT _includeDirs _projectInsertIndex "${_dir}")
+				endif()
+				math (EXPR _projectInsertIndex "${_projectInsertIndex} + 1")
+			else()
+				list (APPEND _includeDirs "${_dir}")
+			endif()
+		else()
+			list (APPEND _includeDirs "${_dir}")
+		endif()
+	endforeach()
+	list (REMOVE_DUPLICATES _includeDirs)
+	list (REMOVE_DUPLICATES _systemIncludeDirs)
+	if (CMAKE_${_language}_IMPLICIT_INCLUDE_DIRECTORIES)
+		list (REMOVE_ITEM _includeDirs ${CMAKE_${_language}_IMPLICIT_INCLUDE_DIRECTORIES})
+	endif()
+	if (WIN32 AND NOT MINGW)
+		# convert Windows paths in include directories to CMake paths
+		if (_includeDirs)
+			set (_paths "")
+			foreach (_dir ${_includeDirs})
+				file (TO_CMAKE_PATH "${_dir}" _path)
+				list (APPEND _paths "${_path}")
+			endforeach()
+			set (_includeDirs ${_paths})
+		endif()
+		if (_systemIncludeDirs)
+			set (_paths "")
+			foreach (_dir ${_systemIncludeDirs})
+				file (TO_CMAKE_PATH "${_dir}" _path)
+				list (APPEND _paths "${_path}")
+			endforeach()
+			set (_systemIncludeDirs ${_paths})
+		endif()
+	endif()
+	if (COTIRE_DEBUG AND _includeDirs)
+		message (STATUS "Target ${_target} include dirs: ${_includeDirs}")
+	endif()
+	set (${_includeDirsVar} ${_includeDirs} PARENT_SCOPE)
+	if (COTIRE_DEBUG AND _systemIncludeDirs)
+		message (STATUS "Target ${_target} system include dirs: ${_systemIncludeDirs}")
+	endif()
+	set (${_systemIncludeDirsVar} ${_systemIncludeDirs} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_target_export_symbol _target _exportSymbolVar)
+	set (_exportSymbol "")
+	get_target_property(_targetType ${_target} TYPE)
+	get_target_property(_enableExports ${_target} ENABLE_EXPORTS)
+	if (_targetType MATCHES "(SHARED|MODULE)_LIBRARY" OR
+		(_targetType STREQUAL "EXECUTABLE" AND _enableExports))
+		get_target_property(_exportSymbol ${_target} DEFINE_SYMBOL)
+		if (NOT _exportSymbol)
+			set (_exportSymbol "${_target}_EXPORTS")
+		endif()
+		string (MAKE_C_IDENTIFIER "${_exportSymbol}" _exportSymbol)
+	endif()
+	set (${_exportSymbolVar} ${_exportSymbol} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_target_compile_definitions _config _language _target _definitionsVar)
+	string (TOUPPER "${_config}" _upperConfig)
+	set (_configDefinitions "")
+	# CMAKE_INTDIR for multi-configuration build systems
+	if (NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
+		list (APPEND _configDefinitions "CMAKE_INTDIR=\"${_config}\"")
+	endif()
+	# target export define symbol
+	cotire_get_target_export_symbol("${_target}" _defineSymbol)
+	if (_defineSymbol)
+		list (APPEND _configDefinitions "${_defineSymbol}")
+	endif()
+	# directory compile definitions
+	get_directory_property(_definitions DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" COMPILE_DEFINITIONS)
+	if (_definitions)
+		list (APPEND _configDefinitions ${_definitions})
+	endif()
+	get_directory_property(_definitions DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" COMPILE_DEFINITIONS_${_upperConfig})
+	if (_definitions)
+		list (APPEND _configDefinitions ${_definitions})
+	endif()
+	# target compile definitions
+	get_target_property(_definitions ${_target} COMPILE_DEFINITIONS)
+	if (_definitions)
+		list (APPEND _configDefinitions ${_definitions})
+	endif()
+	get_target_property(_definitions ${_target} COMPILE_DEFINITIONS_${_upperConfig})
+	if (_definitions)
+		list (APPEND _configDefinitions ${_definitions})
+	endif()
+	# interface compile definitions from linked library targets
+	set (_linkedTargets "")
+	cotire_get_target_usage_requirements(${_target} ${_config} _linkedTargets)
+	foreach (_linkedTarget ${_linkedTargets})
+		get_target_property(_definitions ${_linkedTarget} INTERFACE_COMPILE_DEFINITIONS)
+		if (_definitions)
+			list (APPEND _configDefinitions ${_definitions})
+		endif()
+	endforeach()
+	# parse additional compile definitions from target compile flags
+	# and do not look at directory compile definitions, which we already handled
+	set (_targetFlags "")
+	cotire_get_target_compile_flags("${_config}" "${_language}" "${_target}" _targetFlags)
+	cotire_filter_compile_flags("${_language}" "D" _definitions _ignore ${_targetFlags})
+	if (_definitions)
+		list (APPEND _configDefinitions ${_definitions})
+	endif()
+	list (REMOVE_DUPLICATES _configDefinitions)
+	if (COTIRE_DEBUG AND _configDefinitions)
+		message (STATUS "Target ${_target} compile definitions: ${_configDefinitions}")
+	endif()
+	set (${_definitionsVar} ${_configDefinitions} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_target_compiler_flags _config _language _target _compilerFlagsVar)
+	# parse target compile flags omitting compile definitions and include directives
+	set (_targetFlags "")
+	cotire_get_target_compile_flags("${_config}" "${_language}" "${_target}" _targetFlags)
+	set (_flagFilter "D")
+	if (CMAKE_INCLUDE_FLAG_${_language})
+		string (STRIP "${CMAKE_INCLUDE_FLAG_${_language}}" _includeFlag)
+		string (REGEX REPLACE "^[-/]+" "" _includeFlag "${_includeFlag}")
+		if (_includeFlag)
+			set (_flagFilter "${_flagFilter}|${_includeFlag}")
+		endif()
+	endif()
+	if (CMAKE_INCLUDE_SYSTEM_FLAG_${_language})
+		string (STRIP "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}" _includeFlag)
+		string (REGEX REPLACE "^[-/]+" "" _includeFlag "${_includeFlag}")
+		if (_includeFlag)
+			set (_flagFilter "${_flagFilter}|${_includeFlag}")
+		endif()
+	endif()
+	set (_compilerFlags "")
+	cotire_filter_compile_flags("${_language}" "${_flagFilter}" _ignore _compilerFlags ${_targetFlags})
+	if (COTIRE_DEBUG AND _compilerFlags)
+		message (STATUS "Target ${_target} compiler flags: ${_compilerFlags}")
+	endif()
+	set (${_compilerFlagsVar} ${_compilerFlags} PARENT_SCOPE)
+endfunction()
+
+function (cotire_add_sys_root_paths _pathsVar)
+	if (APPLE)
+		if (CMAKE_OSX_SYSROOT AND CMAKE_${_language}_HAS_ISYSROOT)
+			foreach (_path IN LISTS ${_pathsVar})
+				if (IS_ABSOLUTE "${_path}")
+					get_filename_component(_path "${CMAKE_OSX_SYSROOT}/${_path}" ABSOLUTE)
+					if (EXISTS "${_path}")
+						list (APPEND ${_pathsVar} "${_path}")
+					endif()
+				endif()
+			endforeach()
+		endif()
+	endif()
+	set (${_pathsVar} ${${_pathsVar}} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_source_extra_properties _sourceFile _pattern _resultVar)
+	set (_extraProperties ${ARGN})
+	set (_result "")
+	if (_extraProperties)
+		list (FIND _extraProperties "${_sourceFile}" _index)
+		if (_index GREATER -1)
+			math (EXPR _index "${_index} + 1")
+			list (LENGTH _extraProperties _len)
+			math (EXPR _len "${_len} - 1")
+			foreach (_index RANGE ${_index} ${_len})
+				list (GET _extraProperties ${_index} _value)
+				if (_value MATCHES "${_pattern}")
+					list (APPEND _result "${_value}")
+				else()
+					break()
+				endif()
+			endforeach()
+		endif()
+	endif()
+	set (${_resultVar} ${_result} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_source_compile_definitions _config _language _sourceFile _definitionsVar)
+	set (_compileDefinitions "")
+	if (NOT CMAKE_SCRIPT_MODE_FILE)
+		string (TOUPPER "${_config}" _upperConfig)
+		get_source_file_property(_definitions "${_sourceFile}" COMPILE_DEFINITIONS)
+		if (_definitions)
+			list (APPEND _compileDefinitions ${_definitions})
+		endif()
+		get_source_file_property(_definitions "${_sourceFile}" COMPILE_DEFINITIONS_${_upperConfig})
+		if (_definitions)
+			list (APPEND _compileDefinitions ${_definitions})
+		endif()
+	endif()
+	cotire_get_source_extra_properties("${_sourceFile}" "^[a-zA-Z0-9_]+(=.*)?$" _definitions ${ARGN})
+	if (_definitions)
+		list (APPEND _compileDefinitions ${_definitions})
+	endif()
+	if (COTIRE_DEBUG AND _compileDefinitions)
+		message (STATUS "Source ${_sourceFile} compile definitions: ${_compileDefinitions}")
+	endif()
+	set (${_definitionsVar} ${_compileDefinitions} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_source_files_compile_definitions _config _language _definitionsVar)
+	set (_configDefinitions "")
+	foreach (_sourceFile ${ARGN})
+		cotire_get_source_compile_definitions("${_config}" "${_language}" "${_sourceFile}" _sourceDefinitions)
+		if (_sourceDefinitions)
+			list (APPEND _configDefinitions "${_sourceFile}" ${_sourceDefinitions} "-")
+		endif()
+	endforeach()
+	set (${_definitionsVar} ${_configDefinitions} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_source_undefs _sourceFile _property _sourceUndefsVar)
+	set (_sourceUndefs "")
+	if (NOT CMAKE_SCRIPT_MODE_FILE)
+		get_source_file_property(_undefs "${_sourceFile}" ${_property})
+		if (_undefs)
+			list (APPEND _sourceUndefs ${_undefs})
+		endif()
+	endif()
+	cotire_get_source_extra_properties("${_sourceFile}" "^[a-zA-Z0-9_]+$" _undefs ${ARGN})
+	if (_undefs)
+		list (APPEND _sourceUndefs ${_undefs})
+	endif()
+	if (COTIRE_DEBUG AND _sourceUndefs)
+		message (STATUS "Source ${_sourceFile} ${_property} undefs: ${_sourceUndefs}")
+	endif()
+	set (${_sourceUndefsVar} ${_sourceUndefs} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_source_files_undefs _property _sourceUndefsVar)
+	set (_sourceUndefs "")
+	foreach (_sourceFile ${ARGN})
+		cotire_get_source_undefs("${_sourceFile}" ${_property} _undefs)
+		if (_undefs)
+			list (APPEND _sourceUndefs "${_sourceFile}" ${_undefs} "-")
+		endif()
+	endforeach()
+	set (${_sourceUndefsVar} ${_sourceUndefs} PARENT_SCOPE)
+endfunction()
+
+macro (cotire_set_cmd_to_prologue _cmdVar)
+	set (${_cmdVar} "${CMAKE_COMMAND}")
+	if (COTIRE_DEBUG)
+		list (APPEND ${_cmdVar} "--warn-uninitialized")
+	endif()
+	list (APPEND ${_cmdVar} "-DCOTIRE_BUILD_TYPE:STRING=$<CONFIGURATION>")
+	if (XCODE)
+		list (APPEND ${_cmdVar} "-DXCODE:BOOL=TRUE")
+	endif()
+	if (COTIRE_VERBOSE)
+		list (APPEND ${_cmdVar} "-DCOTIRE_VERBOSE:BOOL=ON")
+	elseif("${CMAKE_GENERATOR}" MATCHES "Makefiles")
+		list (APPEND ${_cmdVar} "-DCOTIRE_VERBOSE:BOOL=$(VERBOSE)")
+	endif()
+endmacro()
+
+function (cotire_init_compile_cmd _cmdVar _language _compilerLauncher _compilerExe _compilerArg1)
+	if (NOT _compilerLauncher)
+		set (_compilerLauncher ${CMAKE_${_language}_COMPILER_LAUNCHER})
+	endif()
+	if (NOT _compilerExe)
+		set (_compilerExe "${CMAKE_${_language}_COMPILER}")
+	endif()
+	if (NOT _compilerArg1)
+		set (_compilerArg1 ${CMAKE_${_language}_COMPILER_ARG1})
+	endif()
+	if (WIN32)
+		file (TO_NATIVE_PATH "${_compilerExe}" _compilerExe)
+	endif()
+	string (STRIP "${_compilerArg1}" _compilerArg1)
+	if ("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
+		# compiler launcher is only supported for Makefile and Ninja
+		set (${_cmdVar} ${_compilerLauncher} "${_compilerExe}" ${_compilerArg1} PARENT_SCOPE)
+	else()
+		set (${_cmdVar} "${_compilerExe}" ${_compilerArg1} PARENT_SCOPE)
+	endif()
+endfunction()
+
+macro (cotire_add_definitions_to_cmd _cmdVar _language)
+	foreach (_definition ${ARGN})
+		if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
+			list (APPEND ${_cmdVar} "/D${_definition}")
+		else()
+			list (APPEND ${_cmdVar} "-D${_definition}")
+		endif()
+	endforeach()
+endmacro()
+
+function (cotire_add_includes_to_cmd _cmdVar _language _includesVar _systemIncludesVar)
+	set (_includeDirs ${${_includesVar}} ${${_systemIncludesVar}})
+	if (_includeDirs)
+		list (REMOVE_DUPLICATES _includeDirs)
+		foreach (_include ${_includeDirs})
+			if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
+				file (TO_NATIVE_PATH "${_include}" _include)
+				list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}")
+			else()
+				set (_index -1)
+				if ("${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}" MATCHES ".+")
+					list (FIND ${_systemIncludesVar} "${_include}" _index)
+				endif()
+				if (_index GREATER -1)
+					list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}")
+				else()
+					list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}")
+				endif()
+			endif()
+		endforeach()
+	endif()
+	set (${_cmdVar} ${${_cmdVar}} PARENT_SCOPE)
+endfunction()
+
+function (cotire_add_frameworks_to_cmd _cmdVar _language _includesVar _systemIncludesVar)
+	if (APPLE)
+		set (_frameworkDirs "")
+		foreach (_include ${${_includesVar}})
+			if (IS_ABSOLUTE "${_include}" AND _include MATCHES "\\.framework$")
+				get_filename_component(_frameworkDir "${_include}" DIRECTORY)
+				list (APPEND _frameworkDirs "${_frameworkDir}")
+			endif()
+		endforeach()
+		set (_systemFrameworkDirs "")
+		foreach (_include ${${_systemIncludesVar}})
+			if (IS_ABSOLUTE "${_include}" AND _include MATCHES "\\.framework$")
+				get_filename_component(_frameworkDir "${_include}" DIRECTORY)
+				list (APPEND _systemFrameworkDirs "${_frameworkDir}")
+			endif()
+		endforeach()
+		if (_systemFrameworkDirs)
+			list (APPEND _frameworkDirs ${_systemFrameworkDirs})
+		endif()
+		if (_frameworkDirs)
+			list (REMOVE_DUPLICATES _frameworkDirs)
+			foreach (_frameworkDir ${_frameworkDirs})
+				set (_index -1)
+				if ("${CMAKE_${_language}_SYSTEM_FRAMEWORK_SEARCH_FLAG}" MATCHES ".+")
+					list (FIND _systemFrameworkDirs "${_frameworkDir}" _index)
+				endif()
+				if (_index GREATER -1)
+					list (APPEND ${_cmdVar} "${CMAKE_${_language}_SYSTEM_FRAMEWORK_SEARCH_FLAG}${_frameworkDir}")
+				else()
+					list (APPEND ${_cmdVar} "${CMAKE_${_language}_FRAMEWORK_SEARCH_FLAG}${_frameworkDir}")
+				endif()
+			endforeach()
+		endif()
+	endif()
+	set (${_cmdVar} ${${_cmdVar}} PARENT_SCOPE)
+endfunction()
+
+macro (cotire_add_compile_flags_to_cmd _cmdVar)
+	foreach (_flag ${ARGN})
+		list (APPEND ${_cmdVar} "${_flag}")
+	endforeach()
+endmacro()
+
+function (cotire_check_file_up_to_date _fileIsUpToDateVar _file)
+	if (EXISTS "${_file}")
+		set (_triggerFile "")
+		foreach (_dependencyFile ${ARGN})
+			if (EXISTS "${_dependencyFile}")
+				# IS_NEWER_THAN returns TRUE if both files have the same timestamp
+				# thus we do the comparison in both directions to exclude ties
+				if ("${_dependencyFile}" IS_NEWER_THAN "${_file}" AND
+					NOT "${_file}" IS_NEWER_THAN "${_dependencyFile}")
+					set (_triggerFile "${_dependencyFile}")
+					break()
+				endif()
+			endif()
+		endforeach()
+		if (_triggerFile)
+			if (COTIRE_VERBOSE)
+				get_filename_component(_fileName "${_file}" NAME)
+				message (STATUS "${_fileName} update triggered by ${_triggerFile} change.")
+			endif()
+			set (${_fileIsUpToDateVar} FALSE PARENT_SCOPE)
+		else()
+			if (COTIRE_VERBOSE)
+				get_filename_component(_fileName "${_file}" NAME)
+				message (STATUS "${_fileName} is up-to-date.")
+			endif()
+			set (${_fileIsUpToDateVar} TRUE PARENT_SCOPE)
+		endif()
+	else()
+		if (COTIRE_VERBOSE)
+			get_filename_component(_fileName "${_file}" NAME)
+			message (STATUS "${_fileName} does not exist yet.")
+		endif()
+		set (${_fileIsUpToDateVar} FALSE PARENT_SCOPE)
+	endif()
+endfunction()
+
+macro (cotire_find_closest_relative_path _headerFile _includeDirs _relPathVar)
+	set (${_relPathVar} "")
+	foreach (_includeDir ${_includeDirs})
+		if (IS_DIRECTORY "${_includeDir}")
+			file (RELATIVE_PATH _relPath "${_includeDir}" "${_headerFile}")
+			if (NOT IS_ABSOLUTE "${_relPath}" AND NOT "${_relPath}" MATCHES "^\\.\\.")
+				string (LENGTH "${${_relPathVar}}" _closestLen)
+				string (LENGTH "${_relPath}" _relLen)
+				if (_closestLen EQUAL 0 OR _relLen LESS _closestLen)
+					set (${_relPathVar} "${_relPath}")
+				endif()
+			endif()
+		elseif ("${_includeDir}" STREQUAL "${_headerFile}")
+			# if path matches exactly, return short non-empty string
+			set (${_relPathVar} "1")
+			break()
+		endif()
+	endforeach()
+endmacro()
+
+macro (cotire_check_header_file_location _headerFile _insideIncludeDirs _outsideIncludeDirs _headerIsInside)
+	# check header path against ignored and honored include directories
+	cotire_find_closest_relative_path("${_headerFile}" "${_insideIncludeDirs}" _insideRelPath)
+	if (_insideRelPath)
+		# header is inside, but could be become outside if there is a shorter outside match
+		cotire_find_closest_relative_path("${_headerFile}" "${_outsideIncludeDirs}" _outsideRelPath)
+		if (_outsideRelPath)
+			string (LENGTH "${_insideRelPath}" _insideRelPathLen)
+			string (LENGTH "${_outsideRelPath}" _outsideRelPathLen)
+			if (_outsideRelPathLen LESS _insideRelPathLen)
+				set (${_headerIsInside} FALSE)
+			else()
+				set (${_headerIsInside} TRUE)
+			endif()
+		else()
+			set (${_headerIsInside} TRUE)
+		endif()
+	else()
+		# header is outside
+		set (${_headerIsInside} FALSE)
+	endif()
+endmacro()
+
+macro (cotire_check_ignore_header_file_path _headerFile _headerIsIgnoredVar)
+	if (NOT EXISTS "${_headerFile}")
+		set (${_headerIsIgnoredVar} TRUE)
+	elseif (IS_DIRECTORY "${_headerFile}")
+		set (${_headerIsIgnoredVar} TRUE)
+	elseif ("${_headerFile}" MATCHES "\\.\\.|[_-]fixed")
+		# heuristic: ignore headers with embedded parent directory references or "-fixed" or "_fixed" in path
+		# these often stem from using GCC #include_next tricks, which may break the precompiled header compilation
+		# with the error message "error: no include path in which to search for header"
+		set (${_headerIsIgnoredVar} TRUE)
+	else()
+		set (${_headerIsIgnoredVar} FALSE)
+	endif()
+endmacro()
+
+macro (cotire_check_ignore_header_file_ext _headerFile _ignoreExtensionsVar _headerIsIgnoredVar)
+	# check header file extension
+	cotire_get_source_file_extension("${_headerFile}" _headerFileExt)
+	set (${_headerIsIgnoredVar} FALSE)
+	if (_headerFileExt)
+		list (FIND ${_ignoreExtensionsVar} "${_headerFileExt}" _index)
+		if (_index GREATER -1)
+			set (${_headerIsIgnoredVar} TRUE)
+		endif()
+	endif()
+endmacro()
+
+macro (cotire_parse_line _line _headerFileVar _headerDepthVar)
+	if (MSVC)
+		# cl.exe /showIncludes produces different output, depending on the language pack used, e.g.:
+		# English: "Note: including file:   C:\directory\file"
+		# German: "Hinweis: Einlesen der Datei:   C:\directory\file"
+		# We use a very general regular expression, relying on the presence of the : characters
+		if (_line MATCHES "( +)([a-zA-Z]:[^:]+)$")
+			string (LENGTH "${CMAKE_MATCH_1}" ${_headerDepthVar})
+			get_filename_component(${_headerFileVar} "${CMAKE_MATCH_2}" ABSOLUTE)
+		else()
+			set (${_headerFileVar} "")
+			set (${_headerDepthVar} 0)
+		endif()
+	else()
+		if (_line MATCHES "^(\\.+) (.*)$")
+			# GCC like output
+			string (LENGTH "${CMAKE_MATCH_1}" ${_headerDepthVar})
+			if (IS_ABSOLUTE "${CMAKE_MATCH_2}")
+				set (${_headerFileVar} "${CMAKE_MATCH_2}")
+			else()
+				get_filename_component(${_headerFileVar} "${CMAKE_MATCH_2}" REALPATH)
+			endif()
+		else()
+			set (${_headerFileVar} "")
+			set (${_headerDepthVar} 0)
+		endif()
+	endif()
+endmacro()
+
+function (cotire_parse_includes _language _scanOutput _ignoredIncludeDirs _honoredIncludeDirs _ignoredExtensions _selectedIncludesVar _unparsedLinesVar)
+	if (WIN32)
+		# prevent CMake macro invocation errors due to backslash characters in Windows paths
+		string (REPLACE "\\" "/" _scanOutput "${_scanOutput}")
+	endif()
+	# canonize slashes
+	string (REPLACE "//" "/" _scanOutput "${_scanOutput}")
+	# prevent semicolon from being interpreted as a line separator
+	string (REPLACE ";" "\\;" _scanOutput "${_scanOutput}")
+	# then separate lines
+	string (REGEX REPLACE "\n" ";" _scanOutput "${_scanOutput}")
+	list (LENGTH _scanOutput _len)
+	# remove duplicate lines to speed up parsing
+	list (REMOVE_DUPLICATES _scanOutput)
+	list (LENGTH _scanOutput _uniqueLen)
+	if (COTIRE_VERBOSE OR COTIRE_DEBUG)
+		message (STATUS "Scanning ${_uniqueLen} unique lines of ${_len} for includes")
+		if (_ignoredExtensions)
+			message (STATUS "Ignored extensions: ${_ignoredExtensions}")
+		endif()
+		if (_ignoredIncludeDirs)
+			message (STATUS "Ignored paths: ${_ignoredIncludeDirs}")
+		endif()
+		if (_honoredIncludeDirs)
+			message (STATUS "Included paths: ${_honoredIncludeDirs}")
+		endif()
+	endif()
+	set (_sourceFiles ${ARGN})
+	set (_selectedIncludes "")
+	set (_unparsedLines "")
+	# stack keeps track of inside/outside project status of processed header files
+	set (_headerIsInsideStack "")
+	foreach (_line IN LISTS _scanOutput)
+		if (_line)
+			cotire_parse_line("${_line}" _headerFile _headerDepth)
+			if (_headerFile)
+				cotire_check_header_file_location("${_headerFile}" "${_ignoredIncludeDirs}" "${_honoredIncludeDirs}" _headerIsInside)
+				if (COTIRE_DEBUG)
+					message (STATUS "${_headerDepth}: ${_headerFile} ${_headerIsInside}")
+				endif()
+				# update stack
+				list (LENGTH _headerIsInsideStack _stackLen)
+				if (_headerDepth GREATER _stackLen)
+					math (EXPR _stackLen "${_stackLen} + 1")
+					foreach (_index RANGE ${_stackLen} ${_headerDepth})
+						list (APPEND _headerIsInsideStack ${_headerIsInside})
+					endforeach()
+				else()
+					foreach (_index RANGE ${_headerDepth} ${_stackLen})
+						list (REMOVE_AT _headerIsInsideStack -1)
+					endforeach()
+					list (APPEND _headerIsInsideStack ${_headerIsInside})
+				endif()
+				if (COTIRE_DEBUG)
+					message (STATUS "${_headerIsInsideStack}")
+				endif()
+				# header is a candidate if it is outside project
+				if (NOT _headerIsInside)
+					# get parent header file's inside/outside status
+					if (_headerDepth GREATER 1)
+						math (EXPR _index "${_headerDepth} - 2")
+						list (GET _headerIsInsideStack ${_index} _parentHeaderIsInside)
+					else()
+						set (_parentHeaderIsInside TRUE)
+					endif()
+					# select header file if parent header file is inside project
+					# (e.g., a project header file that includes a standard header file)
+					if (_parentHeaderIsInside)
+						cotire_check_ignore_header_file_path("${_headerFile}" _headerIsIgnored)
+						if (NOT _headerIsIgnored)
+							cotire_check_ignore_header_file_ext("${_headerFile}" _ignoredExtensions _headerIsIgnored)
+							if (NOT _headerIsIgnored)
+								list (APPEND _selectedIncludes "${_headerFile}")
+							else()
+								# fix header's inside status on stack, it is ignored by extension now
+								list (REMOVE_AT _headerIsInsideStack -1)
+								list (APPEND _headerIsInsideStack TRUE)
+							endif()
+						endif()
+						if (COTIRE_DEBUG)
+							message (STATUS "${_headerFile} ${_ignoredExtensions} ${_headerIsIgnored}")
+						endif()
+					endif()
+				endif()
+			else()
+				if (MSVC)
+					# for cl.exe do not keep unparsed lines which solely consist of a source file name
+					string (FIND "${_sourceFiles}" "${_line}" _index)
+					if (_index LESS 0)
+						list (APPEND _unparsedLines "${_line}")
+					endif()
+				else()
+					list (APPEND _unparsedLines "${_line}")
+				endif()
+			endif()
+		endif()
+	endforeach()
+	list (REMOVE_DUPLICATES _selectedIncludes)
+	set (${_selectedIncludesVar} ${_selectedIncludes} PARENT_SCOPE)
+	set (${_unparsedLinesVar} ${_unparsedLines} PARENT_SCOPE)
+endfunction()
+
+function (cotire_scan_includes _includesVar)
+	set(_options "")
+	set(_oneValueArgs COMPILER_ID COMPILER_EXECUTABLE COMPILER_ARG1 COMPILER_VERSION LANGUAGE UNPARSED_LINES SCAN_RESULT)
+	set(_multiValueArgs COMPILE_DEFINITIONS COMPILE_FLAGS INCLUDE_DIRECTORIES SYSTEM_INCLUDE_DIRECTORIES
+		IGNORE_PATH INCLUDE_PATH IGNORE_EXTENSIONS INCLUDE_PRIORITY_PATH COMPILER_LAUNCHER)
+	cmake_parse_arguments(_option "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
+	set (_sourceFiles ${_option_UNPARSED_ARGUMENTS})
+	if (NOT _option_LANGUAGE)
+		set (_option_LANGUAGE "CXX")
+	endif()
+	if (NOT _option_COMPILER_ID)
+		set (_option_COMPILER_ID "${CMAKE_${_option_LANGUAGE}_ID}")
+	endif()
+	if (NOT _option_COMPILER_VERSION)
+		set (_option_COMPILER_VERSION "${CMAKE_${_option_LANGUAGE}_COMPILER_VERSION}")
+	endif()
+	cotire_init_compile_cmd(_cmd "${_option_LANGUAGE}" "${_option_COMPILER_LAUNCHER}" "${_option_COMPILER_EXECUTABLE}" "${_option_COMPILER_ARG1}")
+	cotire_add_definitions_to_cmd(_cmd "${_option_LANGUAGE}" ${_option_COMPILE_DEFINITIONS})
+	cotire_add_compile_flags_to_cmd(_cmd ${_option_COMPILE_FLAGS})
+	cotire_add_includes_to_cmd(_cmd "${_option_LANGUAGE}" _option_INCLUDE_DIRECTORIES _option_SYSTEM_INCLUDE_DIRECTORIES)
+	cotire_add_frameworks_to_cmd(_cmd "${_option_LANGUAGE}" _option_INCLUDE_DIRECTORIES _option_SYSTEM_INCLUDE_DIRECTORIES)
+	cotire_add_makedep_flags("${_option_LANGUAGE}" "${_option_COMPILER_ID}" "${_option_COMPILER_VERSION}" _cmd)
+	# only consider existing source files for scanning
+	set (_existingSourceFiles "")
+	foreach (_sourceFile ${_sourceFiles})
+		if (EXISTS "${_sourceFile}")
+			list (APPEND _existingSourceFiles "${_sourceFile}")
+		endif()
+	endforeach()
+	if (NOT _existingSourceFiles)
+		set (${_includesVar} "" PARENT_SCOPE)
+		return()
+	endif()
+	# add source files to be scanned
+	if (WIN32)
+		foreach (_sourceFile ${_existingSourceFiles})
+			file (TO_NATIVE_PATH "${_sourceFile}" _sourceFileNative)
+			list (APPEND _cmd "${_sourceFileNative}")
+		endforeach()
+	else()
+		list (APPEND _cmd ${_existingSourceFiles})
+	endif()
+	if (COTIRE_VERBOSE)
+		message (STATUS "execute_process: ${_cmd}")
+	endif()
+	if (MSVC_IDE OR _option_COMPILER_ID MATCHES "MSVC")
+		# cl.exe messes with the output streams unless the environment variable VS_UNICODE_OUTPUT is cleared
+		unset (ENV{VS_UNICODE_OUTPUT})
+	endif()
+	execute_process(
+		COMMAND ${_cmd}
+		WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+		RESULT_VARIABLE _result
+		OUTPUT_QUIET
+		ERROR_VARIABLE _output)
+	if (_result)
+		message (STATUS "Result ${_result} scanning includes of ${_existingSourceFiles}.")
+	endif()
+	cotire_parse_includes(
+		"${_option_LANGUAGE}" "${_output}"
+		"${_option_IGNORE_PATH}" "${_option_INCLUDE_PATH}"
+		"${_option_IGNORE_EXTENSIONS}"
+		_includes _unparsedLines
+		${_sourceFiles})
+	if (_option_INCLUDE_PRIORITY_PATH)
+		set (_sortedIncludes "")
+		foreach (_priorityPath ${_option_INCLUDE_PRIORITY_PATH})
+			foreach (_include ${_includes})
+				string (FIND ${_include} ${_priorityPath} _position)
+				if (_position GREATER -1)
+					list (APPEND _sortedIncludes ${_include})
+				endif()
+			endforeach()
+		endforeach()
+		if (_sortedIncludes)
+			list (INSERT _includes 0 ${_sortedIncludes})
+			list (REMOVE_DUPLICATES _includes)
+		endif()
+	endif()
+	set (${_includesVar} ${_includes} PARENT_SCOPE)
+	if (_option_UNPARSED_LINES)
+		set (${_option_UNPARSED_LINES} ${_unparsedLines} PARENT_SCOPE)
+	endif()
+	if (_option_SCAN_RESULT)
+		set (${_option_SCAN_RESULT} ${_result} PARENT_SCOPE)
+	endif()
+endfunction()
+
+macro (cotire_append_undefs _contentsVar)
+	set (_undefs ${ARGN})
+	if (_undefs)
+		list (REMOVE_DUPLICATES _undefs)
+		foreach (_definition ${_undefs})
+			list (APPEND ${_contentsVar} "#undef ${_definition}")
+		endforeach()
+	endif()
+endmacro()
+
+macro (cotire_comment_str _language _commentText _commentVar)
+	if ("${_language}" STREQUAL "CMAKE")
+		set (${_commentVar} "# ${_commentText}")
+	else()
+		set (${_commentVar} "/* ${_commentText} */")
+	endif()
+endmacro()
+
+function (cotire_write_file _language _file _contents _force)
+	get_filename_component(_moduleName "${COTIRE_CMAKE_MODULE_FILE}" NAME)
+	cotire_comment_str("${_language}" "${_moduleName} ${COTIRE_CMAKE_MODULE_VERSION} generated file" _header1)
+	cotire_comment_str("${_language}" "${_file}" _header2)
+	set (_contents "${_header1}\n${_header2}\n${_contents}")
+	if (COTIRE_DEBUG)
+		message (STATUS "${_contents}")
+	endif()
+	if (_force OR NOT EXISTS "${_file}")
+		file (WRITE "${_file}" "${_contents}")
+	else()
+		file (READ "${_file}" _oldContents)
+		if (NOT "${_oldContents}" STREQUAL "${_contents}")
+			file (WRITE "${_file}" "${_contents}")
+		else()
+			if (COTIRE_DEBUG)
+				message (STATUS "${_file} unchanged")
+			endif()
+		endif()
+	endif()
+endfunction()
+
+function (cotire_generate_unity_source _unityFile)
+	set(_options "")
+	set(_oneValueArgs LANGUAGE)
+	set(_multiValueArgs
+		DEPENDS SOURCES_COMPILE_DEFINITIONS
+		PRE_UNDEFS SOURCES_PRE_UNDEFS POST_UNDEFS SOURCES_POST_UNDEFS PROLOGUE EPILOGUE)
+	cmake_parse_arguments(_option "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
+	if (_option_DEPENDS)
+		cotire_check_file_up_to_date(_unityFileIsUpToDate "${_unityFile}" ${_option_DEPENDS})
+		if (_unityFileIsUpToDate)
+			return()
+		endif()
+	endif()
+	set (_sourceFiles ${_option_UNPARSED_ARGUMENTS})
+	if (NOT _option_PRE_UNDEFS)
+		set (_option_PRE_UNDEFS "")
+	endif()
+	if (NOT _option_SOURCES_PRE_UNDEFS)
+		set (_option_SOURCES_PRE_UNDEFS "")
+	endif()
+	if (NOT _option_POST_UNDEFS)
+		set (_option_POST_UNDEFS "")
+	endif()
+	if (NOT _option_SOURCES_POST_UNDEFS)
+		set (_option_SOURCES_POST_UNDEFS "")
+	endif()
+	set (_contents "")
+	if (_option_PROLOGUE)
+		list (APPEND _contents ${_option_PROLOGUE})
+	endif()
+	if (_option_LANGUAGE AND _sourceFiles)
+		if ("${_option_LANGUAGE}" STREQUAL "CXX")
+			list (APPEND _contents "#ifdef __cplusplus")
+		elseif ("${_option_LANGUAGE}" STREQUAL "C")
+			list (APPEND _contents "#ifndef __cplusplus")
+		endif()
+	endif()
+	set (_compileUndefinitions "")
+	foreach (_sourceFile ${_sourceFiles})
+		cotire_get_source_compile_definitions(
+			"${_option_CONFIGURATION}" "${_option_LANGUAGE}" "${_sourceFile}" _compileDefinitions
+			${_option_SOURCES_COMPILE_DEFINITIONS})
+		cotire_get_source_undefs("${_sourceFile}" COTIRE_UNITY_SOURCE_PRE_UNDEFS _sourcePreUndefs ${_option_SOURCES_PRE_UNDEFS})
+		cotire_get_source_undefs("${_sourceFile}" COTIRE_UNITY_SOURCE_POST_UNDEFS _sourcePostUndefs ${_option_SOURCES_POST_UNDEFS})
+		if (_option_PRE_UNDEFS)
+			list (APPEND _compileUndefinitions ${_option_PRE_UNDEFS})
+		endif()
+		if (_sourcePreUndefs)
+			list (APPEND _compileUndefinitions ${_sourcePreUndefs})
+		endif()
+		if (_compileUndefinitions)
+			cotire_append_undefs(_contents ${_compileUndefinitions})
+			set (_compileUndefinitions "")
+		endif()
+		if (_sourcePostUndefs)
+			list (APPEND _compileUndefinitions ${_sourcePostUndefs})
+		endif()
+		if (_option_POST_UNDEFS)
+			list (APPEND _compileUndefinitions ${_option_POST_UNDEFS})
+		endif()
+		foreach (_definition ${_compileDefinitions})
+			if (_definition MATCHES "^([a-zA-Z0-9_]+)=(.+)$")
+				list (APPEND _contents "#define ${CMAKE_MATCH_1} ${CMAKE_MATCH_2}")
+				list (INSERT _compileUndefinitions 0 "${CMAKE_MATCH_1}")
+			else()
+				list (APPEND _contents "#define ${_definition}")
+				list (INSERT _compileUndefinitions 0 "${_definition}")
+			endif()
+		endforeach()
+		# use absolute path as source file location
+		get_filename_component(_sourceFileLocation "${_sourceFile}" ABSOLUTE)
+		if (WIN32)
+			file (TO_NATIVE_PATH "${_sourceFileLocation}" _sourceFileLocation)
+		endif()
+		list (APPEND _contents "#include \"${_sourceFileLocation}\"")
+	endforeach()
+	if (_compileUndefinitions)
+		cotire_append_undefs(_contents ${_compileUndefinitions})
+		set (_compileUndefinitions "")
+	endif()
+	if (_option_LANGUAGE AND _sourceFiles)
+		list (APPEND _contents "#endif")
+	endif()
+	if (_option_EPILOGUE)
+		list (APPEND _contents ${_option_EPILOGUE})
+	endif()
+	list (APPEND _contents "")
+	string (REPLACE ";" "\n" _contents "${_contents}")
+	if (COTIRE_VERBOSE)
+		message ("${_contents}")
+	endif()
+	cotire_write_file("${_option_LANGUAGE}" "${_unityFile}" "${_contents}" TRUE)
+endfunction()
+
+function (cotire_generate_prefix_header _prefixFile)
+	set(_options "")
+	set(_oneValueArgs LANGUAGE COMPILER_EXECUTABLE COMPILER_ARG1 COMPILER_ID COMPILER_VERSION)
+	set(_multiValueArgs DEPENDS COMPILE_DEFINITIONS COMPILE_FLAGS
+		INCLUDE_DIRECTORIES SYSTEM_INCLUDE_DIRECTORIES IGNORE_PATH INCLUDE_PATH
+		IGNORE_EXTENSIONS INCLUDE_PRIORITY_PATH COMPILER_LAUNCHER)
+	cmake_parse_arguments(_option "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
+	if (NOT _option_COMPILER_ID)
+		set (_option_COMPILER_ID "${CMAKE_${_option_LANGUAGE}_ID}")
+	endif()
+	if (NOT _option_COMPILER_VERSION)
+		set (_option_COMPILER_VERSION "${CMAKE_${_option_LANGUAGE}_COMPILER_VERSION}")
+	endif()
+	if (_option_DEPENDS)
+		cotire_check_file_up_to_date(_prefixFileIsUpToDate "${_prefixFile}" ${_option_DEPENDS})
+		if (_prefixFileIsUpToDate)
+			# create empty log file
+			set (_unparsedLinesFile "${_prefixFile}.log")
+			file (WRITE "${_unparsedLinesFile}" "")
+			return()
+		endif()
+	endif()
+	set (_prologue "")
+	set (_epilogue "")
+	if (_option_COMPILER_ID MATCHES "Clang")
+		set (_prologue "#pragma clang system_header")
+	elseif (_option_COMPILER_ID MATCHES "GNU")
+		set (_prologue "#pragma GCC system_header")
+	elseif (_option_COMPILER_ID MATCHES "MSVC")
+		set (_prologue "#pragma warning(push, 0)")
+		set (_epilogue "#pragma warning(pop)")
+	elseif (_option_COMPILER_ID MATCHES "Intel")
+		# Intel compiler requires hdrstop pragma to stop generating PCH file
+		set (_epilogue "#pragma hdrstop")
+	endif()
+	set (_sourceFiles ${_option_UNPARSED_ARGUMENTS})
+	cotire_scan_includes(_selectedHeaders ${_sourceFiles}
+		LANGUAGE "${_option_LANGUAGE}"
+		COMPILER_LAUNCHER "${_option_COMPILER_LAUNCHER}"
+		COMPILER_EXECUTABLE "${_option_COMPILER_EXECUTABLE}"
+		COMPILER_ARG1 "${_option_COMPILER_ARG1}"
+		COMPILER_ID "${_option_COMPILER_ID}"
+		COMPILER_VERSION "${_option_COMPILER_VERSION}"
+		COMPILE_DEFINITIONS ${_option_COMPILE_DEFINITIONS}
+		COMPILE_FLAGS ${_option_COMPILE_FLAGS}
+		INCLUDE_DIRECTORIES ${_option_INCLUDE_DIRECTORIES}
+		SYSTEM_INCLUDE_DIRECTORIES ${_option_SYSTEM_INCLUDE_DIRECTORIES}
+		IGNORE_PATH ${_option_IGNORE_PATH}
+		INCLUDE_PATH ${_option_INCLUDE_PATH}
+		IGNORE_EXTENSIONS ${_option_IGNORE_EXTENSIONS}
+		INCLUDE_PRIORITY_PATH ${_option_INCLUDE_PRIORITY_PATH}
+		UNPARSED_LINES _unparsedLines
+		SCAN_RESULT _scanResult)
+	cotire_generate_unity_source("${_prefixFile}"
+		PROLOGUE ${_prologue} EPILOGUE ${_epilogue} LANGUAGE "${_option_LANGUAGE}" ${_selectedHeaders})
+	set (_unparsedLinesFile "${_prefixFile}.log")
+	if (_unparsedLines)
+		if (COTIRE_VERBOSE OR _scanResult OR NOT _selectedHeaders)
+			list (LENGTH _unparsedLines _skippedLineCount)
+			if (WIN32)
+				file (TO_NATIVE_PATH "${_unparsedLinesFile}" _unparsedLinesLogPath)
+			else()
+				set (_unparsedLinesLogPath "${_unparsedLinesFile}")
+			endif()
+			message (STATUS "${_skippedLineCount} line(s) skipped, see ${_unparsedLinesLogPath}")
+		endif()
+		string (REPLACE ";" "\n" _unparsedLines "${_unparsedLines}")
+	endif()
+	file (WRITE "${_unparsedLinesFile}" "${_unparsedLines}\n")
+endfunction()
+
+function (cotire_add_makedep_flags _language _compilerID _compilerVersion _flagsVar)
+	set (_flags ${${_flagsVar}})
+	if (_compilerID MATCHES "MSVC")
+		# cl.exe options used
+		# /nologo suppresses display of sign-on banner
+		# /TC treat all files named on the command line as C source files
+		# /TP treat all files named on the command line as C++ source files
+		# /EP preprocess to stdout without #line directives
+		# /showIncludes list include files
+		set (_sourceFileTypeC "/TC")
+		set (_sourceFileTypeCXX "/TP")
+		if (_flags)
+			# append to list
+			list (APPEND _flags /nologo "${_sourceFileType${_language}}" /EP /showIncludes)
+		else()
+			# return as a flag string
+			set (_flags "${_sourceFileType${_language}} /EP /showIncludes")
+		endif()
+	elseif (_compilerID MATCHES "GNU")
+		# GCC options used
+		# -H print the name of each header file used
+		# -E invoke preprocessor
+		# -fdirectives-only do not expand macros, requires GCC >= 4.3
+		if (_flags)
+			# append to list
+			list (APPEND _flags -H -E)
+			if (NOT "${_compilerVersion}" VERSION_LESS "4.3.0")
+				list (APPEND _flags -fdirectives-only)
+			endif()
+		else()
+			# return as a flag string
+			set (_flags "-H -E")
+			if (NOT "${_compilerVersion}" VERSION_LESS "4.3.0")
+				set (_flags "${_flags} -fdirectives-only")
+			endif()
+		endif()
+	elseif (_compilerID MATCHES "Clang")
+		if (UNIX)
+			# Clang options used
+			# -H print the name of each header file used
+			# -E invoke preprocessor
+			# -fno-color-diagnostics do not print diagnostics in color
+			# -Eonly just run preprocessor, no output
+			if (_flags)
+				# append to list
+				list (APPEND _flags -H -E -fno-color-diagnostics -Xclang -Eonly)
+			else()
+				# return as a flag string
+				set (_flags "-H -E -fno-color-diagnostics -Xclang -Eonly")
+			endif()
+		elseif (WIN32)
+			# Clang-cl.exe options used
+			# /TC treat all files named on the command line as C source files
+			# /TP treat all files named on the command line as C++ source files
+			# /EP preprocess to stdout without #line directives
+			# -H print the name of each header file used
+			# -fno-color-diagnostics do not print diagnostics in color
+			# -Eonly just run preprocessor, no output
+			set (_sourceFileTypeC "/TC")
+			set (_sourceFileTypeCXX "/TP")
+			if (_flags)
+				# append to list
+				list (APPEND _flags "${_sourceFileType${_language}}" /EP -fno-color-diagnostics -Xclang -H -Xclang -Eonly)
+			else()
+				# return as a flag string
+				set (_flags "${_sourceFileType${_language}} /EP -fno-color-diagnostics -Xclang -H -Xclang -Eonly")
+			endif()
+		endif()
+	elseif (_compilerID MATCHES "Intel")
+		if (WIN32)
+			# Windows Intel options used
+			# /nologo do not display compiler version information
+			# /QH display the include file order
+			# /EP preprocess to stdout, omitting #line directives
+			# /TC process all source or unrecognized file types as C source files
+			# /TP process all source or unrecognized file types as C++ source files
+			set (_sourceFileTypeC "/TC")
+			set (_sourceFileTypeCXX "/TP")
+			if (_flags)
+				# append to list
+				list (APPEND _flags /nologo "${_sourceFileType${_language}}" /EP /QH)
+			else()
+				# return as a flag string
+				set (_flags "${_sourceFileType${_language}} /EP /QH")
+			endif()
+		else()
+			# Linux / Mac OS X Intel options used
+			# -H print the name of each header file used
+			# -EP preprocess to stdout, omitting #line directives
+			# -Kc++ process all source or unrecognized file types as C++ source files
+			if (_flags)
+				# append to list
+				if ("${_language}" STREQUAL "CXX")
+					list (APPEND _flags -Kc++)
+				endif()
+				list (APPEND _flags -H -EP)
+			else()
+				# return as a flag string
+				if ("${_language}" STREQUAL "CXX")
+					set (_flags "-Kc++ ")
+				endif()
+				set (_flags "${_flags}-H -EP")
+			endif()
+		endif()
+	else()
+		message (FATAL_ERROR "cotire: unsupported ${_language} compiler ${_compilerID} version ${_compilerVersion}.")
+	endif()
+	set (${_flagsVar} ${_flags} PARENT_SCOPE)
+endfunction()
+
+function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersion _prefixFile _pchFile _hostFile _flagsVar)
+	set (_flags ${${_flagsVar}})
+	if (_compilerID MATCHES "MSVC")
+		file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
+		file (TO_NATIVE_PATH "${_pchFile}" _pchFileNative)
+		file (TO_NATIVE_PATH "${_hostFile}" _hostFileNative)
+		# cl.exe options used
+		# /Yc creates a precompiled header file
+		# /Fp specifies precompiled header binary file name
+		# /FI forces inclusion of file
+		# /TC treat all files named on the command line as C source files
+		# /TP treat all files named on the command line as C++ source files
+		# /Zs syntax check only
+		# /Zm precompiled header memory allocation scaling factor
+		set (_sourceFileTypeC "/TC")
+		set (_sourceFileTypeCXX "/TP")
+		if (_flags)
+			# append to list
+			list (APPEND _flags /nologo "${_sourceFileType${_language}}"
+				"/Yc${_prefixFileNative}" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}" /Zs "${_hostFileNative}")
+			if (COTIRE_PCH_MEMORY_SCALING_FACTOR)
+				list (APPEND _flags "/Zm${COTIRE_PCH_MEMORY_SCALING_FACTOR}")
+			endif()
+		else()
+			# return as a flag string
+			set (_flags "/Yc\"${_prefixFileNative}\" /Fp\"${_pchFileNative}\" /FI\"${_prefixFileNative}\"")
+			if (COTIRE_PCH_MEMORY_SCALING_FACTOR)
+				set (_flags "${_flags} /Zm${COTIRE_PCH_MEMORY_SCALING_FACTOR}")
+			endif()
+		endif()
+	elseif (_compilerID MATCHES "GNU")
+		# GCC options used
+		# -x specify the source language
+		# -c compile but do not link
+		# -o place output in file
+		# note that we cannot use -w to suppress all warnings upon pre-compiling, because turning off a warning may
+		# alter compile flags as a side effect (e.g., -Wwrite-string implies -fconst-strings)
+		set (_xLanguage_C "c-header")
+		set (_xLanguage_CXX "c++-header")
+		if (_flags)
+			# append to list
+			list (APPEND _flags -x "${_xLanguage_${_language}}" -c "${_prefixFile}" -o "${_pchFile}")
+		else()
+			# return as a flag string
+			set (_flags "-x ${_xLanguage_${_language}} -c \"${_prefixFile}\" -o \"${_pchFile}\"")
+		endif()
+	elseif (_compilerID MATCHES "Clang")
+		if (UNIX)
+			# Clang options used
+			# -x specify the source language
+			# -c compile but do not link
+			# -o place output in file
+			# -fno-pch-timestamp disable inclusion of timestamp in precompiled headers (clang 4.0.0+)
+			set (_xLanguage_C "c-header")
+			set (_xLanguage_CXX "c++-header")
+			if (_flags)
+				# append to list
+				list (APPEND _flags -x "${_xLanguage_${_language}}" -c "${_prefixFile}" -o "${_pchFile}")
+				if (NOT "${_compilerVersion}" VERSION_LESS "4.0.0")
+					list (APPEND _flags -Xclang -fno-pch-timestamp)
+				endif()
+			else()
+				# return as a flag string
+				set (_flags "-x ${_xLanguage_${_language}} -c \"${_prefixFile}\" -o \"${_pchFile}\"")
+				if (NOT "${_compilerVersion}" VERSION_LESS "4.0.0")
+					set (_flags "${_flags} -Xclang -fno-pch-timestamp")
+				endif()
+			endif()
+		elseif (WIN32)
+			file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
+			file (TO_NATIVE_PATH "${_pchFile}" _pchFileNative)
+			file (TO_NATIVE_PATH "${_hostFile}" _hostFileNative)
+			# Clang-cl.exe options used
+			# /Yc creates a precompiled header file
+			# /Fp specifies precompiled header binary file name
+			# /FI forces inclusion of file
+			# /Zs syntax check only
+			# /TC treat all files named on the command line as C source files
+			# /TP treat all files named on the command line as C++ source files
+			set (_sourceFileTypeC "/TC")
+			set (_sourceFileTypeCXX "/TP")
+			if (_flags)
+				# append to list
+				list (APPEND _flags "${_sourceFileType${_language}}"
+						"/Yc${_prefixFileNative}" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}" /Zs "${_hostFileNative}")
+			else()
+				# return as a flag string
+				set (_flags "/Yc\"${_prefixFileNative}\" /Fp\"${_pchFileNative}\" /FI\"${_prefixFileNative}\"")
+			endif()
+		endif()
+	elseif (_compilerID MATCHES "Intel")
+		if (WIN32)
+			file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
+			file (TO_NATIVE_PATH "${_pchFile}" _pchFileNative)
+			file (TO_NATIVE_PATH "${_hostFile}" _hostFileNative)
+			# Windows Intel options used
+			# /nologo do not display compiler version information
+			# /Yc create a precompiled header (PCH) file
+			# /Fp specify a path or file name for precompiled header files
+			# /FI tells the preprocessor to include a specified file name as the header file
+			# /TC process all source or unrecognized file types as C source files
+			# /TP process all source or unrecognized file types as C++ source files
+			# /Zs syntax check only
+			# /Wpch-messages enable diagnostics related to pre-compiled headers (requires Intel XE 2013 Update 2)
+			set (_sourceFileTypeC "/TC")
+			set (_sourceFileTypeCXX "/TP")
+			if (_flags)
+				# append to list
+				list (APPEND _flags /nologo "${_sourceFileType${_language}}"
+					"/Yc" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}" /Zs "${_hostFileNative}")
+				if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
+					list (APPEND _flags "/Wpch-messages")
+				endif()
+			else()
+				# return as a flag string
+				set (_flags "/Yc /Fp\"${_pchFileNative}\" /FI\"${_prefixFileNative}\"")
+				if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
+					set (_flags "${_flags} /Wpch-messages")
+				endif()
+			endif()
+		else()
+			# Linux / Mac OS X Intel options used
+			# -pch-dir location for precompiled header files
+			# -pch-create name of the precompiled header (PCH) to create
+			# -Kc++ process all source or unrecognized file types as C++ source files
+			# -fsyntax-only check only for correct syntax
+			# -Wpch-messages enable diagnostics related to pre-compiled headers (requires Intel XE 2013 Update 2)
+			get_filename_component(_pchDir "${_pchFile}" DIRECTORY)
+			get_filename_component(_pchName "${_pchFile}" NAME)
+			set (_xLanguage_C "c-header")
+			set (_xLanguage_CXX "c++-header")
+			set (_pchSuppressMessages FALSE)
+			if ("${CMAKE_${_language}_FLAGS}" MATCHES ".*-Wno-pch-messages.*")
+				set(_pchSuppressMessages TRUE)
+			endif()
+			if (_flags)
+				# append to list
+				if ("${_language}" STREQUAL "CXX")
+					list (APPEND _flags -Kc++)
+				endif()
+				list (APPEND _flags -include "${_prefixFile}" -pch-dir "${_pchDir}" -pch-create "${_pchName}" -fsyntax-only "${_hostFile}")
+				if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
+					if (NOT _pchSuppressMessages)
+						list (APPEND _flags -Wpch-messages)
+					endif()
+				endif()
+			else()
+				# return as a flag string
+				set (_flags "-include \"${_prefixFile}\" -pch-dir \"${_pchDir}\" -pch-create \"${_pchName}\"")
+				if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
+					if (NOT _pchSuppressMessages)
+						set (_flags "${_flags} -Wpch-messages")
+					endif()
+				endif()
+			endif()
+		endif()
+	else()
+		message (FATAL_ERROR "cotire: unsupported ${_language} compiler ${_compilerID} version ${_compilerVersion}.")
+	endif()
+	set (${_flagsVar} ${_flags} PARENT_SCOPE)
+endfunction()
+
+function (cotire_add_prefix_pch_inclusion_flags _language _compilerID _compilerVersion _prefixFile _pchFile _flagsVar)
+	set (_flags ${${_flagsVar}})
+	if (_compilerID MATCHES "MSVC")
+		file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
+		# cl.exe options used
+		# /Yu uses a precompiled header file during build
+		# /Fp specifies precompiled header binary file name
+		# /FI forces inclusion of file
+		# /Zm precompiled header memory allocation scaling factor
+		if (_pchFile)
+			file (TO_NATIVE_PATH "${_pchFile}" _pchFileNative)
+			if (_flags)
+				# append to list
+				list (APPEND _flags "/Yu${_prefixFileNative}" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}")
+				if (COTIRE_PCH_MEMORY_SCALING_FACTOR)
+					list (APPEND _flags "/Zm${COTIRE_PCH_MEMORY_SCALING_FACTOR}")
+				endif()
+			else()
+				# return as a flag string
+				set (_flags "/Yu\"${_prefixFileNative}\" /Fp\"${_pchFileNative}\" /FI\"${_prefixFileNative}\"")
+				if (COTIRE_PCH_MEMORY_SCALING_FACTOR)
+					set (_flags "${_flags} /Zm${COTIRE_PCH_MEMORY_SCALING_FACTOR}")
+				endif()
+			endif()
+		else()
+			# no precompiled header, force inclusion of prefix header
+			if (_flags)
+				# append to list
+				list (APPEND _flags "/FI${_prefixFileNative}")
+			else()
+				# return as a flag string
+				set (_flags "/FI\"${_prefixFileNative}\"")
+			endif()
+		endif()
+	elseif (_compilerID MATCHES "GNU")
+		# GCC options used
+		# -include process include file as the first line of the primary source file
+		# -Winvalid-pch warns if precompiled header is found but cannot be used
+		# note: ccache requires the -include flag to be used in order to process precompiled header correctly
+		if (_flags)
+			# append to list
+			list (APPEND _flags -Winvalid-pch -include "${_prefixFile}")
+		else()
+			# return as a flag string
+			set (_flags "-Winvalid-pch -include \"${_prefixFile}\"")
+		endif()
+	elseif (_compilerID MATCHES "Clang")
+		if (UNIX)
+			# Clang options used
+			# -include process include file as the first line of the primary source file
+			# note: ccache requires the -include flag to be used in order to process precompiled header correctly
+			if (_flags)
+				# append to list
+				list (APPEND _flags -include "${_prefixFile}")
+			else()
+				# return as a flag string
+				set (_flags "-include \"${_prefixFile}\"")
+			endif()
+		elseif (WIN32)
+			file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
+			# Clang-cl.exe options used
+			# /Yu uses a precompiled header file during build
+			# /Fp specifies precompiled header binary file name
+			# /FI forces inclusion of file
+			if (_pchFile)
+				file (TO_NATIVE_PATH "${_pchFile}" _pchFileNative)
+				if (_flags)
+					# append to list
+					list (APPEND _flags "/Yu${_prefixFileNative}" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}")
+				else()
+					# return as a flag string
+					set (_flags "/Yu\"${_prefixFileNative}\" /Fp\"${_pchFileNative}\" /FI\"${_prefixFileNative}\"")
+				endif()
+			else()
+				# no precompiled header, force inclusion of prefix header
+				if (_flags)
+					# append to list
+					list (APPEND _flags "/FI${_prefixFileNative}")
+				else()
+					# return as a flag string
+					set (_flags "/FI\"${_prefixFileNative}\"")
+				endif()
+			endif()
+		endif()
+	elseif (_compilerID MATCHES "Intel")
+		if (WIN32)
+			file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
+			# Windows Intel options used
+			# /Yu use a precompiled header (PCH) file
+			# /Fp specify a path or file name for precompiled header files
+			# /FI tells the preprocessor to include a specified file name as the header file
+			# /Wpch-messages enable diagnostics related to pre-compiled headers (requires Intel XE 2013 Update 2)
+			if (_pchFile)
+				file (TO_NATIVE_PATH "${_pchFile}" _pchFileNative)
+				if (_flags)
+					# append to list
+					list (APPEND _flags "/Yu" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}")
+					if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
+						list (APPEND _flags "/Wpch-messages")
+					endif()
+				else()
+					# return as a flag string
+					set (_flags "/Yu /Fp\"${_pchFileNative}\" /FI\"${_prefixFileNative}\"")
+					if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
+						set (_flags "${_flags} /Wpch-messages")
+					endif()
+				endif()
+			else()
+				# no precompiled header, force inclusion of prefix header
+				if (_flags)
+					# append to list
+					list (APPEND _flags "/FI${_prefixFileNative}")
+				else()
+					# return as a flag string
+					set (_flags "/FI\"${_prefixFileNative}\"")
+				endif()
+			endif()
+		else()
+			# Linux / Mac OS X Intel options used
+			# -pch-dir location for precompiled header files
+			# -pch-use name of the precompiled header (PCH) to use
+			# -include process include file as the first line of the primary source file
+			# -Wpch-messages enable diagnostics related to pre-compiled headers (requires Intel XE 2013 Update 2)
+			if (_pchFile)
+				get_filename_component(_pchDir "${_pchFile}" DIRECTORY)
+				get_filename_component(_pchName "${_pchFile}" NAME)
+				set (_pchSuppressMessages FALSE)
+				if ("${CMAKE_${_language}_FLAGS}" MATCHES ".*-Wno-pch-messages.*")
+					set(_pchSuppressMessages TRUE)
+				endif()
+				if (_flags)
+					# append to list
+					list (APPEND _flags -include "${_prefixFile}" -pch-dir "${_pchDir}" -pch-use "${_pchName}")
+					if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
+						if (NOT _pchSuppressMessages)
+							list (APPEND _flags -Wpch-messages)
+						endif()
+					endif()
+				else()
+					# return as a flag string
+					set (_flags "-include \"${_prefixFile}\" -pch-dir \"${_pchDir}\" -pch-use \"${_pchName}\"")
+					if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
+						if (NOT _pchSuppressMessages)
+							set (_flags "${_flags} -Wpch-messages")
+						endif()
+					endif()
+				endif()
+			else()
+				# no precompiled header, force inclusion of prefix header
+				if (_flags)
+					# append to list
+					list (APPEND _flags -include "${_prefixFile}")
+				else()
+					# return as a flag string
+					set (_flags "-include \"${_prefixFile}\"")
+				endif()
+			endif()
+		endif()
+	else()
+		message (FATAL_ERROR "cotire: unsupported ${_language} compiler ${_compilerID} version ${_compilerVersion}.")
+	endif()
+	set (${_flagsVar} ${_flags} PARENT_SCOPE)
+endfunction()
+
+function (cotire_precompile_prefix_header _prefixFile _pchFile _hostFile)
+	set(_options "")
+	set(_oneValueArgs COMPILER_EXECUTABLE COMPILER_ARG1 COMPILER_ID COMPILER_VERSION LANGUAGE)
+	set(_multiValueArgs COMPILE_DEFINITIONS COMPILE_FLAGS INCLUDE_DIRECTORIES SYSTEM_INCLUDE_DIRECTORIES SYS COMPILER_LAUNCHER)
+	cmake_parse_arguments(_option "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
+	if (NOT _option_LANGUAGE)
+		set (_option_LANGUAGE "CXX")
+	endif()
+	if (NOT _option_COMPILER_ID)
+		set (_option_COMPILER_ID "${CMAKE_${_option_LANGUAGE}_ID}")
+	endif()
+	if (NOT _option_COMPILER_VERSION)
+		set (_option_COMPILER_VERSION "${CMAKE_${_option_LANGUAGE}_COMPILER_VERSION}")
+	endif()
+	cotire_init_compile_cmd(_cmd "${_option_LANGUAGE}" "${_option_COMPILER_LAUNCHER}" "${_option_COMPILER_EXECUTABLE}" "${_option_COMPILER_ARG1}")
+	cotire_add_definitions_to_cmd(_cmd "${_option_LANGUAGE}" ${_option_COMPILE_DEFINITIONS})
+	cotire_add_compile_flags_to_cmd(_cmd ${_option_COMPILE_FLAGS})
+	cotire_add_includes_to_cmd(_cmd "${_option_LANGUAGE}" _option_INCLUDE_DIRECTORIES _option_SYSTEM_INCLUDE_DIRECTORIES)
+	cotire_add_frameworks_to_cmd(_cmd "${_option_LANGUAGE}" _option_INCLUDE_DIRECTORIES _option_SYSTEM_INCLUDE_DIRECTORIES)
+	cotire_add_pch_compilation_flags(
+		"${_option_LANGUAGE}" "${_option_COMPILER_ID}" "${_option_COMPILER_VERSION}"
+		"${_prefixFile}" "${_pchFile}" "${_hostFile}" _cmd)
+	if (COTIRE_VERBOSE)
+		message (STATUS "execute_process: ${_cmd}")
+	endif()
+	if (MSVC_IDE OR _option_COMPILER_ID MATCHES "MSVC")
+		# cl.exe messes with the output streams unless the environment variable VS_UNICODE_OUTPUT is cleared
+		unset (ENV{VS_UNICODE_OUTPUT})
+	elseif (_option_COMPILER_ID MATCHES "Clang" AND _option_COMPILER_VERSION VERSION_LESS "4.0.0")
+		if (_option_COMPILER_LAUNCHER MATCHES "ccache" OR
+			_option_COMPILER_EXECUTABLE MATCHES "ccache")
+			# Newer versions of Clang embed a compilation timestamp into the precompiled header binary,
+			# which results in "file has been modified since the precompiled header was built" errors if ccache is used.
+			# We work around the problem by disabling ccache upon pre-compiling the prefix header.
+			set (ENV{CCACHE_DISABLE} "true")
+		endif()
+	endif()
+	execute_process(
+		COMMAND ${_cmd}
+		WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+		RESULT_VARIABLE _result)
+	if (_result)
+		message (FATAL_ERROR "cotire: error ${_result} precompiling ${_prefixFile}.")
+	endif()
+endfunction()
+
+function (cotire_check_precompiled_header_support _language _target _msgVar)
+	set (_unsupportedCompiler
+		"Precompiled headers not supported for ${_language} compiler ${CMAKE_${_language}_COMPILER_ID}")
+	if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC")
+		# PCH supported since Visual Studio C++ 6.0
+		# and CMake does not support an earlier version
+		set (${_msgVar} "" PARENT_SCOPE)
+	elseif (CMAKE_${_language}_COMPILER_ID MATCHES "GNU")
+		# GCC PCH support requires version >= 3.4
+		if ("${CMAKE_${_language}_COMPILER_VERSION}" VERSION_LESS "3.4.0")
+			set (${_msgVar} "${_unsupportedCompiler} version ${CMAKE_${_language}_COMPILER_VERSION}." PARENT_SCOPE)
+		else()
+			set (${_msgVar} "" PARENT_SCOPE)
+		endif()
+	elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Clang")
+		if (UNIX)
+			# all Unix Clang versions have PCH support
+			set (${_msgVar} "" PARENT_SCOPE)
+		elseif (WIN32)
+			# only clang-cl is supported under Windows
+			get_filename_component(_compilerName "${CMAKE_${_language}_COMPILER}" NAME_WE)
+			if (NOT _compilerName MATCHES "cl$")
+				set (${_msgVar} "${_unsupportedCompiler} version ${CMAKE_${_language}_COMPILER_VERSION}. Use clang-cl instead." PARENT_SCOPE)
+			endif()
+		endif()
+	elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Intel")
+		# Intel PCH support requires version >= 8.0.0
+		if ("${CMAKE_${_language}_COMPILER_VERSION}" VERSION_LESS "8.0.0")
+			set (${_msgVar} "${_unsupportedCompiler} version ${CMAKE_${_language}_COMPILER_VERSION}." PARENT_SCOPE)
+		else()
+			set (${_msgVar} "" PARENT_SCOPE)
+		endif()
+	else()
+		set (${_msgVar} "${_unsupportedCompiler}." PARENT_SCOPE)
+	endif()
+	# check if ccache is used as a compiler launcher
+	get_target_property(_launcher ${_target} ${_language}_COMPILER_LAUNCHER)
+	get_filename_component(_realCompilerExe "${CMAKE_${_language}_COMPILER}" REALPATH)
+	if (_realCompilerExe MATCHES "ccache" OR _launcher MATCHES "ccache")
+		# verify that ccache configuration is compatible with precompiled headers
+		# always check environment variable CCACHE_SLOPPINESS, because earlier versions of ccache
+		# do not report the "sloppiness" setting correctly upon printing ccache configuration
+		if (DEFINED ENV{CCACHE_SLOPPINESS})
+			if (NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "pch_defines" OR
+				NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "time_macros")
+				set (${_msgVar}
+					"ccache requires the environment variable CCACHE_SLOPPINESS to be set to \"pch_defines,time_macros\"."
+					PARENT_SCOPE)
+			endif()
+		else()
+			if (_realCompilerExe MATCHES "ccache")
+				set (_ccacheExe "${_realCompilerExe}")
+			else()
+				set (_ccacheExe "${_launcher}")
+			endif()
+			# ccache 3.7.0 replaced --print-config with --show-config
+			# use -p instead, which seems to work for all version for now, sigh
+			execute_process(
+				COMMAND "${_ccacheExe}" "-p"
+				WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+				RESULT_VARIABLE _result
+				OUTPUT_VARIABLE _ccacheConfig OUTPUT_STRIP_TRAILING_WHITESPACE
+				ERROR_QUIET)
+			if (_result)
+				set (${_msgVar} "ccache configuration cannot be determined." PARENT_SCOPE)
+			elseif (NOT _ccacheConfig MATCHES "sloppiness.*=.*time_macros" OR
+				NOT _ccacheConfig MATCHES "sloppiness.*=.*pch_defines")
+				set (${_msgVar}
+					"ccache requires configuration setting \"sloppiness\" to be set to \"pch_defines,time_macros\"."
+					PARENT_SCOPE)
+			endif()
+		endif()
+	endif()
+	if (APPLE)
+		# PCH compilation not supported by GCC / Clang for multi-architecture builds (e.g., i386, x86_64)
+		cotire_get_configuration_types(_configs)
+		foreach (_config ${_configs})
+			set (_targetFlags "")
+			cotire_get_target_compile_flags("${_config}" "${_language}" "${_target}" _targetFlags)
+			cotire_filter_compile_flags("${_language}" "arch" _architectures _ignore ${_targetFlags})
+			list (LENGTH _architectures _numberOfArchitectures)
+			if (_numberOfArchitectures GREATER 1)
+				string (REPLACE ";" ", " _architectureStr "${_architectures}")
+				set (${_msgVar}
+					"Precompiled headers not supported on Darwin for multi-architecture builds (${_architectureStr})."
+					PARENT_SCOPE)
+				break()
+			endif()
+		endforeach()
+	endif()
+endfunction()
+
+macro (cotire_get_intermediate_dir _cotireDir)
+	# ${CMAKE_CFG_INTDIR} may reference a build-time variable when using a generator which supports configuration types
+	get_filename_component(${_cotireDir} "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${COTIRE_INTDIR}" ABSOLUTE)
+endmacro()
+
+macro (cotire_setup_file_extension_variables)
+	set (_unityFileExt_C ".c")
+	set (_unityFileExt_CXX ".cxx")
+	set (_prefixFileExt_C ".h")
+	set (_prefixFileExt_CXX ".hxx")
+	set (_prefixSourceFileExt_C ".c")
+	set (_prefixSourceFileExt_CXX ".cxx")
+endmacro()
+
+function (cotire_make_single_unity_source_file_path _language _target _unityFileVar)
+	cotire_setup_file_extension_variables()
+	if (NOT DEFINED _unityFileExt_${_language})
+		set (${_unityFileVar} "" PARENT_SCOPE)
+		return()
+	endif()
+	set (_unityFileBaseName "${_target}_${_language}${COTIRE_UNITY_SOURCE_FILENAME_SUFFIX}")
+	set (_unityFileName "${_unityFileBaseName}${_unityFileExt_${_language}}")
+	cotire_get_intermediate_dir(_baseDir)
+	set (_unityFile "${_baseDir}/${_unityFileName}")
+	set (${_unityFileVar} "${_unityFile}" PARENT_SCOPE)
+endfunction()
+
+function (cotire_make_unity_source_file_paths _language _target _maxIncludes _unityFilesVar)
+	cotire_setup_file_extension_variables()
+	if (NOT DEFINED _unityFileExt_${_language})
+		set (${_unityFileVar} "" PARENT_SCOPE)
+		return()
+	endif()
+	set (_unityFileBaseName "${_target}_${_language}${COTIRE_UNITY_SOURCE_FILENAME_SUFFIX}")
+	cotire_get_intermediate_dir(_baseDir)
+	set (_startIndex 0)
+	set (_index 0)
+	set (_unityFiles "")
+	set (_sourceFiles ${ARGN})
+	foreach (_sourceFile ${_sourceFiles})
+		get_source_file_property(_startNew "${_sourceFile}" COTIRE_START_NEW_UNITY_SOURCE)
+		math (EXPR _unityFileCount "${_index} - ${_startIndex}")
+		if (_startNew OR (_maxIncludes GREATER 0 AND NOT _unityFileCount LESS _maxIncludes))
+			if (_index GREATER 0)
+				# start new unity file segment
+				math (EXPR _endIndex "${_index} - 1")
+				set (_unityFileName "${_unityFileBaseName}_${_startIndex}_${_endIndex}${_unityFileExt_${_language}}")
+				list (APPEND _unityFiles "${_baseDir}/${_unityFileName}")
+			endif()
+			set (_startIndex ${_index})
+		endif()
+		math (EXPR _index "${_index} + 1")
+	endforeach()
+	list (LENGTH _sourceFiles _numberOfSources)
+	if (_startIndex EQUAL 0)
+		# there is only a single unity file
+		cotire_make_single_unity_source_file_path(${_language} ${_target} _unityFiles)
+	elseif (_startIndex LESS _numberOfSources)
+		# end with final unity file segment
+		math (EXPR _endIndex "${_index} - 1")
+		set (_unityFileName "${_unityFileBaseName}_${_startIndex}_${_endIndex}${_unityFileExt_${_language}}")
+		list (APPEND _unityFiles "${_baseDir}/${_unityFileName}")
+	endif()
+	set (${_unityFilesVar} ${_unityFiles} PARENT_SCOPE)
+	if (COTIRE_DEBUG AND _unityFiles)
+		message (STATUS "unity files: ${_unityFiles}")
+	endif()
+endfunction()
+
+function (cotire_unity_to_prefix_file_path _language _target _unityFile _prefixFileVar)
+	cotire_setup_file_extension_variables()
+	if (NOT DEFINED _unityFileExt_${_language})
+		set (${_prefixFileVar} "" PARENT_SCOPE)
+		return()
+	endif()
+	set (_unityFileBaseName "${_target}_${_language}${COTIRE_UNITY_SOURCE_FILENAME_SUFFIX}")
+	set (_prefixFileBaseName "${_target}_${_language}${COTIRE_PREFIX_HEADER_FILENAME_SUFFIX}")
+	string (REPLACE "${_unityFileBaseName}" "${_prefixFileBaseName}" _prefixFile "${_unityFile}")
+	string (REGEX REPLACE "${_unityFileExt_${_language}}$" "${_prefixFileExt_${_language}}" _prefixFile "${_prefixFile}")
+	set (${_prefixFileVar} "${_prefixFile}" PARENT_SCOPE)
+endfunction()
+
+function (cotire_prefix_header_to_source_file_path _language _prefixHeaderFile _prefixSourceFileVar)
+	cotire_setup_file_extension_variables()
+	if (NOT DEFINED _prefixSourceFileExt_${_language})
+		set (${_prefixSourceFileVar} "" PARENT_SCOPE)
+		return()
+	endif()
+	string (REGEX REPLACE "${_prefixFileExt_${_language}}$" "${_prefixSourceFileExt_${_language}}" _prefixSourceFile "${_prefixHeaderFile}")
+	set (${_prefixSourceFileVar} "${_prefixSourceFile}" PARENT_SCOPE)
+endfunction()
+
+function (cotire_make_prefix_file_name _language _target _prefixFileBaseNameVar _prefixFileNameVar)
+	cotire_setup_file_extension_variables()
+	if (NOT _language)
+		set (_prefixFileBaseName "${_target}${COTIRE_PREFIX_HEADER_FILENAME_SUFFIX}")
+		set (_prefixFileName "${_prefixFileBaseName}${_prefixFileExt_C}")
+	elseif (DEFINED _prefixFileExt_${_language})
+		set (_prefixFileBaseName "${_target}_${_language}${COTIRE_PREFIX_HEADER_FILENAME_SUFFIX}")
+		set (_prefixFileName "${_prefixFileBaseName}${_prefixFileExt_${_language}}")
+	else()
+		set (_prefixFileBaseName "")
+		set (_prefixFileName "")
+	endif()
+	set (${_prefixFileBaseNameVar} "${_prefixFileBaseName}" PARENT_SCOPE)
+	set (${_prefixFileNameVar} "${_prefixFileName}" PARENT_SCOPE)
+endfunction()
+
+function (cotire_make_prefix_file_path _language _target _prefixFileVar)
+	cotire_make_prefix_file_name("${_language}" "${_target}" _prefixFileBaseName _prefixFileName)
+	set (${_prefixFileVar} "" PARENT_SCOPE)
+	if (_prefixFileName)
+		if (NOT _language)
+			set (_language "C")
+		endif()
+		if (CMAKE_${_language}_COMPILER_ID MATCHES "GNU|Clang|Intel|MSVC")
+			cotire_get_intermediate_dir(_baseDir)
+			set (${_prefixFileVar} "${_baseDir}/${_prefixFileName}" PARENT_SCOPE)
+		endif()
+	endif()
+endfunction()
+
+function (cotire_make_pch_file_path _language _target _pchFileVar)
+	cotire_make_prefix_file_name("${_language}" "${_target}" _prefixFileBaseName _prefixFileName)
+	set (${_pchFileVar} "" PARENT_SCOPE)
+	if (_prefixFileBaseName AND _prefixFileName)
+		cotire_check_precompiled_header_support("${_language}" "${_target}" _msg)
+		if (NOT _msg)
+			if (XCODE)
+				# For Xcode, we completely hand off the compilation of the prefix header to the IDE
+				return()
+			endif()
+			cotire_get_intermediate_dir(_baseDir)
+			if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC")
+				# MSVC uses the extension .pch added to the prefix header base name
+				set (${_pchFileVar} "${_baseDir}/${_prefixFileBaseName}.pch" PARENT_SCOPE)
+			elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Clang")
+				# Clang looks for a precompiled header corresponding to the prefix header with the extension .pch appended
+				set (${_pchFileVar} "${_baseDir}/${_prefixFileName}.pch" PARENT_SCOPE)
+			elseif (CMAKE_${_language}_COMPILER_ID MATCHES "GNU")
+				# GCC looks for a precompiled header corresponding to the prefix header with the extension .gch appended
+				set (${_pchFileVar} "${_baseDir}/${_prefixFileName}.gch" PARENT_SCOPE)
+			elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Intel")
+				# Intel uses the extension .pchi added to the prefix header base name
+				set (${_pchFileVar} "${_baseDir}/${_prefixFileBaseName}.pchi" PARENT_SCOPE)
+			endif()
+		endif()
+	endif()
+endfunction()
+
+function (cotire_select_unity_source_files _unityFile _sourcesVar)
+	set (_sourceFiles ${ARGN})
+	if (_sourceFiles AND "${_unityFile}" MATCHES "${COTIRE_UNITY_SOURCE_FILENAME_SUFFIX}_([0-9]+)_([0-9]+)")
+		set (_startIndex ${CMAKE_MATCH_1})
+		set (_endIndex ${CMAKE_MATCH_2})
+		list (LENGTH _sourceFiles _numberOfSources)
+		if (NOT _startIndex LESS _numberOfSources)
+			math (EXPR _startIndex "${_numberOfSources} - 1")
+		endif()
+		if (NOT _endIndex LESS _numberOfSources)
+			math (EXPR _endIndex "${_numberOfSources} - 1")
+		endif()
+		set (_files "")
+		foreach (_index RANGE ${_startIndex} ${_endIndex})
+			list (GET _sourceFiles ${_index} _file)
+			list (APPEND _files "${_file}")
+		endforeach()
+	else()
+		set (_files ${_sourceFiles})
+	endif()
+	set (${_sourcesVar} ${_files} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_unity_source_dependencies _language _target _dependencySourcesVar)
+	set (_dependencySources "")
+	# depend on target's generated source files
+	get_target_property(_targetSourceFiles ${_target} SOURCES)
+	cotire_get_objects_with_property_on(_generatedSources GENERATED SOURCE ${_targetSourceFiles})
+	if (_generatedSources)
+		# but omit all generated source files that have the COTIRE_EXCLUDED property set to true
+		cotire_get_objects_with_property_on(_excludedGeneratedSources COTIRE_EXCLUDED SOURCE ${_generatedSources})
+		if (_excludedGeneratedSources)
+			list (REMOVE_ITEM _generatedSources ${_excludedGeneratedSources})
+		endif()
+		# and omit all generated source files that have the COTIRE_DEPENDENCY property set to false explicitly
+		cotire_get_objects_with_property_off(_excludedNonDependencySources COTIRE_DEPENDENCY SOURCE ${_generatedSources})
+		if (_excludedNonDependencySources)
+			list (REMOVE_ITEM _generatedSources ${_excludedNonDependencySources})
+		endif()
+		if (_generatedSources)
+			list (APPEND _dependencySources ${_generatedSources})
+		endif()
+	endif()
+	if (COTIRE_DEBUG AND _dependencySources)
+		message (STATUS "${_language} ${_target} unity source dependencies: ${_dependencySources}")
+	endif()
+	set (${_dependencySourcesVar} ${_dependencySources} PARENT_SCOPE)
+endfunction()
+
+function (cotire_get_prefix_header_dependencies _language _target _dependencySourcesVar)
+	set (_dependencySources "")
+	# depend on target source files marked with custom COTIRE_DEPENDENCY property
+	get_target_property(_targetSourceFiles ${_target} SOURCES)
+	cotire_get_objects_with_property_on(_dependencySources COTIRE_DEPENDENCY SOURCE ${_targetSourceFiles})
+	if (COTIRE_DEBUG AND _dependencySources)
+		message (STATUS "${_language} ${_target} prefix header dependencies: ${_dependencySources}")
+	endif()
+	set (${_dependencySourcesVar} ${_dependencySources} PARENT_SCOPE)
+endfunction()
+
+function (cotire_generate_target_script _language _configurations _target _targetScriptVar _targetConfigScriptVar)
+	set (_targetSources ${ARGN})
+	cotire_get_prefix_header_dependencies(${_language} ${_target} COTIRE_TARGET_PREFIX_DEPENDS ${_targetSources})
+	cotire_get_unity_source_dependencies(${_language} ${_target} COTIRE_TARGET_UNITY_DEPENDS ${_targetSources})
+	# set up variables to be configured
+	set (COTIRE_TARGET_LANGUAGE "${_language}")
+	get_target_property(COTIRE_TARGET_IGNORE_PATH ${_target} COTIRE_PREFIX_HEADER_IGNORE_PATH)
+	cotire_add_sys_root_paths(COTIRE_TARGET_IGNORE_PATH)
+	get_target_property(COTIRE_TARGET_INCLUDE_PATH ${_target} COTIRE_PREFIX_HEADER_INCLUDE_PATH)
+	cotire_add_sys_root_paths(COTIRE_TARGET_INCLUDE_PATH)
+	get_target_property(COTIRE_TARGET_PRE_UNDEFS ${_target} COTIRE_UNITY_SOURCE_PRE_UNDEFS)
+	get_target_property(COTIRE_TARGET_POST_UNDEFS ${_target} COTIRE_UNITY_SOURCE_POST_UNDEFS)
+	get_target_property(COTIRE_TARGET_MAXIMUM_NUMBER_OF_INCLUDES ${_target} COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES)
+	get_target_property(COTIRE_TARGET_INCLUDE_PRIORITY_PATH ${_target} COTIRE_PREFIX_HEADER_INCLUDE_PRIORITY_PATH)
+	cotire_get_source_files_undefs(COTIRE_UNITY_SOURCE_PRE_UNDEFS COTIRE_TARGET_SOURCES_PRE_UNDEFS ${_targetSources})
+	cotire_get_source_files_undefs(COTIRE_UNITY_SOURCE_POST_UNDEFS COTIRE_TARGET_SOURCES_POST_UNDEFS ${_targetSources})
+	set (COTIRE_TARGET_CONFIGURATION_TYPES "${_configurations}")
+	foreach (_config ${_configurations})
+		string (TOUPPER "${_config}" _upperConfig)
+		cotire_get_target_include_directories(
+			"${_config}" "${_language}" "${_target}" COTIRE_TARGET_INCLUDE_DIRECTORIES_${_upperConfig} COTIRE_TARGET_SYSTEM_INCLUDE_DIRECTORIES_${_upperConfig})
+		cotire_get_target_compile_definitions(
+			"${_config}" "${_language}" "${_target}" COTIRE_TARGET_COMPILE_DEFINITIONS_${_upperConfig})
+		cotire_get_target_compiler_flags(
+			"${_config}" "${_language}" "${_target}" COTIRE_TARGET_COMPILE_FLAGS_${_upperConfig})
+		cotire_get_source_files_compile_definitions(
+			"${_config}" "${_language}" COTIRE_TARGET_SOURCES_COMPILE_DEFINITIONS_${_upperConfig} ${_targetSources})
+	endforeach()
+	get_target_property(COTIRE_TARGET_${_language}_COMPILER_LAUNCHER ${_target} ${_language}_COMPILER_LAUNCHER)
+	# set up COTIRE_TARGET_SOURCES
+	set (COTIRE_TARGET_SOURCES "")
+	foreach (_sourceFile ${_targetSources})
+		get_source_file_property(_generated "${_sourceFile}" GENERATED)
+		if (_generated)
+			# use absolute paths for generated files only, retrieving the LOCATION property is an expensive operation
+			get_source_file_property(_sourceLocation "${_sourceFile}" LOCATION)
+			list (APPEND COTIRE_TARGET_SOURCES "${_sourceLocation}")
+		else()
+			list (APPEND COTIRE_TARGET_SOURCES "${_sourceFile}")
+		endif()
+	endforeach()
+	# copy variable definitions to cotire target script
+	get_cmake_property(_vars VARIABLES)
+	string (REGEX MATCHALL "COTIRE_[A-Za-z0-9_]+" _matchVars "${_vars}")
+	# omit COTIRE_*_INIT variables
+	string (REGEX MATCHALL "COTIRE_[A-Za-z0-9_]+_INIT" _initVars "${_matchVars}")
+	if (_initVars)
+		list (REMOVE_ITEM _matchVars ${_initVars})
+	endif()
+	# omit COTIRE_VERBOSE which is passed as a CMake define on command line
+	list (REMOVE_ITEM _matchVars COTIRE_VERBOSE)
+	set (_contents "")
+	set (_contentsHasGeneratorExpressions FALSE)
+	foreach (_var IN LISTS _matchVars ITEMS
+		XCODE MSVC CMAKE_GENERATOR CMAKE_BUILD_TYPE CMAKE_CONFIGURATION_TYPES
+		CMAKE_${_language}_COMPILER_ID CMAKE_${_language}_COMPILER_VERSION
+		CMAKE_${_language}_COMPILER_LAUNCHER CMAKE_${_language}_COMPILER CMAKE_${_language}_COMPILER_ARG1
+		CMAKE_INCLUDE_FLAG_${_language} CMAKE_INCLUDE_FLAG_SEP_${_language}
+		CMAKE_INCLUDE_SYSTEM_FLAG_${_language}
+		CMAKE_${_language}_FRAMEWORK_SEARCH_FLAG
+		CMAKE_${_language}_SYSTEM_FRAMEWORK_SEARCH_FLAG
+		CMAKE_${_language}_SOURCE_FILE_EXTENSIONS)
+		if (DEFINED ${_var})
+			string (REPLACE "\"" "\\\"" _value "${${_var}}")
+			set (_contents "${_contents}set (${_var} \"${_value}\")\n")
+			if (NOT _contentsHasGeneratorExpressions)
+				if ("${_value}" MATCHES "\\$<.*>")
+					set (_contentsHasGeneratorExpressions TRUE)
+				endif()
+			endif()
+		endif()
+	endforeach()
+	# generate target script file
+	get_filename_component(_moduleName "${COTIRE_CMAKE_MODULE_FILE}" NAME)
+	set (_targetCotireScript "${CMAKE_CURRENT_BINARY_DIR}/${_target}_${_language}_${_moduleName}")
+	cotire_write_file("CMAKE" "${_targetCotireScript}" "${_contents}" FALSE)
+	if (_contentsHasGeneratorExpressions)
+		# use file(GENERATE ...) to expand generator expressions in the target script at CMake generate-time
+		set (_configNameOrNoneGeneratorExpression "$<$<CONFIG:>:None>$<$<NOT:$<CONFIG:>>:$<CONFIGURATION>>")
+		set (_targetCotireConfigScript "${CMAKE_CURRENT_BINARY_DIR}/${_target}_${_language}_${_configNameOrNoneGeneratorExpression}_${_moduleName}")
+		file (GENERATE OUTPUT "${_targetCotireConfigScript}" INPUT "${_targetCotireScript}")
+	else()
+		set (_targetCotireConfigScript "${_targetCotireScript}")
+	endif()
+	set (${_targetScriptVar} "${_targetCotireScript}" PARENT_SCOPE)
+	set (${_targetConfigScriptVar} "${_targetCotireConfigScript}" PARENT_SCOPE)
+endfunction()
+
+function (cotire_setup_pch_file_compilation _language _target _targetScript _prefixFile _pchFile _hostFile)
+	set (_sourceFiles ${ARGN})
+	if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR
+		(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
+		# for MSVC, Intel and Clang-cl, we attach the precompiled header compilation to the host file
+		# the remaining files include the precompiled header, see cotire_setup_pch_file_inclusion
+		if (_sourceFiles)
+			set (_flags "")
+			cotire_add_pch_compilation_flags(
+				"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
+				"${_prefixFile}" "${_pchFile}" "${_hostFile}" _flags)
+			set_property (SOURCE ${_hostFile} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
+			if (COTIRE_DEBUG)
+				message (STATUS "set_property: SOURCE ${_hostFile} APPEND_STRING COMPILE_FLAGS ${_flags}")
+			endif()
+			set_property (SOURCE ${_hostFile} APPEND PROPERTY OBJECT_OUTPUTS "${_pchFile}")
+			# make object file generated from host file depend on prefix header
+			set_property (SOURCE ${_hostFile} APPEND PROPERTY OBJECT_DEPENDS "${_prefixFile}")
+			# mark host file as cotired to prevent it from being used in another cotired target
+			set_property (SOURCE ${_hostFile} PROPERTY COTIRE_TARGET "${_target}")
+		endif()
+	elseif ("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
+		# for makefile based generator, we add a custom command to precompile the prefix header
+		if (_targetScript)
+			cotire_set_cmd_to_prologue(_cmds)
+			list (APPEND _cmds -P "${COTIRE_CMAKE_MODULE_FILE}" "precompile" "${_targetScript}" "${_prefixFile}" "${_pchFile}" "${_hostFile}")
+			if (MSVC_IDE)
+				file (TO_NATIVE_PATH "${_pchFile}" _pchFileLogPath)
+			else()
+				file (RELATIVE_PATH _pchFileLogPath "${CMAKE_BINARY_DIR}" "${_pchFile}")
+			endif()
+			# make precompiled header compilation depend on the actual compiler executable used to force
+			# re-compilation when the compiler executable is updated. This prevents "created by a different GCC executable"
+			# warnings when the precompiled header is included.
+			get_filename_component(_realCompilerExe "${CMAKE_${_language}_COMPILER}" ABSOLUTE)
+			if (COTIRE_DEBUG)
+				message (STATUS "add_custom_command: OUTPUT ${_pchFile} ${_cmds} DEPENDS ${_prefixFile} ${_realCompilerExe} IMPLICIT_DEPENDS ${_language} ${_prefixFile}")
+			endif()
+			set_property (SOURCE "${_pchFile}" PROPERTY GENERATED TRUE)
+			add_custom_command(
+				OUTPUT "${_pchFile}"
+				COMMAND ${_cmds}
+				DEPENDS "${_prefixFile}" "${_realCompilerExe}"
+				IMPLICIT_DEPENDS ${_language} "${_prefixFile}"
+				WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+				COMMENT "Building ${_language} precompiled header ${_pchFileLogPath}"
+				VERBATIM)
+		endif()
+	endif()
+endfunction()
+
+function (cotire_setup_pch_file_inclusion _language _target _wholeTarget _prefixFile _pchFile _hostFile)
+	if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR
+		(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
+		# for MSVC, Intel and clang-cl, we include the precompiled header in all but the host file
+		# the host file does the precompiled header compilation, see cotire_setup_pch_file_compilation
+		set (_sourceFiles ${ARGN})
+		list (LENGTH _sourceFiles _numberOfSourceFiles)
+		if (_numberOfSourceFiles GREATER 0)
+			# mark sources as cotired to prevent them from being used in another cotired target
+			set_source_files_properties(${_sourceFiles} PROPERTIES COTIRE_TARGET "${_target}")
+			set (_flags "")
+			cotire_add_prefix_pch_inclusion_flags(
+				"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
+				"${_prefixFile}" "${_pchFile}" _flags)
+			set_property (SOURCE ${_sourceFiles} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
+			if (COTIRE_DEBUG)
+				message (STATUS "set_property: SOURCE ${_sourceFiles} APPEND_STRING COMPILE_FLAGS ${_flags}")
+			endif()
+			# make object files generated from source files depend on precompiled header
+			set_property (SOURCE ${_sourceFiles} APPEND PROPERTY OBJECT_DEPENDS "${_pchFile}")
+		endif()
+	elseif ("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
+		set (_sourceFiles ${_hostFile} ${ARGN})
+		if (NOT _wholeTarget)
+			# for makefile based generator, we force the inclusion of the prefix header for a subset
+			# of the source files, if this is a multi-language target or has excluded files
+			set (_flags "")
+			cotire_add_prefix_pch_inclusion_flags(
+				"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
+				"${_prefixFile}" "${_pchFile}" _flags)
+			set_property (SOURCE ${_sourceFiles} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
+			if (COTIRE_DEBUG)
+				message (STATUS "set_property: SOURCE ${_sourceFiles} APPEND_STRING COMPILE_FLAGS ${_flags}")
+			endif()
+			# mark sources as cotired to prevent them from being used in another cotired target
+			set_source_files_properties(${_sourceFiles} PROPERTIES COTIRE_TARGET "${_target}")
+		endif()
+		# make object files generated from source files depend on precompiled header
+		set_property (SOURCE ${_sourceFiles} APPEND PROPERTY OBJECT_DEPENDS "${_pchFile}")
+	endif()
+endfunction()
+
+function (cotire_setup_prefix_file_inclusion _language _target _prefixFile)
+	set (_sourceFiles ${ARGN})
+	# force the inclusion of the prefix header for the given source files
+	set (_flags "")
+	set (_pchFile "")
+	cotire_add_prefix_pch_inclusion_flags(
+		"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
+		"${_prefixFile}" "${_pchFile}" _flags)
+	set_property (SOURCE ${_sourceFiles} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
+	if (COTIRE_DEBUG)
+		message (STATUS "set_property: SOURCE ${_sourceFiles} APPEND_STRING COMPILE_FLAGS ${_flags}")
+	endif()
+	# mark sources as cotired to prevent them from being used in another cotired target
+	set_source_files_properties(${_sourceFiles} PROPERTIES COTIRE_TARGET "${_target}")
+	# make object files generated from source files depend on prefix header
+	set_property (SOURCE ${_sourceFiles} APPEND PROPERTY OBJECT_DEPENDS "${_prefixFile}")
+endfunction()
+
+function (cotire_get_first_set_property_value _propertyValueVar _type _object)
+	set (_properties ${ARGN})
+	foreach (_property ${_properties})
+		get_property(_propertyValue ${_type} "${_object}" PROPERTY ${_property})
+		if (_propertyValue)
+			set (${_propertyValueVar} ${_propertyValue} PARENT_SCOPE)
+			return()
+		endif()
+	endforeach()
+	set (${_propertyValueVar} "" PARENT_SCOPE)
+endfunction()
+
+function (cotire_setup_combine_command _language _targetScript _joinedFile _cmdsVar)
+	set (_files ${ARGN})
+	set (_filesPaths "")
+	foreach (_file ${_files})
+		get_filename_component(_filePath "${_file}" ABSOLUTE)
+		list (APPEND _filesPaths "${_filePath}")
+	endforeach()
+	cotire_set_cmd_to_prologue(_prefixCmd)
+	list (APPEND _prefixCmd -P "${COTIRE_CMAKE_MODULE_FILE}" "combine")
+	if (_targetScript)
+		list (APPEND _prefixCmd "${_targetScript}")
+	endif()
+	list (APPEND _prefixCmd "${_joinedFile}" ${_filesPaths})
+	if (COTIRE_DEBUG)
+		message (STATUS "add_custom_command: OUTPUT ${_joinedFile} COMMAND ${_prefixCmd} DEPENDS ${_files}")
+	endif()
+	set_property (SOURCE "${_joinedFile}" PROPERTY GENERATED TRUE)
+	if (MSVC_IDE)
+		file (TO_NATIVE_PATH "${_joinedFile}" _joinedFileLogPath)
+	else()
+		file (RELATIVE_PATH _joinedFileLogPath "${CMAKE_BINARY_DIR}" "${_joinedFile}")
+	endif()
+	get_filename_component(_joinedFileBaseName "${_joinedFile}" NAME_WE)
+	get_filename_component(_joinedFileExt "${_joinedFile}" EXT)
+	if (_language AND _joinedFileBaseName MATCHES "${COTIRE_UNITY_SOURCE_FILENAME_SUFFIX}$")
+		set (_comment "Generating ${_language} unity source ${_joinedFileLogPath}")
+	elseif (_language AND _joinedFileBaseName MATCHES "${COTIRE_PREFIX_HEADER_FILENAME_SUFFIX}$")
+		if (_joinedFileExt MATCHES "^\\.c")
+			set (_comment "Generating ${_language} prefix source ${_joinedFileLogPath}")
+		else()
+			set (_comment "Generating ${_language} prefix header ${_joinedFileLogPath}")
+		endif()
+	else()
+		set (_comment "Generating ${_joinedFileLogPath}")
+	endif()
+	add_custom_command(
+		OUTPUT "${_joinedFile}"
+		COMMAND ${_prefixCmd}
+		DEPENDS ${_files}
+		COMMENT "${_comment}"
+		WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+		VERBATIM)
+	list (APPEND ${_cmdsVar} COMMAND ${_prefixCmd})
+	set (${_cmdsVar} ${${_cmdsVar}} PARENT_SCOPE)
+endfunction()
+
+function (cotire_setup_target_pch_usage _languages _target _wholeTarget)
+	if (XCODE)
+		# for Xcode, we attach a pre-build action to generate the unity sources and prefix headers
+		set (_prefixFiles "")
+		foreach (_language ${_languages})
+			get_property(_prefixFile TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER)
+			if (_prefixFile)
+				list (APPEND _prefixFiles "${_prefixFile}")
+			endif()
+		endforeach()
+		set (_cmds ${ARGN})
+		list (LENGTH _prefixFiles _numberOfPrefixFiles)
+		if (_numberOfPrefixFiles GREATER 1)
+			# we also generate a generic, single prefix header which includes all language specific prefix headers
+			set (_language "")
+			set (_targetScript "")
+			cotire_make_prefix_file_path("${_language}" ${_target} _prefixHeader)
+			cotire_setup_combine_command("${_language}" "${_targetScript}" "${_prefixHeader}" _cmds ${_prefixFiles})
+		else()
+			set (_prefixHeader "${_prefixFiles}")
+		endif()
+		if (COTIRE_DEBUG)
+			message (STATUS "add_custom_command: TARGET ${_target} PRE_BUILD ${_cmds}")
+		endif()
+		# because CMake PRE_BUILD command does not support dependencies,
+		# we check dependencies explicity in cotire script mode when the pre-build action is run
+		add_custom_command(
+			TARGET "${_target}"
+			PRE_BUILD ${_cmds}
+			WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+			COMMENT "Updating target ${_target} prefix headers"
+			VERBATIM)
+		# make Xcode precompile the generated prefix header with ProcessPCH and ProcessPCH++
+		set_target_properties(${_target} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES")
+		set_target_properties(${_target} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${_prefixHeader}")
+	elseif ("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
+		# for makefile based generator, we force inclusion of the prefix header for all target source files
+		# if this is a single-language target without any excluded files
+		if (_wholeTarget)
+			set (_language "${_languages}")
+			# for MSVC, Intel and clang-cl, precompiled header inclusion is always done on the source file level
+			# see cotire_setup_pch_file_inclusion
+			if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" AND NOT
+				(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
+				get_property(_prefixFile TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER)
+				if (_prefixFile)
+					get_property(_pchFile TARGET ${_target} PROPERTY COTIRE_${_language}_PRECOMPILED_HEADER)
+					set (_options COMPILE_OPTIONS)
+					cotire_add_prefix_pch_inclusion_flags(
+						"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
+						"${_prefixFile}" "${_pchFile}" _options)
+					set_property(TARGET ${_target} APPEND PROPERTY ${_options})
+					if (COTIRE_DEBUG)
+						message (STATUS "set_property: TARGET ${_target} APPEND PROPERTY ${_options}")
+					endif()
+				endif()
+			endif()
+		endif()
+	endif()
+endfunction()
+
+function (cotire_setup_unity_generation_commands _language _target _targetScript _targetConfigScript _unityFiles _cmdsVar)
+	set (_dependencySources "")
+	cotire_get_unity_source_dependencies(${_language} ${_target} _dependencySources ${ARGN})
+	foreach (_unityFile ${_unityFiles})
+		set_property (SOURCE "${_unityFile}" PROPERTY GENERATED TRUE)
+		# set up compiled unity source dependencies via OBJECT_DEPENDS
+		# this ensures that missing source files are generated before the unity file is compiled
+		if (COTIRE_DEBUG AND _dependencySources)
+			message (STATUS "${_unityFile} OBJECT_DEPENDS ${_dependencySources}")
+		endif()
+		if (_dependencySources)
+			# the OBJECT_DEPENDS property requires a list of full paths
+			set (_objectDependsPaths "")
+			foreach (_sourceFile ${_dependencySources})
+				get_source_file_property(_sourceLocation "${_sourceFile}" LOCATION)
+				list (APPEND _objectDependsPaths "${_sourceLocation}")
+			endforeach()
+			set_property (SOURCE "${_unityFile}" PROPERTY OBJECT_DEPENDS ${_objectDependsPaths})
+		endif()
+		if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
+			# unity file compilation results in potentially huge object file,
+			# thus use /bigobj by default unter cl.exe and Windows Intel
+			set_property (SOURCE "${_unityFile}" APPEND_STRING PROPERTY COMPILE_FLAGS "/bigobj")
+		endif()
+		cotire_set_cmd_to_prologue(_unityCmd)
+		list (APPEND _unityCmd -P "${COTIRE_CMAKE_MODULE_FILE}" "unity" "${_targetConfigScript}" "${_unityFile}")
+		if (CMAKE_VERSION VERSION_LESS "3.1.0")
+			set (_unityCmdDepends "${_targetScript}")
+		else()
+			# CMake 3.1.0 supports generator expressions in arguments to DEPENDS
+			set (_unityCmdDepends "${_targetConfigScript}")
+		endif()
+		if (MSVC_IDE)
+			file (TO_NATIVE_PATH "${_unityFile}" _unityFileLogPath)
+		else()
+			file (RELATIVE_PATH _unityFileLogPath "${CMAKE_BINARY_DIR}" "${_unityFile}")
+		endif()
+		if (COTIRE_DEBUG)
+			message (STATUS "add_custom_command: OUTPUT ${_unityFile} COMMAND ${_unityCmd} DEPENDS ${_unityCmdDepends}")
+		endif()
+		add_custom_command(
+			OUTPUT "${_unityFile}"
+			COMMAND ${_unityCmd}
+			DEPENDS ${_unityCmdDepends}
+			COMMENT "Generating ${_language} unity source ${_unityFileLogPath}"
+			WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+			VERBATIM)
+		list (APPEND ${_cmdsVar} COMMAND ${_unityCmd})
+	endforeach()
+	set (${_cmdsVar} ${${_cmdsVar}} PARENT_SCOPE)
+endfunction()
+
+function (cotire_setup_prefix_generation_command _language _target _targetScript _prefixFile _unityFiles _cmdsVar)
+	set (_sourceFiles ${ARGN})
+	set (_dependencySources "")
+	cotire_get_prefix_header_dependencies(${_language} ${_target} _dependencySources ${_sourceFiles})
+	cotire_set_cmd_to_prologue(_prefixCmd)
+	list (APPEND _prefixCmd -P "${COTIRE_CMAKE_MODULE_FILE}" "prefix" "${_targetScript}" "${_prefixFile}" ${_unityFiles})
+	set_property (SOURCE "${_prefixFile}" PROPERTY GENERATED TRUE)
+	# make prefix header generation depend on the actual compiler executable used to force
+	# re-generation when the compiler executable is updated. This prevents "file not found"
+	# errors for compiler version specific system header files.
+	get_filename_component(_realCompilerExe "${CMAKE_${_language}_COMPILER}" ABSOLUTE)
+	if (COTIRE_DEBUG)
+		message (STATUS "add_custom_command: OUTPUT ${_prefixFile} COMMAND ${_prefixCmd} DEPENDS ${_unityFile} ${_dependencySources} ${_realCompilerExe}")
+	endif()
+	if (MSVC_IDE)
+		file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileLogPath)
+	else()
+		file (RELATIVE_PATH _prefixFileLogPath "${CMAKE_BINARY_DIR}" "${_prefixFile}")
+	endif()
+	get_filename_component(_prefixFileExt "${_prefixFile}" EXT)
+	if (_prefixFileExt MATCHES "^\\.c")
+		set (_comment "Generating ${_language} prefix source ${_prefixFileLogPath}")
+	else()
+		set (_comment "Generating ${_language} prefix header ${_prefixFileLogPath}")
+	endif()
+	# prevent pre-processing errors upon generating the prefix header when a target's generated include file does not yet exist
+	# we do not add a file-level dependency for the target's generated files though, because we only want to depend on their existence
+	# thus we make the prefix header generation depend on a custom helper target which triggers the generation of the files
+	set (_preTargetName "${_target}${COTIRE_PCH_TARGET_SUFFIX}_pre")
+	if (TARGET ${_preTargetName})
+		# custom helper target has already been generated while processing a different language
+		list (APPEND _dependencySources ${_preTargetName})
+	else()
+		get_target_property(_targetSourceFiles ${_target} SOURCES)
+		cotire_get_objects_with_property_on(_generatedSources GENERATED SOURCE ${_targetSourceFiles})
+		if (_generatedSources)
+			add_custom_target("${_preTargetName}" DEPENDS ${_generatedSources})
+			cotire_init_target("${_preTargetName}")
+			list (APPEND _dependencySources ${_preTargetName})
+		endif()
+	endif()
+	add_custom_command(
+		OUTPUT "${_prefixFile}" "${_prefixFile}.log"
+		COMMAND ${_prefixCmd}
+		DEPENDS ${_unityFiles} ${_dependencySources} "${_realCompilerExe}"
+		COMMENT "${_comment}"
+		WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+		VERBATIM)
+	list (APPEND ${_cmdsVar} COMMAND ${_prefixCmd})
+	set (${_cmdsVar} ${${_cmdsVar}} PARENT_SCOPE)
+endfunction()
+
+function (cotire_setup_prefix_generation_from_unity_command _language _target _targetScript _prefixFile _unityFiles _cmdsVar)
+	set (_sourceFiles ${ARGN})
+	if (CMAKE_${_language}_COMPILER_ID MATCHES "GNU|Clang")
+		# GNU and Clang require indirect compilation of the prefix header to make them honor the system_header pragma
+		cotire_prefix_header_to_source_file_path(${_language} "${_prefixFile}" _prefixSourceFile)
+	else()
+		set (_prefixSourceFile "${_prefixFile}")
+	endif()
+	cotire_setup_prefix_generation_command(
+		${_language} ${_target} "${_targetScript}"
+		"${_prefixSourceFile}" "${_unityFiles}" ${_cmdsVar} ${_sourceFiles})
+	if (CMAKE_${_language}_COMPILER_ID MATCHES "GNU|Clang")
+		# set up generation of a prefix source file which includes the prefix header
+		cotire_setup_combine_command(${_language} "${_targetScript}" "${_prefixFile}" _cmds ${_prefixSourceFile})
+	endif()
+	set (${_cmdsVar} ${${_cmdsVar}} PARENT_SCOPE)
+endfunction()
+
+function (cotire_setup_prefix_generation_from_provided_command _language _target _targetScript _prefixFile _cmdsVar)
+	set (_prefixHeaderFiles ${ARGN})
+	if (CMAKE_${_language}_COMPILER_ID MATCHES "GNU|Clang")
+		# GNU and Clang require indirect compilation of the prefix header to make them honor the system_header pragma
+		cotire_prefix_header_to_source_file_path(${_language} "${_prefixFile}" _prefixSourceFile)
+	else()
+		set (_prefixSourceFile "${_prefixFile}")
+	endif()
+	cotire_setup_combine_command(${_language} "${_targetScript}" "${_prefixSourceFile}" _cmds ${_prefixHeaderFiles})
+	if (CMAKE_${_language}_COMPILER_ID MATCHES "GNU|Clang")
+		# set up generation of a prefix source file which includes the prefix header
+		cotire_setup_combine_command(${_language} "${_targetScript}" "${_prefixFile}" _cmds ${_prefixSourceFile})
+	endif()
+	set (${_cmdsVar} ${${_cmdsVar}} PARENT_SCOPE)
+endfunction()
+
+function (cotire_init_cotire_target_properties _target)
+	get_property(_isSet TARGET ${_target} PROPERTY COTIRE_ENABLE_PRECOMPILED_HEADER SET)
+	if (NOT _isSet)
+		set_property(TARGET ${_target} PROPERTY COTIRE_ENABLE_PRECOMPILED_HEADER TRUE)
+	endif()
+	get_property(_isSet TARGET ${_target} PROPERTY COTIRE_ADD_UNITY_BUILD SET)
+	if (NOT _isSet)
+		set_property(TARGET ${_target} PROPERTY COTIRE_ADD_UNITY_BUILD TRUE)
+	endif()
+	get_property(_isSet TARGET ${_target} PROPERTY COTIRE_ADD_CLEAN SET)
+	if (NOT _isSet)
+		set_property(TARGET ${_target} PROPERTY COTIRE_ADD_CLEAN FALSE)
+	endif()
+	get_property(_isSet TARGET ${_target} PROPERTY COTIRE_PREFIX_HEADER_IGNORE_PATH SET)
+	if (NOT _isSet)
+		set_property(TARGET ${_target} PROPERTY COTIRE_PREFIX_HEADER_IGNORE_PATH "${CMAKE_SOURCE_DIR}")
+		cotire_check_is_path_relative_to("${CMAKE_BINARY_DIR}" _isRelative "${CMAKE_SOURCE_DIR}")
+		if (NOT _isRelative)
+			set_property(TARGET ${_target} APPEND PROPERTY COTIRE_PREFIX_HEADER_IGNORE_PATH "${CMAKE_BINARY_DIR}")
+		endif()
+	endif()
+	get_property(_isSet TARGET ${_target} PROPERTY COTIRE_PREFIX_HEADER_INCLUDE_PATH SET)
+	if (NOT _isSet)
+		set_property(TARGET ${_target} PROPERTY COTIRE_PREFIX_HEADER_INCLUDE_PATH "")
+	endif()
+	get_property(_isSet TARGET ${_target} PROPERTY COTIRE_PREFIX_HEADER_INCLUDE_PRIORITY_PATH SET)
+	if (NOT _isSet)
+		set_property(TARGET ${_target} PROPERTY COTIRE_PREFIX_HEADER_INCLUDE_PRIORITY_PATH "")
+	endif()
+	get_property(_isSet TARGET ${_target} PROPERTY COTIRE_UNITY_SOURCE_PRE_UNDEFS SET)
+	if (NOT _isSet)
+		set_property(TARGET ${_target} PROPERTY COTIRE_UNITY_SOURCE_PRE_UNDEFS "")
+	endif()
+	get_property(_isSet TARGET ${_target} PROPERTY COTIRE_UNITY_SOURCE_POST_UNDEFS SET)
+	if (NOT _isSet)
+		set_property(TARGET ${_target} PROPERTY COTIRE_UNITY_SOURCE_POST_UNDEFS "")
+	endif()
+	get_property(_isSet TARGET ${_target} PROPERTY COTIRE_UNITY_LINK_LIBRARIES_INIT SET)
+	if (NOT _isSet)
+		set_property(TARGET ${_target} PROPERTY COTIRE_UNITY_LINK_LIBRARIES_INIT "COPY_UNITY")
+	endif()
+	get_property(_isSet TARGET ${_target} PROPERTY COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES SET)
+	if (NOT _isSet)
+		if (COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES)
+			set_property(TARGET ${_target} PROPERTY COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES "${COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES}")
+		else()
+			set_property(TARGET ${_target} PROPERTY COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES "")
+		endif()
+	endif()
+endfunction()
+
+function (cotire_make_target_message _target _languages _disableMsg _targetMsgVar)
+	get_target_property(_targetUsePCH ${_target} COTIRE_ENABLE_PRECOMPILED_HEADER)
+	get_target_property(_targetAddSCU ${_target} COTIRE_ADD_UNITY_BUILD)
+	string (REPLACE ";" " " _languagesStr "${_languages}")
+	math (EXPR _numberOfExcludedFiles "${ARGC} - 4")
+	if (_numberOfExcludedFiles EQUAL 0)
+		set (_excludedStr "")
+	elseif (COTIRE_VERBOSE OR _numberOfExcludedFiles LESS 4)
+		string (REPLACE ";" ", " _excludedStr "excluding ${ARGN}")
+	else()
+		set (_excludedStr "excluding ${_numberOfExcludedFiles} files")
+	endif()
+	set (_targetMsg "")
+	if (NOT _languages)
+		set (_targetMsg "Target ${_target} cannot be cotired.")
+		if (_disableMsg)
+			set (_targetMsg "${_targetMsg} ${_disableMsg}")
+		endif()
+	elseif (NOT _targetUsePCH AND NOT _targetAddSCU)
+		set (_targetMsg "${_languagesStr} target ${_target} cotired without unity build and precompiled header.")
+		if (_disableMsg)
+			set (_targetMsg "${_targetMsg} ${_disableMsg}")
+		endif()
+	elseif (NOT _targetUsePCH)
+		if (_excludedStr)
+			set (_targetMsg "${_languagesStr} target ${_target} cotired without precompiled header ${_excludedStr}.")
+		else()
+			set (_targetMsg "${_languagesStr} target ${_target} cotired without precompiled header.")
+		endif()
+		if (_disableMsg)
+			set (_targetMsg "${_targetMsg} ${_disableMsg}")
+		endif()
+	elseif (NOT _targetAddSCU)
+		if (_excludedStr)
+			set (_targetMsg "${_languagesStr} target ${_target} cotired without unity build ${_excludedStr}.")
+		else()
+			set (_targetMsg "${_languagesStr} target ${_target} cotired without unity build.")
+		endif()
+		if (_disableMsg)
+			set (_targetMsg "${_targetMsg} ${_disableMsg}")
+		endif()
+	else()
+		if (_excludedStr)
+			set (_targetMsg "${_languagesStr} target ${_target} cotired ${_excludedStr}.")
+		else()
+			set (_targetMsg "${_languagesStr} target ${_target} cotired.")
+		endif()
+	endif()
+	set (${_targetMsgVar} "${_targetMsg}" PARENT_SCOPE)
+endfunction()
+
+function (cotire_choose_target_languages _target _targetLanguagesVar _wholeTargetVar)
+	set (_languages ${ARGN})
+	set (_allSourceFiles "")
+	set (_allExcludedSourceFiles "")
+	set (_allCotiredSourceFiles "")
+	set (_targetLanguages "")
+	set (_pchEligibleTargetLanguages "")
+	get_target_property(_targetType ${_target} TYPE)
+	get_target_property(_targetSourceFiles ${_target} SOURCES)
+	get_target_property(_targetUsePCH ${_target} COTIRE_ENABLE_PRECOMPILED_HEADER)
+	get_target_property(_targetAddSCU ${_target} COTIRE_ADD_UNITY_BUILD)
+	set (_disableMsg "")
+	foreach (_language ${_languages})
+		get_target_property(_prefixHeader ${_target} COTIRE_${_language}_PREFIX_HEADER)
+		get_target_property(_unityBuildFile ${_target} COTIRE_${_language}_UNITY_SOURCE)
+		if (_prefixHeader OR _unityBuildFile)
+			message (STATUS "cotire: target ${_target} has already been cotired.")
+			set (${_targetLanguagesVar} "" PARENT_SCOPE)
+			return()
+		endif()
+		if (_targetUsePCH AND "${_language}" MATCHES "^C|CXX$" AND DEFINED CMAKE_${_language}_COMPILER_ID)
+			if (CMAKE_${_language}_COMPILER_ID)
+				cotire_check_precompiled_header_support("${_language}" "${_target}" _disableMsg)
+				if (_disableMsg)
+					set (_targetUsePCH FALSE)
+				endif()
+			endif()
+		endif()
+		set (_sourceFiles "")
+		set (_excludedSources "")
+		set (_cotiredSources "")
+		cotire_filter_language_source_files(${_language} ${_target} _sourceFiles _excludedSources _cotiredSources ${_targetSourceFiles})
+		if (_sourceFiles OR _excludedSources OR _cotiredSources)
+			list (APPEND _targetLanguages ${_language})
+		endif()
+		if (_sourceFiles)
+			list (APPEND _allSourceFiles ${_sourceFiles})
+		endif()
+		list (LENGTH _sourceFiles _numberOfSources)
+		if (NOT _numberOfSources LESS ${COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES})
+			list (APPEND _pchEligibleTargetLanguages ${_language})
+		endif()
+		if (_excludedSources)
+			list (APPEND _allExcludedSourceFiles ${_excludedSources})
+		endif()
+		if (_cotiredSources)
+			list (APPEND _allCotiredSourceFiles ${_cotiredSources})
+		endif()
+	endforeach()
+	set (_targetMsgLevel STATUS)
+	if (NOT _targetLanguages)
+		string (REPLACE ";" " or " _languagesStr "${_languages}")
+		set (_disableMsg "No ${_languagesStr} source files.")
+		set (_targetUsePCH FALSE)
+		set (_targetAddSCU FALSE)
+	endif()
+	if (_targetUsePCH)
+		if (_allCotiredSourceFiles)
+			cotire_get_source_file_property_values(_cotireTargets COTIRE_TARGET ${_allCotiredSourceFiles})
+			list (REMOVE_DUPLICATES _cotireTargets)
+			string (REPLACE ";" ", " _cotireTargetsStr "${_cotireTargets}")
+			set (_disableMsg "Target sources already include a precompiled header for target(s) ${_cotireTargets}.")
+			set (_disableMsg "${_disableMsg} Set target property COTIRE_ENABLE_PRECOMPILED_HEADER to FALSE for targets ${_target},")
+			set (_disableMsg "${_disableMsg} ${_cotireTargetsStr} to get a workable build system.")
+			set (_targetMsgLevel SEND_ERROR)
+			set (_targetUsePCH FALSE)
+		elseif (NOT _pchEligibleTargetLanguages)
+			set (_disableMsg "Too few applicable sources.")
+			set (_targetUsePCH FALSE)
+		elseif (XCODE AND _allExcludedSourceFiles)
+			# for Xcode, we cannot apply the precompiled header to individual sources, only to the whole target
+			set (_disableMsg "Exclusion of source files not supported for generator Xcode.")
+			set (_targetUsePCH FALSE)
+		elseif (XCODE AND "${_targetType}" STREQUAL "OBJECT_LIBRARY")
+			# for Xcode, we cannot apply the required PRE_BUILD action to generate the prefix header to an OBJECT_LIBRARY target
+			set (_disableMsg "Required PRE_BUILD action not supported for OBJECT_LIBRARY targets for generator Xcode.")
+			set (_targetUsePCH FALSE)
+		endif()
+	endif()
+	if (_targetAddSCU)
+		# disable unity builds if automatic Qt processing is used
+		get_target_property(_targetAutoMoc ${_target} AUTOMOC)
+		get_target_property(_targetAutoUic ${_target} AUTOUIC)
+		get_target_property(_targetAutoRcc ${_target} AUTORCC)
+		if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
+			if (_disableMsg)
+				set (_disableMsg "${_disableMsg} Target uses automatic CMake Qt processing.")
+			else()
+				set (_disableMsg "Target uses automatic CMake Qt processing.")
+			endif()
+			set (_targetAddSCU FALSE)
+		endif()
+	endif()
+	set_property(TARGET ${_target} PROPERTY COTIRE_ENABLE_PRECOMPILED_HEADER ${_targetUsePCH})
+	set_property(TARGET ${_target} PROPERTY COTIRE_ADD_UNITY_BUILD ${_targetAddSCU})
+	cotire_make_target_message(${_target} "${_targetLanguages}" "${_disableMsg}" _targetMsg ${_allExcludedSourceFiles})
+	if (_targetMsg)
+		if (NOT DEFINED COTIREMSG_${_target})
+			set (COTIREMSG_${_target} "")
+		endif()
+		if (COTIRE_VERBOSE OR NOT "${_targetMsgLevel}" STREQUAL "STATUS" OR
+			NOT "${COTIREMSG_${_target}}" STREQUAL "${_targetMsg}")
+			# cache message to avoid redundant messages on re-configure
+			set (COTIREMSG_${_target} "${_targetMsg}" CACHE INTERNAL "${_target} cotire message.")
+			message (${_targetMsgLevel} "${_targetMsg}")
+		endif()
+	endif()
+	list (LENGTH _targetLanguages _numberOfLanguages)
+	if (_numberOfLanguages GREATER 1 OR _allExcludedSourceFiles)
+		set (${_wholeTargetVar} FALSE PARENT_SCOPE)
+	else()
+		set (${_wholeTargetVar} TRUE PARENT_SCOPE)
+	endif()
+	set (${_targetLanguagesVar} ${_targetLanguages} PARENT_SCOPE)
+endfunction()
+
+function (cotire_compute_unity_max_number_of_includes _target _maxIncludesVar)
+	set (_sourceFiles ${ARGN})
+	get_target_property(_maxIncludes ${_target} COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES)
+	if (_maxIncludes MATCHES "(-j|--parallel|--jobs) ?([0-9]*)")
+		if (DEFINED CMAKE_MATCH_2)
+			set (_numberOfThreads "${CMAKE_MATCH_2}")
+		else()
+			set (_numberOfThreads "")
+		endif()
+		if (NOT _numberOfThreads)
+			# use all available cores
+			ProcessorCount(_numberOfThreads)
+		endif()
+		list (LENGTH _sourceFiles _numberOfSources)
+		math (EXPR _maxIncludes "(${_numberOfSources} + ${_numberOfThreads} - 1) / ${_numberOfThreads}")
+	elseif (NOT _maxIncludes MATCHES "[0-9]+")
+		set (_maxIncludes 0)
+	endif()
+	if (COTIRE_DEBUG)
+		message (STATUS "${_target} unity source max includes: ${_maxIncludes}")
+	endif()
+	set (${_maxIncludesVar} ${_maxIncludes} PARENT_SCOPE)
+endfunction()
+
+function (cotire_process_target_language _language _configurations _target _wholeTarget _cmdsVar)
+	set (${_cmdsVar} "" PARENT_SCOPE)
+	get_target_property(_targetSourceFiles ${_target} SOURCES)
+	set (_sourceFiles "")
+	set (_excludedSources "")
+	set (_cotiredSources "")
+	cotire_filter_language_source_files(${_language} ${_target} _sourceFiles _excludedSources _cotiredSources ${_targetSourceFiles})
+	if (NOT _sourceFiles AND NOT _cotiredSources)
+		return()
+	endif()
+	set (_cmds "")
+	# check for user provided unity source file list
+	get_property(_unitySourceFiles TARGET ${_target} PROPERTY COTIRE_${_language}_UNITY_SOURCE_INIT)
+	if (NOT _unitySourceFiles)
+		set (_unitySourceFiles ${_sourceFiles} ${_cotiredSources})
+	endif()
+	cotire_generate_target_script(
+		${_language} "${_configurations}" ${_target} _targetScript _targetConfigScript ${_unitySourceFiles})
+	# set up unity files for parallel compilation
+	cotire_compute_unity_max_number_of_includes(${_target} _maxIncludes ${_unitySourceFiles})
+	cotire_make_unity_source_file_paths(${_language} ${_target} ${_maxIncludes} _unityFiles ${_unitySourceFiles})
+	list (LENGTH _unityFiles _numberOfUnityFiles)
+	if (_numberOfUnityFiles EQUAL 0)
+		return()
+	elseif (_numberOfUnityFiles GREATER 1)
+		cotire_setup_unity_generation_commands(
+			${_language} ${_target} "${_targetScript}" "${_targetConfigScript}" "${_unityFiles}" _cmds ${_unitySourceFiles})
+	endif()
+	# set up single unity file for prefix header generation
+	cotire_make_single_unity_source_file_path(${_language} ${_target} _unityFile)
+	cotire_setup_unity_generation_commands(
+		${_language} ${_target} "${_targetScript}" "${_targetConfigScript}" "${_unityFile}" _cmds ${_unitySourceFiles})
+	cotire_make_prefix_file_path(${_language} ${_target} _prefixFile)
+	# set up prefix header
+	if (_prefixFile)
+		# check for user provided prefix header files
+		get_property(_prefixHeaderFiles TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER_INIT)
+		if (_prefixHeaderFiles)
+			cotire_setup_prefix_generation_from_provided_command(
+				${_language} ${_target} "${_targetConfigScript}" "${_prefixFile}" _cmds ${_prefixHeaderFiles})
+		else()
+			cotire_setup_prefix_generation_from_unity_command(
+				${_language} ${_target} "${_targetConfigScript}" "${_prefixFile}" "${_unityFile}" _cmds ${_unitySourceFiles})
+		endif()
+		# check if selected language has enough sources at all
+		list (LENGTH _sourceFiles _numberOfSources)
+		if (_numberOfSources LESS ${COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES})
+			set (_targetUsePCH FALSE)
+		else()
+			get_target_property(_targetUsePCH ${_target} COTIRE_ENABLE_PRECOMPILED_HEADER)
+		endif()
+		if (_targetUsePCH)
+			cotire_make_pch_file_path(${_language} ${_target} _pchFile)
+			if (_pchFile)
+				# first file in _sourceFiles is passed as the host file
+				cotire_setup_pch_file_compilation(
+					${_language} ${_target} "${_targetConfigScript}" "${_prefixFile}" "${_pchFile}" ${_sourceFiles})
+				cotire_setup_pch_file_inclusion(
+					${_language} ${_target} ${_wholeTarget} "${_prefixFile}" "${_pchFile}" ${_sourceFiles})
+			endif()
+		elseif (_prefixHeaderFiles)
+			# user provided prefix header must be included unconditionally
+			cotire_setup_prefix_file_inclusion(${_language} ${_target} "${_prefixFile}" ${_sourceFiles})
+		endif()
+	endif()
+	# mark target as cotired for language
+	set_property(TARGET ${_target} PROPERTY COTIRE_${_language}_UNITY_SOURCE "${_unityFiles}")
+	if (_prefixFile)
+		set_property(TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER "${_prefixFile}")
+		if (_targetUsePCH AND _pchFile)
+			set_property(TARGET ${_target} PROPERTY COTIRE_${_language}_PRECOMPILED_HEADER "${_pchFile}")
+		endif()
+	endif()
+	set (${_cmdsVar} ${_cmds} PARENT_SCOPE)
+endfunction()
+
+function (cotire_setup_clean_target _target)
+	set (_cleanTargetName "${_target}${COTIRE_CLEAN_TARGET_SUFFIX}")
+	if (NOT TARGET "${_cleanTargetName}")
+		cotire_set_cmd_to_prologue(_cmds)
+		get_filename_component(_outputDir "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}" ABSOLUTE)
+		list (APPEND _cmds -P "${COTIRE_CMAKE_MODULE_FILE}" "cleanup" "${_outputDir}" "${COTIRE_INTDIR}" "${_target}")
+		add_custom_target(${_cleanTargetName}
+			COMMAND ${_cmds}
+			WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+			COMMENT "Cleaning up target ${_target} cotire generated files"
+			VERBATIM)
+		cotire_init_target("${_cleanTargetName}")
+	endif()
+endfunction()
+
+function (cotire_setup_pch_target _languages _configurations _target)
+	if ("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
+		# for makefile based generators, we add a custom target to trigger the generation of the cotire related files
+		set (_dependsFiles "")
+		foreach (_language ${_languages})
+			set (_props COTIRE_${_language}_PREFIX_HEADER COTIRE_${_language}_UNITY_SOURCE)
+			if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" AND NOT
+				(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
+				# MSVC, Intel and clang-cl only create precompiled header as a side effect
+				list (INSERT _props 0 COTIRE_${_language}_PRECOMPILED_HEADER)
+			endif()
+			cotire_get_first_set_property_value(_dependsFile TARGET ${_target} ${_props})
+			if (_dependsFile)
+				list (APPEND _dependsFiles "${_dependsFile}")
+			endif()
+		endforeach()
+		if (_dependsFiles)
+			set (_pchTargetName "${_target}${COTIRE_PCH_TARGET_SUFFIX}")
+			add_custom_target("${_pchTargetName}" DEPENDS ${_dependsFiles})
+			cotire_init_target("${_pchTargetName}")
+			cotire_add_to_pch_all_target(${_pchTargetName})
+		endif()
+	else()
+		# for other generators, we add the "clean all" target to clean up the precompiled header
+		cotire_setup_clean_all_target()
+	endif()
+endfunction()
+
+function (cotire_filter_object_libraries _target _objectLibrariesVar)
+	set (_objectLibraries "")
+	foreach (_source ${ARGN})
+		if (_source MATCHES "^\\$<TARGET_OBJECTS:.+>$")
+			list (APPEND _objectLibraries "${_source}")
+		endif()
+	endforeach()
+	set (${_objectLibrariesVar} ${_objectLibraries} PARENT_SCOPE)
+endfunction()
+
+function (cotire_collect_unity_target_sources _target _languages _unityTargetSourcesVar)
+	get_target_property(_targetSourceFiles ${_target} SOURCES)
+	set (_unityTargetSources ${_targetSourceFiles})
+	foreach (_language ${_languages})
+		get_property(_unityFiles TARGET ${_target} PROPERTY COTIRE_${_language}_UNITY_SOURCE)
+		if (_unityFiles)
+			# remove source files that are included in the unity source
+			set (_sourceFiles "")
+			set (_excludedSources "")
+			set (_cotiredSources "")
+			cotire_filter_language_source_files(${_language} ${_target} _sourceFiles _excludedSources _cotiredSources ${_targetSourceFiles})
+			if (_sourceFiles OR _cotiredSources)
+				list (REMOVE_ITEM _unityTargetSources ${_sourceFiles} ${_cotiredSources})
+			endif()
+			# add unity source files instead
+			list (APPEND _unityTargetSources ${_unityFiles})
+		endif()
+	endforeach()
+	# handle object libraries which are part of the target's sources
+	get_target_property(_linkLibrariesStrategy ${_target} COTIRE_UNITY_LINK_LIBRARIES_INIT)
+	if ("${_linkLibrariesStrategy}" MATCHES "^COPY_UNITY$")
+		cotire_filter_object_libraries(${_target} _objectLibraries ${_targetSourceFiles})
+		if (_objectLibraries)
+			cotire_map_libraries("${_linkLibrariesStrategy}" _unityObjectLibraries ${_objectLibraries})
+			list (REMOVE_ITEM _unityTargetSources ${_objectLibraries})
+			list (APPEND _unityTargetSources ${_unityObjectLibraries})
+		endif()
+	endif()
+	set (${_unityTargetSourcesVar} ${_unityTargetSources} PARENT_SCOPE)
+endfunction()
+
+function (cotire_setup_unity_target_pch_usage _languages _target)
+	foreach (_language ${_languages})
+		get_property(_unityFiles TARGET ${_target} PROPERTY COTIRE_${_language}_UNITY_SOURCE)
+		if (_unityFiles)
+			get_property(_userPrefixFile TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER_INIT)
+			get_property(_prefixFile TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER)
+			if (_userPrefixFile AND _prefixFile)
+				# user provided prefix header must be included unconditionally by unity sources
+				cotire_setup_prefix_file_inclusion(${_language} ${_target} "${_prefixFile}" ${_unityFiles})
+			endif()
+		endif()
+	endforeach()
+endfunction()
+
+function (cotire_setup_unity_build_target _languages _configurations _target)
+	get_target_property(_unityTargetName ${_target} COTIRE_UNITY_TARGET_NAME)
+	if (NOT _unityTargetName)
+		set (_unityTargetName "${_target}${COTIRE_UNITY_BUILD_TARGET_SUFFIX}")
+	endif()
+	# determine unity target sub type
+	get_target_property(_targetType ${_target} TYPE)
+	if ("${_targetType}" STREQUAL "EXECUTABLE")
+		set (_unityTargetSubType "")
+	elseif (_targetType MATCHES "(STATIC|SHARED|MODULE|OBJECT)_LIBRARY")
+		set (_unityTargetSubType "${CMAKE_MATCH_1}")
+	else()
+		message (WARNING "cotire: target ${_target} has unknown target type ${_targetType}.")
+		return()
+	endif()
+	# determine unity target sources
+	set (_unityTargetSources "")
+	cotire_collect_unity_target_sources(${_target} "${_languages}" _unityTargetSources)
+	# prevent AUTOMOC, AUTOUIC and AUTORCC properties from being set when the unity target is created
+	set (CMAKE_AUTOMOC OFF)
+	set (CMAKE_AUTOUIC OFF)
+	set (CMAKE_AUTORCC OFF)
+	if (COTIRE_DEBUG)
+		message (STATUS "add target ${_targetType} ${_unityTargetName} ${_unityTargetSubType} EXCLUDE_FROM_ALL ${_unityTargetSources}")
+	endif()
+	# generate unity target
+	if ("${_targetType}" STREQUAL "EXECUTABLE")
+		add_executable(${_unityTargetName} ${_unityTargetSubType} EXCLUDE_FROM_ALL ${_unityTargetSources})
+	else()
+		add_library(${_unityTargetName} ${_unityTargetSubType} EXCLUDE_FROM_ALL ${_unityTargetSources})
+	endif()
+	# copy output location properties
+	set (_outputDirProperties
+		ARCHIVE_OUTPUT_DIRECTORY ARCHIVE_OUTPUT_DIRECTORY_<CONFIG>
+		LIBRARY_OUTPUT_DIRECTORY LIBRARY_OUTPUT_DIRECTORY_<CONFIG>
+		RUNTIME_OUTPUT_DIRECTORY RUNTIME_OUTPUT_DIRECTORY_<CONFIG>)
+	if (COTIRE_UNITY_OUTPUT_DIRECTORY)
+		set (_setDefaultOutputDir TRUE)
+		if (IS_ABSOLUTE "${COTIRE_UNITY_OUTPUT_DIRECTORY}")
+			set (_outputDir "${COTIRE_UNITY_OUTPUT_DIRECTORY}")
+		else()
+			# append relative COTIRE_UNITY_OUTPUT_DIRECTORY to target's actual output directory
+			cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName} ${_outputDirProperties})
+			cotire_resolve_config_properties("${_configurations}" _properties ${_outputDirProperties})
+			foreach (_property ${_properties})
+				get_property(_outputDir TARGET ${_target} PROPERTY ${_property})
+				if (_outputDir)
+					get_filename_component(_outputDir "${_outputDir}/${COTIRE_UNITY_OUTPUT_DIRECTORY}" ABSOLUTE)
+					set_property(TARGET ${_unityTargetName} PROPERTY ${_property} "${_outputDir}")
+					set (_setDefaultOutputDir FALSE)
+				endif()
+			endforeach()
+			if (_setDefaultOutputDir)
+				get_filename_component(_outputDir "${CMAKE_CURRENT_BINARY_DIR}/${COTIRE_UNITY_OUTPUT_DIRECTORY}" ABSOLUTE)
+			endif()
+		endif()
+		if (_setDefaultOutputDir)
+			set_target_properties(${_unityTargetName} PROPERTIES
+				ARCHIVE_OUTPUT_DIRECTORY "${_outputDir}"
+				LIBRARY_OUTPUT_DIRECTORY "${_outputDir}"
+				RUNTIME_OUTPUT_DIRECTORY "${_outputDir}")
+		endif()
+	else()
+		cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
+			${_outputDirProperties})
+	endif()
+	# copy output name
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
+		ARCHIVE_OUTPUT_NAME ARCHIVE_OUTPUT_NAME_<CONFIG>
+		LIBRARY_OUTPUT_NAME LIBRARY_OUTPUT_NAME_<CONFIG>
+		OUTPUT_NAME OUTPUT_NAME_<CONFIG>
+		RUNTIME_OUTPUT_NAME RUNTIME_OUTPUT_NAME_<CONFIG>
+		PREFIX <CONFIG>_POSTFIX SUFFIX
+		IMPORT_PREFIX IMPORT_SUFFIX)
+	# copy compile stuff
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
+		COMPILE_DEFINITIONS COMPILE_DEFINITIONS_<CONFIG>
+		COMPILE_FLAGS COMPILE_OPTIONS
+		Fortran_FORMAT Fortran_MODULE_DIRECTORY
+		INCLUDE_DIRECTORIES
+		INTERPROCEDURAL_OPTIMIZATION INTERPROCEDURAL_OPTIMIZATION_<CONFIG>
+		POSITION_INDEPENDENT_CODE
+		C_COMPILER_LAUNCHER CXX_COMPILER_LAUNCHER
+		C_INCLUDE_WHAT_YOU_USE CXX_INCLUDE_WHAT_YOU_USE
+		C_VISIBILITY_PRESET CXX_VISIBILITY_PRESET VISIBILITY_INLINES_HIDDEN
+		C_CLANG_TIDY CXX_CLANG_TIDY)
+	# copy compile features
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
+		C_EXTENSIONS C_STANDARD C_STANDARD_REQUIRED
+		CXX_EXTENSIONS CXX_STANDARD CXX_STANDARD_REQUIRED
+		COMPILE_FEATURES)
+	# copy interface stuff
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
+		COMPATIBLE_INTERFACE_BOOL COMPATIBLE_INTERFACE_NUMBER_MAX COMPATIBLE_INTERFACE_NUMBER_MIN
+		COMPATIBLE_INTERFACE_STRING
+		INTERFACE_COMPILE_DEFINITIONS INTERFACE_COMPILE_FEATURES INTERFACE_COMPILE_OPTIONS
+		INTERFACE_INCLUDE_DIRECTORIES INTERFACE_SOURCES
+		INTERFACE_POSITION_INDEPENDENT_CODE INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
+		INTERFACE_AUTOUIC_OPTIONS NO_SYSTEM_FROM_IMPORTED)
+	# copy link stuff
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
+		BUILD_WITH_INSTALL_RPATH BUILD_WITH_INSTALL_NAME_DIR
+		INSTALL_RPATH INSTALL_RPATH_USE_LINK_PATH SKIP_BUILD_RPATH
+		LINKER_LANGUAGE LINK_DEPENDS LINK_DEPENDS_NO_SHARED
+		LINK_FLAGS LINK_FLAGS_<CONFIG>
+		LINK_INTERFACE_LIBRARIES LINK_INTERFACE_LIBRARIES_<CONFIG>
+		LINK_INTERFACE_MULTIPLICITY LINK_INTERFACE_MULTIPLICITY_<CONFIG>
+		LINK_SEARCH_START_STATIC LINK_SEARCH_END_STATIC
+		STATIC_LIBRARY_FLAGS STATIC_LIBRARY_FLAGS_<CONFIG>
+		NO_SONAME SOVERSION VERSION
+		LINK_WHAT_YOU_USE BUILD_RPATH)
+	# copy cmake stuff
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
+		IMPLICIT_DEPENDS_INCLUDE_TRANSFORM RULE_LAUNCH_COMPILE RULE_LAUNCH_CUSTOM RULE_LAUNCH_LINK)
+	# copy Apple platform specific stuff
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
+		BUNDLE BUNDLE_EXTENSION FRAMEWORK FRAMEWORK_VERSION INSTALL_NAME_DIR
+		MACOSX_BUNDLE MACOSX_BUNDLE_INFO_PLIST MACOSX_FRAMEWORK_INFO_PLIST MACOSX_RPATH
+		OSX_ARCHITECTURES OSX_ARCHITECTURES_<CONFIG> PRIVATE_HEADER PUBLIC_HEADER RESOURCE XCTEST
+		IOS_INSTALL_COMBINED XCODE_EXPLICIT_FILE_TYPE XCODE_PRODUCT_TYPE)
+	# copy Windows platform specific stuff
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
+		GNUtoMS
+		COMPILE_PDB_NAME COMPILE_PDB_NAME_<CONFIG>
+		COMPILE_PDB_OUTPUT_DIRECTORY COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>
+		PDB_NAME PDB_NAME_<CONFIG> PDB_OUTPUT_DIRECTORY PDB_OUTPUT_DIRECTORY_<CONFIG>
+		VS_DESKTOP_EXTENSIONS_VERSION VS_DOTNET_REFERENCES VS_DOTNET_TARGET_FRAMEWORK_VERSION
+		VS_GLOBAL_KEYWORD VS_GLOBAL_PROJECT_TYPES VS_GLOBAL_ROOTNAMESPACE
+		VS_IOT_EXTENSIONS_VERSION VS_IOT_STARTUP_TASK
+		VS_KEYWORD VS_MOBILE_EXTENSIONS_VERSION
+		VS_SCC_AUXPATH VS_SCC_LOCALPATH VS_SCC_PROJECTNAME VS_SCC_PROVIDER
+		VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION
+		VS_WINRT_COMPONENT VS_WINRT_EXTENSIONS VS_WINRT_REFERENCES
+		WIN32_EXECUTABLE WINDOWS_EXPORT_ALL_SYMBOLS
+		DEPLOYMENT_REMOTE_DIRECTORY VS_CONFIGURATION_TYPE
+		VS_SDK_REFERENCES VS_USER_PROPS VS_DEBUGGER_WORKING_DIRECTORY)
+	# copy Android platform specific stuff
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
+		ANDROID_API ANDROID_API_MIN ANDROID_GUI
+		ANDROID_ANT_ADDITIONAL_OPTIONS ANDROID_ARCH ANDROID_ASSETS_DIRECTORIES
+		ANDROID_JAR_DEPENDENCIES ANDROID_JAR_DIRECTORIES ANDROID_JAVA_SOURCE_DIR
+		ANDROID_NATIVE_LIB_DEPENDENCIES ANDROID_NATIVE_LIB_DIRECTORIES
+		ANDROID_PROCESS_MAX ANDROID_PROGUARD ANDROID_PROGUARD_CONFIG_PATH
+		ANDROID_SECURE_PROPS_PATH ANDROID_SKIP_ANT_STEP ANDROID_STL_TYPE)
+	# copy CUDA platform specific stuff
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
+		CUDA_PTX_COMPILATION CUDA_SEPARABLE_COMPILATION CUDA_RESOLVE_DEVICE_SYMBOLS
+		CUDA_EXTENSIONS CUDA_STANDARD CUDA_STANDARD_REQUIRED)
+	# use output name from original target
+	get_target_property(_targetOutputName ${_unityTargetName} OUTPUT_NAME)
+	if (NOT _targetOutputName)
+		set_property(TARGET ${_unityTargetName} PROPERTY OUTPUT_NAME "${_target}")
+	endif()
+	# use export symbol from original target
+	cotire_get_target_export_symbol("${_target}" _defineSymbol)
+	if (_defineSymbol)
+		set_property(TARGET ${_unityTargetName} PROPERTY DEFINE_SYMBOL "${_defineSymbol}")
+		if ("${_targetType}" STREQUAL "EXECUTABLE")
+			set_property(TARGET ${_unityTargetName} PROPERTY ENABLE_EXPORTS TRUE)
+		endif()
+	endif()
+	# enable parallel compilation for MSVC
+	if (MSVC AND "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
+		list (LENGTH _unityTargetSources _numberOfUnityTargetSources)
+		if (_numberOfUnityTargetSources GREATER 1)
+			set_property(TARGET ${_unityTargetName} APPEND PROPERTY COMPILE_OPTIONS "/MP")
+		endif()
+	endif()
+	cotire_init_target(${_unityTargetName})
+	cotire_add_to_unity_all_target(${_unityTargetName})
+	set_property(TARGET ${_target} PROPERTY COTIRE_UNITY_TARGET_NAME "${_unityTargetName}")
+endfunction(cotire_setup_unity_build_target)
+
+function (cotire_target _target)
+	set(_options "")
+	set(_oneValueArgs "")
+	set(_multiValueArgs LANGUAGES CONFIGURATIONS)
+	cmake_parse_arguments(_option "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
+	if (NOT _option_LANGUAGES)
+		get_property (_option_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
+	endif()
+	if (NOT _option_CONFIGURATIONS)
+		cotire_get_configuration_types(_option_CONFIGURATIONS)
+	endif()
+	# check if cotire can be applied to target at all
+	cotire_is_target_supported(${_target} _isSupported)
+	if (NOT _isSupported)
+		get_target_property(_imported ${_target} IMPORTED)
+		get_target_property(_targetType ${_target} TYPE)
+		if (_imported)
+			message (WARNING "cotire: imported ${_targetType} target ${_target} cannot be cotired.")
+		else()
+			message (STATUS "cotire: ${_targetType} target ${_target} cannot be cotired.")
+		endif()
+		return()
+	endif()
+	# resolve alias
+	get_target_property(_aliasName ${_target} ALIASED_TARGET)
+	if (_aliasName)
+		if (COTIRE_DEBUG)
+			message (STATUS "${_target} is an alias. Applying cotire to aliased target ${_aliasName} instead.")
+		endif()
+		set (_target ${_aliasName})
+	endif()
+	# check if target needs to be cotired for build type
+	# when using configuration types, the test is performed at build time
+	cotire_init_cotire_target_properties(${_target})
+	if (NOT CMAKE_CONFIGURATION_TYPES)
+		if (CMAKE_BUILD_TYPE)
+			list (FIND _option_CONFIGURATIONS "${CMAKE_BUILD_TYPE}" _index)
+		else()
+			list (FIND _option_CONFIGURATIONS "None" _index)
+		endif()
+		if (_index EQUAL -1)
+			if (COTIRE_DEBUG)
+				message (STATUS "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} not cotired (${_option_CONFIGURATIONS})")
+			endif()
+			return()
+		endif()
+	endif()
+	# when not using configuration types, immediately create cotire intermediate dir
+	if (NOT CMAKE_CONFIGURATION_TYPES)
+		cotire_get_intermediate_dir(_baseDir)
+		file (MAKE_DIRECTORY "${_baseDir}")
+	endif()
+	# choose languages that apply to the target
+	cotire_choose_target_languages("${_target}" _targetLanguages _wholeTarget ${_option_LANGUAGES})
+	if (NOT _targetLanguages)
+		return()
+	endif()
+	set (_cmds "")
+	foreach (_language ${_targetLanguages})
+		cotire_process_target_language("${_language}" "${_option_CONFIGURATIONS}" ${_target} ${_wholeTarget} _cmd)
+		if (_cmd)
+			list (APPEND _cmds ${_cmd})
+		endif()
+	endforeach()
+	get_target_property(_targetAddSCU ${_target} COTIRE_ADD_UNITY_BUILD)
+	if (_targetAddSCU)
+		cotire_setup_unity_build_target("${_targetLanguages}" "${_option_CONFIGURATIONS}" ${_target})
+	endif()
+	get_target_property(_targetUsePCH ${_target} COTIRE_ENABLE_PRECOMPILED_HEADER)
+	if (_targetUsePCH)
+		cotire_setup_target_pch_usage("${_targetLanguages}" ${_target} ${_wholeTarget} ${_cmds})
+		cotire_setup_pch_target("${_targetLanguages}" "${_option_CONFIGURATIONS}" ${_target})
+		if (_targetAddSCU)
+			cotire_setup_unity_target_pch_usage("${_targetLanguages}" ${_target})
+		endif()
+	endif()
+	get_target_property(_targetAddCleanTarget ${_target} COTIRE_ADD_CLEAN)
+	if (_targetAddCleanTarget)
+		cotire_setup_clean_target(${_target})
+	endif()
+endfunction(cotire_target)
+
+function (cotire_map_libraries _strategy _mappedLibrariesVar)
+	set (_mappedLibraries "")
+	foreach (_library ${ARGN})
+		if (_library MATCHES "^\\$<LINK_ONLY:(.+)>$")
+			set (_libraryName "${CMAKE_MATCH_1}")
+			set (_linkOnly TRUE)
+			set (_objectLibrary FALSE)
+		elseif (_library MATCHES "^\\$<TARGET_OBJECTS:(.+)>$")
+			set (_libraryName "${CMAKE_MATCH_1}")
+			set (_linkOnly FALSE)
+			set (_objectLibrary TRUE)
+		else()
+			set (_libraryName "${_library}")
+			set (_linkOnly FALSE)
+			set (_objectLibrary FALSE)
+		endif()
+		if ("${_strategy}" MATCHES "COPY_UNITY")
+			cotire_is_target_supported(${_libraryName} _isSupported)
+			if (_isSupported)
+				# use target's corresponding unity target, if available
+				get_target_property(_libraryUnityTargetName ${_libraryName} COTIRE_UNITY_TARGET_NAME)
+				if (TARGET "${_libraryUnityTargetName}")
+					if (_linkOnly)
+						list (APPEND _mappedLibraries "$<LINK_ONLY:${_libraryUnityTargetName}>")
+					elseif (_objectLibrary)
+						list (APPEND _mappedLibraries "$<TARGET_OBJECTS:${_libraryUnityTargetName}>")
+					else()
+						list (APPEND _mappedLibraries "${_libraryUnityTargetName}")
+					endif()
+				else()
+					list (APPEND _mappedLibraries "${_library}")
+				endif()
+			else()
+				list (APPEND _mappedLibraries "${_library}")
+			endif()
+		else()
+			list (APPEND _mappedLibraries "${_library}")
+		endif()
+	endforeach()
+	list (REMOVE_DUPLICATES _mappedLibraries)
+	set (${_mappedLibrariesVar} ${_mappedLibraries} PARENT_SCOPE)
+endfunction()
+
+function (cotire_target_link_libraries _target)
+	cotire_is_target_supported(${_target} _isSupported)
+	if (NOT _isSupported)
+		return()
+	endif()
+	get_target_property(_unityTargetName ${_target} COTIRE_UNITY_TARGET_NAME)
+	if (TARGET "${_unityTargetName}")
+		get_target_property(_linkLibrariesStrategy ${_target} COTIRE_UNITY_LINK_LIBRARIES_INIT)
+		if (COTIRE_DEBUG)
+			message (STATUS "unity target ${_unityTargetName} link strategy: ${_linkLibrariesStrategy}")
+		endif()
+		if ("${_linkLibrariesStrategy}" MATCHES "^(COPY|COPY_UNITY)$")
+			get_target_property(_linkLibraries ${_target} LINK_LIBRARIES)
+			if (_linkLibraries)
+				cotire_map_libraries("${_linkLibrariesStrategy}" _unityLinkLibraries ${_linkLibraries})
+				set_target_properties(${_unityTargetName} PROPERTIES LINK_LIBRARIES "${_unityLinkLibraries}")
+				if (COTIRE_DEBUG)
+					message (STATUS "unity target ${_unityTargetName} link libraries: ${_unityLinkLibraries}")
+				endif()
+			endif()
+			get_target_property(_interfaceLinkLibraries ${_target} INTERFACE_LINK_LIBRARIES)
+			if (_interfaceLinkLibraries)
+				cotire_map_libraries("${_linkLibrariesStrategy}" _unityLinkInterfaceLibraries ${_interfaceLinkLibraries})
+				set_target_properties(${_unityTargetName} PROPERTIES INTERFACE_LINK_LIBRARIES "${_unityLinkInterfaceLibraries}")
+				if (COTIRE_DEBUG)
+					message (STATUS "unity target ${_unityTargetName} interface link libraries: ${_unityLinkInterfaceLibraries}")
+				endif()
+			endif()
+			get_target_property(_manualDependencies ${_target} MANUALLY_ADDED_DEPENDENCIES)
+			if (_manualDependencies)
+				cotire_map_libraries("${_linkLibrariesStrategy}" _unityManualDependencies ${_manualDependencies})
+				if (_unityManualDependencies)
+					add_dependencies("${_unityTargetName}" ${_unityManualDependencies})
+				endif()
+			endif()
+		endif()
+	endif()
+endfunction(cotire_target_link_libraries)
+
+function (cotire_cleanup _binaryDir _cotireIntermediateDirName _targetName)
+	if (_targetName)
+		file (GLOB_RECURSE _cotireFiles "${_binaryDir}/${_targetName}*.*")
+	else()
+		file (GLOB_RECURSE _cotireFiles "${_binaryDir}/*.*")
+	endif()
+	# filter files in intermediate directory
+	set (_filesToRemove "")
+	foreach (_file ${_cotireFiles})
+		get_filename_component(_dir "${_file}" DIRECTORY)
+		get_filename_component(_dirName "${_dir}" NAME)
+		if ("${_dirName}" STREQUAL "${_cotireIntermediateDirName}")
+			list (APPEND _filesToRemove "${_file}")
+		endif()
+	endforeach()
+	if (_filesToRemove)
+		if (COTIRE_VERBOSE)
+			message (STATUS "cleaning up ${_filesToRemove}")
+		endif()
+		file (REMOVE ${_filesToRemove})
+	endif()
+endfunction()
+
+function (cotire_init_target _targetName)
+	if (COTIRE_TARGETS_FOLDER)
+		set_target_properties(${_targetName} PROPERTIES FOLDER "${COTIRE_TARGETS_FOLDER}")
+	endif()
+	set_target_properties(${_targetName} PROPERTIES EXCLUDE_FROM_ALL TRUE)
+	if (MSVC_IDE)
+		set_target_properties(${_targetName} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
+	endif()
+endfunction()
+
+function (cotire_add_to_pch_all_target _pchTargetName)
+	set (_targetName "${COTIRE_PCH_ALL_TARGET_NAME}")
+	if (NOT TARGET "${_targetName}")
+		add_custom_target("${_targetName}"
+			WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+			VERBATIM)
+		cotire_init_target("${_targetName}")
+	endif()
+	cotire_setup_clean_all_target()
+	add_dependencies(${_targetName} ${_pchTargetName})
+endfunction()
+
+function (cotire_add_to_unity_all_target _unityTargetName)
+	set (_targetName "${COTIRE_UNITY_BUILD_ALL_TARGET_NAME}")
+	if (NOT TARGET "${_targetName}")
+		add_custom_target("${_targetName}"
+			WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+			VERBATIM)
+		cotire_init_target("${_targetName}")
+	endif()
+	cotire_setup_clean_all_target()
+	add_dependencies(${_targetName} ${_unityTargetName})
+endfunction()
+
+function (cotire_setup_clean_all_target)
+	set (_targetName "${COTIRE_CLEAN_ALL_TARGET_NAME}")
+	if (NOT TARGET "${_targetName}")
+		cotire_set_cmd_to_prologue(_cmds)
+		list (APPEND _cmds -P "${COTIRE_CMAKE_MODULE_FILE}" "cleanup" "${CMAKE_BINARY_DIR}" "${COTIRE_INTDIR}")
+		add_custom_target(${_targetName}
+			COMMAND ${_cmds}
+			WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+			COMMENT "Cleaning up all cotire generated files"
+			VERBATIM)
+		cotire_init_target("${_targetName}")
+	endif()
+endfunction()
+
+function (cotire)
+	set(_options "")
+	set(_oneValueArgs "")
+	set(_multiValueArgs LANGUAGES CONFIGURATIONS)
+	cmake_parse_arguments(_option "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
+	set (_targets ${_option_UNPARSED_ARGUMENTS})
+	foreach (_target ${_targets})
+		if (TARGET ${_target})
+			cotire_target(${_target} LANGUAGES ${_option_LANGUAGES} CONFIGURATIONS ${_option_CONFIGURATIONS})
+		else()
+			message (WARNING "cotire: ${_target} is not a target.")
+		endif()
+	endforeach()
+	foreach (_target ${_targets})
+		if (TARGET ${_target})
+			cotire_target_link_libraries(${_target})
+		endif()
+	endforeach()
+endfunction()
+
+if (CMAKE_SCRIPT_MODE_FILE)
+
+	# cotire is being run in script mode
+	# locate -P on command args
+	set (COTIRE_ARGC -1)
+	foreach (_index RANGE ${CMAKE_ARGC})
+		if (COTIRE_ARGC GREATER -1)
+			set (COTIRE_ARGV${COTIRE_ARGC} "${CMAKE_ARGV${_index}}")
+			math (EXPR COTIRE_ARGC "${COTIRE_ARGC} + 1")
+		elseif ("${CMAKE_ARGV${_index}}" STREQUAL "-P")
+			set (COTIRE_ARGC 0)
+		endif()
+	endforeach()
+
+	# include target script if available
+	if ("${COTIRE_ARGV2}" MATCHES "\\.cmake$")
+		# the included target scripts sets up additional variables relating to the target (e.g., COTIRE_TARGET_SOURCES)
+		include("${COTIRE_ARGV2}")
+	endif()
+
+	if (COTIRE_DEBUG)
+		message (STATUS "${COTIRE_ARGV0} ${COTIRE_ARGV1} ${COTIRE_ARGV2} ${COTIRE_ARGV3} ${COTIRE_ARGV4} ${COTIRE_ARGV5}")
+	endif()
+
+	if (NOT COTIRE_BUILD_TYPE)
+		set (COTIRE_BUILD_TYPE "None")
+	endif()
+	string (TOUPPER "${COTIRE_BUILD_TYPE}" _upperConfig)
+	set (_includeDirs ${COTIRE_TARGET_INCLUDE_DIRECTORIES_${_upperConfig}})
+	set (_systemIncludeDirs ${COTIRE_TARGET_SYSTEM_INCLUDE_DIRECTORIES_${_upperConfig}})
+	set (_compileDefinitions ${COTIRE_TARGET_COMPILE_DEFINITIONS_${_upperConfig}})
+	set (_compileFlags ${COTIRE_TARGET_COMPILE_FLAGS_${_upperConfig}})
+	# check if target has been cotired for actual build type COTIRE_BUILD_TYPE
+	list (FIND COTIRE_TARGET_CONFIGURATION_TYPES "${COTIRE_BUILD_TYPE}" _index)
+	if (_index GREATER -1)
+		set (_sources ${COTIRE_TARGET_SOURCES})
+		set (_sourcesDefinitions ${COTIRE_TARGET_SOURCES_COMPILE_DEFINITIONS_${_upperConfig}})
+	else()
+		if (COTIRE_DEBUG)
+			message (STATUS "COTIRE_BUILD_TYPE=${COTIRE_BUILD_TYPE} not cotired (${COTIRE_TARGET_CONFIGURATION_TYPES})")
+		endif()
+		set (_sources "")
+		set (_sourcesDefinitions "")
+	endif()
+	set (_targetPreUndefs ${COTIRE_TARGET_PRE_UNDEFS})
+	set (_targetPostUndefs ${COTIRE_TARGET_POST_UNDEFS})
+	set (_sourcesPreUndefs ${COTIRE_TARGET_SOURCES_PRE_UNDEFS})
+	set (_sourcesPostUndefs ${COTIRE_TARGET_SOURCES_POST_UNDEFS})
+
+	if ("${COTIRE_ARGV1}" STREQUAL "unity")
+
+		if (XCODE)
+			# executing pre-build action under Xcode, check dependency on target script
+			set (_dependsOption DEPENDS "${COTIRE_ARGV2}")
+		else()
+			# executing custom command, no need to re-check for dependencies
+			set (_dependsOption "")
+		endif()
+
+		cotire_select_unity_source_files("${COTIRE_ARGV3}" _sources ${_sources})
+
+		cotire_generate_unity_source(
+			"${COTIRE_ARGV3}" ${_sources}
+			LANGUAGE "${COTIRE_TARGET_LANGUAGE}"
+			SOURCES_COMPILE_DEFINITIONS ${_sourcesDefinitions}
+			PRE_UNDEFS ${_targetPreUndefs}
+			POST_UNDEFS ${_targetPostUndefs}
+			SOURCES_PRE_UNDEFS ${_sourcesPreUndefs}
+			SOURCES_POST_UNDEFS ${_sourcesPostUndefs}
+			${_dependsOption})
+
+	elseif ("${COTIRE_ARGV1}" STREQUAL "prefix")
+
+		if (XCODE)
+			# executing pre-build action under Xcode, check dependency on unity file and prefix dependencies
+			set (_dependsOption DEPENDS "${COTIRE_ARGV4}" ${COTIRE_TARGET_PREFIX_DEPENDS})
+		else()
+			# executing custom command, no need to re-check for dependencies
+			set (_dependsOption "")
+		endif()
+
+		set (_files "")
+		foreach (_index RANGE 4 ${COTIRE_ARGC})
+			if (COTIRE_ARGV${_index})
+				list (APPEND _files "${COTIRE_ARGV${_index}}")
+			endif()
+		endforeach()
+
+		cotire_generate_prefix_header(
+			"${COTIRE_ARGV3}" ${_files}
+			COMPILER_LAUNCHER "${COTIRE_TARGET_${COTIRE_TARGET_LANGUAGE}_COMPILER_LAUNCHER}"
+			COMPILER_EXECUTABLE "${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER}"
+			COMPILER_ARG1 ${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER_ARG1}
+			COMPILER_ID "${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER_ID}"
+			COMPILER_VERSION "${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER_VERSION}"
+			LANGUAGE "${COTIRE_TARGET_LANGUAGE}"
+			IGNORE_PATH "${COTIRE_TARGET_IGNORE_PATH};${COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_PATH}"
+			INCLUDE_PATH ${COTIRE_TARGET_INCLUDE_PATH}
+			IGNORE_EXTENSIONS "${CMAKE_${COTIRE_TARGET_LANGUAGE}_SOURCE_FILE_EXTENSIONS};${COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_EXTENSIONS}"
+			INCLUDE_PRIORITY_PATH ${COTIRE_TARGET_INCLUDE_PRIORITY_PATH}
+			INCLUDE_DIRECTORIES ${_includeDirs}
+			SYSTEM_INCLUDE_DIRECTORIES ${_systemIncludeDirs}
+			COMPILE_DEFINITIONS ${_compileDefinitions}
+			COMPILE_FLAGS ${_compileFlags}
+			${_dependsOption})
+
+	elseif ("${COTIRE_ARGV1}" STREQUAL "precompile")
+
+		set (_files "")
+		foreach (_index RANGE 5 ${COTIRE_ARGC})
+			if (COTIRE_ARGV${_index})
+				list (APPEND _files "${COTIRE_ARGV${_index}}")
+			endif()
+		endforeach()
+
+		cotire_precompile_prefix_header(
+			"${COTIRE_ARGV3}" "${COTIRE_ARGV4}" "${COTIRE_ARGV5}"
+			COMPILER_LAUNCHER "${COTIRE_TARGET_${COTIRE_TARGET_LANGUAGE}_COMPILER_LAUNCHER}"
+			COMPILER_EXECUTABLE "${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER}"
+			COMPILER_ARG1 ${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER_ARG1}
+			COMPILER_ID "${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER_ID}"
+			COMPILER_VERSION "${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER_VERSION}"
+			LANGUAGE "${COTIRE_TARGET_LANGUAGE}"
+			INCLUDE_DIRECTORIES ${_includeDirs}
+			SYSTEM_INCLUDE_DIRECTORIES ${_systemIncludeDirs}
+			COMPILE_DEFINITIONS ${_compileDefinitions}
+			COMPILE_FLAGS ${_compileFlags})
+
+	elseif ("${COTIRE_ARGV1}" STREQUAL "combine")
+
+		if (COTIRE_TARGET_LANGUAGE)
+			set (_combinedFile "${COTIRE_ARGV3}")
+			set (_startIndex 4)
+		else()
+			set (_combinedFile "${COTIRE_ARGV2}")
+			set (_startIndex 3)
+		endif()
+		set (_files "")
+		foreach (_index RANGE ${_startIndex} ${COTIRE_ARGC})
+			if (COTIRE_ARGV${_index})
+				list (APPEND _files "${COTIRE_ARGV${_index}}")
+			endif()
+		endforeach()
+
+		if (XCODE)
+			# executing pre-build action under Xcode, check dependency on files to be combined
+			set (_dependsOption DEPENDS ${_files})
+		else()
+			# executing custom command, no need to re-check for dependencies
+			set (_dependsOption "")
+		endif()
+
+		if (COTIRE_TARGET_LANGUAGE)
+			cotire_generate_unity_source(
+				"${_combinedFile}" ${_files}
+				LANGUAGE "${COTIRE_TARGET_LANGUAGE}"
+				${_dependsOption})
+		else()
+			cotire_generate_unity_source("${_combinedFile}" ${_files} ${_dependsOption})
+		endif()
+
+	elseif ("${COTIRE_ARGV1}" STREQUAL "cleanup")
+
+		cotire_cleanup("${COTIRE_ARGV2}" "${COTIRE_ARGV3}" "${COTIRE_ARGV4}")
+
+	else()
+		message (FATAL_ERROR "cotire: unknown command \"${COTIRE_ARGV1}\".")
+	endif()
+
+else()
+
+	# cotire is being run in include mode
+	# set up all variable and property definitions
+
+	if (NOT DEFINED COTIRE_DEBUG_INIT)
+		if (DEFINED COTIRE_DEBUG)
+			set (COTIRE_DEBUG_INIT ${COTIRE_DEBUG})
+		else()
+			set (COTIRE_DEBUG_INIT FALSE)
+		endif()
+	endif()
+	option (COTIRE_DEBUG "Enable cotire debugging output?" ${COTIRE_DEBUG_INIT})
+
+	if (NOT DEFINED COTIRE_VERBOSE_INIT)
+		if (DEFINED COTIRE_VERBOSE)
+			set (COTIRE_VERBOSE_INIT ${COTIRE_VERBOSE})
+		else()
+			set (COTIRE_VERBOSE_INIT FALSE)
+		endif()
+	endif()
+	option (COTIRE_VERBOSE "Enable cotire verbose output?" ${COTIRE_VERBOSE_INIT})
+
+	set (COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_EXTENSIONS "inc;inl;ipp" CACHE STRING
+		"Ignore headers with the listed file extensions from the generated prefix header.")
+
+	set (COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_PATH "" CACHE STRING
+		"Ignore headers from these directories when generating the prefix header.")
+
+	set (COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS "m;mm" CACHE STRING
+		"Ignore sources with the listed file extensions from the generated unity source.")
+
+	set (COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES "2" CACHE STRING
+		"Minimum number of sources in target required to enable use of precompiled header.")
+
+	if (NOT DEFINED COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES_INIT)
+		if (DEFINED COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES)
+			set (COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES_INIT ${COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES})
+		elseif ("${CMAKE_GENERATOR}" MATCHES "JOM|Ninja|Visual Studio")
+			# enable parallelization for generators that run multiple jobs by default
+			set (COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES_INIT "-j")
+		else()
+			set (COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES_INIT "0")
+		endif()
+	endif()
+	set (COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES "${COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES_INIT}" CACHE STRING
+		"Maximum number of source files to include in a single unity source file.")
+
+	if (NOT COTIRE_PREFIX_HEADER_FILENAME_SUFFIX)
+		set (COTIRE_PREFIX_HEADER_FILENAME_SUFFIX "_prefix")
+	endif()
+	if (NOT COTIRE_UNITY_SOURCE_FILENAME_SUFFIX)
+		set (COTIRE_UNITY_SOURCE_FILENAME_SUFFIX "_unity")
+	endif()
+	if (NOT COTIRE_INTDIR)
+		set (COTIRE_INTDIR "cotire")
+	endif()
+	if (NOT COTIRE_PCH_ALL_TARGET_NAME)
+		set (COTIRE_PCH_ALL_TARGET_NAME "all_pch")
+	endif()
+	if (NOT COTIRE_UNITY_BUILD_ALL_TARGET_NAME)
+		set (COTIRE_UNITY_BUILD_ALL_TARGET_NAME "all_unity")
+	endif()
+	if (NOT COTIRE_CLEAN_ALL_TARGET_NAME)
+		set (COTIRE_CLEAN_ALL_TARGET_NAME "clean_cotire")
+	endif()
+	if (NOT COTIRE_CLEAN_TARGET_SUFFIX)
+		set (COTIRE_CLEAN_TARGET_SUFFIX "_clean_cotire")
+	endif()
+	if (NOT COTIRE_PCH_TARGET_SUFFIX)
+		set (COTIRE_PCH_TARGET_SUFFIX "_pch")
+	endif()
+	if (MSVC)
+		# MSVC default PCH memory scaling factor of 100 percent (75 MB) is too small for template heavy C++ code
+		# use a bigger default factor of 170 percent (128 MB)
+		if (NOT DEFINED COTIRE_PCH_MEMORY_SCALING_FACTOR)
+			set (COTIRE_PCH_MEMORY_SCALING_FACTOR "170")
+		endif()
+	endif()
+	if (NOT COTIRE_UNITY_BUILD_TARGET_SUFFIX)
+		set (COTIRE_UNITY_BUILD_TARGET_SUFFIX "_unity")
+	endif()
+	if (NOT DEFINED COTIRE_TARGETS_FOLDER)
+		set (COTIRE_TARGETS_FOLDER "cotire")
+	endif()
+	if (NOT DEFINED COTIRE_UNITY_OUTPUT_DIRECTORY)
+		if ("${CMAKE_GENERATOR}" MATCHES "Ninja")
+			# generated Ninja build files do not work if the unity target produces the same output file as the cotired target
+			set (COTIRE_UNITY_OUTPUT_DIRECTORY "unity")
+		else()
+			set (COTIRE_UNITY_OUTPUT_DIRECTORY "")
+		endif()
+	endif()
+
+	# define cotire cache variables
+
+	define_property(
+		CACHED_VARIABLE PROPERTY "COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_PATH"
+		BRIEF_DOCS "Ignore headers from these directories when generating the prefix header."
+		FULL_DOCS
+			"The variable can be set to a semicolon separated list of include directories."
+			"If a header file is found in one of these directories or sub-directories, it will be excluded from the generated prefix header."
+			"If not defined, defaults to empty list."
+	)
+
+	define_property(
+		CACHED_VARIABLE PROPERTY "COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_EXTENSIONS"
+		BRIEF_DOCS "Ignore includes with the listed file extensions from the generated prefix header."
+		FULL_DOCS
+			"The variable can be set to a semicolon separated list of file extensions."
+			"If a header file extension matches one in the list, it will be excluded from the generated prefix header."
+			"Includes with an extension in CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS are always ignored."
+			"If not defined, defaults to inc;inl;ipp."
+	)
+
+	define_property(
+		CACHED_VARIABLE PROPERTY "COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS"
+		BRIEF_DOCS "Exclude sources with the listed file extensions from the generated unity source."
+		FULL_DOCS
+			"The variable can be set to a semicolon separated list of file extensions."
+			"If a source file extension matches one in the list, it will be excluded from the generated unity source file."
+			"Source files with an extension in CMAKE_<LANG>_IGNORE_EXTENSIONS are always excluded."
+			"If not defined, defaults to m;mm."
+	)
+
+	define_property(
+		CACHED_VARIABLE PROPERTY "COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES"
+		BRIEF_DOCS "Minimum number of sources in target required to enable use of precompiled header."
+		FULL_DOCS
+			"The variable can be set to an integer > 0."
+			"If a target contains less than that number of source files, cotire will not enable the use of the precompiled header for the target."
+			"If not defined, defaults to 2."
+	)
+
+	define_property(
+		CACHED_VARIABLE PROPERTY "COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES"
+		BRIEF_DOCS "Maximum number of source files to include in a single unity source file."
+		FULL_DOCS
+			"This may be set to an integer >= 0."
+			"If 0, cotire will only create a single unity source file."
+			"If a target contains more than that number of source files, cotire will create multiple unity source files for it."
+			"Can be set to \"-j\" to optimize the count of unity source files for the number of available processor cores."
+			"Can be set to \"-j jobs\" to optimize the number of unity source files for the given number of simultaneous jobs."
+			"Is used to initialize the target property COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES."
+			"Defaults to \"-j\" for the generators Visual Studio, JOM or Ninja. Defaults to 0 otherwise."
+	)
+
+	# define cotire directory properties
+
+	define_property(
+		DIRECTORY PROPERTY "COTIRE_ENABLE_PRECOMPILED_HEADER"
+		BRIEF_DOCS "Modify build command of cotired targets added in this directory to make use of the generated precompiled header."
+		FULL_DOCS
+			"See target property COTIRE_ENABLE_PRECOMPILED_HEADER."
+	)
+
+	define_property(
+		DIRECTORY PROPERTY "COTIRE_ADD_UNITY_BUILD"
+		BRIEF_DOCS "Add a new target that performs a unity build for cotired targets added in this directory."
+		FULL_DOCS
+			"See target property COTIRE_ADD_UNITY_BUILD."
+	)
+
+	define_property(
+		DIRECTORY PROPERTY "COTIRE_ADD_CLEAN"
+		BRIEF_DOCS "Add a new target that cleans all cotire generated files for cotired targets added in this directory."
+		FULL_DOCS
+			"See target property COTIRE_ADD_CLEAN."
+	)
+
+	define_property(
+		DIRECTORY PROPERTY "COTIRE_PREFIX_HEADER_IGNORE_PATH"
+		BRIEF_DOCS "Ignore headers from these directories when generating the prefix header."
+		FULL_DOCS
+			"See target property COTIRE_PREFIX_HEADER_IGNORE_PATH."
+	)
+
+	define_property(
+		DIRECTORY PROPERTY "COTIRE_PREFIX_HEADER_INCLUDE_PATH"
+		BRIEF_DOCS "Honor headers from these directories when generating the prefix header."
+		FULL_DOCS
+			"See target property COTIRE_PREFIX_HEADER_INCLUDE_PATH."
+	)
+
+	define_property(
+		DIRECTORY PROPERTY "COTIRE_PREFIX_HEADER_INCLUDE_PRIORITY_PATH"
+		BRIEF_DOCS "Header paths matching one of these directories are put at the top of the prefix header."
+		FULL_DOCS
+			"See target property COTIRE_PREFIX_HEADER_INCLUDE_PRIORITY_PATH."
+	)
+
+	define_property(
+		DIRECTORY PROPERTY "COTIRE_UNITY_SOURCE_PRE_UNDEFS"
+		BRIEF_DOCS "Preprocessor undefs to place in the generated unity source file before the inclusion of each source file."
+		FULL_DOCS
+			"See target property COTIRE_UNITY_SOURCE_PRE_UNDEFS."
+	)
+
+	define_property(
+		DIRECTORY PROPERTY "COTIRE_UNITY_SOURCE_POST_UNDEFS"
+		BRIEF_DOCS "Preprocessor undefs to place in the generated unity source file after the inclusion of each source file."
+		FULL_DOCS
+			"See target property COTIRE_UNITY_SOURCE_POST_UNDEFS."
+	)
+
+	define_property(
+		DIRECTORY PROPERTY "COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES"
+		BRIEF_DOCS "Maximum number of source files to include in a single unity source file."
+		FULL_DOCS
+			"See target property COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES."
+	)
+
+	define_property(
+		DIRECTORY PROPERTY "COTIRE_UNITY_LINK_LIBRARIES_INIT"
+		BRIEF_DOCS "Define strategy for setting up the unity target's link libraries."
+		FULL_DOCS
+			"See target property COTIRE_UNITY_LINK_LIBRARIES_INIT."
+	)
+
+	# define cotire target properties
+
+	define_property(
+		TARGET PROPERTY "COTIRE_ENABLE_PRECOMPILED_HEADER" INHERITED
+		BRIEF_DOCS "Modify this target's build command to make use of the generated precompiled header."
+		FULL_DOCS
+			"If this property is set to TRUE, cotire will modify the build command to make use of the generated precompiled header."
+			"Irrespective of the value of this property, cotire will setup custom commands to generate the unity source and prefix header for the target."
+			"For makefile based generators cotire will also set up a custom target to manually invoke the generation of the precompiled header."
+			"The target name will be set to this target's name with the suffix _pch appended."
+			"Inherited from directory."
+			"Defaults to TRUE."
+	)
+
+	define_property(
+		TARGET PROPERTY "COTIRE_ADD_UNITY_BUILD" INHERITED
+		BRIEF_DOCS "Add a new target that performs a unity build for this target."
+		FULL_DOCS
+			"If this property is set to TRUE, cotire creates a new target of the same type that uses the generated unity source file instead of the target sources."
+			"Most of the relevant target properties will be copied from this target to the new unity build target."
+			"Target dependencies and linked libraries have to be manually set up for the new unity build target."
+			"The unity target name will be set to this target's name with the suffix _unity appended."
+			"Inherited from directory."
+			"Defaults to TRUE."
+	)
+
+	define_property(
+		TARGET PROPERTY "COTIRE_ADD_CLEAN" INHERITED
+		BRIEF_DOCS "Add a new target that cleans all cotire generated files for this target."
+		FULL_DOCS
+			"If this property is set to TRUE, cotire creates a new target that clean all files (unity source, prefix header, precompiled header)."
+			"The clean target name will be set to this target's name with the suffix _clean_cotire appended."
+			"Inherited from directory."
+			"Defaults to FALSE."
+	)
+
+	define_property(
+		TARGET PROPERTY "COTIRE_PREFIX_HEADER_IGNORE_PATH" INHERITED
+		BRIEF_DOCS "Ignore headers from these directories when generating the prefix header."
+		FULL_DOCS
+			"The property can be set to a list of directories."
+			"If a header file is found in one of these directories or sub-directories, it will be excluded from the generated prefix header."
+			"Inherited from directory."
+			"If not set, this property is initialized to \${CMAKE_SOURCE_DIR};\${CMAKE_BINARY_DIR}."
+	)
+
+	define_property(
+		TARGET PROPERTY "COTIRE_PREFIX_HEADER_INCLUDE_PATH" INHERITED
+		BRIEF_DOCS "Honor headers from these directories when generating the prefix header."
+		FULL_DOCS
+			"The property can be set to a list of directories."
+			"If a header file is found in one of these directories or sub-directories, it will be included in the generated prefix header."
+			"If a header file is both selected by COTIRE_PREFIX_HEADER_IGNORE_PATH and COTIRE_PREFIX_HEADER_INCLUDE_PATH,"
+			"the option which yields the closer relative path match wins."
+			"Inherited from directory."
+			"If not set, this property is initialized to the empty list."
+	)
+
+	define_property(
+		TARGET PROPERTY "COTIRE_PREFIX_HEADER_INCLUDE_PRIORITY_PATH" INHERITED
+		BRIEF_DOCS "Header paths matching one of these directories are put at the top of prefix header."
+		FULL_DOCS
+			"The property can be set to a list of directories."
+			"Header file paths matching one of these directories will be inserted at the beginning of the generated prefix header."
+			"Header files are sorted according to the order of the directories in the property."
+			"If not set, this property is initialized to the empty list."
+	)
+
+	define_property(
+		TARGET PROPERTY "COTIRE_UNITY_SOURCE_PRE_UNDEFS" INHERITED
+		BRIEF_DOCS "Preprocessor undefs to place in the generated unity source file before the inclusion of each target source file."
+		FULL_DOCS
+			"This may be set to a semicolon-separated list of preprocessor symbols."
+			"cotire will add corresponding #undef directives to the generated unit source file before each target source file."
+			"Inherited from directory."
+			"Defaults to empty string."
+	)
+
+	define_property(
+		TARGET PROPERTY "COTIRE_UNITY_SOURCE_POST_UNDEFS" INHERITED
+		BRIEF_DOCS "Preprocessor undefs to place in the generated unity source file after the inclusion of each target source file."
+		FULL_DOCS
+			"This may be set to a semicolon-separated list of preprocessor symbols."
+			"cotire will add corresponding #undef directives to the generated unit source file after each target source file."
+			"Inherited from directory."
+			"Defaults to empty string."
+	)
+
+	define_property(
+		TARGET PROPERTY "COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES" INHERITED
+		BRIEF_DOCS "Maximum number of source files to include in a single unity source file."
+		FULL_DOCS
+			"This may be set to an integer > 0."
+			"If a target contains more than that number of source files, cotire will create multiple unity build files for it."
+			"If not set, cotire will only create a single unity source file."
+			"Inherited from directory."
+			"Defaults to empty."
+	)
+
+	define_property(
+		TARGET PROPERTY "COTIRE_<LANG>_UNITY_SOURCE_INIT"
+		BRIEF_DOCS "User provided unity source file to be used instead of the automatically generated one."
+		FULL_DOCS
+			"If set, cotire will only add the given file(s) to the generated unity source file."
+			"If not set, cotire will add all the target source files to the generated unity source file."
+			"The property can be set to a user provided unity source file."
+			"Defaults to empty."
+	)
+
+	define_property(
+		TARGET PROPERTY "COTIRE_<LANG>_PREFIX_HEADER_INIT"
+		BRIEF_DOCS "User provided prefix header file to be used instead of the automatically generated one."
+		FULL_DOCS
+			"If set, cotire will add the given header file(s) to the generated prefix header file."
+			"If not set, cotire will generate a prefix header by tracking the header files included by the unity source file."
+			"The property can be set to a user provided prefix header file (e.g., stdafx.h)."
+			"Defaults to empty."
+	)
+
+	define_property(
+		TARGET PROPERTY "COTIRE_UNITY_LINK_LIBRARIES_INIT" INHERITED
+		BRIEF_DOCS "Define strategy for setting up unity target's link libraries."
+		FULL_DOCS
+			"If this property is empty or set to NONE, the generated unity target's link libraries have to be set up manually."
+			"If this property is set to COPY, the unity target's link libraries will be copied from this target."
+			"If this property is set to COPY_UNITY, the unity target's link libraries will be copied from this target with considering existing unity targets."
+			"Inherited from directory."
+			"Defaults to empty."
+	)
+
+	define_property(
+		TARGET PROPERTY "COTIRE_<LANG>_UNITY_SOURCE"
+		BRIEF_DOCS "Read-only property. The generated <LANG> unity source file(s)."
+		FULL_DOCS
+			"cotire sets this property to the path of the generated <LANG> single computation unit source file for the target."
+			"Defaults to empty string."
+	)
+
+	define_property(
+		TARGET PROPERTY "COTIRE_<LANG>_PREFIX_HEADER"
+		BRIEF_DOCS "Read-only property. The generated <LANG> prefix header file."
+		FULL_DOCS
+			"cotire sets this property to the full path of the generated <LANG> language prefix header for the target."
+			"Defaults to empty string."
+	)
+
+	define_property(
+		TARGET PROPERTY "COTIRE_<LANG>_PRECOMPILED_HEADER"
+		BRIEF_DOCS "Read-only property. The generated <LANG> precompiled header file."
+		FULL_DOCS
+			"cotire sets this property to the full path of the generated <LANG> language precompiled header binary for the target."
+			"Defaults to empty string."
+	)
+
+	define_property(
+		TARGET PROPERTY "COTIRE_UNITY_TARGET_NAME"
+		BRIEF_DOCS "The name of the generated unity build target corresponding to this target."
+		FULL_DOCS
+			"This property can be set to the desired name of the unity target that will be created by cotire."
+			"If not set, the unity target name will be set to this target's name with the suffix _unity appended."
+			"After this target has been processed by cotire, the property is set to the actual name of the generated unity target."
+			"Defaults to empty string."
+	)
+
+	# define cotire source properties
+
+	define_property(
+		SOURCE PROPERTY "COTIRE_EXCLUDED"
+		BRIEF_DOCS "Do not modify source file's build command."
+		FULL_DOCS
+			"If this property is set to TRUE, the source file's build command will not be modified to make use of the precompiled header."
+			"The source file will also be excluded from the generated unity source file."
+			"Source files that have their COMPILE_FLAGS property set will be excluded by default."
+			"Defaults to FALSE."
+	)
+
+	define_property(
+		SOURCE PROPERTY "COTIRE_DEPENDENCY"
+		BRIEF_DOCS "Add this source file to dependencies of the automatically generated prefix header file."
+		FULL_DOCS
+			"If this property is set to TRUE, the source file is added to dependencies of the generated prefix header file."
+			"If the file is modified, cotire will re-generate the prefix header source upon build."
+			"Defaults to FALSE."
+	)
+
+	define_property(
+		SOURCE PROPERTY "COTIRE_UNITY_SOURCE_PRE_UNDEFS"
+		BRIEF_DOCS "Preprocessor undefs to place in the generated unity source file before the inclusion of this source file."
+		FULL_DOCS
+			"This may be set to a semicolon-separated list of preprocessor symbols."
+			"cotire will add corresponding #undef directives to the generated unit source file before this file is included."
+			"Defaults to empty string."
+	)
+
+	define_property(
+		SOURCE PROPERTY "COTIRE_UNITY_SOURCE_POST_UNDEFS"
+		BRIEF_DOCS "Preprocessor undefs to place in the generated unity source file after the inclusion of this source file."
+		FULL_DOCS
+			"This may be set to a semicolon-separated list of preprocessor symbols."
+			"cotire will add corresponding #undef directives to the generated unit source file after this file is included."
+			"Defaults to empty string."
+	)
+
+	define_property(
+		SOURCE PROPERTY "COTIRE_START_NEW_UNITY_SOURCE"
+		BRIEF_DOCS "Start a new unity source file which includes this source file as the first one."
+		FULL_DOCS
+			"If this property is set to TRUE, cotire will complete the current unity file and start a new one."
+			"The new unity source file will include this source file as the first one."
+			"This property essentially works as a separator for unity source files."
+			"Defaults to FALSE."
+	)
+
+	define_property(
+		SOURCE PROPERTY "COTIRE_TARGET"
+		BRIEF_DOCS "Read-only property. Mark this source file as cotired for the given target."
+		FULL_DOCS
+			"cotire sets this property to the name of target, that the source file's build command has been altered for."
+			"Defaults to empty string."
+	)
+
+	message (STATUS "cotire ${COTIRE_CMAKE_MODULE_VERSION} loaded.")
+
+endif()

+ 3 - 3
CMakeLists.txt

@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8)
 # on / off for verbose build.
 set(CMAKE_VERBOSE_MAKEFILE off)
 
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/lib/cotire/CMake")
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMake")
 include(cotire)
 
 # Project Information.
@@ -105,7 +105,7 @@ endif()
 find_package(Qt5Widgets REQUIRED)
 find_package(ZLIB REQUIRED)
 find_package(OGRE REQUIRED)
-find_package(OIS REQUIRED)
+#find_package(OIS REQUIRED)
 
 
 #if(NOT OIS_FOUND)
@@ -395,4 +395,4 @@ endif()
 SET_PROPERTY(TARGET LuaBind PROPERTY FOLDER "3rdparty")
 
 INCLUDE(CPack)
-#End of install instructions
+#End of install instructions

+ 0 - 1
SupportedGames/CMakeLists.txt

@@ -1 +0,0 @@
-add_subdirectory(FinalFantasy7)

+ 0 - 37
SupportedGames/FinalFantasy7/CMakeLists.txt

@@ -1,37 +0,0 @@
-# define header and source files for the library
-set(HEADER_FILES
-    include/common/FF7NameLookup.h
-    include/data/FF7ModelListFile.h
-    include/data/FF7ModelListFileManager.h
-    include/data/FF7ModelListFileSerializer.h
-    include/map/FF7WalkmeshFileSerializer.h
-    include/FF7Common.h
-)
-set(SOURCE_FILES
-    src/common/FF7NameLookup.cpp
-    src/data/FF7ModelListFile.cpp
-    src/data/FF7ModelListFileManager.cpp
-    src/data/FF7ModelListFileSerializer.cpp
-    src/map/FF7WalkmeshFileSerializer.cpp
-    src/FF7Common.cpp
-)
-
-include_directories(
-    ${VGears_INCLUDE_DIRS}
-    ${VGears_SOURCE_DIR}/V-Gears/include
-    ${CMAKE_CURRENT_SOURCE_DIR}/include
-)
-
-add_library(FinalFantasy7 STATIC
-    ${HEADER_FILES}
-    ${SOURCE_FILES}
-)
-SET_PROPERTY(TARGET FinalFantasy7 PROPERTY FOLDER "v-gears")
-
-set(LIBRARIES
-    ${OGRE_LIBRARIES}
-    ${OIS_LIBRARIES}
-    V-Gears
-)
-
-target_link_libraries(FinalFantasy7 ${LIBRARIES})

+ 1 - 2
V-Gears-Installer/CMakeLists.txt

@@ -2,7 +2,6 @@
 include_directories(
     ${VGears_INCLUDE_DIRS}
     ${VGears_SOURCE_DIR}/V-Gears/include
-    ${VGears_SOURCE_DIR}/SupportedGames/FinalFantasy7/include
     ${CMAKE_CURRENT_SOURCE_DIR}/include
     ${CMAKE_CURRENT_SOURCE_DIR}
     ${ZLIB_INCLUDE_DIRS}
@@ -256,4 +255,4 @@ if(WIN32 OR APPLE)
     install(TARGETS v-gears-launcher DESTINATION .)
 else()
     install(TARGETS v-gears-launcher RUNTIME DESTINATION bin)
-endif()
+endif()

+ 0 - 101
V-Gears-Installer/include/decompiler/doc/cfg.tex

@@ -1,101 +0,0 @@
-\section{Control flow analysis}
-
-The control flow analysis is a multi-step process:
-
-\begin{itemize}
-\item Create a graph with one instruction per vertex, and edges going from instructions to their possible successors
-\item Do a depth-first search to determine the expected stack level at each vertex
-\item Optionally detect functions
-\item Merge vertices to form groups
-\item Perform analysis on vertices
-\end{itemize}
-
-Calls to in-script functions are not represented with edges in the graph. This is done to keep functions separate from one another, so if your engine uses a jump as part of calling functions, you need to make sure you represent the jump using a \code{CallInstruction} instead of a \code{JumpInstruction}.
-
-The first step is handled in the constructor, while the next three steps are handled by the \code{createGroups()} method. The last step is handled by the \code{analyze} method.
-
-\subsection{Function detection}
-\label{sec:autofunc}
-Prior to grouping, the control flow can be used to detect new functions. This detection is automatically activated if the Engine method \code{detectMoreFuncs} returns true.
-
-When function detection is enabled, unreachable blocks of code will be treated as functions, unless the presumed entry point is located within the range of another function. The end point of the function will then be the last instruction reachable from the entry point.
-
-Functions detected this way will be given the name \code{auto\_}. You can use this as a prefix to the actual name to signify that the function may not actually be a function, or you can ignore it and just replace it with the name you would normally use.
-
-You can also have the function detection determine the end point of an existing function. To do so, \code{\_endIt} must be the same as \code{\_startIt} for that function. In this case, only the end point will be changed within the function; the name will stay the same.
-
-Note that the control flow analysis has no way of determining an appropriate name, number of arguments, return value, or metadata. You will have to fill that in yourself using \code{postCFG} in the engine.
-
-If this step is not enabled, and no functions have been defined before the control flow analysis is started, there will still be added a single function covering the entire script. This is done to avoid having a special case in the code, and it will not affect the output of your script in any way.
-
-\subsection{Group generation}
-\label{sec:groupgen}
-Groups are initially formed according to these rules:
-\begin{itemize}
-\item If the next instruction is a jump or a return, end the group here.
-\item If the next instruction has multiple predecessors, end the group here.
-\item If the current instruction brings the stack to a lower level than the start of the current group, make the new level the expected stack level (to support clean-up after control structures).
-\item If the current instruction brings the stack level to the same as the start of the current group, and at least one instruction with a non-negative stack effect exists in the group, end the group here.
-\end{itemize}
-
-The final two rules are based on a property of stack-based engines: when the stack becomes balanced, as defined by these two rules, this indicates that the current group corresponds to a single line of code. This property of the groups can be helpful when performing code generation, since it adds some context -- e.g., conditions are placed in a group of their own.
-
-However, this only works for stack-based engines; for a non-stack-based engine, each instruction ends up in a group of its own, which is particularly bad for visualization of the code flow, since dot tends to choke on the large amount of vertices resulting from this. For this reason, engines are able to request \emph{pure grouping} via the virtual \code{usePureGrouping} method, mentioned in Section~\vref{sec:addingengine}. In pure grouping, only the first two rules are applied, creating the minimum number of groups for any grouping algorithm.
-
-Prior to applying these rules, a depth-first search is performed to calculate the expected stack level at each instruction. If multiple paths are found to the same instruction, a warning will be output if the expected stack level from each path differs.
-
-Unreachable code will not be processed during the group generation, but will remain as individual instructions.
-
-\subsection{Short-circuit detection}
-\emph{NOTE: This feature is currently disabled.}
-
-As part of the group generation, the decompiler can combine multiple, consecutive groups if it detects them as being part of a single condition check that are merely split up due to short-circuiting.
-
-The rules used to detect if two consecutive groups $A$ and $B$ are oart of the same short-circuited check are as follows:
-\begin{itemize}
-\item Both group $A$ and $B$ end with a conditional jump (they have two possible successors each)
-\item For each outgoing edge from A, the edge must either go to B, or to a successor of B -- in other words, merging may not add any new successors. More formally, $\text{succ}(A) \subseteq \{B\} \cup \text{succ}(B)$, where $\text{succ}(X)$ is the set of possible successors for the group $X$.
-\end{itemize}
-
-\subsection{Construct detection}
-After the groups have been created, we then analyze the groups to find the various kind of control flow constructs. The constructs are detected in multiple steps, with one construct per step, in the following order:
-\begin{itemize}
-\item \code{do-while}
-\item \code{while}
-\item \code{break}
-\item \code{continue}
-\item \code{if}
-\item \code{else}
-\end{itemize}
-
-Each of these five constructs are marked using a \code{GroupType} member of the \code{Group} type, while \code{else} blocks are flagged using two booleans, \code{\_startElse} and \code{\_endElse}. If \code{\_startElse} is true, then an \code{else} block starts with this group, and should be output prior to the code in this group. If \code{\_endElse} is true, an \code{else} block ends with this group, and the end should be output after the code in this group.
-
-Once a group has been flagged as being some construct, it is skipped for the other constructs.
-
-The criteria used for each construct are as follows:
-
-\paragraph{Do-while detection}
-Group must end with a conditional jump (i.e., have two outgoing edges). Jump must go to an earlier place in the code.
-
-\paragraph{While detection}
-Group must end with conditional jump. Block must have an ingoing edge from some group later in the code, unless that edge comes from a do-while condition (in which case it is assumed to be an \code{if} instead).
-
-\paragraph{Break detection}
-Unconditional jump to some place later in the code. That place must either be the group immediately after a \code{do-while} condition, or the jump target of a \code{while} condition. Additionally, the jump is verified to go to the appropriate loop (so it does not exit multiple loops at once).
-
-\paragraph{Continue detection}
-Unconditional jump to a \code{while} or \code{do-while} condition, unless it is targeting a \code{while} condition which jumps to the next sequential group (in which case it is merely the end of the \code{while}-loop). Just as with \code{break}s, the jump is verified to go to the appropriate loop.
-
-\paragraph{If detection}
-All unflagged conditional jumps are flagged as \code{if}s.
-
-\paragraph{Else detection}
-All \code{if}s are processed to see if they may have an \code{else} attached. If the jump target of an \code{if} is immediately preceded by an unconditional jump, which is neither a break or a continue, and that jump goes to later in the code, this signifies a possible \code{else} block, starting with the jump target of the if condition and ending with the group immediately before the target of the jump immediately before the jump target of the if condition. To avoid false positives, this block is then validated to not cross block boundaries. If the check passes, the \code{else} block data is added to the graph.
-
-\subsection{Graph output}
-The graph can be output in DOT format by using the \code{-g} switch. In the graph, arrows on edges will be hollow if the edge is a jump, and filled if the edge represents the usual sequential order.
-
-\subsection{Limitations}
-Currently, only unconditional jumps are supported for \code{break} and \code{continue}; however, for code of the form \code{if (...) break;} or \code{if (...) continue;}, it is a pretty straight-forward optimization to use the \code{break}/\code{continue} jump as the conditional jump for the \code{if} condition check. Since \code{if}s are found last, it should be possible to simply check unmarked conditional jumps as well and see if they meet the other criteria for a \code{break}/\code{continue}, although there might be some false positives for an if that stretches to the end of the loop it is placed in.
-
-It is currently assumed that all conditional jumps in \code{if} condition checks go to a later place in the code. If optimized continue statements are used in a while (as described above), this will cause the analysis to be incorrect.

+ 0 - 145
V-Gears-Installer/include/decompiler/doc/codegen.tex

@@ -1,145 +0,0 @@
-\section{Code generation}
-\label{sec:codegen}
-
-Having detected all of the various control flow constructs in the previous phase, it is now time to put that information to use and generate some code from the instructions.
-
-Code generation is implemented as a two-step process:
-\begin{itemize}
-\item First, a DFS is performed to process all reachable groups. During this processing, the code for that group is generated.
-\item Next, the groups are iterated over sequentially, and the generated code is output.
-\end{itemize}
-
-This process is repeated for each function.
-
-\subsection{Function signature}
-For each function in the script, the \code{constructFuncSignature} method is called. By default, this will return the empty string, and this will cause the code to be output "freely", i.e. without anything surrounding it. If a non-empty string is returned, a \code{\}} will be added after all of the code in the function.
-
-If your engine uses methods, you will want to override this method to output your own signature.
-
-\emph{Note:} You must currently include a \code{\{} at the end of your signature.
-
-\subsection{Group processing}
-During processing of a group, the instructions in the group are processed one at a time. This is done by calling \code{processInst} on each instruction. This method should emulate the effect of the instruction, and, if the instruction corresponds to a statement, call \code{addOutputLine} on the code generator to add this statement as a line of code.
-
-If you need to access information about the group currently being processed, use the member variable \code{\_curGroup} on the code generator.
-
-\subsection{The stack and stack entries}
-\label{sec:stackvalues}
-When generating the code, a stack is used to represent the state of the system. When data is pushed on the stack, a \code{Value} describing how that data was created is added; when data is popped, a \code{Value} describing the popped data is removed.
-
-To manipulate the stack, use the \code{push} and \code{pop} methods to push or pop values. Unlike the STL stack, \code{pop} returns the value being popped from the stack, so you do not have to first get the top element and then pop it afterwards, but you can still call the \code{peek} method if you just want to look at the topmost element without removing it. Additionally, it has an \code{empty} method to check if the stack is empty.
-
-Some engines require you to look further down the stack than just the topmost element. You can use the \code{peekPos} method to retrieve an element at an arbitrary position in the stack. This method takes an integer containing the number of stack entries to skip, i.e. passing the value 0 will give you the topmost element, while passing the value 2 will give you the third value on the stack.
-
-\emph{Note:} \code{peekPos} accesses the underlying STL container (\code{std::deque}) using the \code{at} function, which will throw an exception if the stack does not contain enough elements.
-
-When working with values, you should use the \code{ValuePtr} type. This wraps the entry in a \code{boost::intrusive\_ptr} to free the associated memory when it is no longer referenced.
-
-Some value types contain references to an arbitrary number of values. This can be handled using an STL \code{deque}, typedef'ed as \code{ValueList}.
-
-The following value types are predefined:
-
-\paragraph{Integers (IntValue)}
-Integers can use up to 32-bits, and be signed or unsigned. When creating an integer, you must specify its value and whether or not it is signed. This also contains additional methods to extract the value and signedness of the value, which may be of use in some situations.
-
-\paragraph{Addresses (AddressValue/RelAddressValue)}
-Addresses are implemented as a specialization of IntValue. When output to a string, hexadecimal notation is used instead of decimal, and for relative addresses, the sign is prefixed and the absolute offset value is used instead (i.e., -1 is shown as \code{-0x1} instead of \code{0xFFFFFFFF}).
-
-Absolute addresses cannot be retrieved using \code{getSigned}, while relative addresses will return the offset with this method. To get the absolute address associated with either of these values, call \code{getUnsigned}.
-
-\paragraph{Variables (VarValue)}
-Variables are stored as a simple string. Subclasses of \code{CodeGenerator} must implement their own logic to determine a suitable variable name when given a reference.
-
-\paragraph{Binary operations (BinaryOpValue)}
-Binary operations stores the two stack entries used as operands, and a string containing the operator. Parentheses are added if the operator precedence requires it.
-
-\paragraph{Unary operations (UnaryOpValue)}
-Just like binary operations, except only a single operand is stored. The operator can be placed before (prefix) or after (postfix) the operand.
-
-\paragraph{Duplicated entries (DupValue)}
-Stores an index to distinguish between multiple duplicated entries. This index is automatically assigned and determined when calling the \code{dup} function to duplicate a stack entry.
-
-\paragraph{Array entries (ArrayValue)}
-Array entries are stored as a simple string containing the name of the array, and an EntryList of stack entries used as the indices, with the first element in the ValueList being output as the first index.
-
-\paragraph{Strings (StringValue)}
-A string is stored as... well, a string. The default implementation automatically surrounds the string with quotes.
-
-\paragraph{Negated values (NegatedValue)}
-\code{NegatedValue} represents an expression of the form \code{!value}, i.e. boolean negation. This type is used to ensure that \code{value->negate()->negate()} does not actually perform double negation, but simply uses the original value.
-
-\paragraph{Function calls (CallValue)}
-Function calls have the same underlying storage types as an array entry, but the output is formatted like a function call instead of an array access.
-
-Each entry type knows how to output itself to an \code{std::ostream} supplied as a parameter to the \code{print} function, and the common base class \code{StackEntry} also overloads the \code{<<} operator so any stack entry can be streamed directly to an output stream using that function.
-
-\subsection{Outputting code}
-When processing certain kinds of instructions, you will probably want to create a line of code as part of the output. To do that, call \code{addOutputLine} with a string containing the code you wish to output as an argument. This will then be associated with the group being processed.
-
-If your line of code deals with specialized control flow, you will probably want to do something about the indentation. You can supply two extra boolean arguments to \code{addOutputLine} to state that the indentation should be decreased before outputting this line, and/or that the indentation should be increased for lines output after this line. If you leave out these arguments, no extra indentation is added.
-
-Note: By default, if, while and do-while statements detected in the control flow graph are automatically output after processing the conditional jump. To fill in the condition, the topmost stack value is used.
-
-Note: This indent handling is currently considered a temporary solution until there is time to implement something better. It may be replaced with a different form of indentation handling at a later time.
-
-You will usually need to output assignments at some point. For that, you can use the \code{writeAssignment} method to generate an assignment statement. \code{writeAssignment} takes two parameters, the first being the Value representing the left-hand side of the assignment operator, and the second being the Value representing the right-hand side of the operator.
-
-\subsection{Default instruction handling and instruction metadata}
-Default handling exists for a number of instruction types, described below. See also Section~\vref{sec:instructions} which discusses instructions in more detail.
-\paragraph{DupStackInstruction}
-The topmost stack entry is popped, and two duplicated copies are pushed to the stack. If the entry being duplicated was not already a duplicate, an assignment will be output to assign the original stack entry to a special dup variable, to show that the original entry is not being recalculated.
-
-\paragraph{UnaryOpPrefixStackInstruction/UnaryOpPostfixStackInstruction}
-The topmost stack entry is popped, and a \code{UnaryOpEntry} is created and pushed to the stack, using the codegen metadata as the operator, and the previously popped entry as the operand. The exact type determines whether the operator is pre- or postfixed to the operand.
-
-\paragraph{BinaryOpStackInstruction}
-The two topmost stack entries are popped, and a BinaryOpEntry is created and pushed to the stack, using the codegen metadata as the operator and the previously popped entries as the operands. The order of the operands is determined by the value of the field \code{\_binOrder}, as described in Section~\vref{sec:argOrder}.
-
-\paragraph{ReturnInstruction}
-This simply adds a line \code{return;} to the output.
-
-\emph{Note:} The default handling does not currently allow specifying a return value as part of the statement, as in \code{return 0;}. You will have to handle that yourself using a subclass.
-
-\paragraph{KernelCallStackInstruction}
-The metadata is treated similar to parameter specifications in \code{SimpleDisassembler} (see Section~\vref{sec:simpledisasm}). If the specification string starts with the character \code{r}, this signifies that the call returns a value, and processing starts at the next character.
-For each character in the metadata string, \code{processSpecialMetadata} is called with the instruction being processed, and the current metadata character to be handled. The default implementation only understands the character \code{p}, which pops an argument from the stack and adds it to the argument list.
-Once the metadata string has been processed fully, then an entry representing the function call is pushed to the stack if the call returns a value. Otherwise, the call is added to the output.
-
-You can override the \code{processSpecialMetadata} method to add your own specification characters, just like you would override \code{readParameter} in \code{SimpleDisassembler}. Use the \code{addArg} method to add arguments.
-
-Due to the conflict with the specification of a return value, it is recommended that you do not adopt \code{r} as a metadata character unless you provide your own \code{processInst} implementation for this purpose.
-
-\paragraph{UncondJumpInstruction}
-Nothing is output, as this should already be handled by the generic code.
-
-In addition, certain instruction types trigger additional generic behavior:
-\paragraph{Conditional jumps}
-After processing the conditional jump, an if, while or do-while condition is output using the topmost stack entry as the condition. The condition is automatically negated for if and while conditons, so you only need to consider what the instruction itself does. If the jump is taken when the checked condition is false (e.g. a \code{jumpFalse} instruction), you must remember to negate the value representing the condition.
-
-\paragraph{Unconditional jumps}
-After processing the instruction, if the current group has been detected as a break or a continue, a break or continue statement is output. Otherwise, the jump is analyzed and output unless it is a jump back to the condition of a while-loop that ends there, or it is determined that the jump is unnecessary due to an else block following immediately after. A default, empty implementation of \code{processInst} is provided for this type.
-
-\paragraph{Other types}
-No default handling exists for types other than those mentioned above, so you must handle them yourself by creating new Instruction subclasses.
-
-Note that this also includes \code{CallInstruction}. Although many engines might want to handle this in a manner similar to \code{KernelCallInstruction} opcodes, this is left to the engine-specific code so they can fully make sense of the metadata they choose to add to the function.
-
-\subsection{Order of arguments}
-\label{sec:argOrder}
-The generic handling of binary operators (\code{BinaryOpStackInstruction}) and kernel functions (\code{KernelCallStackInstruction}) can be configured to display their arguments using FIFO or LIFO - respectively, the first and the last entry to be pushed onto the stack is used as the first (leftmost) argument. This is set as part of the constructor for the \code{CodeGenerator} class, using the enumeration values \code{kFIFOArgOrder} and \code{kLIFOArgOrder}.
-
-To provide an example, consider the following sequence of instructions:
-
-\begin{bytecode}
-\begin{lstlisting}
-PUSH a
-PUSH b
-SUB
-\end{lstlisting}
-\end{bytecode}
-
-This can mean two different things, either \code{a - b} or \code{b - a}, depending on the order in which the operands should be evaluated. For the former, choose FIFO ordering, for the latter, choose LIFO.
-
-For arguments to function calls, the same principle applies. You can use the \code{addArg} method to add an argument to the call currently being processed, using the chosen ordering.
-
-In general, you might not know which ordering is more correct for function arguments; unless you have reason to believe otherwise, simply use the same ordering as for binary operators.

+ 0 - 315
V-Gears-Installer/include/decompiler/doc/disassembler.tex

@@ -1,315 +0,0 @@
-\section{Disassembler}
-\label{sec:disassembler}
-The purpose of the disassembler is to read instructions from a script file and convert them to a common, machine-readable form for further analysis.
-
-\subsection{Instructions}
-\label{sec:instructions}
-Instructions are represented using a type hierarchy, with the \code{Instruction} struct as the base type.
-
-\begin{C++}
-\begin{lstlisting}
-struct Instruction : public RefCounted {
-	uint32 _opcode;
-	uint32 _address;
-	int16 _stackChange;
-	std::string _name;
-	std::vector<ValuePtr> _params;
-	std::string _codeGenData;
-
-	friend std::ostream &operator<<(std::ostream &output, const Instruction *inst);
-	virtual std::ostream &print(std::ostream &output) const;
-	virtual bool isJump() const;
-	virtual bool isCondJump() const;
-	virtual bool isUncondJump() const;
-	virtual bool isStackOp() const;
-	virtual bool isFuncCall() const;
-	virtual bool isReturn() const;
-	virtual bool isKernelCall() const;
-	virtual bool isLoad() const;
-	virtual bool isStore() const;
-	virtual uint32 getDestAddress() const;
-	virtual void processInst(ValueStack &stack, Engine *engine, CodeGenerator *codeGen) = 0;
-};
-\end{lstlisting}
-\end{C++}
-
-Each member of this struct has a specific purpose:
-\begin{itemize}
-\item \code{\_opcode} is used to store the numeric opcode associated with the instruction. This is not used by the decompiler itself, but is for your reference during later parts of the decompilation process. Note that this field is declared as a 32-bit integer; if you need more than 4 bytes for your opcodes, you will need to figure out which bytes you want to store if you want to use this field.
-\item \code{\_address} stores the absolute memory address where this instruction would be loaded into memory.
-\item \code{\_stackChange} stores the net change of executing this instruction - for example, if the instruction pushes a byte on to the stack, this should be set to 1. This is used to determine when each statement ends. The count can be in any unit you wish - bytes, words, bits - as long as the same unit is used for all instructions. This means that if your stack only works with 16-bit elements, pushing an 8-bit value and pushing a 16-bit value should have the same net effect on the stack.
-\item \code{\_name} contains the name of the instruction. This is mainly for use during code generation.
-\item \code{\_params} contains the parameters given to the instruction - for example, if you have the instruction \code{PUSH 1}, there would be one parameter, with the value of 1. See Section~\vref{sec:parameter} for details on the Value type.
-\item \code{\_codeGenData} stores metadata to be used during code generation. For details, see Section~\vref{sec:codegen}.
-\end{itemize}
-
-If some instructions do not have a fixed effect on the stack--that is, the instruction name alone does not determine the effect on the stack--set the field to some easily recognizable value when doing the disassembly. You will, however, have to determine the exact stack effect after disassembling the script, as the code flow analysis depends on this information to be accurate.
-
-\subsection{Instruction types}
-\label{sec:insttype}
-As mentioned previously, the different instructions are represented using a type hierarchy. This allows you to independently specify how each kind of instruction should be handled, while abstracting away the engine-specific information to allow for generic analysis.
-
-This is particularly important during code flow analysis; since this part is completely engine-independent, the analysis must have some way of distinguishing the different types of instructions. For that purpose, a number of \code{is*} methods are defined which specify whether the instruction satisfies some specific purpose.
-
-Each of the predefined instruction types have a class associated with it to make it simpler to add functionality to a specific class of instructions, as specified in Table~\vref{tbl:insttypes}.
-
-\begin{table}
-\centering
-\begin{tabular}{|m{5cm}|p{3.2cm}|}
-\hline
-\textbf{Base class} & \textbf{Purpose} \\
-\hline
-\code{BinaryOpInstruction} & Binary operations (+, *, ==, etc.) \\\hline
-\code{BoolNegateInstruction} & Boolean negation \\\hline
-\code{CallInstruction} & Script function call \\\hline
-\code{CondJumpInstruction} & Conditional jumps \\\hline
-\code{DupInstruction} & Duplicate stack entry \\\hline
-\code{UncondJumpInstruction} & Unconditional jumps \\\hline
-\code{KernelCallInstruction} & Kernel function call \\\hline
-\code{LoadInstruction} & Load from memory \\\hline
-\code{ReturnInstruction} & Function return \\\hline
-\code{StackInstruction} & Stack allocation or deallocation \\\hline
-\code{StoreInstruction} & Store to memory \\\hline
-\code{UnaryOpPrefixInstruction} & Unary operation, prefixed operator \\\hline
-\code{UnaryOpPostfixInstruction} & Unary operation, postfixed operator \\\hline
-\end{tabular}
-\caption{Predefined instruction types}
-\label{tbl:insttypes}
-\end{table}
-
-For some of these, an extra type exists which contains a default implementation of \code{processInst}, assuming a sensible default implementation exists. The default implementations are found in \code{BinaryOpStackInstruction}, \code{BoolNegateStackInstruction}, \code{DupStackInstruction}, \code{KernelCallStackInstruction}, \code{ReturnInstruction}, \code{UnarayOpPrefixStackInstruction}, \code{UnaryOpPostfixStackInstruction}, \code{UncondJumpInstruction}. Most of these are targeted at stack-based engines, but if your engine doesn't work with these, you can always create your own class with your own implementation of \code{processInst}.
-
-\code{getDestAddress} must be implemented on jump instructions to allow the generic code to find the target of a jump. You must create subclassses for your jump instructions which override this method.
-
-Most of the types are self-explanatory, with the possible exception of \code{KernelCallInstruction}. \code{KernelCallInstruction} should be used for "magic functions"--opcodes that perform some function specific to the engine, like playing a sound, drawing a graphic, or saving the game.
-
-In a few cases, you may not know which instruction type is correct. For example, in Kyra, the same opcode is used for unconditional jumps and script function calls, but the correct type depends on other instructions. You can handle this is by creating a new Instruction type which can work as both, depending on a flag you declare in your type, and set once you can correctly determine the type. Note that since \code{InstPtr} is not a raw pointer, you must first convert it to one before you can cast it to the pointer type of your choice. This can be done by calling \code{inst.get()}, where \code{inst} is your \code{InstPtr}.
-
-When at all possible, you should inherit from one of the more specific types, rather than inheriting directly from \code{Instruction}.
-
-\subsection{Parameters and values}
-\label{sec:parameter}
-Instruction parameters are stored using a hierarchy of \code{Value} types. Several types are predefined in \code{value.h}, and you can declare new types if you need to (e.g. a list of values).
-
-\code{Value} types are also used during code generation, so you can reuse your parameter values directly.
-
-All \code{Value} types must define a \code{print} function which prints themselves to a \code{std::ostream}. This is used not only for code generation, but also for disassembly and control flow output.
-
-For direct values, you should also override the \code{dup} function to create a copy of your class. The default implementation is tailored for values that represent expressions, and will therefore output an assignment to show that the result of an expression is being duplicated.
-
-For more details, see Section~\vref{sec:stackvalues}, where Values are discussed wrt. code generation, and a list of predefined value types is given.
-
-\subsection{The Disassembler class}
-All disassemblers must inherit, directly or indirectly, from the \code{Disassembler} class. This is an abstract class providing an interface for disassemblers.
-
-\begin{C++}
-\begin{lstlisting}
-class Disassembler {
-protected:
-	Common::File _f;
-	InstVec &_insts;
-	uint32 _addressBase;
-
-	virtual void doDisassemble() = 0;
-	virtual void doDumpDisassembly(std::ostream &output);
-
-public:
-	Disassembler(InstVec &insts);
-	virtual ~Disassembler() {}
-
-	void open(const char *filename);
-	void disassemble();
-	void dumpDisassembly(std::ostream &output);
-};
-\end{lstlisting}
-\end{C++}
-
-\code{\_f} represents the file you will be reading from. The file is opened using the \code{open} function.
-
-\code{\_insts} is a reference to an \code{std::vector} storing the instructions, passed in via the constructor. Whenever you have read an instruction fully, add it here.
-
-\code{\_addressBase} is provided as a convenience if your engine does not consider the first instruction to be located at address 0. Assign the expected base address to this field, and make sure that the addresses you assign to the instructions are relative to this base address. This is mainly useful if your engine supports jumps or other references to absolute addresses in the script; if only relative addresses are used, the base address will not be relevant.
-
-\code{doDisassemble} is the method used to perform the actual disassembly, so this method must be implemented by all disassemblers.
-
-\code{disassemble} simply calls the \code{doDisassemble} method to perform the disassembly. The result is cached, so if this method is called twice, it won't perform disassembly again.
-
-Finally, \code{dumpDisassembly} is used to output the instructions in a human-readable format to a file or stdout, performing a disassembly first if required, and then calls \code{doDumpDisassembly} to perform the actual output. \code{doDumpDisassembly} simply outputs each instruction in turn, using the printing function associated with each instruction. If you want to customize the way instructions are output, you should ideally create new Instruction subclasses and override their printing function, as the same format is used when dumping a code flow graph, but if you just want to prepend or append some additional information to the dump, you can override this method to do so.
-
-\subsection{The SimpleDisassembler class}
-\label{sec:simpledisasm}
-To simplify the development of disassemblers, another base class is provided for instruction sets where instructions are of the format \code{opcode [params]}, with opcode and parameters stored in distinct bytes.
-
-\code{SimpleDisassembler} defines a number of macros which you can use for writing your disassembler, and provides a framework for reading instruction parameters.
-
-Following is a guide on how to implement a disassembler using this class as its base class. The instruction set used for this example is described in Table~\vref{tbl:simple_disasm_example}. While not a very useful instruction set, it covers many different aspects.
-
-\begin{table}[!hpbt]
-\centering
-\begin{tabular}{c | c | c}
-Instruction & Parameters & Description \\
-\hline
-\code{PUSH} (0x00) & uint8 & Pushes byte onto the stack.\\
-\code{POP} (0x01) & &  Pops a byte from the stack. \\
-\code{PUSH2} (0x02) & int16 & Pushes two bytes onto the stack.\\
-\code{POP2} (0x03) & &  Pops two bytes from the stack. \\
-\code{PRINT} (0x80) & C string & Prints string to standard output. \\
-\code{HALT} (0xFF 0x00) & & Stops the machine.
-\end{tabular}
-\caption{Instruction set used in the SimpleDisassembler example.}
-\label{tbl:simple_disasm_example}
-\end{table}
-
-For the purpose of this example, our instruction set will use little-endian values, and uses byte elements for the stack (so \code{POP} changes the stack pointer by 1 and \code{POP2} changes it by 2).
-
-\subsubsection{Opcode recognition}
-The first thing to do in the \code{doDisassemble} method is to read past any header which may be present in your script file. We will assume that our bytecode files do not have a header.
-
-You must place your opcodes between two macros, \code{START\_OPCODES} and \code{END\_OPCODES}. These two macros define the looping required to read one byte at a time.
-
-\begin{C++}
-\begin{lstlisting}
-START_OPCODES;
-END_OPCODES;
-\end{lstlisting}
-\end{C++}
-
-To define an opcode, use the \code{OPCODE} macro. This macro takes 5 parameters: the opcode value, the name of the instruction, the name of the Instruction type to use, the net effect on the stack, and a string describing the parameters that are part of the instruction. We will start by implementing the \code{POP} and \code{POP2} opcodes:
-
-\begin{C++}
-\begin{lstlisting}
-START_OPCODES;
-	OPCODE(0x01, "POP", MyStackInstruction, -1, "");
-	OPCODE(0x03, "POP2", MyStackInstruction, -2, "");
-END_OPCODES;
-\end{lstlisting}
-\end{C++}
-
-The \code{OPCODE} macro automatically stores the full opcode in the \code{\_opcode} field of the generated \code{Instruction}.
-
-\subsubsection{Parameter reading}
-\code{PUSH}, \code{PUSH2} and \code{PRINT} all take parameters as part of the instruction. To read these, you must specify them as part of the parameter string, using one character per parameter. The types understood by default are specified in Table~\vref{tbl:paramtypes}.
-
-\begin{table}[!hpbt]
-\centering
-\begin{tabular}{c | c}
-Character & Type \\
-\hline
-b & Signed 8-bit integer. \\
-B & Unsigned 8-bit integer. \\
-s & Signed 16-bit byte, little-endian. \\
-S & Signed 16-bit byte, big-endian. \\
-w & Unsigned 16-bit byte, little-endian. \\
-W & Unsigned 16-bit byte, big-endian. \\
-i & Signed 32-bit byte, little-endian. \\
-I & Signed 32-bit byte, big-endian. \\
-d & Unsigned 32-bit byte, little-endian. \\
-D & Unsigned 32-bit byte, big-endian. \\
-\end{tabular}
-\caption{Type specifications recognized by SimpleDisassembler.}
-\label{tbl:paramtypes}
-\end{table}
-
-To help you remember these meanings, little-endian values are encoded using lower case ("small letters", i.e. little), while big-endian values are encoded using upper case ("big" letters). The exception here is a single byte, since endianness has no effect for individual bytes. Here, the mnemonic is that an unsigned byte ("B") has a larger maximum value. For the other letters, "s" was used because it is the first letter in "short", which is usually a 16-bit signed value in C. Similarly, "i" is short for "int". "w" and "d" come from the terms "word" and "dword", which are terms for 16-bit and 32-bit unsigned types on the x86 platform.
-
-Note that strings are not supported by default. To add reading of a string type, you can override the \code{readParameter} function to add your own types:
-
-\begin{C++}
-\begin{lstlisting}
-	switch (type)	{
-	case 'c': //Character string
-		{
-		byte cmd;
-		bool inStr = false;
-		std::stringstream s;
-		while ((cmd = _f.readByte()) != 0) {
-			s << cmd;
-			_address}};
-		}
-		s << '"';
-		p->_type = kStringParamType;
-		p->_value = s.str();
-		}
-		break;
-	default: //Defer handling to parent implementation
-		SimpleDisassembler::readParameter(p, type);
-		break;
-	}
-\end{lstlisting}
-\end{C++}
-
-Note that you will have to increment the \code{\_address} variable manually when you read a byte. This variable is used to determine the address of the instruction, and must be kept in sync with your progress reading the file.
-
-Now, we can add all three opcodes to the list:
-
-\begin{C++}
-\begin{lstlisting}
-START_OPCODES;
-	OPCODE(0x00, "PUSH", MyStackInstruction, 1, "B");
-	OPCODE(0x01, "POP", MyStackInstruction, -1, "");
-	OPCODE(0x02, "PUSH", MyStackInstruction, 1, "w");
-	OPCODE(0x03, "POP2", MyStackInstruction, -2, "");
-	OPCODE(0x80, "PRINT", KernelCallStackInstruction, 0, "c");
-END_OPCODES;
-\end{lstlisting}
-\end{C++}
-
-\subsubsection{Multi-byte opcodes}
-There is only one opcode left to add, \code{HALT}. This one is a bit trickier, because it uses multiple bytes for the opcode - and the \code{OPCODE} macro only works for one byte at a time.
-
-To solve this, you can define \emph{subopcodes}. By defining 0xFF as the start of a multi-byte opcode, we can then specify 0x00 as representing a \code{HALT} instruction when it follows 0xFF.
-
-Defining 0xFF is easily done using the \code{START\_SUBOPCODE} macro. After that, specify the opcodes for this following byte, and finish the subopcode declarations with \code{END\_SUBOPCODE}.
-
-\begin{C++}
-\begin{lstlisting}
-START_OPCODES;
-	OPCODE(0x00, "PUSH", MyStackInstruction, 1, "B");
-	OPCODE(0x01, "POP", MyStackInstruction, -1, "");
-	OPCODE(0x02, "PUSH", MyStackInstruction, 1, "w");
-	OPCODE(0x03, "POP2", MyStackInstruction, -2, "");
-	OPCODE(0x80, "PRINT", KernelCallStackInstruction, 0, "c");
-	START_SUBOPCODE(0xFF);
-		OPCODE(0x00, "HALT", KernelCallStackInstruction, 0, "");
-	END_SUBOPCODE;
-END_OPCODES;
-\end{lstlisting}
-\end{C++}
-
-Subopcodes can be nested if the instruction set requires it. For subopcodes, the \code{\_opcode} field stores the bytes in the order they appear in the file - i.e., the HALT instruction would have the opcode value 0xFF00. If the opcodes are longer than 4 bytes, only the last 4 bytes will be stored.
-
-If all opcodes in a group of subopcodes share a prefix, you can use the \code{START\_SUBOPCODE\_WITH\_PREFIX} macro instead of \code{START\_SUBOPCODE}. This macro takes an additional string parameter containing the full prefix to use for the opcodes associated with this subopcode. The prefix is not propagated if you nest subopcodes, only the nearest prefix is used.
-
-\subsubsection{Code generation metadata}
-For each opcode, you will need to replicate its semantics during code generation. To assist you in generalizing your code, you can use the \code{OPCODE\_MD} macro to add metadata to the instruction, which is then available during code generation.
-
-For example, if you have an opcode for addition, you can store the addition operator as a string in the metadata field, and have that put to use during code generation to avoid having to check the opcode for each instruction of that type.
-
-The arguments for the \code{OPCODE\_MD} are the same as those for \code{OPCODE}, but with an extra parameter at the end for the metadata.
-
-\begin{C++}
-\begin{lstlisting}
-START_OPCODES;
-	OPCODE_MD(0x14, "add", BinaryOpStackInstruction, -1, "", "+");
-END_OPCODES;
-\end{lstlisting}
-\end{C++}
-
-For details, see Section~\vref{sec:codegen}.
-
-\subsubsection{Advanced opcode handling}
-If you have one or two opcodes that do not quite fit into the framework provided, you can define your own specialized handling for these opcodes.
-
-Instead of using the \code{OPCODE} macro, put your code between \code{OPCODE\_BASE} and \code{OPCODE\_END}. For example, if your opcode has the value 0x40, you would use this:
-
-\begin{C++}
-\begin{lstlisting}
-OPCODE_BASE(0x40);
-	//Your code here
-OPCODE_END;
-\end{lstlisting}
-\end{C++}
-
-\code{OPCODE\_BASE} automatically keeps track of the current opcode value. You can access \code{full\_opcode} to get the current full opcode. Alternatively, you can use the \code{OPCODE\_BODY} macro to use the standard behavior for opcodes, and then follow that with the additional code you want. The \code{OPCODE\_BODY} macro takes the same arguments as the \code{OPCODE\_MD} macro.
-
-For your convenience, a few additional macros are available: \code{ADD\_INST}, which adds an empty instruction of the provided type to the vector, and \code{LAST\_INST} which retrieves the last instruction in the vector. Additionally, you can use \code{INC\_ADDR} as a shorthand for incrementing the address variable by 1, but note that you should \emph{not} increment the address for the opcode itself - this is handled by the other macros.

+ 0 - 20
V-Gears-Installer/include/decompiler/doc/doc.tex

@@ -1,20 +0,0 @@
-\input{preamble}
-
-\begin{document}
-\title{Generic decompiler documentation}
-\author{Michael Madsen}
-\maketitle
-
-\tableofcontents
-
-\newpage
-\input{overview}
-\input{engine}
-\input{disassembler}
-\input{cfg}
-\input{codegen}
-\input{restrictions}
-\input{todo}
-%\newpage\listoffixmes
-
-\end{document}

+ 0 - 71
V-Gears-Installer/include/decompiler/doc/engine.tex

@@ -1,71 +0,0 @@
-\newpage\section{Engine}
-The \code{Engine} class represent a single engine. It works as a factory for the engine-specific classes required for each step of the process.
-
-As a minimum, engines must provide a disassembler and a code generator. All other steps are optional, but you can implement them for additional processing.
-
-If you need to store metadata about the script, you can add the necessary fields to your engine class and store the information there, as the same instance will be used throughout the decompilation process.
-
-\subsection{Adding a new engine}
-\label{sec:addingengine}
-In order to make the decompiler use the code you write to decompile code for some engine, it must be registered in the program. To do so, include the header file for your engine in \code{decompiler.cpp}, and use the \code{ENGINE} macro defined there to register your engine with the program.
-
-This macro takes 3 parameters: the engine ID, a description of the engine, and the name of the \code{Engine} subclass used to create the classes used for the various steps of the process. The ID is entered by the user to signify the engine where the script originates from, and the description is a descriptive text which will be shown when the user requests a list of the supported engines. In general, you should place the files for your engine in a folder with the same name as the engine ID you use.
-
-The methods you need to implement in your \code{Engine} subclass are:
-\begin{itemize}
-\item \code{getDisassembler}, which takes a reference to the instruction vector to use for storage and creates a disassembler object and returns it. For more on disassemblers, see Section~\vref{sec:disassembler}.
-\item \code{getCodeGenerator}, which takes a reference to the \code{std::ostream} to output the code to and creates a code generator object and returns it. For more on code generators, see Section~\vref{sec:codegen}.
-\end{itemize}
-
-Additional methods you can override are:
-\begin{itemize}
-\item \code{supportsCodeFlow} and \code{supportsCodeGen}, which can be used to stop the decompiler from going any further after disassembly or code flow analysis, respectively. This is helpful when working on a brand new engine, so you can take one step at a time without having to remember to use the right command-line switch. If you do not override these methods, the decompiler will go through all steps.
-\item \code{detectMoreFuncs} allows you to tell the control flow analysis to automatically detect functions based on reachability. See Section~\vref{sec:autofunc} for details. By default, this is turned off; engines must opt-in to this feature.
-\item \code{postCFG}, which is a post-processing step called after control flow analysis. If you override \code{detectMoreFuncs} to return true, you must also override this function to process any newly found functions. A default implementation which does nothing is already provided in case you do not need to do any post-processing.
-\item \code{usePureGrouping} is used to toggle ``pure'' grouping. In pure grouping, stack levels are ignored during group generation in the control flow analysis. By default, this is turned off. See Section~\vref{sec:groupgen} for details.
-\end{itemize}
-
-Additionally, if your engine is not stack-based, you may not wish to see the stack effect when reviewing the disassembly or code flow graph. You can disable this by calling \code{setOutputStackEffect(false)} from e.g. your Engine constructor. The method is defined in instruction.h, which you will have to include.
-
-It is important to realize that you do not necessarily need to implement a completely new code generator and disassembler for every engine; for variations on the same engine, you can reuse the existing classes and simply send in any extra information required. In particular, code generators are likely to be reusable without change for different versions of the same engine -- e.g., the Kyra2 code generator will likely work for all Kyra games.
-
-For this purpose, the user may optionally specify an \emph{engine variant}, which is a string that will be passed to your Engine. If you make use of this feature, you should also override \code{getVariants} to specify which variants your engine supports. This list will be displayed to the user if they specify an engine while using the \code{-h} option.
-
-Note that the variant sent into your engine is not validated against your list of supported variants. This keeps the variant logic flexible, and allows you to implement your own fallback logic for unknown variant strings.
-
-If you can auto-detect the variant from the script file, you should prefer this approach over asking the user to specify the variant.
-
-\subsection{Functions}
-Some engines allow multiple functions in a single script file. Each function must be analyzed separately, but in order to do that, it is of course necessary to know where the functions start and end, and when it is time to actually generate some code, you will want to know a bit about the function as well.
-
-This information is stored in the engine, as a \code{std::map} of \code{Function}s, in the field \code{\_functions}.
-
-\begin{C++}
-\begin{lstlisting}
-struct Function {
-public:
-	ConstInstIterator _startIt;
-	ConstInstIterator _endIt;
-	std::string _name;
-	GraphVertex _v;
-	uint32 _args;
-	bool _retVal;
-	std::string _metadata;
-};
-\end{lstlisting}
-\end{C++}
-
-Each member of this struct has a specific purpose:
-\begin{itemize}
-\item \code{\_startIt} is a const iterator pointing to the first instruction in the function, i.e. the entry point.
-\item \code{\_endIt} is a const iterator pointing to the instruction immediately after the last instruction, similar to \code{end()} on STL collections.
-\item \code{\_name} is the name of the functions.
-\item \code{\_v} is the GraphVertex containing the entry point. This will be automatically assigned in the control flow analysis.
-\item \code{\_args} is the number of arguments for the function. This is present as a convenience; usually, you will not know the names of the arguments in the function, so you can store the number of them here and use this during code generation to generate a method signature containing some default parameter names.
-\item \code{\_retVal} should be true if your method returns a value, and false if it does not. Again, this is for your own convenience, to make it easier to handle calls.
-\item \code{\_metadata} contains metadata about the function, so you know how to handle the arguments when the function is being called. It is up to you how you want to use this.
-\end{itemize}
-
-When you add a function to the map, you must use the address of the first instruction as the key.
-
-Sometimes, you do not know where all of the functions begin or end. In that case, the control flow analysis can analyze the code for you and automatically detect missing functions or unknown end points. See Section~\vref{sec:autofunc} for details.

+ 0 - 31
V-Gears-Installer/include/decompiler/doc/overview.tex

@@ -1,31 +0,0 @@
-\section{Overview}
-The decompilation process consists of a few different steps:
-
-\begin{itemize}
-\item Disassembly
-\item Code flow analysis
-\item Code generation
-\end{itemize}
-
-Of these steps, the code flow analysis is engine-independent, while disassembly and code generation require engine-specific code.
-
-\subsection{Reading guide}
-Names used in code are written in a \code{monospaced typewriter font}.
-
-Actual code snippets have basic syntax highlighting on a light gray background, and lines are numbered, like below:
-
-\begin{C++}
-\begin{lstlisting}
-#include <stdio.h>
-
-int main(int argc, char **argv) {
-	printf("Hello world!");
-	return 0;
-}
-\end{lstlisting}
-\end{C++}
-
-In this document, the terms \emph{control flow analysis} and \emph{code flow analysis} are used interchangably.
-
-\subsection{Limitations}
-The decompiler is targeted for stack-based instruction sets, and may contain assumptions to that effect. If you want to add an engine which does not use a stack-based instruction set, parts of this document may not apply directly, and additional work to the generic parts may be necessary.

+ 0 - 123
V-Gears-Installer/include/decompiler/doc/preamble.tex

@@ -1,123 +0,0 @@
-\documentclass[a4paper,11pt,english]{article}
-
-\usepackage[english]{babel} % English hypenations
-%If hypernations errors add correct hypernation to this file
-\IfFileExists{hyphens.tex}
-{
-  \input{hyphens.tex}
-}{}
-% Alter some LaTeX defaults for better treatment of figures:
-    % See p.105 of "TeX Unbound" for suggested values.
-    % See pp. 199-200 of Lamport's "LaTeX" book for details.
-    %   General parameters, for ALL pages:
-    \renewcommand{\topfraction}{0.9}	% max fraction of floats at top
-    \renewcommand{\bottomfraction}{0.8}	% max fraction of floats at bottom
-    %   Parameters for TEXT pages (not float pages):
-    \setcounter{topnumber}{2}
-    \setcounter{bottomnumber}{2}
-    \setcounter{totalnumber}{4}     % 2 may work better
-    \setcounter{dbltopnumber}{2}    % for 2-column pages
-    \renewcommand{\dbltopfraction}{0.9}	% fit big float above 2-col. text
-    \renewcommand{\textfraction}{0.07}	% allow minimal text w. figs
-    %   Parameters for FLOAT pages (not text pages):
-    \renewcommand{\floatpagefraction}{0.7}	% require fuller float pages
-	% N.B.: floatpagefraction MUST be less than topfraction !!
-    \renewcommand{\dblfloatpagefraction}{0.7}	% require fuller float pages
-
-	% remember to use [htp] or [htpb] for placement
-\usepackage{lmodern} % Use vector font
-\usepackage{ucs}
-\usepackage[utf8x]{inputenc} % UTF8
-\usepackage[T1]{fontenc}
-\usepackage[dvips]{graphicx} % dvi-output
-%\usepackage[round]{natbib}
-\usepackage{makeidx}				% For index
-\makeindex									% For index
-%\usepackage{graphicx}
-\usepackage[chatter]{rotating}
-\usepackage[usenames]{color}
-\usepackage{amsmath, amssymb}
-\usepackage{float} % For better float-support
-\usepackage{varioref}		% Better citation (includes page)
-\usepackage{hyperref}
-%\labelformat{equation}{(#1)}	% Correct equation references !!DOESN'T WORK ATM!!
-\usepackage{verbatim}
-\usepackage{array}
-
-% Listings, for writing code
-\usepackage{listings}
-
-\usepackage[draft]{fixme}
-
-\definecolor{MyMaroon}{cmyk}{0,0.87,0.68,0.32} % PANTONE 201
-\definecolor{grey}{rgb}{0.95,0.95,0.95}
-\newenvironment{C++}{
-  \lstset{
-    language=C++,
-		defaultdialect=GNU,
-		extendedchars=true,
-		inputencoding=utf8x,
-		escapeinside={(*@}{@*)},
-    basicstyle=\footnotesize\sf,
-    tabsize=4,
-    tab=$\to$,
-    float=tbph,
-    numbers=left,
-    breaklines,
-    showtabs=false,
-    showspaces=false,
-    showstringspaces=false,
-    keywordstyle=\color{blue}\textbf,
-		stringstyle=\color{MyMaroon},
-    captionpos=b,
-    mathescape={true},
-		columns=fullflexible,
-%    escapechar = |,
-    backgroundcolor=\color{grey},
-%    aboveskip=\bigskipamount,
-  }
-}{}
-
-\newenvironment{bytecode}{
-  \lstset{
-    language=,
-%		defaultdialect=x86masm,
-		extendedchars=true,
-		inputencoding=utf8x,
-		escapeinside={(*@}{@*)},
-    basicstyle=\footnotesize\sf,
-    tabsize=4,
-    tab=$\to$,
-    float=tbph,
-    numbers=left,
-    breaklines,
-    showtabs=false,
-    showspaces=false,
-    showstringspaces=false,
-    keywordstyle=\color{blue}\textbf,
-		stringstyle=\color{Maroon},
-    captionpos=b,
-    mathescape={true},
-		columns=fullflexible,
-%    escapechar = |,
-    backgroundcolor=\color{grey},
-%    aboveskip=\bigskipamount,
-  }
-}{}
-
-% Table stuff
-%\usepackage{tabls}
-\usepackage{longtable}
-\makeatletter
-\setlength{\belowcaptionskip}{6pt}
-\makeatother
-
-\newcommand\T{\rule{0pt}{2.6ex}}
-\newcommand\B{\rule[-1.4ex]{0pt}{0pt}}
-
-%\setlength{\parindent}{0mm}
-
-\newcommand{\code}[1]{\texttt{#1}}
-
-\numberwithin{figure}{section}
-\numberwithin{table}{section}

+ 0 - 12
V-Gears-Installer/include/decompiler/doc/restrictions.tex

@@ -1,12 +0,0 @@
-\section{Current restrictions}
-This section describes restrictions and limitations that are currently placed on the individual engines that have been implemented.
-
-\subsection{SCUMMv6}
-roomObj scripts have a header specifying offsets for various verbs. This is currently ignored, and the script is treated as a single piece of code; it would be more appropriate to create functions from these and properly treat stopObjectCodeA/B as returns.
-
-\subsection{KYRA2}
-The decompiler has only been tested with English scripts (.EMC files) from the Kyra 2 demo. It is possible that some scripts from the full version misbehave somehow; as I do not own the game, I cannot be sure of this.
-
-The setRetAndJmp opcode is not currently handled since I don't have any examples of it.
-
-Only "regular" scripts are supported; animation scripts are not supported. It looks like the file names of animation scripts all start with either \_Z or \_IDL, but this is not necessarily an exhaustive list.

+ 0 - 38
V-Gears-Installer/include/decompiler/doc/todo.tex

@@ -1,38 +0,0 @@
-\section{To-do list}
-During the course of developing the decompiler, various ideas have been considered for implementation in the decompiler, but not all of them could be implemented within the given timeframe.
-
-Following is a description of known issues and enhancements that would be nice to see in the decompiler at some point in time.
-
-Note that the order of the issues is not necessarily indicative of the priority that should be given to each issue.
-
-\subsection{Allow conditional jumps to be used for break/continue}
-Currently, only unconditional jumps are allowed for break/continue. However, where the code is similar to \code{if (...) break;}, it is a simple and obvious optimization to not output an unconditional jump and just make the proper address the target of the conditional jump from the if.
-
-Support for this should be added to the analysis. Should be doable by also checking destinations of unmarked conditional jumps, since ifs are marked after breaks and continues - so simply add that to the initial filter and make sure we process the right (non-sequential) target vertex.
-
-Classifying as an enhancement since it appears this optimization is not used in SCUMMv6 (there is an if (...) break in tentacle/room-13-206, but the break is a separate jump). Not sure if KYRA uses it - a cursory scan of the KYRA2 demo suggests that it could use an optimization, as I found only 1 occurence of a c1\_ifNotJmp immediately followed by a c1\_jump (skull\textbackslash skull.emc, 0x0578) - but it did not look like a loop. That, however, does not prove that KYRA actually uses the optimization - it could simply be that such a piece of code was never used.
-
-As far as I have been able to tell, this optimization really is not used in Kyra, so this will have to be deferred until we have an engine which needs it.
-
-\subsection{Re-enable short-circuit detection}
-Currently the short-circuit detection is disabled because it requires some extra handling in code generation which is not there yet (you have to analyze each jump more closely).
-
-\subsection{Refactor CFG design}
-The CFG anaylsis, while certainly functional, is not entirely pretty right now.
-
-It would be a good idea to go over this and see if it can be made better somehow, e.g. by incorporating more of the syntax as nodes in the graph. This might also make it easier to get short-circuiting working correctly.
-
-\subsection{Refactor disassemblers to accept a SeekableReadStream}
-It would be desirable if disassemblers accepted a \code{Common::SeekableReadStream} instead of a \code{Common::File}, for easier integration with other tools and possibly ScummVM itself.
-
-Unfortunately, streams do not currently exist in the tools repository. To get around this, it should be enough to move over \code{ReadStream}, \code{WriteStream}, and \code{SeekableReadStream} to begin with, and make \code{Common::File} subclass from the required streams.
-
-This is very much an *optional* task, and only to be done near the end, if time permits - it is not really within the scope of the project, and it would be fairly easy to make the switch after GSoC.
-
-\subsection{SCUMM: Rewrite jump 0 at end of script to infinite loop}
-Several SCUMM scripts end with a jump 0, making them infinite loops. It would be nice if this could be expressed accordingly, but this does not appear to be a trivial task; some jump 0s in a script could be expressed as a continue, others cannot.
-
-\subsection{Proper getCondition method on Value}
-For now, it is assumed that conditional jumps leave their condition on the stack, so this can be retrieved by the generic code generation code. For non-stack-based engines, it would be a bit nicer if they could just give us a condition to use in an if/while/do-while, instead of currently requiring that the value is on the top of the stack.
-
-A very simple way to do this would be to simply define a getCondition on Value that takes the same parameters as processInst, with a default implementation that just calls processInst and pops and returns the top value from the stack - this means no changes would be required to exisiting engines, and new engines can override this method as they see fit.

+ 0 - 1
V-Gears-Installer/src/CMakeLists.txt

@@ -1,7 +1,6 @@
 include_directories(
     ${VGears_INCLUDE_DIRS}
     ${VGears_SOURCE_DIR}/V-Gears/include
-    ${VGears_SOURCE_DIR}/SupportedGames/FinalFantasy7/include
     ${CMAKE_CURRENT_SOURCE_DIR}/common/include
     ${CMAKE_CURRENT_SOURCE_DIR}
     ${ZLIB_INCLUDE_DIRS}

+ 1 - 3
doc/BUILD.md

@@ -4,10 +4,8 @@
 Install required dependencies by runing the script `CIBuild/linux/dependencies.sh`. Alternativelly, install them manually by running as root
 
 ```bash
-apt install libogre-1.12-dev libtinyxml-dev boost1.55 libvorbis-dev libalut-devlibfreetype6-dev libfreeimage-dev zlib1g-dev libzzip-dev libois-dev libglu-dev libqt5core5a libqt5widgets5 libpng
+apt install g++ cmake libqt5widgets5 qtbase5-dev zlib1g-dev libogre-1.12-dev libois-dev libvorbis-dev libboost-dev libboost-test-dev libboost-filesystem-dev lua5.2 liblua5.2-dev libluabind-dev luajit libopenal-dev libtinyxml-dev
 ```
-## TODO:
-I will either explain tis, or, preferably, fix it so it isn't nedded.
 
 ## Build using CMake
 ```bash

+ 0 - 8
lib/cotire/.gitattributes

@@ -1,8 +0,0 @@
-*.sh            eol=lf
-bootstrap       eol=lf
-configure       eol=lf
-*.[1-9]         eol=lf
-
-*.bat           eol=crlf
-*.cmd           eol=crlf
-*.vbs           eol=crlf

+ 0 - 5
lib/cotire/.gitignore

@@ -1,5 +0,0 @@
-# ignore CMake build directories
-*build*/
-.DS_Store
-.project
-.idea

+ 0 - 20
lib/cotire/CMakeLists.txt

@@ -1,20 +0,0 @@
-# cotire example project
-cmake_minimum_required(VERSION 2.8.12)
-
-if (POLICY CMP0058)
-	# Ninja requires custom command byproducts to be explicit
-	cmake_policy(SET CMP0058 NEW)
-endif()
-
-project (CotireExample)
-
-set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake")
-
-if (NOT CMAKE_VERSION VERSION_LESS "3.1.0")
-	set (CMAKE_CXX_STANDARD "98")
-	set (CMAKE_CXX_EXTENSIONS OFF)
-endif()
-
-include(cotire)
-
-add_subdirectory(src)

+ 0 - 360
lib/cotire/HISTORY.md

@@ -1,360 +0,0 @@
-## 1.8.1 (2019-12-23)
-
-* harden check for embedded parent directory references.
-* use native paths for Clang under Windows.
-* work around ccache 3.7 command line interface change.  
-
-## 1.8.0 (2018-03-18)
-
-* support for clang-cl.exe under Windows.
-* faster prefix header generation for Clang.
-* enable parallel compilation of unity target for MSVC.
-* CMake 3.9 and 3.10 compatibility fixes.
-* disable inclusion of timestamp in precompiled headers for Clang.
-* work around ccache reporting incorrect configuration.
-* honor `MANUALLY_ADDED_DEPENDENCIES` property upon generation of unity targets.
-* use default setting of 2 for `COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES`.
-* drop broken support for unity building of targets with automatic CMake Qt processing turned on.
-* manual updates.
-
-## 1.7.10 (2017-06-16)
-
-* CMake 3.8 compatibility.
-* CMake 3.8.0 Qt automoc support (thanks bilke).
-* fix Xcode recompiling every time builds happen (thanks gcamp).
-* disable PCH messages when `-Wno-pch-messages` flag exists (thanks kbinani).
-* work around ccache incompatibility with newer versions of GCC and Clang.
-* fix MinGW incompatibility with `BUILD_INTERFACE` generator expression.
-* fix handling of `CMAKE_INCLUDE_FLAG_SEP_<LANG>` variables.
-
-## 1.7.9 (2016-12-08)
-
-* CMake 3.6 and 3.7 compatibility.
-* fix ccache 3.2 compatibility issues.
-* fix bugs with handling language standard related properties (e.g., `CXX_STANDARD`, `CXX_EXTENSIONS`).
-* make prefix header generation and precompiled header compilation depend on the compiler executable.
-* fix Qt automoc handling for Windows (thanks jcelerier).
-* convert Windows paths in include directories to CMake paths (thanks wdx04).
-* replace object library with corresponding unity object library when using `COPY_UNITY` linking strategy.
-* better error reporting from prefix header generation.
-
-## 1.7.8 (2016-03-27)
-
-* fix `COPY_UNITY` linking strategy for private link dependencies.
-* honor `CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE` upon handling of target usage requirements.
-* reworked setting up of `LINK_LIBRARIES` and `INTERFACE_LINK_LIBRARIES` properties for unity targets.
-
-## 1.7.7 (2016-03-20)
-
-* CMake 3.5 compatibility.
-* fix bugs related to handling of interface libraries.
-* output shorter log messages when using Visual Studio IDE.
-* don't disable PCH if CMAKE_<LANG>_COMPILER_ID is not set (thanks jcelerier).
-* add support for compiler launchers introduced in CMake 3.4 (thanks misery).
-
-## 1.7.6 (2015-12-06)
-
-* fix CMake 3.4 compatibility issues.
-* prevent redundant re-generation of prefix header when a target has generated source files.
-
-## 1.7.5 (2015-10-27)
-
-* handle visibility target properties (`CXX_VISIBILITY_PRESET` and `VISIBILITY_INLINES_HIDDEN`).
-* better handling of include directories and system include directories.
-* parse additional system include directories from target compile flags.
-* activate select CMake policies.
-
-## 1.7.4 (2015-10-10)
-
-* set up single unity source file for prefix header generation.
-* increase MSVC default PCH memory to 128M.
-* remove obsolete code.
-
-## 1.7.3 (2015-07-25)
-
-* handle language standard target properties (e.g., `CXX_STANDARD`).
-* apply user provided prefix header to unity build target.
-* remove effect of `COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES` on generated unity target.
-* manual updates.
-
-## 1.7.2 (2015-04-22)
-
-* reduce configure time overhead.
-* fix bug with dependency checking when using Xcode.
-* remove obsolete code required for CMake versions older than 2.8.12.
-* streamline debugging output.
-
-## 1.7.1 (2015-04-06)
-
-* fix problem with CMake's automatic Qt processing for generated unity targets.
-* added a section on common pitfalls when using cotire to the manual.
-* remove obsolete code required for CMake versions older than 2.8.12.
-* streamline debugging output.
-* activate select CMake policies.
-
-## 1.7.0 (2015-03-29)
-
-* fix CMake 3.2 compatibility issues.
-* cotire now requires CMake 2.8.12 or newer.
-* copy `IMPORT_PREFIX` and `IMPORT_SUFFIX` target properties for unity targets (thanks peterhuene).
-* new property `COTIRE_PREFIX_HEADER_INCLUDE_PRIORITY_PATH` allows for organizing includes
-  added to the prefix header by priority (thanks ArnaudD-FR).
-* for Visual Studio C++, increase static precompiled header memory allocation.
-* the default strategy for setting up a unity target's linked libraries is now `COPY_UNITY`.
-* for Qt projects, fix problem with handling of `AUTOMOC` in generated unity target.
-* fix problem with generating the cotire intermediate directory.
-* documentation updates.
-
-## 1.6.9 (2015-01-18)
-
-* fix bug with parsing of localized MSVC `/showIncludes` output.
-
-## 1.6.8 (2014-12-28)
-
-* fix bug with generation of unity source file segments for parallel builds.
-
-## 1.6.7 (2014-12-21)
-
-* fix CMake 3.1 compatibility issues.
-* fix ccache 3.2 compatibility issues.
-* handle `COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES` correctly for mixed-language targets.
-* correctly compute absolute paths of generated source files added to the unity source file.
-* fix bug with checking unity source and prefix header dependencies under Xcode.
-* fix bug with handling of unity source file dependencies.
-* move code to determine build configurations to function of its own.
-* documentation updates.
-
-## 1.6.6 (2014-09-21)
-
-* fix GCC issue with prefix header generation when source files are missing.
-* fix bug where some target properties were not properly propagated to the generated unity target.
-* use `target_link_libraries` to set up the unity target link libraries.
-* add Qt4 and Qt5 examples to the `Patches` directory.
-* documentation updates.
-
-## 1.6.5 (2014-08-26)
-
-* correctly handle generator expressions used in compile definitions, compile flags and include
-  directories (requires CMake 2.8.12 or newer).
-* fix `-isystem` includes being incorrectly passed to `execute_process` (thanks nickhutchinson).
-* make some error messages more verbose.
-
-## 1.6.4 (2014-07-14)
-
-* fix CMake 3.0 compatibility issues.
-* preserve system flag for includes when generating PCH (thanks gjasny).
-* fix bug with setting up `EXPORTS` symbol for shared libraries.
-
-## 1.6.3 (2014-06-11)
-
-* correctly handle usage requirements for transitive link targets.
-* use indirect inclusion for prefix header when using generator Xcode.
-
-## 1.6.2 (2014-06-09)
-
-* don't use `-w` flag for pre-compiling the prefix header, because it has unwanted side effects.
-* correctly handle linked targets' `INTERFACE_COMPILE_OPTIONS`, `INTERFACE_INCLUDE_DIRECTORIES`
-  and `INTERFACE_COMPILE_DEFINITIONS` properties upon pre-compiling and prefix header generation.
-* For Clang and GCC, pre-compile prefix header through indirect inclusion via a prefix source file,
-  to make both compilers honor the `system_header` pragma in the prefix header correctly.
-* fix ccache incompatibility.
-
-## 1.6.1 (2014-04-20)
-
-* fixed bug where precompiled headers did not work with Clang (thanks to nh2 for reporting).
-* when using ccache, require that environment variable `CCACHE_SLOPPINESS` is set to `time_macros`.
-
-## 1.6.0 (2014-03-16)
-
-* suppress compiler warnings from precompiled headers.
-* fix Clang compatibility issue with prefix header generation.
-* use file extension `.pch` for precompiled headers generated with Clang.
-* manual updates.
-
-## 1.5.2 (2014-01-17)
-
-* honor framework includes under OS X correctly.
-* fix handling of OS X specific variables `CMAKE_OSX_SYSROOT` and `CMAKE_OSX_DEPLOYMENT_TARGET`.
-* add new examples to the `Patches` directory.
-
-## 1.5.1 (2013-11-12)
-
-* fixed string quoting bugs.
-
-## 1.5.0 (2013-10-13)
-
-* CMake 2.8.12 compatibility fixes.
-* Upon generation of a unity target, cotire can now be configured to automatically copy all the
-  linked libraries and targets from the original target. See the section on the new target property
-  `COTIRE_UNITY_LINK_LIBRARIES_INIT` in the cotire manual.
-* fixed bug with copying target properties to generated unity target.
-* cotire manual updates.
-* add new examples to the `Patches` directory.
-* fix typos.
-
-## 1.4.3 (2013-09-28)
-
-* fixed bug with generation of unity source file when `COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES` is
-  set to 0.
-
-## 1.4.2 (2013-08-24)
-
-* CMake 2.8.11 compatibility fixes.
-* always force the inclusion of a user provided prefix header, even if the target
-  contains too few sources to enable the use of a precompiled header.
-
-## 1.4.1 (2013-06-08)
-
-* fixed bug with determination of compiler version.
-* fixed bug with generation of unity source when target source files are used for multiple targets.
-* fixed bug with multi-core optimized prefix header generation.
-
-## 1.4.0 (2013-03-11)
-
-* one year anniversary release.
-* add support for multi-core optimized unity builds for some CMake generators.
-* add support for multi-core optimized prefix header generation.
-* add more examples to cotire manual.
-
-## 1.3.6 (2013-03-06)
-
-* fix bug with prefix header initialization for generator Xcode.
-* print cotire version upon inclusion.
-
-## 1.3.5 (2013-03-01)
-
-* fix typos in function names and property descriptions.
-
-## 1.3.4 (2013-02-07)
-
-* fixed bug with computing to output directory of the generated unity target (thanks shaunew).
-* fixed wrong variable reference in debugging output (thanks shaunew).
-
-## 1.3.3 (2013-02-03)
-
-* fixed bug with handling of policy CMP0018 relating to target property `POSITION_INDEPENDENT_CODE`.
-* fixed warnings relating to uninitialized variables.
-* Intel XE 2013 Update 2 compatibility fixes.
-
-## 1.3.2 (2013-02-02)
-
-* fixed missing curly brace (thanks shaunew).
-
-## 1.3.1 (2013-01-29)
-
-* fix bug with filtering of compile options.
-
-## 1.3.0 (2013-01-09)
-
-* add support for Intel C and C++ compilers.
-* CMake 2.8.10 compatibility fixes.
-* properly clean up generated cotire log files upon invoking `clean` target.
-* documentation updates.
-
-## 1.2.0 (2012-11-01)
-
-* add support for manually maintained prefix header and unity source files.
-* the target property `COTIRE_<LANG>_PREFIX_HEADER_INIT` can be set to a user provided prefix
-  header file to be used instead of the automatically generated one (e.g., `stdafx.h`).
-* the new target property `COTIRE_<LANG>_UNITY_SOURCE_INIT` can be set to a user provided unity
-  source file to be used instead of the automatically generated one.
-* the target property `COTIRE_UNITY_TARGET_NAME` is no longer read-only. It can be set to the
-  desired name of the unity target that will be added by cotire.
-* add parameters `SOURCE_DIR` and `BINARY_DIR` to function `cotire` to allow for explicitly
-  specifying a target's source and binary directory, if target to be cotired has been added in a
-  different directory.
-
-## 1.1.8 (2012-10-27)
-
-* when using MSVC, apply option `/bigobj` to compilation of generated unity files.
-
-## 1.1.7 (2012-10-26)
-
-* cope with double slash characters in scanned include paths.
-
-## 1.1.6 (2012-09-22)
-
-* check result code upon scanning includes.
-* always add a `clean_cotire` target to easily clean up cotire generated files.
-* add section on `extern "C"` linkage issues to manual.
-
-## 1.1.5 (2012-08-17)
-
-* new cache variable `COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS` can be set to globally exclude
-  sources with the listed file extensions from the generated unity source.
-* fix check for multi-architecture builds under OS X.
-
-## 1.1.4 (2012-08-15)
-
-* prevent redundant re-generation of the unity source, prefix header and precompiled header files
-  (this makes cotire more applicable to C++ projects that use Qt).
-
-## 1.1.3 (2012-08-12)
-
-* fix out of range index operation upon building list of target include directories.
-* honor target properties `POSITION_INDEPENDENT_CODE` and `NO_SONAME` introduced with CMake 2.8.9.
-* make selection of target source files for requested target language more careful.
-* prevent modification of the CMake policy stack upon CMake version check.
-
-## 1.1.2 (2012-05-06)
-
-* make handling of include directories more robust against invalid paths.
-
-## 1.1.1 (2012-04-20)
-
-* fixed bug with generation of unity targets for `WIN32_EXECUTABLE` targets.
-* fixed bug with parsing of localized MSVC `/showIncludes` output.
-
-## 1.1.0 (2012-04-19)
-
-* tested with CMake 2.8.8.
-* added example to manual that shows how to apply cotire to CMake object library targets.
-* fixed multiple bugs with handling of CMake single build type and multiple configuration builds.
-* added more robust parsing of localized MSVC `/showIncludes` output.
-
-## 1.0.9 (2012-04-09)
-
-* add support for compiler wrappers like ccache.
-* under OS X, apply `CMAKE_OSX_SYSROOT` to prefix header include and ignore paths.
-
-## 1.0.8 (2012-04-05)
-
-* require CMake 2.8.6 since we are using `set_property` option `APPEND_STRING`.
-
-## 1.0.7 (2012-04-02)
-
-* add support for Ninja generator introduced in CMake 2.8.8.
-* fix bug with initialization of variable `COTIRE_VERBOSE`.
-
-## 1.0.6 (2012-04-01)
-
-* correctly handle builds where both `CMAKE_BUILD_TYPE` and `CMAKE_CONFIGURATION_TYPES` are set.
-
-## 1.0.5 (2012-03-26)
-
-* fix Visual Studio C++ 2010 compilation of example project.
-* enhance heuristic for #include_next directive detection.
-* fix llvm-3.0.src.patch for GCC 4.6 compilation.
-
-## 1.0.4 (2012-03-24)
-
-* honor target property INCLUDE_DIRECTORIES introduced in CMake 2.8.8.
-
-## 1.0.3 (2012-03-23)
-
-* handle OBJECT_LIBRARY targets introduced in CMake 2.8.8.
-* use predefined compiler version variable, if available.
-
-## 1.0.2 (2012-03-16)
-
-* fix Xcode 4.3 compatibility.
-* Cotire manual corrections.
-
-## 1.0.1 (2012-03-15)
-
-* Cotire manual corrections.
-* Add prefix header to the generated unity build target.
-
-## 1.0.0 (2012-03-11)
-
-* First release.

+ 0 - 791
lib/cotire/MANUAL.md

@@ -1,791 +0,0 @@
-cotire manual
-=============
-
-Cotire (compile time reducer) is a CMake module that speeds up the build process of CMake based
-build systems by fully automating techniques as [precompiled header][pch] usage and
-[single compilation unit][scu] builds for C and C++.
-
-motivation
-----------
-
-Cotire was born out of a dissatisfaction with the existing CMake solutions for adding
-[precompiled header][1260] support and unity build support to CMake based build systems.
-The design of cotire tries to adhere to the following principles:
-
-#### as automatic as possible
-
-[Precompiled header][pch] and [unity builds][scu] are good ideas in principle, but in reality
-they do not work if the burden of maintaining the required additional source files (a
-[prefix header][pfh] and a unity source file) is put on the developer. A modern build system
-like CMake provides enough context information to have the build system generate and update
-these files automatically.
-
-#### non-intrusive
-
-The configuration of precompiled headers usage and single computation unit builds belongs to the
-build system and not in the source code. Nobody wants to litter one's source files with `hdrstop`
-pragmas or be forced to add an include directive to every file. Source code should build properly
-when a precompiled header isn't used and should build faster when a precompiled header is used.
-
-#### minimal interface
-
-Maintaining a build system over time is enough work and the CMake language may often get in your
-way. Thus the solution should only add few public CMake functions. It should be easy to integrate
-it into an existing CMake based build system and it should be just as easy to remove it again.
-
-#### lazy file creation
-
-The additional source files needed for precompiled header support and unity build support should
-only be created when they are required for the compilation of a target. Thus the solution should
-not create these files upon configuring the project, but should set up custom build commands for
-the creation of these files that only kick in when the files are required to exist by the build
-process.
-
-#### cross-platform
-
-C/C++ Compilers and IDEs on different platforms vary widely in how the implement precompiled
-header support. The solution should hide these implementation details and present a uniform
-interface to the developer on all supported platforms.
-
-cotire basic usage
-------------------
-
-Cotire consists of a single CMake module file, which can be easily added to an existing CMake
-project.
-
-The file `CMake/cotire.cmake` needs to be copied to the module directory of a CMake project. In the
-top-level `CMakeList.txt` file, the module directory needs to be added to the CMake module search
-path:
-
-    set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake")
-
-To use cotire in a CMake project, one adds the following include directive to the beginning of the
-top-level `CMakeList.txt`:
-
-    include(cotire)
-
-To speed the build process of a CMake library or executable target, the `cotire` function is
-applied to a CMake target. From the example project that ships with cotire:
-
-    add_executable(example main.cpp example.cpp log.cpp log.h example.h)
-    ...
-    cotire(example)
-
-Cotire looks at the properties of the target provided by CMake (e.g., target type, source files,
-compile flags, preprocessor defines, include directories, ...) and modifies the target's build
-process in the following way:
-
-1. cotire adds a custom build rule to produce a unity source file from the target's sources.
-2. cotire adds a custom build rule to produce a prefix header file by tracking the header files
-   included by the target's sources.
-3. cotire adds a custom build rule to produce a precompiled header from the prefix header.
-4. cotire modifies the target's compile flags to make use of the generated precompiled header.
-5. cotire adds a couple of new targets.
-
-For makefile based build systems, running `make help` in the terminal reveals the new targets:
-
-    $ make help
-    ...
-    ... all_pch
-    ... all_unity
-    ... clean_cotire
-    ... example
-    ... example_pch
-    ... example_unity
-
-The `example_pch` target triggers the compilation of the precompiled header and as a side effect
-the generation of the unity source and the prefix header. The target `clean_cotire` cleans up all
-files generated by cotire. The `example_unity` target  produces the same output as the original
-`example` target, but does so by performing a unity build. The `all_pch` and `all_unity` serve as
-pool targets for all cotired project targets.
-
-By default, the `example_unity` target inherits all build settings from the original target
-`example` including linked libraries and target dependencies.
-
-cotire generated files
-----------------------
-
-For a target that has been cotired, three files will be generated as part of the build process:
-
-### the unity source
-
-The unity source file is generated from the target by querying the target's `SOURCES` property.
-It consists of preprocessor include directives for each of the target source files. The files
-are included in the same order that is used in the CMake `add_executable` or `add_library` call.
-Header files are omitted.
-
-This is a unity source generated for the example project under OS X:
-
-    #ifdef __cplusplus
-    #include "/Users/sakra/Documents/cotire/src/main.cpp"
-    #include "/Users/sakra/Documents/cotire/src/example.cpp"
-    #include "/Users/sakra/Documents/cotire/src/log.cpp"
-    #endif
-
-The unity source file uses absolute paths to include the target's source file. The file is not
-intended to be portable across different build folders or machines. It is an intermediate file
-tied to the build folder that is automatically recreated by the build system if it is missing.
-
-For multi-core machines cotire can be configured to generate multiple unity file segments that
-can be built in parallel by the chosen CMake generator (see below).
-
-### the prefix header
-
-The prefix header is produced from the unity source file by running the unity file through the
-preprocessor and keeping track of each header file used (this is done by using option `-H` with
-GCC / Clang and `/showIncludes` with Visual Studio C++). The path of each used header file is
-compared against an exclude directory list and an include directory list to decide if the header
-file should be added to the prefix header.
-
-By default the include directory list is empty and the exclude directory list is initialized to
-`"${CMAKE_SOURCE_DIR};${CMAKE_BINARY_DIR}"`. This default setting guarantees that project headers
-which are likely to be changed frequently are not added to the prefix header.
-
-Upon generation of the prefix header cotire makes sure that target compile options, include path
-settings and preprocessor defines (e.g., `NDEBUG`) that affect the outcome of the preprocessor
-are correctly set up.
-
-Generating the prefix header from the unity source is much faster than running each individual
-target source file through the preprocessor, because the coalesced unity source will make the
-preprocessor process most header files only once.
-
-This is a prefix header produced for the example project with Visual Studio 2013 under Windows 7:
-
-    #pragma warning(push, 0)
-    #ifdef __cplusplus
-    #include "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\string"
-    #include "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\algorithm"
-    #include "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iostream"
-    #endif
-    #pragma warning(pop)
-
-Generating the prefix file under Ubuntu 12.04 with GCC 4.6 yields the following result:
-
-    #pragma GCC system_header
-    #ifdef __cplusplus
-    #include "/usr/include/c++/4.6/string"
-    #include "/usr/include/c++/4.6/algorithm"
-    #include "/usr/include/c++/4.6/iterator"
-    #include "/usr/include/c++/4.6/iostream"
-    #endif
-
-Using Xcode 5.1 under OS X 10.9, this is the resulting prefix header:
-
-    #pragma clang system_header
-    #ifdef __cplusplus
-    #include "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/string"
-    #include "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/iostream"
-    #endif
-
-Besides include directives, cotire also adds compiler specific pragmas to the generated prefix
-header to suppress compiler warnings upon inclusion.
-
-Cotire attempts to produce a minimal list of header files by omitting header files indirectly
-included by a header that is already part of the prefix header. Header files with nonstandard
-file extensions like `.inl`, `.inc` of `.ipp` are omitted by default.
-
-The generated prefix file includes the selected header files by their absolute paths. This speeds
-up the precompiling of the prefix header because the compiler does not have to search for header
-files in include directories again.
-
-The prefix header is tailored to the CMake target that it is generated for. It is tied to the
-compiler environment of the local machine and is not portable across different compilers or
-machines. It is automatically recreated by the build system if it goes missing.
-
-The generated prefix header can be applied to a different target added in the same source directory
-(see below).
-
-Optionally, cotire will also create a prefix source file that consists of a single include directive
-for the prefix header. This file is needed for pre-compiling the prefix header with Clang or GCC
-to make both compilers handle the `system_header` pragma correctly.
-
-### the precompiled header
-
-The precompiled header is produced from the generated prefix header by using the proprietary
-precompiling mechanism depending on the compiler used. For GCC and Clang cotire sets up a custom
-build rule and generates the precompiled header as described in the documentation for
-[GCC][gcc_pch] and [Clang][clang_pch]. Cotire then modifies the `COMPILE_FLAGS` property of the
-target to force the inclusion of the prefix header.
-
-Visual Studio C++ and Intel C++ use a [different approach][msvc_pch] to pre-compiling. Both
-compilers require a host source file to generate the precompiled header as a side effect of
-producing an object file. Cotire modifies the `COMPILE_FLAGS` of the first target source file to
-[generate][msvc_pch_create] the precompiled header and then modifies the `COMPILE_FLAGS` of the
-remaining target source files to [include][msvc_pch_use] the generated precompiled header.
-
-For Xcode projects generated with CMake, cotire completely hands off the pre-compilation of
-the prefix header and the inclusion of the precompiled header to the IDE. Cotire attaches a
-pre-build action to the target which generates the unity source file and the prefix header.
-Cotire then modifies Xcode attributes of the generated Xcode project to have Xcode precompile the
-the generated prefix header with the Xcode build steps `ProcessPCH` for C sources and
-`ProcessPCH++` for C++ sources.
-
-For precompiled headers creation flags must match use flags exactly. Cotire uses the same flags,
-include directories and preprocessor defines that are used for the compilation of source files
-for the generation of the precompiled header. Thus the resulting precompiled header binary is only
-usable for the target and cannot be re-used for a different CMake target.
-
-cotire advanced usage
----------------------
-
-### applying cotire to multiple targets at the same time
-
-The `cotire` function can be applied to multiple targets added in the same source directory in one
-call:
-
-    add_library(libA STATIC ...)
-    add_library(libB SHARED ...)
-    add_executable(example ...)
-    ...
-    cotire(example libA libB)
-
-### mixed-language targets
-
-Cotire is able to speed up the build process of mixed language targets, consisting of both C and
-C++ sources. It generates a separate set of unity source files, prefix headers and precompiled
-headers for both languages and modifies the `COMPILE_FLAGS` of each target source file to include
-the correct precompiled header depending on the compilation language of the source file.
-
-### obtaining the names of the generated files and targets
-
-For a cotired target the target properties `COTIRE_<LANG>_UNITY_SOURCE`,
-`COTIRE_<LANG>_PREFIX_HEADER`, `COTIRE_<LANG>_PRECOMPILED_HEADER` will be set to the paths of the
-generated files (`<LANG>` can be set to `CXX` or `C`). The target property
-`COTIRE_UNITY_TARGET_NAME` will be set to the name of the generated unity target:
-
-    cotire(example)
-    ...
-    get_target_property(_unitySource example COTIRE_CXX_UNITY_SOURCE)
-    get_target_property(_prefixHeader example COTIRE_CXX_PREFIX_HEADER)
-    get_target_property(_precompiledHeader example COTIRE_CXX_PRECOMPILED_HEADER)
-    get_target_property(_unityTargetName example COTIRE_UNITY_TARGET_NAME)
-
-If a source file's `COMPILE_FLAGS` are modified by cotire, it sets the source file property
-`COTIRE_TARGET` to the name of the target, that the source file's build command has been
-altered for:
-
-    cotire(example)
-    ...
-    get_source_file_property(_cotireTargetName "example.cpp" COTIRE_TARGET)
-    if (_cotireTargetName)
-        message(STATUS "example.cpp has been cotired for target ${_cotireTargetName}")
-    endif()
-
-### changing the name of the generated unity build target
-
-By default cotire uses the name of the the original target with the suffix `_unity` appended
-for the name of the generated unity build target. To create the unity build target under a
-different name, set the `COTIRE_UNITY_TARGET_NAME` property:
-
-    add_executable(example_template main.cpp example.cpp log.cpp log.h example.h)
-    set_target_properties(example_template PROPERTIES COTIRE_UNITY_TARGET_NAME "example")
-    ...
-    cotire(example_template)
-
-Invoking the `example` target will then run the unity build.
-
-### restricting cotire to certain build configurations
-
-To restrict the cotire related modifications to the build process to certain build configurations,
-the `CONFIGURATIONS` parameter can be added to the `cotire` call.
-
-    cotire(example CONFIGURATIONS Release MinSizeRel)
-
-For single build type builds the selected configuration will be checked at configure time, for
-multi-configuration builds the check will be done at build time.
-
-It is recommended to have at least one build configuration that does not make use of cotire to
-ensure that the project builds properly without cotire.
-
-### disabling precompiled headers and unity builds
-
-If the target's build process should not be modified to make use of the generated precompiled
-header, the target property `COTIRE_ENABLE_PRECOMPILED_HEADER` can be set to `FALSE`:
-
-    set_target_properties(example PROPERTIES COTIRE_ENABLE_PRECOMPILED_HEADER FALSE)
-    cotire(example)
-
-If a unity build target should not be added by cotire, the target property
-`COTIRE_ADD_UNITY_BUILD` can be set to `FALSE`:
-
-    set_target_properties(example PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
-    cotire(example)
-
-The property `COTIRE_ADD_UNITY_BUILD` only affects the addition of the unity build target. Custom
-build rules for the generation of the unity source file will always be set up, because the
-unity source file is needed for the generation of the prefix header.
-
-Both properties default to `TRUE`. If both are set to `FALSE`, cotire will only set up custom build
-rules for the generation of the unity source and the prefix header.
-
-The properties `COTIRE_ENABLE_PRECOMPILED_HEADER` and `COTIRE_ADD_UNITY_BUILD` can also be set on
-directories. A target inherits the property value from its enclosing directory.
-
-### disabling precompiled headers for small targets
-
-The cache variable `COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES` can be set to the minimum number of
-source files required to enable the use of a precompiled header. It defaults to 2. To override the
-default, run `cmake` with the following options:
-
-    $ cmake -D COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES=5 <path-to-source>
-
-### using a manually maintained prefix header instead of the automatically generated one
-
-cotire can be configured to use an existing manually maintained prefix header (e.g., Visual Studio
-projects often use a prefix header named `stdafx.h`) instead of the automatically generated one.
-Set the target property `COTIRE_CXX_PREFIX_HEADER_INIT` to the path of the existing prefix header
-file. The path is interpreted relative to the target source directory:
-
-    set_target_properties(example PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "stdafx.h")
-    cotire(example)
-
-If the prefix header `stdafx.h` needs an accompanying source file (e.g., `stdafx.cpp`) in order
-to be precompiled properly, that source file needs to be the first one on the list of source
-files in the target's `add_executable` or `add_library` call.
-
-The property `COTIRE_CXX_PREFIX_HEADER_INIT` can also be set to a list of header files which will
-then make up the contents of the generated prefix header.
-
-A manually maintained prefix header will always be applied to the corresponding target,
-even if the target contains too few sources to enable the use of a precompiled header.
-
-### using a generated prefix header for multiple targets
-
-A prefix header that is generated for a cotired target can be applied to a different target
-added in the same source directory:
-
-    cotire(example)
-    get_target_property(_prefixHeader example COTIRE_CXX_PREFIX_HEADER)
-    ...
-    set_target_properties(other_target PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "${_prefixHeader}")
-    cotire(other_target)
-
-The compilation of either target will trigger the generation of the prefix header.
-
-### configuring the generation of the prefix header
-
-There are multiple target properties which affect the generation of the prefix header:
-
-* `COTIRE_PREFIX_HEADER_IGNORE_PATH` can be set to a semicolon separated list of directories. If a
-header file is found in one of these directories or sub-directories, it will be excluded from the
-generated prefix header.
-
-* `COTIRE_PREFIX_HEADER_INCLUDE_PATH` can be set to a semicolon separated list of directories. If
-a header file is included from one of these directories or sub-directories, it will be included
-in the generated prefix header.
-
-If a header file is matched by both `COTIRE_PREFIX_HEADER_IGNORE_PATH` and
-`COTIRE_PREFIX_HEADER_INCLUDE_PATH`, the option which yields the closer relative path match wins.
-For example, if third-party libraries are part of the source tree in a directory called `Libs`,
-the following setting will make cotire select header files from the third-party directory, but
-ignore other project related headers in `CMAKE_SOURCE_DIR`:
-
-    set_target_properties(example PROPERTIES
-        COTIRE_PREFIX_HEADER_IGNORE_PATH "${CMAKE_SOURCE_DIR}"
-        COTIRE_PREFIX_HEADER_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/Libs")
-
-The properties `COTIRE_PREFIX_HEADER_IGNORE_PATH` and `COTIRE_PREFIX_HEADER_INCLUDE_PATH` can
-also be set on directories.
-
-The following cache variables also affect the selection of prefix headers:
-
-* Directory paths in `COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_PATH` will be added to the list of
-ignored directories when the prefix header file is created.
-
-* `COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_EXTENSIONS` can be used to ignore header files by file
-extension. It defaults to the CMake list `inc;inl;ipp`.
-
-During development, changes to the project source files may affect the list of header files that
-should be selected for inclusion in the prefix header (e.g., a standard include may be added or
-removed from a target source file). Cotire does not automatically recreate the prefix header,
-when a target source file is changed, because this would always trigger a re-compilation of the
-precompiled header and would result in a rebuild of the whole target. To make the prefix header
-creation dependent on changes to certain target source files, the source file property
-`COTIRE_DEPENDENCY` can be set to `TRUE` for those files:
-
-    set_property (SOURCE "example.cpp" PROPERTY COTIRE_DEPENDENCY "TRUE")
-
-### fixing linkage issues
-
-When a C++ program uses `extern "C"` on a system header file, cotire will not be able to detect
-that the include file needs C linkage and will include the file with C++ linkage in the generated
-prefix header instead. For example, the C interface to BLAS `cblas.h` usually has to be included
-as `extern "C"` in a C++ program:
-
-    extern "C" {
-    #include <cblas.h>
-    }
-
-The presence of `extern "C"` includes will prevent cotired targets from being linked successfully
-because of unresolved function references using the wrong linkage. To work around the problem,
-the property `COTIRE_PREFIX_HEADER_IGNORE_PATH` can also include the full path of header files
-besides directories. Here is an example:
-
-    set_property(DIRECTORY
-        PROPERTY COTIRE_PREFIX_HEADER_IGNORE_PATH
-            "${ATLAS_INCLUDE_DIR}/cblas.h"
-            "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}")
-
-That way `cblas.h` will not be included in the generated prefix header and will not cause problems
-upon linking.
-
-### using a manually maintained unity source instead of the automatically generated one
-
-Cotire can be configured to use an existing manually maintained unity source file instead of the
-automatically generated one. Set the target property `COTIRE_CXX_UNITY_SOURCE_INIT` to the path
-of the existing unity source file. Its path is interpreted relative to the target source directory:
-
-    set_target_properties(example PROPERTIES COTIRE_CXX_UNITY_SOURCE_INIT "example-all.cpp")
-    cotire(example)
-
-The property can also be set to a list of source files which will then make up the contents of
-the generated unity source file.
-
-### configuring the generation of the unity source
-
-By default cotire adds all target source files to the generated unity source. In most cases a
-unity build will not work out of the box, because unity builds [break][EoUB] the use of some C
-and C++ language features. Unity build problems can be tackled in the following way:
-
-* Change the order of the source files in the `add_executable` or `add_library` calls.
-Problematic source files should be moved towards the end.
-
-* Set the source file property `COTIRE_EXCLUDED` on problematic source files. The source file
-will not be included in the unity source file and will be compiled separately when the unity build
-is performed.
-
-* `COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS` can be used to exclude source files by file extension
-from inclusion in the generated unity source. It defaults to the CMake list `m;mm`.
-
-* If the unity source file is too large and the compilation process runs into a compiler limit,
-the target property `COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES` can be set. If the target
-contains more than that number of source files, cotire will create multiple unity source files
-for it. Each unity source file is compiled separately when the unity build is performed.
-The property is initialized by value of the cache variable
-`COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES`.
-
-* Another way to break up a large unity source file is to set the source file property
-`COTIRE_START_NEW_UNITY_SOURCE` to `TRUE` on selected target source files. If cotire encounters
-this property, it will complete the current unity file and start a new one. The new unity source
-file will include the source file as the first one. This property essentially works as a separator
-for unity source files.
-
-### optimizing the build process for multiple processor cores
-
-To make use of all the machine's CPU cores for the unity compilation of a target, the target
-property `COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES` can be set to the string `-j`. Cotire
-will then create as many unity file segments as there are CPU cores on the machine. Because
-the unity file segments do not depend on each other, a multi-core aware build process can compile
-the file segments in parallel.
-
-To explicitly specify the number of cores, append the number after `-j`, e.g. `-j 4` or `-j4`.
-
-For CMake generators that are multi-core aware by default (i.e., Visual Studio, JOM, Ninja), cotire
-will automatically initialize the property to `-j`. For makefile based generators, this has to be
-done explicitly by setting the cache variable `COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES`, i.e.:
-
-    $ cmake -D COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES=-j4 <path-to-source>
-    $ make -j 4
-
-### fixing macro definition clashes
-
-Many unity build problems stem from macro definitions leaking into other target source files,
-where they may conflict with other definitions of the same name. Cotire adds the properties
-`COTIRE_UNITY_SOURCE_PRE_UNDEFS` and `COTIRE_UNITY_SOURCE_POST_UNDEFS` to fix macro definition
-clashes.
-
-As an example, if these properties are set on a source file of the example project:
-
-    set_source_files_properties (example.cpp PROPERTIES
-        COTIRE_UNITY_SOURCE_PRE_UNDEFS "max;min"
-        COTIRE_UNITY_SOURCE_POST_UNDEFS "DEBUG_TYPE")
-
-This will make cotire add undefs to the generated unity source file.
-
-    #ifdef __cplusplus
-    #include "/Users/sakra/Documents/cotire/src/main.cpp"
-    #undef min
-    #undef max
-    #include "/Users/sakra/Documents/cotire/src/example.cpp"
-    #undef DEBUG_TYPE
-    #include "/Users/sakra/Documents/cotire/src/log.cpp"
-    #endif
-
-The properties `COTIRE_UNITY_SOURCE_PRE_UNDEFS` and `COTIRE_UNITY_SOURCE_POST_UNDEFS` can also be
-set on targets. Cotire will add `#undef` directives for each source file in the unity source then.
-
-### enabling verbose builds
-
-The cache variable `COTIRE_VERBOSE` can be set to `TRUE` to see all compile commands used when
-generating the cotire related files. Cotire will also print the contents of the generated unity
-source and the prefix header for verbose builds. `COTIRE_VERBOSE` defaults to `FALSE`.
-When using a Makefile generator `COTIRE_VERBOSE` defaults to the value of the makefile variable
-`VERBOSE` (i.e., `make VERBOSE=1`).
-
-### conditionally loading cotire
-
-To make a `CMakeLists.txt` robust against a missing `cotire.cmake` module, the following strategy
-can be applied to using cotire:
-
-    include(cotire OPTIONAL)
-    ...
-    add_executable(example main.cpp example.cpp log.cpp log.h example.h)
-    ...
-    if (COMMAND cotire)
-        cotire(example)
-    endif()
-
-The `include(cotire OPTIONAL)` will prevent CMake from raising an error if cotire cannot be
-found. The actual calls to cotire need to be guarded by `if (COMMAND cotire)` blocks.
-
-### using cotire with compiler wrappers
-
-Cotire is compatible with CMake compiler wrappers. For example, the use of [ccache][ccch] may be
-enabled in the following way upon configuring the project:
-
-    $ export CC="/usr/local/bin/ccache /usr/bin/gcc"
-    $ export CXX="/usr/local/bin/ccache /usr/bin/g++"
-    $ export CCACHE_SLOPPINESS=pch_defines,time_macros
-    $ cmake ..
-
-Alternatively, for CMake 3.4 or later compiler wrappers can be enabled by pointing the CMake
-variable `CMAKE_CXX_COMPILER_LAUNCHER` to the compiler wrapper executable upon configuring:
-
-    $ cmake -D CMAKE_CXX_COMPILER_LAUNCHER=/usr/local/bin/ccache <path-to-source>
-
-Note that with ccache in order for precompiled headers to work properly, it is necessary to set
-the environment variable `CCACHE_SLOPPINESS` to `pch_defines,time_macros`. Otherwise the build
-process may abort with the following error message:
-
-    fatal error: file 'example_CXX_prefix.hxx' has been modified since the precompiled header
-          'example_CXX_prefix.hxx.gch' was built
-
-Also see the [ccache manual][ccch_pch].
-
-### applying cotire to object library targets
-
-CMake 2.8.8 introduced a new type of library target called [object library][objlib]. An object
-library is a convenience target that compiles multiple source files but does not create a linked
-target library for them, e.g.:
-
-    add_library(myLib OBJECT lib1.cpp lib2.cpp lib3.cpp)
-    add_executable(exeA $<TARGET_OBJECTS:myLib> mainA.cpp)
-    add_executable(exeB $<TARGET_OBJECTS:myLib> mainB.cpp)
-
-The `cotire` function can be applied to an object library target in a familiar fashion:
-
-    add_library(myLib OBJECT lib1.cpp lib2.cpp lib3.cpp)
-    cotire(myLib)
-    # use unity object library for executables
-    add_executable(exeA $<TARGET_OBJECTS:myLib_unity> mainA.cpp)
-    add_executable(exeB $<TARGET_OBJECTS:myLib_unity> mainB.cpp)
-
-Because object library targets do not support `PRE_BUILD` actions, precompiled header usage cannot
-be enabled for them for Xcode projects generated with CMake. Unity builds work as expected, though.
-
-### automatically setting up linked libraries in the unity target
-
-The setting of the target property `COTIRE_UNITY_LINK_LIBRARIES_INIT` controls the linking
-strategy for the generated unit target.
-
-If this property is empty or set to `NONE`, the generated unity target's link libraries have to be
-set up manually with subsequent `target_link_libraries` calls:
-
-    set_target_properties(example PROPERTIES COTIRE_UNITY_LINK_LIBRARIES_INIT "NONE")
-    ...
-    cotire(example)
-    target_link_libraries(MyExecutable_unity ${MyExecutableLibraries})
-
-If this property is set to `COPY`, the unity target's link libraries will be copied from the
-original target.
-
-If this property is set to `COPY_UNITY`, the unity target's link libraries will be copied from the
-original target but instead of copying a linked target verbatim, the target's corresponding unity
-target will be preferred, provided one exists. This also applies to object libraries, which have
-been added to the original target with a `TARGET_OBJECTS` generator expression.
-
-As of cotire 1.7.0, the default linking strategy for unit targets is `COPY_UNITY`.
-
-The property `COTIRE_UNITY_LINK_LIBRARIES_INIT` can also be set on directories. A target inherits
-the property value from its enclosing directory. To make all targets in the project use the
-`COPY` strategy, the directory property can be set in the outermost `CMakeList.txt` file:
-
-    include(cotire)
-    ...
-    set_property(DIRECTORY PROPERTY COTIRE_UNITY_LINK_LIBRARIES_INIT "COPY")
-
-### using cotire with Qt
-
-Cotire is compatible with both Qt projects that use CMake as build system, provided Qt targets
-do not use CMake automatic moc, uid or rcc scanning.
-
-### installing files generated by unity targets
-
-Cotire cannot set up a `install_unity` target that mimics the `install` target automatically,
-because CMake does not provide the necessary information about the existing install rules
-programmatically.
-
-When using a Makefile generator, you can use the following workaround (thanks to peterhuene):
-
-    $ make all_unity
-    $ make install/fast
-
-The `install/fast` does not trigger a build, but will use the binaries built by the `all_unity`
-target.
-
-For other generators, set up an `install_unity` target manually. First set up install rules for
-all unity targets, that mimic the install rules for the original targets:
-
-    install(TARGETS example_unity RUNTIME DESTINATION "bin" OPTIONAL COMPONENT "unity")
-
-This installs the `example` executable built by the unity target to the `bin` folder. The install
-rules for unity targets must use a custom install component. Then add a global `install_unity`
-target that performs the installation of all unity targets:
-
-    add_custom_target(install_unity
-        COMMAND ${CMAKE_COMMAND} -DCOMPONENT=unity -P cmake_install.cmake
-        COMMENT "Install the unity-built project..."
-        WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
-    add_dependencies(unity_install example_unity)
-
-The global `install_unity` target must depend on all unity targets that should be installed.
-
-### customized inclusion of system headers
-
-If a system header ends up in a precompiled header, it is not possible to customize the inclusion
-of that header in a source file through preprocessor defines.
-
-For example, under Windows one may want to include `Windows.h` with `NOMINMAX` defined to prevent
-the definition of the `min` and `max` macros:
-
-    #define NOMINMAX
-    #include <Windows.h>
-
-The dependency of `Windows.h` on the preprocessor define `NOMINMAX` will not be picked up by cotire
-automatically upon adding `Windows.h` to the prefix header. To work around the problem, make the
-dependency explicit by using `add_definitions` in the corresponding `CMakeLists.txt`:
-
-    if (WIN32)
-        # prevent definition of min and max macros through inclusion of Windows.h
-        add_definitions("-DNOMINMAX")
-    endif()
-
-That way, the preprocessor define `NOMINMAX` will be picked up by cotire and applied to the
-pre-compilation of the prefix header.
-
-### organize includes added to the prefix header
-
-Sometimes the order of the includes in the automatically generated prefix header may result in
-compilation errors due to subtile header dependencies.
-
-To work around the problem, the target property `COTIRE_PREFIX_HEADER_INCLUDE_PRIORITY_PATH`
-can be set to a list of directories. Header files whose path matches one of these directories will
-be inserted at the beginning of generated prefix header. Header files are sorted according to
-the order of the directories in the property. Headers not matching one of these directories are
-left untouched.
-
-The property `COTIRE_PREFIX_HEADER_INCLUDE_PRIORITY_PATH` can also be set on directories. A target
-inherits the property value from its enclosing directory.
-
-common pitfalls
----------------
-
-### include the `cotire.cmake` module correctly
-
-If CMake issues the message `Unknown CMake command "cotire"`, double check that the cotire module
-has been included correctly in your project. See the manual section "cotire basic usage".
-
-### do not modify a target's build related properties after applying cotire
-
-Cotire only considers build related settings of a target at the time of the `cotire` function call.
-If target properties that control the build are changed after the call to the `cotire` function,
-the build rules set up by cotire for the precompiled header and unity build may not work correctly.
-
-Don't do this:
-
-    add_executable(example main.cpp example.cpp log.cpp log.h example.h)
-    cotire(example)
-    ...
-    set_target_properties(example PROPERTIES POSITION_INDEPENDENT_CODE ON) # affects build
-
-
-### always apply cotire in the same source directory where a target has been added
-
-CMake targets are globally visible. Nevertheless, it is important that the `cotire` function is
-called for a target in the exact same directory that creates the target with `add_library` or
-`add_executable`.
-
-Don't do this:
-
-    add_subdirectory(src)
-    ...
-    cotire(mytarget) # mytarget added in src directory
-
-Cotire may fail to inspect the target's source files correctly, if the target has been added in a
-different directory and you may get odd messages about missing source files.
-
-known issues
-------------
-
-### generator expressions
-
-cotire uses the CMake command `file(GENERATE ...` to expand generator expressions used in various
-compilation settings. This command does not handle certain CMake generator expressions like
-`$<CXX_COMPILER_ID:...>` correctly.
-
-### Ninja compatibility
-
-Under Ninja indirect prefix header dependencies are ignored by the generated build system. Cotire
-uses the `IMPLICIT_DEPENDS` option of `add_custom_command` to make the precompiled header depend
-on header files indirectly included by the prefix header. The `IMPLICIT_DEPENDS` option is not
-supported by CMake's Ninja generator. See [CMake issue][ninja_issue].
-
-### using source files for multiple targets
-
-When the same set of source files is used for different targets (e.g., for producing a static
-and a shared library variant from the same sources), using a precompiled header may not work.
-Under certain circumstances, cotire cannot enable the precompiled header usage by changing the
-`COMPILE_FLAGS` property of the whole target, but must set the `COMPILE_FLAGS` properties of
-individual target source files instead. This will break the usage of the source file for multiple
-targets.
-
-### multi-architecture builds under Mac OS X
-
-Neither GCC nor Clang support the use of precompiled headers when performing a Mac OS X
-multi-architecture build (e.g., using option `-DCMAKE_OSX_ARCHITECTURES=i386;x86_64`).
-
-### Objective-C
-
-CMake targets that contain Objective-C or Objective-C++ source files cannot be cotired. Source
-files ending with .m and .mm are excluded by default through the initial default setting of
-`COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS`.
-
-### Intel C++
-
-Intel C++ support has only been tested with [Intel C++ Composer XE 2013 for Linux][icc_linux] and
-may not work with other platforms or versions.
-
-The Intel compiler may issue incorrect warnings #672 (the command line options do not match those
-used when precompiled header was created) or #673 (the initial sequence of preprocessing directives
-is not compatible with those of precompiled header file) upon compilation of cotired targets.
-
-### IncrediBuild
-
-Cotire is not compatible with [Xoreax IncrediBuild][XGE].
-
-[1260]:https://cmake.org/Bug/view.php?id=1260
-[ccch]:https://ccache.samba.org/
-[ccch_pch]:https://ccache.samba.org/manual.html#_precompiled_headers
-[clang_pch]:https://clang.llvm.org/docs/UsersManual.html#precompiled-headers
-[gcc_pch]:https://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html
-[msvc_pch]:https://msdn.microsoft.com/en-us/library/szfdksca(v=vs.90).aspx
-[msvc_pch_create]:https://msdn.microsoft.com/en-us/library/7zc28563(v=vs.90).aspx
-[msvc_pch_use]:https://msdn.microsoft.com/en-us/library/z0atkd6c(v=vs.90).aspx
-[ninja_issue]:https://cmake.org/Bug/view.php?id=13234
-[EoUB]:http://altdevblog.com/2011/08/14/the-evils-of-unity-builds/
-[pch]:https://en.wikipedia.org/wiki/Precompiled_header
-[scu]:https://en.wikipedia.org/wiki/Single_Compilation_Unit
-[objlib]:https://cmake.org/cmake/help/latest/command/add_library.html#object-libraries
-[pfh]:https://en.wikipedia.org/wiki/Prefix_header
-[icc_linux]:https://software.intel.com/en-us/c-compilers/ipsxe-support
-[XGE]:https://www.incredibuild.com/

+ 0 - 299
lib/cotire/Patches/OpenCV-2.3.1.patch

@@ -1,299 +0,0 @@
-diff -rupN OpenCV-2.3.1/3rdparty/libjasper/CMakeLists.txt OpenCV-2.3.1.cotire/3rdparty/libjasper/CMakeLists.txt
---- OpenCV-2.3.1/3rdparty/libjasper/CMakeLists.txt	2011-09-12 20:39:55.000000000 +0200
-+++ OpenCV-2.3.1.cotire/3rdparty/libjasper/CMakeLists.txt	2012-04-01 11:23:04.000000000 +0200
-@@ -56,3 +56,7 @@ if(NOT BUILD_SHARED_LIBS)
-     install(TARGETS ${the_target}
- 	    ARCHIVE DESTINATION share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
- endif()
-+
-+if (COMMAND cotire)
-+cotire(${the_target})
-+endif()
-diff -rupN OpenCV-2.3.1/3rdparty/libjpeg/CMakeLists.txt OpenCV-2.3.1.cotire/3rdparty/libjpeg/CMakeLists.txt
---- OpenCV-2.3.1/3rdparty/libjpeg/CMakeLists.txt	2011-09-12 20:40:15.000000000 +0200
-+++ OpenCV-2.3.1.cotire/3rdparty/libjpeg/CMakeLists.txt	2012-04-01 11:23:10.000000000 +0200
-@@ -48,3 +48,7 @@ if(NOT BUILD_SHARED_LIBS)
-     install(TARGETS ${the_target}
- 	    ARCHIVE DESTINATION share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
- endif()
-+
-+if (COMMAND cotire)
-+cotire(${the_target})
-+endif()
-diff -rupN OpenCV-2.3.1/3rdparty/libpng/CMakeLists.txt OpenCV-2.3.1.cotire/3rdparty/libpng/CMakeLists.txt
---- OpenCV-2.3.1/3rdparty/libpng/CMakeLists.txt	2011-09-12 20:40:02.000000000 +0200
-+++ OpenCV-2.3.1.cotire/3rdparty/libpng/CMakeLists.txt	2012-04-01 11:23:17.000000000 +0200
-@@ -49,3 +49,7 @@ if(NOT BUILD_SHARED_LIBS)
-     install(TARGETS ${the_target}
- 	    ARCHIVE DESTINATION share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
- endif()
-+
-+if (COMMAND cotire)
-+cotire(${the_target})
-+endif()
-diff -rupN OpenCV-2.3.1/3rdparty/libtiff/CMakeLists.txt OpenCV-2.3.1.cotire/3rdparty/libtiff/CMakeLists.txt
---- OpenCV-2.3.1/3rdparty/libtiff/CMakeLists.txt	2011-09-12 20:29:15.000000000 +0200
-+++ OpenCV-2.3.1.cotire/3rdparty/libtiff/CMakeLists.txt	2012-04-01 11:23:23.000000000 +0200
-@@ -103,3 +103,7 @@ if(NOT BUILD_SHARED_LIBS)
-     install(TARGETS ${the_target}
- 	    ARCHIVE DESTINATION share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
- endif()
-+
-+if (COMMAND cotire)
-+cotire(${the_target})
-+endif()
-diff -rupN OpenCV-2.3.1/3rdparty/zlib/CMakeLists.txt OpenCV-2.3.1.cotire/3rdparty/zlib/CMakeLists.txt
---- OpenCV-2.3.1/3rdparty/zlib/CMakeLists.txt	2011-09-12 20:29:21.000000000 +0200
-+++ OpenCV-2.3.1.cotire/3rdparty/zlib/CMakeLists.txt	2012-04-01 11:24:36.000000000 +0200
-@@ -40,3 +40,7 @@ if(NOT BUILD_SHARED_LIBS)
-     install(TARGETS ${the_target}
- 	    ARCHIVE DESTINATION share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
- endif()
-+
-+if (COMMAND cotire)
-+cotire(${the_target})
-+endif()
-diff -rupN OpenCV-2.3.1/CMakeLists.txt OpenCV-2.3.1.cotire/CMakeLists.txt
---- OpenCV-2.3.1/CMakeLists.txt	2011-09-12 20:45:38.000000000 +0200
-+++ OpenCV-2.3.1.cotire/CMakeLists.txt	2012-04-01 14:34:56.000000000 +0200
-@@ -39,6 +39,8 @@ endif(NOT CMAKE_TOOLCHAIN_FILE)
- cmake_minimum_required(VERSION 2.4)
- project(OpenCV)
- 
-+include("${CMAKE_SOURCE_DIR}/cotire.cmake")
-+
- set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
- if(DEFINED CMAKE_BUILD_TYPE)
-     set_property( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )
-diff -rupN OpenCV-2.3.1/OpenCVModule.cmake OpenCV-2.3.1.cotire/OpenCVModule.cmake
---- OpenCV-2.3.1/OpenCVModule.cmake	2011-09-12 20:45:38.000000000 +0200
-+++ OpenCV-2.3.1.cotire/OpenCVModule.cmake	2012-04-01 11:26:16.000000000 +0200
-@@ -86,7 +86,7 @@ macro(define_opencv_module name)
-         INSTALL_NAME_DIR lib
-         )
- 
--    add_opencv_precompiled_headers(${the_target})
-+#    add_opencv_precompiled_headers(${the_target})
- 
-     # Add the required libraries for linking:
-     target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${ARGN})
-@@ -102,6 +102,10 @@ macro(define_opencv_module name)
-             )
-     endif()
- 
-+    if (COMMAND cotire)
-+    cotire(${the_target})
-+    endif()
-+
-     # Dependencies of this target:
-     add_dependencies(${the_target} ${ARGN})
- 
-@@ -137,7 +141,7 @@ macro(define_opencv_module name)
- 
-         add_executable(${the_target} ${test_srcs} ${test_hdrs})
- 
--        add_opencv_precompiled_headers(${the_target})
-+#       add_opencv_precompiled_headers(${the_target})
- 
-         # Additional target properties
-         set_target_properties(${the_target} PROPERTIES
-@@ -149,6 +153,10 @@ macro(define_opencv_module name)
-             set_target_properties(${the_target} PROPERTIES FOLDER "tests")
-         endif() 
- 
-+        if (COMMAND cotire)
-+        cotire(${the_target})
-+        endif()
-+
-         add_dependencies(${the_target} ${test_deps})
- 
-         # Add the required libraries for linking:
-diff -rupN OpenCV-2.3.1/modules/androidcamera/CMakeLists.txt OpenCV-2.3.1.cotire/modules/androidcamera/CMakeLists.txt
---- OpenCV-2.3.1/modules/androidcamera/CMakeLists.txt	2011-09-12 20:42:03.000000000 +0200
-+++ OpenCV-2.3.1.cotire/modules/androidcamera/CMakeLists.txt	2012-04-01 11:28:54.000000000 +0200
-@@ -52,3 +52,7 @@ if (NOT BUILD_ANDROID_CAMERA_WRAPPER)
-           COMPONENT main)
-   endforeach()
- endif()
-+
-+if (COMMAND cotire)
-+cotire(${the_target})
-+endif()
-diff -rupN OpenCV-2.3.1/modules/androidcamera/camera_wrapper/CMakeLists.txt OpenCV-2.3.1.cotire/modules/androidcamera/camera_wrapper/CMakeLists.txt
---- OpenCV-2.3.1/modules/androidcamera/camera_wrapper/CMakeLists.txt	2011-09-12 20:42:03.000000000 +0200
-+++ OpenCV-2.3.1.cotire/modules/androidcamera/camera_wrapper/CMakeLists.txt	2012-04-01 11:20:26.000000000 +0200
-@@ -34,3 +34,7 @@ SET_TARGET_PROPERTIES(${the_target} PROP
-                       )
- 
- install(TARGETS ${the_target} LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
-+
-+if (COMMAND cotire)
-+cotire(${the_target})
-+endif()
-diff -rupN OpenCV-2.3.1/modules/gpu/CMakeLists.txt OpenCV-2.3.1.cotire/modules/gpu/CMakeLists.txt
---- OpenCV-2.3.1/modules/gpu/CMakeLists.txt	2011-09-12 20:42:20.000000000 +0200
-+++ OpenCV-2.3.1.cotire/modules/gpu/CMakeLists.txt	2012-04-01 11:41:04.000000000 +0200
-@@ -106,7 +106,7 @@ if (BUILD_SHARED_LIBS)
- 	endif()
- endif()
- 
--add_opencv_precompiled_headers(${the_target})
-+#add_opencv_precompiled_headers(${the_target})
- 
- # Additional target properties
- set_target_properties(${the_target} PROPERTIES
-@@ -156,6 +156,9 @@ install(FILES src/nvidia/NPP_staging/NPP
- #	DESTINATION ${OPENCV_INCLUDE_PREFIX}/opencv2/${name}/device
- #	COMPONENT main)
- 
-+if (COMMAND cotire)
-+cotire(${the_target})
-+endif()
- 
- ################################################################################################################
- ################################      GPU Module Tests     #####################################################
-@@ -192,14 +195,17 @@ if(BUILD_TESTS AND EXISTS ${CMAKE_CURREN
-     
-     add_executable(${the_test_target} ${test_srcs} ${test_hdrs} ${nvidia})
-     
--    add_opencv_precompiled_headers(${the_test_target})
-+#    add_opencv_precompiled_headers(${the_test_target})
-     
-     # Additional target properties
-     set_target_properties(${the_test_target} PROPERTIES
-         DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
-         RUNTIME_OUTPUT_DIRECTORY "${EXECUTABLE_OUTPUT_PATH}"
-         )
--	
-+	if (COMMAND cotire)
-+	cotire(${the_test_target})
-+	endif()
-+
- 	if(ENABLE_SOLUTION_FOLDERS)
- 		set_target_properties(${the_test_target} PROPERTIES FOLDER "tests")
- 	endif()
-diff -rupN OpenCV-2.3.1/modules/haartraining/CMakeLists.txt OpenCV-2.3.1.cotire/modules/haartraining/CMakeLists.txt
---- OpenCV-2.3.1/modules/haartraining/CMakeLists.txt	2011-09-12 20:43:56.000000000 +0200
-+++ OpenCV-2.3.1.cotire/modules/haartraining/CMakeLists.txt	2012-04-01 11:21:27.000000000 +0200
-@@ -45,6 +45,10 @@ set_target_properties(opencv_haartrainin
-     INSTALL_NAME_DIR lib
-     )
- 
-+if (COMMAND cotire)
-+cotire(opencv_haartraining_engine)
-+endif()
-+
- if(NOT ANDROID)
- # -----------------------------------------------------------
- #  haartraining
-diff -rupN OpenCV-2.3.1/modules/highgui/CMakeLists.txt OpenCV-2.3.1.cotire/modules/highgui/CMakeLists.txt
---- OpenCV-2.3.1/modules/highgui/CMakeLists.txt	2011-09-12 20:41:29.000000000 +0200
-+++ OpenCV-2.3.1.cotire/modules/highgui/CMakeLists.txt	2012-04-01 12:17:12.000000000 +0200
-@@ -77,6 +77,10 @@ file(GLOB grfmt_srcs src/grfmt*.cpp)
- set(grfmt_hdrs src/bitstrm.hpp ${grfmt_hdrs})
- set(grfmt_srcs src/bitstrm.cpp ${grfmt_srcs})
- 
-+if (COMMAND cotire)
-+	set_source_files_properties (${grfmt_srcs} PROPERTIES COTIRE_EXCLUDED TRUE)
-+endif()
-+
- source_group("Src\\grfmts" FILES ${grfmt_hdrs} ${grfmt_srcs})
- 
- set(highgui_srcs
-@@ -209,6 +213,9 @@ if(APPLE)
-     else()
-         set(highgui_srcs ${highgui_srcs} src/cap_qtkit.mm)
-     endif()
-+	if (COMMAND cotire)
-+		set_source_files_properties (src/window_cocoa.mm src/cap_qtkit.mm PROPERTIES COTIRE_EXCLUDED TRUE)
-+	endif()
- endif(APPLE)
- 
- if(WITH_ANDROID_CAMERA)
-@@ -276,7 +283,7 @@ if (BUILD_SHARED_LIBS)
- 	endif()
- endif()
- 
--add_opencv_precompiled_headers(${the_target})
-+#add_opencv_precompiled_headers(${the_target})
- 
- # For dynamic link numbering convenions
- if(NOT ANDROID)
-@@ -307,6 +314,10 @@ if(MSVC)
-     set_target_properties(${the_target} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:atlsd.lib /DEBUG")
- endif(MSVC)
- 
-+if (COMMAND cotire)
-+cotire(${the_target})
-+endif()
-+
- # Dependencies of this target:
- add_dependencies(${the_target} opencv_core opencv_imgproc)
- 
-@@ -397,7 +408,7 @@ if(BUILD_TESTS)
- 
-   add_executable(${the_target} ${test_srcs} ${test_hdrs})
- 
--  add_opencv_precompiled_headers(${the_target})
-+#  add_opencv_precompiled_headers(${the_target})
- 
-   # Additional target properties
-   set_target_properties(${the_target} PROPERTIES
-@@ -409,6 +420,10 @@ if(BUILD_TESTS)
-     set_target_properties(${the_target} PROPERTIES FOLDER "tests")
-   endif()
- 
-+if (COMMAND cotire)
-+cotire(${the_target})
-+endif()
-+
-   add_dependencies(${the_target} ${test_deps})
- 
-   # Add the required libraries for linking:
-diff -rupN OpenCV-2.3.1/modules/java/CMakeLists.txt OpenCV-2.3.1.cotire/modules/java/CMakeLists.txt
---- OpenCV-2.3.1/modules/java/CMakeLists.txt	2011-09-12 20:40:26.000000000 +0200
-+++ OpenCV-2.3.1.cotire/modules/java/CMakeLists.txt	2012-04-01 11:22:49.000000000 +0200
-@@ -163,6 +163,10 @@ set_target_properties(${target} PROPERTI
- 
- install(TARGETS ${target} LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
- 
-+if (COMMAND cotire)
-+cotire(${target})
-+endif()
-+
- if(ANDROID)
-     target_link_libraries(${target} jnigraphics)
- 
-diff -rupN OpenCV-2.3.1/modules/python/CMakeLists.txt OpenCV-2.3.1.cotire/modules/python/CMakeLists.txt
---- OpenCV-2.3.1/modules/python/CMakeLists.txt	2011-09-12 20:40:30.000000000 +0200
-+++ OpenCV-2.3.1.cotire/modules/python/CMakeLists.txt	2012-04-01 11:23:51.000000000 +0200
-@@ -92,3 +92,7 @@ install(TARGETS ${cvpymodules}
-       ARCHIVE DESTINATION ${CVPY_PATH} COMPONENT main
-       )
- install(FILES src2/cv.py DESTINATION ${CVPY_PATH} COMPONENT main)
-+
-+if (COMMAND cotire)
-+cotire(${cv2_target})
-+endif()
-diff -rupN OpenCV-2.3.1/modules/stitching/CMakeLists.txt OpenCV-2.3.1.cotire/modules/stitching/CMakeLists.txt
---- OpenCV-2.3.1/modules/stitching/CMakeLists.txt	2011-09-12 20:42:22.000000000 +0200
-+++ OpenCV-2.3.1.cotire/modules/stitching/CMakeLists.txt	2012-04-01 11:24:09.000000000 +0200
-@@ -38,3 +38,7 @@ endif()	
- target_link_libraries(${the_target} ${stitching_libs})
- 
- install(TARGETS ${the_target} RUNTIME DESTINATION bin COMPONENT main)
-+
-+if (COMMAND cotire)
-+cotire(${the_target})
-+endif()
-diff -rupN OpenCV-2.3.1/modules/traincascade/CMakeLists.txt OpenCV-2.3.1.cotire/modules/traincascade/CMakeLists.txt
---- OpenCV-2.3.1/modules/traincascade/CMakeLists.txt	2011-09-12 20:40:17.000000000 +0200
-+++ OpenCV-2.3.1.cotire/modules/traincascade/CMakeLists.txt	2012-04-01 11:24:25.000000000 +0200
-@@ -44,3 +44,7 @@ target_link_libraries(${the_target} ${tr
- if(NOT ANDROID)
-     install(TARGETS ${the_target} RUNTIME DESTINATION bin COMPONENT main)
- endif()
-+
-+if (COMMAND cotire)
-+cotire(${the_target})
-+endif()

+ 0 - 24
lib/cotire/Patches/README.md

@@ -1,24 +0,0 @@
-This directory contains patch files to enable cotire for some popular open sources packages that
-use CMake as a build system.
-
-For example, to apply Cotire to LLVM 3.0, first copy `cotire.cmake` to a directory on the CMake
-module search path (e.g., `llvm-3.0.src/cmake/modules`).
-
-Then apply the corresponding patch:
-
-    $ cd /path/to/llvm-3.0.src
-    $ patch -p1 < /path/to/llvm-3.0.src.patch
-
-Then proceed with an out-of-source CMake build:
-
-    $ mkdir build; cd build
-    $ cmake ..
-    -- The C compiler identification is GNU 4.2.1
-    -- The CXX compiler identification is Clang 3.1.0
-    ...
-    $ make
-    [  0%] Generating C unity source lib/Support/cotire/LLVMSupport_C_unity.c
-    [  0%] Generating CXX unity source lib/Support/cotire/LLVMSupport_CXX_unity.cxx
-    [  0%] Generating CXX prefix header lib/Support/cotire/LLVMSupport_CXX_prefix.hxx
-    [  0%] Building CXX precompiled header lib/Support/cotire/LLVMSupport_CXX_prefix.hxx.gch
-    ...

+ 0 - 389
lib/cotire/Patches/bullet-2.80-rev2531.patch

@@ -1,389 +0,0 @@
-diff -rupN bullet-2.80-rev2531/CMakeLists.txt bullet-2.80-rev2531.cotire/CMakeLists.txt
---- bullet-2.80-rev2531/CMakeLists.txt	2012-03-03 04:15:04.000000000 +0100
-+++ bullet-2.80-rev2531.cotire/CMakeLists.txt	2012-03-24 20:40:40.000000000 +0100
-@@ -11,6 +11,7 @@ IF(COMMAND cmake_policy)
-    cmake_policy(SET CMP0003 NEW)
- ENDIF(COMMAND cmake_policy)
- 
-+include("${CMAKE_SOURCE_DIR}/cotire.cmake") 
- 
- IF (NOT CMAKE_BUILD_TYPE)
- # SET(CMAKE_BUILD_TYPE "Debug")
-diff -rupN bullet-2.80-rev2531/Demos/OpenGL/CMakeLists.txt bullet-2.80-rev2531.cotire/Demos/OpenGL/CMakeLists.txt
---- bullet-2.80-rev2531/Demos/OpenGL/CMakeLists.txt	2011-09-13 03:52:42.000000000 +0200
-+++ bullet-2.80-rev2531.cotire/Demos/OpenGL/CMakeLists.txt	2012-03-24 20:35:19.000000000 +0100
-@@ -65,3 +65,7 @@ IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR
- 		ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
- 	ENDIF (INSTALL_EXTRA_LIBS)
- ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
-+
-+if (COMMAND cotire)
-+	cotire(OpenGLSupport)
-+endif()
-diff -rupN bullet-2.80-rev2531/Extras/ConvexDecomposition/CMakeLists.txt bullet-2.80-rev2531.cotire/Extras/ConvexDecomposition/CMakeLists.txt
---- bullet-2.80-rev2531/Extras/ConvexDecomposition/CMakeLists.txt	2010-09-18 02:24:50.000000000 +0200
-+++ bullet-2.80-rev2531.cotire/Extras/ConvexDecomposition/CMakeLists.txt	2012-03-24 20:35:36.000000000 +0100
-@@ -62,3 +62,7 @@ DESTINATION ${INCLUDE_INSTALL_DIR} FILES
- 		ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
- 	ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
- ENDIF (INSTALL_EXTRA_LIBS)
-+
-+if (COMMAND cotire)
-+	cotire(ConvexDecomposition)
-+endif()
-diff -rupN bullet-2.80-rev2531/Extras/GIMPACTUtils/CMakeLists.txt bullet-2.80-rev2531.cotire/Extras/GIMPACTUtils/CMakeLists.txt
---- bullet-2.80-rev2531/Extras/GIMPACTUtils/CMakeLists.txt	2010-09-18 02:24:50.000000000 +0200
-+++ bullet-2.80-rev2531.cotire/Extras/GIMPACTUtils/CMakeLists.txt	2012-03-24 20:35:42.000000000 +0100
-@@ -35,3 +35,7 @@ DESTINATION ${INCLUDE_INSTALL_DIR} FILES
- 		ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
- 	ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
- ENDIF (INSTALL_EXTRA_LIBS)
-+
-+if (COMMAND cotire)
-+	cotire(GIMPACTUtils)
-+endif()
-diff -rupN bullet-2.80-rev2531/Extras/HACD/CMakeLists.txt bullet-2.80-rev2531.cotire/Extras/HACD/CMakeLists.txt
---- bullet-2.80-rev2531/Extras/HACD/CMakeLists.txt	2011-07-07 02:28:15.000000000 +0200
-+++ bullet-2.80-rev2531.cotire/Extras/HACD/CMakeLists.txt	2012-03-24 20:36:03.000000000 +0100
-@@ -49,3 +49,7 @@ DESTINATION ${INCLUDE_INSTALL_DIR} FILES
- 		ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
-
- 	ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
-
- ENDIF (INSTALL_EXTRA_LIBS)
-
-+
-
-+if (COMMAND cotire)
-
-+	cotire(HACD)
-
-+endif()
-
-diff -rupN bullet-2.80-rev2531/Extras/PhysicsEffects/src/base_level/CMakeLists.txt bullet-2.80-rev2531.cotire/Extras/PhysicsEffects/src/base_level/CMakeLists.txt
---- bullet-2.80-rev2531/Extras/PhysicsEffects/src/base_level/CMakeLists.txt	2012-03-05 05:59:58.000000000 +0100
-+++ bullet-2.80-rev2531.cotire/Extras/PhysicsEffects/src/base_level/CMakeLists.txt	2012-03-24 20:36:29.000000000 +0100
-@@ -75,3 +75,7 @@ ADD_LIBRARY(PfxBaseLevel ${PfxBaseLevel_
- 
-
- SET_TARGET_PROPERTIES(PfxBaseLevel PROPERTIES VERSION ${BULLET_VERSION})
-
- SET_TARGET_PROPERTIES(PfxBaseLevel PROPERTIES SOVERSION ${BULLET_VERSION})
-
-+
-
-+if (COMMAND cotire)
-
-+	cotire(PfxBaseLevel)
-
-+endif()
-
-diff -rupN bullet-2.80-rev2531/Extras/PhysicsEffects/src/low_level/CMakeLists.txt bullet-2.80-rev2531.cotire/Extras/PhysicsEffects/src/low_level/CMakeLists.txt
---- bullet-2.80-rev2531/Extras/PhysicsEffects/src/low_level/CMakeLists.txt	2012-03-05 05:59:58.000000000 +0100
-+++ bullet-2.80-rev2531.cotire/Extras/PhysicsEffects/src/low_level/CMakeLists.txt	2012-03-24 20:36:39.000000000 +0100
-@@ -27,3 +27,7 @@ ADD_LIBRARY(PfxLowLevel ${PfxLowLevel_SR
- 
-
- SET_TARGET_PROPERTIES(PfxLowLevel PROPERTIES VERSION ${BULLET_VERSION})
-
- SET_TARGET_PROPERTIES(PfxLowLevel PROPERTIES SOVERSION ${BULLET_VERSION})
-
-+
-
-+if (COMMAND cotire)
-
-+	cotire(PfxLowLevel)
-
-+endif()
-
-diff -rupN bullet-2.80-rev2531/Extras/PhysicsEffects/src/util/CMakeLists.txt bullet-2.80-rev2531.cotire/Extras/PhysicsEffects/src/util/CMakeLists.txt
---- bullet-2.80-rev2531/Extras/PhysicsEffects/src/util/CMakeLists.txt	2012-03-05 05:59:58.000000000 +0100
-+++ bullet-2.80-rev2531.cotire/Extras/PhysicsEffects/src/util/CMakeLists.txt	2012-03-24 20:36:47.000000000 +0100
-@@ -18,3 +18,7 @@ ADD_LIBRARY(PfxUtil ${PfxUtil_SRCS} ${Pf
- 
-
- SET_TARGET_PROPERTIES(PfxUtil PROPERTIES VERSION ${BULLET_VERSION})
-
- SET_TARGET_PROPERTIES(PfxUtil PROPERTIES SOVERSION ${BULLET_VERSION})
-
-+
-
-+if (COMMAND cotire)
-
-+	cotire(PfxUtil)
-
-+endif()
-
-diff -rupN bullet-2.80-rev2531/Extras/Serialize/BlenderSerialize/CMakeLists.txt bullet-2.80-rev2531.cotire/Extras/Serialize/BlenderSerialize/CMakeLists.txt
---- bullet-2.80-rev2531/Extras/Serialize/BlenderSerialize/CMakeLists.txt	2010-03-06 16:23:36.000000000 +0100
-+++ bullet-2.80-rev2531.cotire/Extras/Serialize/BlenderSerialize/CMakeLists.txt	2012-03-24 20:36:55.000000000 +0100
-@@ -5,3 +5,7 @@ ${BULLET_PHYSICS_SOURCE_DIR}/Extras/Seri
- )
- 
- ADD_LIBRARY(BlenderSerialize dna249.cpp dna249-64bit.cpp bBlenderFile.cpp  bBlenderFile.h bMain.cpp bMain.h )
-+
-+if (COMMAND cotire)
-+	cotire(BlenderSerialize)
-+endif()
-diff -rupN bullet-2.80-rev2531/Extras/Serialize/BulletFileLoader/CMakeLists.txt bullet-2.80-rev2531.cotire/Extras/Serialize/BulletFileLoader/CMakeLists.txt
---- bullet-2.80-rev2531/Extras/Serialize/BulletFileLoader/CMakeLists.txt	2012-02-29 05:43:51.000000000 +0100
-+++ bullet-2.80-rev2531.cotire/Extras/Serialize/BulletFileLoader/CMakeLists.txt	2012-03-24 20:37:05.000000000 +0100
-@@ -47,3 +47,7 @@ DESTINATION ${INCLUDE_INSTALL_DIR} FILES
-                 ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
-         ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
- ENDIF (INSTALL_EXTRA_LIBS)
-+
-+if (COMMAND cotire)
-+	cotire(BulletFileLoader)
-+endif()
-diff -rupN bullet-2.80-rev2531/Extras/Serialize/BulletWorldImporter/CMakeLists.txt bullet-2.80-rev2531.cotire/Extras/Serialize/BulletWorldImporter/CMakeLists.txt
---- bullet-2.80-rev2531/Extras/Serialize/BulletWorldImporter/CMakeLists.txt	2012-02-29 05:43:51.000000000 +0100
-+++ bullet-2.80-rev2531.cotire/Extras/Serialize/BulletWorldImporter/CMakeLists.txt	2012-03-24 20:37:15.000000000 +0100
-@@ -36,3 +36,7 @@ DESTINATION ${INCLUDE_INSTALL_DIR} FILES
- 		ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
- 	ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
- ENDIF (INSTALL_EXTRA_LIBS)
-+
-+if (COMMAND cotire)
-+	cotire(BulletWorldImporter)
-+endif()
-diff -rupN bullet-2.80-rev2531/Extras/Serialize/makesdna/CMakeLists.txt bullet-2.80-rev2531.cotire/Extras/Serialize/makesdna/CMakeLists.txt
---- bullet-2.80-rev2531/Extras/Serialize/makesdna/CMakeLists.txt	2010-03-06 16:23:36.000000000 +0100
-+++ bullet-2.80-rev2531.cotire/Extras/Serialize/makesdna/CMakeLists.txt	2012-03-24 20:37:26.000000000 +0100
-@@ -35,3 +35,7 @@ SET(SRC  ${BULLET_PHYSICS_SOURCE_DIR}/sr
- ADD_LIBRARY(BulletDNA ${SRC} ${INC_FILES})
- 
- MESSAGE(STATUS "Configuring makesdna")
-+
-+if (COMMAND cotire)
-+	cotire(BulletDNA)
-+endif()
-diff -rupN bullet-2.80-rev2531/Extras/glui/CMakeLists.txt bullet-2.80-rev2531.cotire/Extras/glui/CMakeLists.txt
---- bullet-2.80-rev2531/Extras/glui/CMakeLists.txt	2010-03-06 16:23:36.000000000 +0100
-+++ bullet-2.80-rev2531.cotire/Extras/glui/CMakeLists.txt	2012-03-24 20:35:51.000000000 +0100
-@@ -64,3 +64,7 @@ arcball.cpp			glui_button.cpp			glui_fil
- IF (BUILD_SHARED_LIBS)
-   TARGET_LINK_LIBRARIES(GLUI ${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
- ENDIF (BUILD_SHARED_LIBS)
-+
-+if (COMMAND cotire)
-+	cotire(GLUI)
-+endif()
-diff -rupN bullet-2.80-rev2531/Extras/iff/CMakeLists.txt bullet-2.80-rev2531.cotire/Extras/iff/CMakeLists.txt
---- bullet-2.80-rev2531/Extras/iff/CMakeLists.txt	2010-03-06 16:23:36.000000000 +0100
-+++ bullet-2.80-rev2531.cotire/Extras/iff/CMakeLists.txt	2012-03-24 20:36:12.000000000 +0100
-@@ -9,3 +9,7 @@ iffw.cpp
- )
- 
- #SUBDIRS( BulletIffConverter )
-+
-+if (COMMAND cotire)
-+	cotire(Iff)
-+endif()
-diff -rupN bullet-2.80-rev2531/UnitTests/cppunit/CMakeLists.txt bullet-2.80-rev2531.cotire/UnitTests/cppunit/CMakeLists.txt
---- bullet-2.80-rev2531/UnitTests/cppunit/CMakeLists.txt	2010-07-24 00:09:57.000000000 +0200
-+++ bullet-2.80-rev2531.cotire/UnitTests/cppunit/CMakeLists.txt	2012-03-24 20:39:51.000000000 +0100
-@@ -71,4 +71,8 @@ ADD_LIBRARY(cppunit
-
- 	src/cppunit/XmlDocument.cpp
-
- 	src/cppunit/XmlElement.cpp
-
- 	
-
--)
-\ No newline at end of file
-+)
-
-+
-
-+if (COMMAND cotire)
-
-+	cotire(cppunit)
-
-+endif()
-
-diff -rupN bullet-2.80-rev2531/src/BulletCollision/CMakeLists.txt bullet-2.80-rev2531.cotire/src/BulletCollision/CMakeLists.txt
---- bullet-2.80-rev2531/src/BulletCollision/CMakeLists.txt	2012-02-29 06:19:22.000000000 +0100
-+++ bullet-2.80-rev2531.cotire/src/BulletCollision/CMakeLists.txt	2012-03-24 20:37:38.000000000 +0100
-@@ -277,3 +277,7 @@ DESTINATION ${INCLUDE_INSTALL_DIR}/Bulle
- 		ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
- 	ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
- ENDIF (INSTALL_LIBS)
-+
-+if (COMMAND cotire)
-+	cotire(BulletCollision)
-+endif()
-diff -rupN bullet-2.80-rev2531/src/BulletDynamics/CMakeLists.txt bullet-2.80-rev2531.cotire/src/BulletDynamics/CMakeLists.txt
---- bullet-2.80-rev2531/src/BulletDynamics/CMakeLists.txt	2011-09-15 20:47:13.000000000 +0200
-+++ bullet-2.80-rev2531.cotire/src/BulletDynamics/CMakeLists.txt	2012-03-24 20:43:34.000000000 +0100
-@@ -110,3 +110,7 @@ DESTINATION ${INCLUDE_INSTALL_DIR}/Bulle
- 		ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
- 	ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
- ENDIF (INSTALL_LIBS)
-+
-+if (COMMAND cotire)
-+	cotire(BulletDynamics)
-+endif()
-diff -rupN bullet-2.80-rev2531/src/BulletMultiThreaded/CMakeLists.txt bullet-2.80-rev2531.cotire/src/BulletMultiThreaded/CMakeLists.txt
---- bullet-2.80-rev2531/src/BulletMultiThreaded/CMakeLists.txt	2012-02-29 06:19:22.000000000 +0100
-+++ bullet-2.80-rev2531.cotire/src/BulletMultiThreaded/CMakeLists.txt	2012-03-24 20:37:58.000000000 +0100
-@@ -121,3 +121,6 @@ PATTERN "*.h"  PATTERN ".svn" EXCLUDE PA
- 	ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
- ENDIF (INSTALL_LIBS)
- 
-+if (COMMAND cotire)
-+	cotire(BulletMultiThreaded)
-+endif()
-diff -rupN bullet-2.80-rev2531/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/CMakeLists.txt bullet-2.80-rev2531.cotire/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/CMakeLists.txt
---- bullet-2.80-rev2531/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/CMakeLists.txt	2011-11-11 20:00:26.000000000 +0100
-+++ bullet-2.80-rev2531.cotire/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/CMakeLists.txt	2012-03-24 20:38:09.000000000 +0100
-@@ -81,3 +81,7 @@ IF (INSTALL_LIBS)
-
- 		ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
-
- 	ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
-
- ENDIF (INSTALL_LIBS)
-
-+
-
-+if (COMMAND cotire)
-
-+	cotire(BulletSoftBodySolvers_DX11)
-
-+endif()
-
-diff -rupN bullet-2.80-rev2531/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/AMD/CMakeLists.txt bullet-2.80-rev2531.cotire/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/AMD/CMakeLists.txt
---- bullet-2.80-rev2531/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/AMD/CMakeLists.txt	2011-12-20 19:03:24.000000000 +0100
-+++ bullet-2.80-rev2531.cotire/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/AMD/CMakeLists.txt	2012-03-24 20:38:22.000000000 +0100
-@@ -60,3 +60,7 @@ IF (INSTALL_LIBS)
-
- 		ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
-
- 	ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
-
- ENDIF (INSTALL_LIBS)
-
-+
-
-+if (COMMAND cotire)
-
-+	cotire(BulletSoftBodySolvers_OpenCL_AMD)
-
-+endif()
-
-diff -rupN bullet-2.80-rev2531/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Apple/CMakeLists.txt bullet-2.80-rev2531.cotire/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Apple/CMakeLists.txt
---- bullet-2.80-rev2531/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Apple/CMakeLists.txt	2011-11-11 20:00:26.000000000 +0100
-+++ bullet-2.80-rev2531.cotire/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Apple/CMakeLists.txt	2012-03-24 20:38:38.000000000 +0100
-@@ -75,3 +75,7 @@ IF (INSTALL_LIBS)
-
- 		ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
-
- 	ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
-
- ENDIF (INSTALL_LIBS)
-
-+
-
-+if (COMMAND cotire)
-
-+	cotire(BulletSoftBodySolvers_OpenCL_Apple)
-
-+endif()
-
-diff -rupN bullet-2.80-rev2531/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Intel/CMakeLists.txt bullet-2.80-rev2531.cotire/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Intel/CMakeLists.txt
---- bullet-2.80-rev2531/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Intel/CMakeLists.txt	2011-12-20 19:03:24.000000000 +0100
-+++ bullet-2.80-rev2531.cotire/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/Intel/CMakeLists.txt	2012-03-24 20:38:51.000000000 +0100
-@@ -80,3 +80,7 @@ IF (INSTALL_LIBS)
-
- 		ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
-
- 	ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
-
- ENDIF (INSTALL_LIBS)
-
-+
-
-+if (COMMAND cotire)
-
-+	cotire(BulletSoftBodySolvers_OpenCL_Intel)
-
-+endif()
-
-diff -rupN bullet-2.80-rev2531/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/MiniCL/CMakeLists.txt bullet-2.80-rev2531.cotire/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/MiniCL/CMakeLists.txt
---- bullet-2.80-rev2531/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/MiniCL/CMakeLists.txt	2011-11-11 20:00:26.000000000 +0100
-+++ bullet-2.80-rev2531.cotire/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/MiniCL/CMakeLists.txt	2012-03-24 20:39:00.000000000 +0100
-@@ -73,3 +73,7 @@ IF (INSTALL_LIBS)
-
- 		ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
-
- 	ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
-
- ENDIF (INSTALL_LIBS)
-
-+
-
-+if (COMMAND cotire)
-
-+	cotire(BulletSoftBodySolvers_OpenCL_Mini)
-
-+endif()
-
-diff -rupN bullet-2.80-rev2531/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/NVidia/CMakeLists.txt bullet-2.80-rev2531.cotire/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/NVidia/CMakeLists.txt
---- bullet-2.80-rev2531/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/NVidia/CMakeLists.txt	2011-12-20 19:03:24.000000000 +0100
-+++ bullet-2.80-rev2531.cotire/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/NVidia/CMakeLists.txt	2012-03-24 20:39:08.000000000 +0100
-@@ -79,3 +79,7 @@ IF (INSTALL_LIBS)
-
- 		ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
-
- 	ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
-
- ENDIF (INSTALL_LIBS)
-
-+
-
-+if (COMMAND cotire)
-
-+	cotire(BulletSoftBodySolvers_OpenCL_NVidia)
-
-+endif()
-
-diff -rupN bullet-2.80-rev2531/src/BulletSoftBody/CMakeLists.txt bullet-2.80-rev2531.cotire/src/BulletSoftBody/CMakeLists.txt
---- bullet-2.80-rev2531/src/BulletSoftBody/CMakeLists.txt	2010-12-01 06:55:08.000000000 +0100
-+++ bullet-2.80-rev2531.cotire/src/BulletSoftBody/CMakeLists.txt	2012-03-24 20:39:20.000000000 +0100
-@@ -63,3 +63,7 @@ DESTINATION ${INCLUDE_INSTALL_DIR} FILES
- 		ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
- 	ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
- ENDIF (INSTALL_LIBS)
-+
-+if (COMMAND cotire)
-+	cotire(BulletSoftBody)
-+endif()
-diff -rupN bullet-2.80-rev2531/src/LinearMath/CMakeLists.txt bullet-2.80-rev2531.cotire/src/LinearMath/CMakeLists.txt
---- bullet-2.80-rev2531/src/LinearMath/CMakeLists.txt	2011-11-11 21:11:03.000000000 +0100
-+++ bullet-2.80-rev2531.cotire/src/LinearMath/CMakeLists.txt	2012-03-24 20:39:28.000000000 +0100
-@@ -64,3 +64,7 @@ DESTINATION ${INCLUDE_INSTALL_DIR} FILES
- 		ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
- 	ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
- ENDIF (INSTALL_LIBS)
-+
-+if (COMMAND cotire)
-+	cotire(LinearMath)
-+endif()
-diff -rupN bullet-2.80-rev2531/src/MiniCL/CMakeLists.txt bullet-2.80-rev2531.cotire/src/MiniCL/CMakeLists.txt
---- bullet-2.80-rev2531/src/MiniCL/CMakeLists.txt	2012-02-29 06:19:22.000000000 +0100
-+++ bullet-2.80-rev2531.cotire/src/MiniCL/CMakeLists.txt	2012-03-24 20:39:38.000000000 +0100
-@@ -64,3 +64,6 @@ PATTERN "*.h"  PATTERN ".svn" EXCLUDE PA
- 	ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
-
- ENDIF (INSTALL_LIBS)
-
- 
-
-+if (COMMAND cotire)
-
-+	cotire(MiniCL)
-
-+endif()
-

+ 0 - 35
lib/cotire/Patches/clang-3.0.src.patch

@@ -1,35 +0,0 @@
-diff -rupN clang-3.0.src/CMakeLists.txt clang-3.0.src.cotire/CMakeLists.txt
---- clang-3.0.src/CMakeLists.txt	2011-10-06 15:03:08.000000000 +0200
-+++ clang-3.0.src.cotire/CMakeLists.txt	2012-03-24 14:04:10.000000000 +0100
-@@ -36,6 +36,7 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
-   include(TableGen)
-   include("${CLANG_PATH_TO_LLVM_BUILD}/share/llvm/cmake/LLVMConfig.cmake")
-   include(HandleLLVMOptions)
-+  include(cotire)
- 
-   set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
- 
-@@ -206,6 +207,11 @@ macro(add_clang_library name)
-     LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-     ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
-   set_target_properties(${name} PROPERTIES FOLDER "Clang libraries")
-+  if (COMMAND cotire)
-+    if (NOT "${name}" MATCHES "libclang")
-+      cotire(${name})
-+    endif()
-+  endif()
- endmacro(add_clang_library)
- 
- macro(add_clang_executable name)
-diff -rupN clang-3.0.src/tools/libclang/CMakeLists.txt clang-3.0.src.cotire/tools/libclang/CMakeLists.txt
---- clang-3.0.src/tools/libclang/CMakeLists.txt	2011-10-06 09:00:54.000000000 +0200
-+++ clang-3.0.src.cotire/tools/libclang/CMakeLists.txt	2012-03-24 14:05:02.000000000 +0100
-@@ -70,3 +70,8 @@ if( NOT BUILD_SHARED_LIBS AND NOT WIN32 
-     PROPERTIES
-     OUTPUT_NAME "libclang")
- endif()
-+
-+if (COMMAND cotire)
-+  cotire(libclang)
-+  cotire(${LIBCLANG_STATIC_TARGET_NAME})
-+endif()

+ 0 - 35
lib/cotire/Patches/clang-3.1.src.patch

@@ -1,35 +0,0 @@
-diff -rupN clang-3.1.src/CMakeLists.txt clang-3.1.src.cotire/CMakeLists.txt
---- clang-3.1.src/CMakeLists.txt	2012-04-16 06:16:43.000000000 +0200
-+++ clang-3.1.src.cotire/CMakeLists.txt	2012-05-23 19:34:06.000000000 +0200
-@@ -36,6 +36,7 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
-   include(TableGen)
-   include("${CLANG_PATH_TO_LLVM_BUILD}/share/llvm/cmake/LLVMConfig.cmake")
-   include(HandleLLVMOptions)
-+  include(cotire)
- 
-   set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
- 
-@@ -211,6 +212,11 @@ macro(add_clang_library name)
-     ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-     RUNTIME DESTINATION bin)
-   set_target_properties(${name} PROPERTIES FOLDER "Clang libraries")
-+  if (COMMAND cotire)
-+    if (NOT "${name}" MATCHES "libclang")
-+      cotire(${name})
-+    endif()
-+  endif()
- endmacro(add_clang_library)
- 
- macro(add_clang_executable name)
-diff -rupN clang-3.1.src/tools/libclang/CMakeLists.txt clang-3.1.src.cotire/tools/libclang/CMakeLists.txt
---- clang-3.1.src/tools/libclang/CMakeLists.txt	2012-04-13 19:26:32.000000000 +0200
-+++ clang-3.1.src.cotire/tools/libclang/CMakeLists.txt	2012-05-23 19:34:06.000000000 +0200
-@@ -88,3 +88,8 @@ if( NOT BUILD_SHARED_LIBS AND NOT WIN32 
-     PROPERTIES
-     OUTPUT_NAME "libclang")
- endif()
-+
-+if (COMMAND cotire)
-+  cotire(libclang)
-+  cotire(${LIBCLANG_STATIC_TARGET_NAME})
-+endif()

+ 0 - 46
lib/cotire/Patches/clang-3.3.src.patch

@@ -1,46 +0,0 @@
-diff -rupN cfe-3.3.src/CMakeLists.txt cfe-3.3.src.cotire/CMakeLists.txt
---- cfe-3.3.src/CMakeLists.txt	2013-04-22 16:51:21.000000000 +0200
-+++ cfe-3.3.src.cotire/CMakeLists.txt	2013-10-13 12:02:05.000000000 +0200
-@@ -2,7 +2,7 @@
- # standalone project, using LLVM as an external library:
- if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
-   project(Clang)
--  cmake_minimum_required(VERSION 2.8)
-+  cmake_minimum_required(VERSION 2.8.11)
- 
-   set(CLANG_PATH_TO_LLVM_SOURCE "" CACHE PATH
-     "Path to LLVM source code. Not necessary if using an installed LLVM.")
-@@ -36,6 +36,8 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
-   include(TableGen)
-   include("${CLANG_PATH_TO_LLVM_BUILD}/share/llvm/cmake/LLVMConfig.cmake")
-   include(HandleLLVMOptions)
-+  include(cotire)
-+  set_property(DIRECTORY PROPERTY COTIRE_UNITY_LINK_LIBRARIES_INIT "COPY_UNITY")
- 
-   set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
- 
-@@ -234,6 +236,12 @@ macro(add_clang_library name)
-     ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-     RUNTIME DESTINATION bin)
-   set_target_properties(${name} PROPERTIES FOLDER "Clang libraries")
-+  if (COMMAND cotire)
-+    if (NOT "${name}" MATCHES "libclang")
-+      set_target_properties(${name} PROPERTIES COTIRE_UNITY_SOURCE_POST_UNDEFS "DEBUG_TYPE")
-+      cotire(${name})
-+    endif()
-+  endif()
- endmacro(add_clang_library)
- 
- macro(add_clang_executable name)
-diff -rupN cfe-3.3.src/tools/libclang/CMakeLists.txt cfe-3.3.src.cotire/tools/libclang/CMakeLists.txt
---- cfe-3.3.src/tools/libclang/CMakeLists.txt	2013-03-29 22:51:40.000000000 +0100
-+++ cfe-3.3.src.cotire/tools/libclang/CMakeLists.txt	2013-10-13 11:32:48.000000000 +0200
-@@ -114,3 +114,8 @@ if( NOT BUILD_SHARED_LIBS AND NOT WIN32 
-     PROPERTIES
-     OUTPUT_NAME "clang")
- endif()
-+
-+if (COMMAND cotire)
-+  cotire(libclang)
-+  cotire(${LIBCLANG_STATIC_TARGET_NAME})
-+endif()

+ 0 - 48
lib/cotire/Patches/clang-3.4.src.patch

@@ -1,48 +0,0 @@
-diff -rupN clang-3.4.src/CMakeLists.txt clang-3.4.src.cotire/CMakeLists.txt
---- clang-3.4.src/CMakeLists.txt	2013-11-06 09:37:50.000000000 +0100
-+++ clang-3.4.src.cotire/CMakeLists.txt	2014-01-17 20:33:42.000000000 +0100
-@@ -2,7 +2,7 @@
- # standalone project, using LLVM as an external library:
- if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
-   project(Clang)
--  cmake_minimum_required(VERSION 2.8)
-+  cmake_minimum_required(VERSION 2.8.11)
- 
-   set(CLANG_PATH_TO_LLVM_SOURCE "" CACHE PATH
-     "Path to LLVM source code. Not necessary if using an installed LLVM.")
-@@ -40,6 +40,8 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
-   include(TableGen)
-   include("${CLANG_PATH_TO_LLVM_BUILD}/share/llvm/cmake/LLVMConfig.cmake")
-   include(HandleLLVMOptions)
-+  include(cotire)
-+  set_property(DIRECTORY PROPERTY COTIRE_UNITY_LINK_LIBRARIES_INIT "COPY_UNITY")
- 
-   set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
- 
-@@ -286,6 +288,12 @@ macro(add_clang_library name)
-   endif()
- 
-   set_target_properties(${name} PROPERTIES FOLDER "Clang libraries")
-+  if (COMMAND cotire)
-+    if (NOT "${name}" MATCHES "libclang")
-+      set_target_properties(${name} PROPERTIES COTIRE_UNITY_SOURCE_POST_UNDEFS "DEBUG_TYPE")
-+      cotire(${name})
-+    endif()
-+  endif()
- endmacro(add_clang_library)
- 
- macro(add_clang_executable name)
-diff -rupN clang-3.4.src/tools/libclang/CMakeLists.txt clang-3.4.src.cotire/tools/libclang/CMakeLists.txt
---- clang-3.4.src/tools/libclang/CMakeLists.txt	2013-11-13 23:26:04.000000000 +0100
-+++ clang-3.4.src.cotire/tools/libclang/CMakeLists.txt	2014-01-17 20:37:53.000000000 +0100
-@@ -124,3 +124,10 @@ if( (NOT LLVM_ENABLE_PIC OR LIBCLANG_BUI
-     PROPERTIES
-     OUTPUT_NAME "clang")
- endif()
-+
-+if (COMMAND cotire)
-+  cotire(libclang)
-+  if (TARGET ${LIBCLANG_STATIC_TARGET_NAME})
-+    cotire(${LIBCLANG_STATIC_TARGET_NAME})
-+  endif()
-+endif()

+ 0 - 39
lib/cotire/Patches/clang-3.5.src.patch

@@ -1,39 +0,0 @@
-diff -rupN --exclude=.DS_Store cfe-3.5.0.src/CMakeLists.txt cfe-3.5.0.src.cotire/CMakeLists.txt
---- cfe-3.5.0.src/CMakeLists.txt	2014-07-16 18:48:33.000000000 +0200
-+++ cfe-3.5.0.src.cotire/CMakeLists.txt	2014-12-21 19:58:36.000000000 +0100
-@@ -94,6 +94,8 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
-   include(AddLLVM)
-   include(TableGen)
-   include(HandleLLVMOptions)
-+  include(cotire)
-+  set_property(DIRECTORY PROPERTY COTIRE_UNITY_LINK_LIBRARIES_INIT "COPY_UNITY")
- 
-   set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
- 
-@@ -343,6 +345,12 @@ macro(add_clang_library name)
-   endif()
- 
-   set_target_properties(${name} PROPERTIES FOLDER "Clang libraries")
-+  if (COMMAND cotire)
-+    if (NOT "${name}" MATCHES "libclang")
-+      set_target_properties(${name} PROPERTIES COTIRE_UNITY_SOURCE_POST_UNDEFS "DEBUG_TYPE")
-+      cotire(${name})
-+    endif()
-+  endif()
- endmacro(add_clang_library)
- 
- macro(add_clang_executable name)
-diff -rupN --exclude=.DS_Store cfe-3.5.0.src/tools/libclang/CMakeLists.txt cfe-3.5.0.src.cotire/tools/libclang/CMakeLists.txt
---- cfe-3.5.0.src/tools/libclang/CMakeLists.txt	2014-07-15 00:17:16.000000000 +0200
-+++ cfe-3.5.0.src.cotire/tools/libclang/CMakeLists.txt	2014-12-21 19:58:36.000000000 +0100
-@@ -114,3 +114,10 @@ if(ENABLE_SHARED)
-                  LINK_FLAGS ${LIBCLANG_LINK_FLAGS})
-   endif()
- endif()
-+
-+if (COMMAND cotire)
-+  cotire(libclang)
-+  if (TARGET ${LIBCLANG_STATIC_TARGET_NAME})
-+    cotire(${LIBCLANG_STATIC_TARGET_NAME})
-+  endif()
-+endif()

+ 0 - 93
lib/cotire/Patches/clapack-3.2.1-CMAKE.patch

@@ -1,93 +0,0 @@
-diff -rupN clapack-3.2.1-CMAKE/BLAS/SRC/CMakeLists.txt clapack-3.2.1-CMAKE.cotire/BLAS/SRC/CMakeLists.txt
---- clapack-3.2.1-CMAKE/BLAS/SRC/CMakeLists.txt	2009-08-14 22:16:25.000000000 +0200
-+++ clapack-3.2.1-CMAKE.cotire/BLAS/SRC/CMakeLists.txt	2012-03-24 19:59:26.000000000 +0100
-@@ -141,3 +141,13 @@ if(UNIX)
-   target_link_libraries(blas m)
- endif()
- target_link_libraries(blas f2c)
-+
-+if (COMMAND cotire)
-+	cotire(blas)
-+	if (TARGET blas_unity)
-+		if(UNIX)
-+		  target_link_libraries(blas_unity m)
-+		endif()
-+		target_link_libraries(blas_unity f2c_unity)
-+	endif()
-+endif()
-diff -rupN clapack-3.2.1-CMAKE/CMakeLists.txt clapack-3.2.1-CMAKE.cotire/CMakeLists.txt
---- clapack-3.2.1-CMAKE/CMakeLists.txt	2009-08-10 20:46:33.000000000 +0200
-+++ clapack-3.2.1-CMAKE.cotire/CMakeLists.txt	2012-03-24 19:56:58.000000000 +0100
-@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.6)
- project(CLAPACK C)
- enable_testing()
- include(CTest)
-+include("${CMAKE_SOURCE_DIR}/cotire.cmake")
- 
- if(WIN32 AND NOT CYGWIN)
-   set(SECOND_SRC  ${CLAPACK_SOURCE_DIR}/INSTALL/winsecond.c)
-diff -rupN clapack-3.2.1-CMAKE/F2CLIBS/libf2c/CMakeLists.txt clapack-3.2.1-CMAKE.cotire/F2CLIBS/libf2c/CMakeLists.txt
---- clapack-3.2.1-CMAKE/F2CLIBS/libf2c/CMakeLists.txt	2009-08-10 20:06:06.000000000 +0200
-+++ clapack-3.2.1-CMAKE.cotire/F2CLIBS/libf2c/CMakeLists.txt	2012-03-24 19:58:41.000000000 +0100
-@@ -60,3 +60,6 @@ include_directories(${CLAPACK_SOURCE_DIR
- include_directories(${CLAPACK_BINARY_DIR}/F2CLIBS/libf2c)
- add_library(f2c ${OFILES} ${CMAKE_CURRENT_BINARY_DIR}/arith.h)
- set_property(TARGET f2c PROPERTY PREFIX lib)
-+if (COMMAND cotire)
-+	cotire(f2c)
-+endif()
-diff -rupN clapack-3.2.1-CMAKE/SRC/CMakeLists.txt clapack-3.2.1-CMAKE.cotire/SRC/CMakeLists.txt
---- clapack-3.2.1-CMAKE/SRC/CMakeLists.txt	2009-08-10 19:47:54.000000000 +0200
-+++ clapack-3.2.1-CMAKE.cotire/SRC/CMakeLists.txt	2012-03-24 19:59:20.000000000 +0100
-@@ -378,3 +378,9 @@ endif()
- add_library(lapack ${ALLOBJ} ${ALLXOBJ})
- target_link_libraries(lapack blas)
- 
-+if (COMMAND cotire)
-+	cotire(lapack)
-+	if (TARGET lapack_unity)
-+		target_link_libraries(lapack_unity blas_unity)
-+	endif()
-+endif()
-diff -rupN clapack-3.2.1-CMAKE/TESTING/EIG/CMakeLists.txt clapack-3.2.1-CMAKE.cotire/TESTING/EIG/CMakeLists.txt
---- clapack-3.2.1-CMAKE/TESTING/EIG/CMakeLists.txt	2009-08-10 19:47:54.000000000 +0200
-+++ clapack-3.2.1-CMAKE.cotire/TESTING/EIG/CMakeLists.txt	2012-03-24 20:07:55.000000000 +0100
-@@ -120,6 +120,12 @@ set(ZEIGTST  zchkee.c 
- macro(add_eig_executable name )
-   add_executable(${name} ${ARGN})
-   target_link_libraries(${name} tmglib lapack )
-+  if (COMMAND cotire)
-+    cotire(${name})
-+    if (TARGET ${name}_unity)
-+      target_link_libraries(${name}_unity tmglib lapack )
-+    endif()
-+  endif()
- endmacro(add_eig_executable)
- 
- add_eig_executable(xeigtsts ${SEIGTST} ${SCIGTST} ${AEIGTST} 
-diff -rupN clapack-3.2.1-CMAKE/TESTING/LIN/CMakeLists.txt clapack-3.2.1-CMAKE.cotire/TESTING/LIN/CMakeLists.txt
---- clapack-3.2.1-CMAKE/TESTING/LIN/CMakeLists.txt	2009-08-10 20:06:06.000000000 +0200
-+++ clapack-3.2.1-CMAKE.cotire/TESTING/LIN/CMakeLists.txt	2012-03-24 20:08:13.000000000 +0100
-@@ -190,6 +190,12 @@ set(ZLINTSTRFP  zchkrfp.c zdrvrfp.c zdrv
- macro(add_lin_executable name )
-   add_executable(${name} ${ARGN})
-   target_link_libraries(${name} tmglib lapack)
-+  if (COMMAND cotire)
-+    cotire(${name})
-+    if (TARGET ${name}_unity)
-+      target_link_libraries(${name}_unity tmglib lapack )
-+    endif()
-+  endif()
- endmacro(add_lin_executable)
- 
- add_lin_executable(xlintsts ${ALINTST} ${SCLNTST} ${SLINTST} 
-diff -rupN clapack-3.2.1-CMAKE/TESTING/MATGEN/CMakeLists.txt clapack-3.2.1-CMAKE.cotire/TESTING/MATGEN/CMakeLists.txt
---- clapack-3.2.1-CMAKE/TESTING/MATGEN/CMakeLists.txt	2009-08-10 19:47:54.000000000 +0200
-+++ clapack-3.2.1-CMAKE.cotire/TESTING/MATGEN/CMakeLists.txt	2012-03-24 20:05:19.000000000 +0100
-@@ -67,3 +67,6 @@ if(BUILD_COMPLEX16)
- endif()
- add_library(tmglib ${ALLOBJ} )
- 
-+if (COMMAND cotire)
-+	cotire(tmglib)
-+endif()

+ 0 - 218
lib/cotire/Patches/cmake-2.8.7.patch

@@ -1,218 +0,0 @@
-diff -rupN cmake-2.8.7/CMakeLists.txt cmake-2.8.7.cotire/CMakeLists.txt
---- cmake-2.8.7/CMakeLists.txt	2011-12-30 17:49:56.000000000 +0100
-+++ cmake-2.8.7.cotire/CMakeLists.txt	2012-03-24 14:41:40.000000000 +0100
-@@ -13,6 +13,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FAT
- SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
- PROJECT(CMake)
- 
-+include(Modules/cotire.cmake)
-+
- IF(CMAKE_BOOTSTRAP)
-   # Running from bootstrap script.  Set local variable and remove from cache.
-   SET(CMAKE_BOOTSTRAP 1)
-diff -rupN cmake-2.8.7/Source/CMakeLists.txt cmake-2.8.7.cotire/Source/CMakeLists.txt
---- cmake-2.8.7/Source/CMakeLists.txt	2011-12-30 17:49:56.000000000 +0100
-+++ cmake-2.8.7.cotire/Source/CMakeLists.txt	2012-02-24 22:35:58.000000000 +0100
-@@ -364,6 +364,9 @@ TARGET_LINK_LIBRARIES(CMakeLib cmsys
- IF(APPLE)
-   TARGET_LINK_LIBRARIES(CMakeLib "-framework CoreFoundation")
- ENDIF(APPLE)
-+if (COMMAND cotire)
-+cotire(CMakeLib)
-+endif()
- 
- # On some platforms we need the rpcrt4 library for the VS 7 generators.
- IF(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW)
-@@ -433,6 +436,9 @@ SET(CTEST_SRCS cmCTest.cxx
- # Build CTestLib
- ADD_LIBRARY(CTestLib ${CTEST_SRCS})
- TARGET_LINK_LIBRARIES(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES})
-+if (COMMAND cotire)
-+cotire(CTestLib)
-+endif()
- 
- #
- # Sources for CPack
-@@ -477,6 +483,9 @@ ENDIF(APPLE)
- # Build CPackLib
- ADD_LIBRARY(CPackLib ${CPACK_SRCS})
- TARGET_LINK_LIBRARIES(CPackLib CMakeLib)
-+if (COMMAND cotire)
-+cotire(CPackLib)
-+endif()
- 
- IF(APPLE)
-   ADD_EXECUTABLE(cmakexbuild cmakexbuild.cxx)
-@@ -485,11 +494,17 @@ IF(APPLE)
-     CPack/OSXScriptLauncher.cxx)
-   TARGET_LINK_LIBRARIES(OSXScriptLauncher cmsys)
-   TARGET_LINK_LIBRARIES(OSXScriptLauncher "-framework CoreFoundation")
-+if (COMMAND cotire)
-+cotire(cmakexbuild)
-+endif()
- ENDIF(APPLE)
- 
- # Build CMake executable
- ADD_EXECUTABLE(cmake cmakemain.cxx)
- TARGET_LINK_LIBRARIES(cmake CMakeLib)
-+if (COMMAND cotire)
-+cotire(cmake)
-+endif()
- 
- # Build special executable for running programs on Windows 98
- IF(WIN32)
-@@ -503,10 +518,16 @@ ENDIF(WIN32)
- # Build CTest executable
- ADD_EXECUTABLE(ctest ctest.cxx)
- TARGET_LINK_LIBRARIES(ctest CTestLib)
-+if (COMMAND cotire)
-+cotire(ctest)
-+endif()
- 
- # Build CPack executable
- ADD_EXECUTABLE(cpack CPack/cpack.cxx)
- TARGET_LINK_LIBRARIES(cpack CPackLib)
-+if (COMMAND cotire)
-+cotire(cpack)
-+endif()
- 
- # Curses GUI
- IF(BUILD_CursesDialog)
-diff -rupN cmake-2.8.7/Source/CursesDialog/CMakeLists.txt cmake-2.8.7.cotire/Source/CursesDialog/CMakeLists.txt
---- cmake-2.8.7/Source/CursesDialog/CMakeLists.txt	2011-12-30 17:49:57.000000000 +0100
-+++ cmake-2.8.7.cotire/Source/CursesDialog/CMakeLists.txt	2012-02-22 20:41:03.000000000 +0100
-@@ -33,5 +33,7 @@ INCLUDE_DIRECTORIES(${CURSES_INCLUDE_PAT
- ADD_EXECUTABLE(ccmake ${CURSES_SRCS} )
- TARGET_LINK_LIBRARIES(ccmake CMakeLib)
- TARGET_LINK_LIBRARIES(ccmake cmForm)
--
-+if (COMMAND cotire)
-+cotire(ccmake)
-+endif()
- INSTALL_TARGETS(/bin ccmake)
-diff -rupN cmake-2.8.7/Source/CursesDialog/form/CMakeLists.txt cmake-2.8.7.cotire/Source/CursesDialog/form/CMakeLists.txt
---- cmake-2.8.7/Source/CursesDialog/form/CMakeLists.txt	2011-12-30 17:49:57.000000000 +0100
-+++ cmake-2.8.7.cotire/Source/CursesDialog/form/CMakeLists.txt	2012-02-24 21:30:47.000000000 +0100
-@@ -64,3 +64,6 @@ TARGET_LINK_LIBRARIES(cmForm ${CURSES_LI
- IF(CURSES_EXTRA_LIBRARY)
-   TARGET_LINK_LIBRARIES(cmForm ${CURSES_EXTRA_LIBRARY})
- ENDIF(CURSES_EXTRA_LIBRARY)
-+if (COMMAND cotire)
-+cotire(cmForm)
-+endif()
-diff -rupN cmake-2.8.7/Source/kwsys/CMakeLists.txt cmake-2.8.7.cotire/Source/kwsys/CMakeLists.txt
---- cmake-2.8.7/Source/kwsys/CMakeLists.txt	2011-12-30 17:49:57.000000000 +0100
-+++ cmake-2.8.7.cotire/Source/kwsys/CMakeLists.txt	2012-03-24 15:03:17.000000000 +0100
-@@ -926,6 +926,9 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
-       ADD_LIBRARY(${KWSYS_NAMESPACE}TestDynload MODULE testDynload.c)
-       SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestDynload PROPERTY LABELS ${KWSYS_LABELS_LIB})
-       ADD_DEPENDENCIES(${KWSYS_NAMESPACE}TestDynload ${KWSYS_NAMESPACE})
-+if (COMMAND cotire)
-+cotire(${KWSYS_NAMESPACE}TestDynload)
-+endif()
-     ENDIF(KWSYS_USE_DynamicLoader)
-     CREATE_TEST_SOURCELIST(
-       KWSYS_CXX_TEST_SRCS ${KWSYS_NAMESPACE}TestsCxx.cxx
-@@ -934,6 +937,9 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
-     ADD_EXECUTABLE(${KWSYS_NAMESPACE}TestsCxx ${KWSYS_CXX_TEST_SRCS})
-     SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestsCxx PROPERTY LABELS ${KWSYS_LABELS_EXE})
-     TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE}TestsCxx ${KWSYS_NAMESPACE})
-+if (COMMAND cotire)
-+cotire(${KWSYS_NAMESPACE}TestsCxx)
-+endif()
-     SET(TEST_SYSTEMTOOLS_BIN_FILE
-       "${CMAKE_CURRENT_SOURCE_DIR}/testSystemTools.bin")
-     SET(TEST_SYSTEMTOOLS_SRC_FILE
-diff -rupN cmake-2.8.7/Utilities/cmbzip2/CMakeLists.txt cmake-2.8.7.cotire/Utilities/cmbzip2/CMakeLists.txt
---- cmake-2.8.7/Utilities/cmbzip2/CMakeLists.txt	2011-12-30 17:49:58.000000000 +0100
-+++ cmake-2.8.7.cotire/Utilities/cmbzip2/CMakeLists.txt	2012-02-22 20:45:26.000000000 +0100
-@@ -2,3 +2,6 @@ project(bzip2)
- add_definitions(-D_FILE_OFFSET_BITS=64)
- add_library(cmbzip2
-   blocksort.c huffman.c crctable.c randtable.c compress.c decompress.c bzlib.c)
-+if (COMMAND cotire)
-+cotire(cmbzip2)
-+endif()
-\ No newline at end of file
-diff -rupN cmake-2.8.7/Utilities/cmcompress/CMakeLists.txt cmake-2.8.7.cotire/Utilities/cmcompress/CMakeLists.txt
---- cmake-2.8.7/Utilities/cmcompress/CMakeLists.txt	2011-12-30 17:49:58.000000000 +0100
-+++ cmake-2.8.7.cotire/Utilities/cmcompress/CMakeLists.txt	2012-02-22 20:45:29.000000000 +0100
-@@ -3,3 +3,6 @@ PROJECT(CMCompress)
- ADD_LIBRARY(cmcompress cmcompress.c)
- 
- INSTALL(FILES Copyright.txt DESTINATION ${CMake_DOC_DEST}/cmcompress)
-+if (COMMAND cotire)
-+cotire(cmcompress)
-+endif()
-\ No newline at end of file
-diff -rupN cmake-2.8.7/Utilities/cmcurl/CMakeLists.txt cmake-2.8.7.cotire/Utilities/cmcurl/CMakeLists.txt
---- cmake-2.8.7/Utilities/cmcurl/CMakeLists.txt	2011-12-30 17:49:58.000000000 +0100
-+++ cmake-2.8.7.cotire/Utilities/cmcurl/CMakeLists.txt	2012-02-22 20:43:57.000000000 +0100
-@@ -706,6 +706,9 @@ IF(CMAKE_BUILD_CURL_SHARED)
-     RUNTIME_OUTPUT_DIRECTORY ${CMake_BIN_DIR})
-   INSTALL_TARGETS(/bin cmcurl)
- ENDIF(CMAKE_BUILD_CURL_SHARED)
-+if (COMMAND cotire)
-+cotire(cmcurl)
-+endif()
- 
- OPTION(CURL_TESTING "Do libCurl testing" OFF)
- IF(CURL_TESTING)
-diff -rupN cmake-2.8.7/Utilities/cmexpat/CMakeLists.txt cmake-2.8.7.cotire/Utilities/cmexpat/CMakeLists.txt
---- cmake-2.8.7/Utilities/cmexpat/CMakeLists.txt	2011-12-30 17:49:58.000000000 +0100
-+++ cmake-2.8.7.cotire/Utilities/cmexpat/CMakeLists.txt	2012-02-22 20:45:40.000000000 +0100
-@@ -32,3 +32,6 @@ CONFIGURE_FILE(${CMEXPAT_SOURCE_DIR}/exp
- 
- ADD_LIBRARY(cmexpat ${expat_SRCS})
- INSTALL(FILES COPYING DESTINATION ${CMake_DOC_DEST}/cmexpat)
-+if (COMMAND cotire)
-+cotire(cmexpat)
-+endif()
-\ No newline at end of file
-diff -rupN cmake-2.8.7/Utilities/cmlibarchive/libarchive/CMakeLists.txt cmake-2.8.7.cotire/Utilities/cmlibarchive/libarchive/CMakeLists.txt
---- cmake-2.8.7/Utilities/cmlibarchive/libarchive/CMakeLists.txt	2011-12-30 17:49:58.000000000 +0100
-+++ cmake-2.8.7.cotire/Utilities/cmlibarchive/libarchive/CMakeLists.txt	2012-02-22 20:45:55.000000000 +0100
-@@ -116,6 +116,9 @@ IF(BUILD_ARCHIVE_WITHIN_CMAKE)
-   # and call the library cmlibarchive
-   ADD_LIBRARY(cmlibarchive STATIC ${libarchive_SOURCES} ${include_HEADERS})
-   TARGET_LINK_LIBRARIES(cmlibarchive ${ADDITIONAL_LIBS})
-+if (COMMAND cotire)
-+cotire(cmlibarchive)
-+endif()
- ELSE()
-   # Libarchive is a shared library
-   ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS})
-@@ -123,7 +126,10 @@ ELSE()
-   SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION})
-   SET_TARGET_PROPERTIES(archive PROPERTIES
-     RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
--  
-+if (COMMAND cotire)
-+cotire(archive)
-+endif()
-+
-   # archive_static is a static library
-   ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS})
-   SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS
-@@ -134,6 +140,9 @@ ELSE()
-   IF(NOT WIN32 OR CYGWIN)
-     SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive)
-   ENDIF(NOT WIN32 OR CYGWIN)
-+if (COMMAND cotire)
-+cotire(archive_static)
-+endif()
-   
-   # How to install the libraries
-   INSTALL(TARGETS archive archive_static
-diff -rupN cmake-2.8.7/Utilities/cmzlib/CMakeLists.txt cmake-2.8.7.cotire/Utilities/cmzlib/CMakeLists.txt
---- cmake-2.8.7/Utilities/cmzlib/CMakeLists.txt	2011-12-30 17:49:58.000000000 +0100
-+++ cmake-2.8.7.cotire/Utilities/cmzlib/CMakeLists.txt	2012-02-22 20:42:30.000000000 +0100
-@@ -39,5 +39,7 @@ ENDFOREACH(name)
- 
- 
- ADD_LIBRARY(cmzlib ${ZLIB_SRCS})
--
-+if (COMMAND cmzlib)
-+cotire(cmzlib)
-+endif()
- INSTALL(FILES Copyright.txt DESTINATION ${CMake_DOC_DEST}/cmzlib)

+ 0 - 18
lib/cotire/Patches/cminpack-1.1.4.patch

@@ -1,18 +0,0 @@
-diff -rupN cminpack-1.1.4/CMakeLists.txt cminpack-1.1.4.cotire/CMakeLists.txt
---- cminpack-1.1.4/CMakeLists.txt	2011-04-15 08:51:13.000000000 +0200
-+++ cminpack-1.1.4.cotire/CMakeLists.txt	2012-03-24 20:21:19.000000000 +0100
-@@ -6,6 +6,7 @@ project (CMINPACK)
- string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
- 
- include(${PROJECT_SOURCE_DIR}/cmake/cminpack_utils.cmake)
-+include(${PROJECT_SOURCE_DIR}/cmake/cotire.cmake)
- # Set version and OS-specific settings
- set(CMINPACK_VERSION 1.0.90 CACHE STRING "CMinpack version")
- DISSECT_VERSION()
-@@ -70,3 +71,6 @@ endif (USE_FPIC AND NOT SHARED_LIBS)
- 
- set_target_properties(cminpack PROPERTIES VERSION ${CMINPACK_VERSION})
- 
-+if (COMMAND cotire)
-+  cotire(cminpack)
-+endif()

+ 0 - 118
lib/cotire/Patches/hdf5-1.8.8.patch

@@ -1,118 +0,0 @@
-diff -rupN hdf5-1.8.8/CMakeLists.txt hdf5-1.8.8.cotire/CMakeLists.txt
---- hdf5-1.8.8/CMakeLists.txt	2011-11-07 23:11:41.000000000 +0100
-+++ hdf5-1.8.8.cotire/CMakeLists.txt	2012-03-24 17:30:29.000000000 +0100
-@@ -200,6 +200,7 @@ SET (HDF5_PACKAGE_BUGREPORT "help@hdfgro
- #-----------------------------------------------------------------------------
- INCLUDE (${HDF5_RESOURCES_DIR}/HDFMacros.cmake)
- INCLUDE (${HDF5_RESOURCES_DIR}/HDF5Macros.cmake)
-+INCLUDE (${HDF5_RESOURCES_DIR}/cotire.cmake)
- 
- #-----------------------------------------------------------------------------
- # Setup output Directories
-diff -rupN hdf5-1.8.8/c++/src/CMakeLists.txt hdf5-1.8.8.cotire/c++/src/CMakeLists.txt
---- hdf5-1.8.8/c++/src/CMakeLists.txt	2011-11-07 23:11:40.000000000 +0100
-+++ hdf5-1.8.8.cotire/c++/src/CMakeLists.txt	2012-03-24 17:29:43.000000000 +0100
-@@ -85,6 +85,9 @@ ADD_LIBRARY (${HDF5_CPP_LIB_TARGET} ${LI
- TARGET_LINK_LIBRARIES (${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET})
- SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}")
- H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} ${LIB_TYPE})
-+if (COMMAND cotire)
-+cotire(${HDF5_CPP_LIB_TARGET})
-+endif()
- 
- #-----------------------------------------------------------------------------
- # Add file(s) to CMake Install 
-diff -rupN hdf5-1.8.8/fortran/src/CMakeLists.txt hdf5-1.8.8.cotire/fortran/src/CMakeLists.txt
---- hdf5-1.8.8/fortran/src/CMakeLists.txt	2011-11-07 23:11:41.000000000 +0100
-+++ hdf5-1.8.8.cotire/fortran/src/CMakeLists.txt	2012-03-24 17:30:02.000000000 +0100
-@@ -118,6 +118,9 @@ ADD_LIBRARY (${HDF5_F90_C_LIB_TARGET} ${
- TARGET_LINK_LIBRARIES (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET})
- SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}")
- H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_NAME} ${LIB_TYPE})
-+if (COMMAND cotire)
-+cotire(${HDF5_F90_C_LIB_TARGET})
-+endif()
- 
- #-----------------------------------------------------------------------------
- # Fortran 2003 standard
-@@ -221,6 +224,7 @@ SET_TARGET_PROPERTIES (${HDF5_F90_LIB_TA
- TARGET_LINK_LIBRARIES (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET})
- SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIB_TARGET}")
- H5_SET_LIB_OPTIONS (${HDF5_F90_LIB_TARGET} ${HDF5_F90_LIB_NAME} ${LIB_TYPE})
-+cotire(${HDF5_F90_LIB_TARGET})
- 
- #-----------------------------------------------------------------------------
- # Add file(s) to CMake Install
-diff -rupN hdf5-1.8.8/hl/c++/src/CMakeLists.txt hdf5-1.8.8.cotire/hl/c++/src/CMakeLists.txt
---- hdf5-1.8.8/hl/c++/src/CMakeLists.txt	2011-11-07 23:11:39.000000000 +0100
-+++ hdf5-1.8.8.cotire/hl/c++/src/CMakeLists.txt	2012-03-24 17:29:52.000000000 +0100
-@@ -18,6 +18,9 @@ TARGET_LINK_LIBRARIES (
- )
- SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIB_TARGET}")
- H5_SET_LIB_OPTIONS (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_CPP_LIB_NAME} ${LIB_TYPE})
-+if (COMMAND cotire)
-+cotire(${HDF5_HL_CPP_LIB_TARGET})
-+endif()
- 
- #-----------------------------------------------------------------------------
- # Add file(s) to CMake Install 
-diff -rupN hdf5-1.8.8/hl/src/CMakeLists.txt hdf5-1.8.8.cotire/hl/src/CMakeLists.txt
---- hdf5-1.8.8/hl/src/CMakeLists.txt	2011-11-07 23:11:38.000000000 +0100
-+++ hdf5-1.8.8.cotire/hl/src/CMakeLists.txt	2012-03-24 17:30:11.000000000 +0100
-@@ -37,6 +37,9 @@ ADD_LIBRARY (${HDF5_HL_LIB_TARGET} ${LIB
- TARGET_LINK_LIBRARIES (${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET})
- SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}")
- H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} ${LIB_TYPE})
-+if (COMMAND cotire)
-+cotire(${HDF5_HL_LIB_TARGET})
-+endif()
- 
- #-----------------------------------------------------------------------------
- # Add file(s) to CMake Install 
-diff -rupN hdf5-1.8.8/src/CMakeLists.txt hdf5-1.8.8.cotire/src/CMakeLists.txt
---- hdf5-1.8.8/src/CMakeLists.txt	2011-11-07 23:11:30.000000000 +0100
-+++ hdf5-1.8.8.cotire/src/CMakeLists.txt	2012-03-24 17:29:26.000000000 +0100
-@@ -631,6 +631,16 @@ ADD_LIBRARY (${HDF5_LIB_TARGET} ${LIB_TY
- TARGET_LINK_LIBRARIES (${HDF5_LIB_TARGET} ${LINK_LIBS})
- SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET})
- H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} ${LIB_TYPE})
-+#set_target_properties(${HDF5_LIB_TARGET} PROPERTIES COTIRE_IGNORED_INCLUDE_DIRECTORIES "/Developer/usr;/usr/llvm-gcc-4.2;${CMAKE_SOURCE_DIR};${CMAKE_BINARY_DIR}")
-+
-+if (COMMAND cotire)
-+SET_SOURCE_FILES_PROPERTIES (
-+"${HDF5_BINARY_DIR}/H5overflow.h"
-+"${HDF5_BINARY_DIR}/H5version.h"
-+"${HDF5_BINARY_DIR}/H5Edefin.h"
-+PROPERTIES COTIRE_DEPENDENCY FALSE)
-+cotire(${HDF5_LIB_TARGET})
-+endif()
- 
- #-----------------------------------------------------------------------------
- # Add file(s) to CMake Install
-Binary files hdf5-1.8.8/src/H5public.h.gch and hdf5-1.8.8.cotire/src/H5public.h.gch differ
-diff -rupN hdf5-1.8.8/test/CMakeLists.txt hdf5-1.8.8.cotire/test/CMakeLists.txt
---- hdf5-1.8.8/test/CMakeLists.txt	2011-11-07 23:11:23.000000000 +0100
-+++ hdf5-1.8.8.cotire/test/CMakeLists.txt	2012-03-24 17:30:22.000000000 +0100
-@@ -30,6 +30,9 @@ IF (MINGW)
- ENDIF (MINGW)
- TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
- H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} ${LIB_TYPE})
-+if (COMMAND cotire)
-+cotire(${HDF5_TEST_LIB_TARGET})
-+endif()
- 
- # --------------------------------------------------------------------
- # Copy all the HDF5 files from the test directory into the source directory
-diff -rupN hdf5-1.8.8/tools/lib/CMakeLists.txt hdf5-1.8.8.cotire/tools/lib/CMakeLists.txt
---- hdf5-1.8.8/tools/lib/CMakeLists.txt	2011-11-07 23:11:35.000000000 +0100
-+++ hdf5-1.8.8.cotire/tools/lib/CMakeLists.txt	2012-03-24 17:28:41.000000000 +0100
-@@ -40,6 +40,9 @@ H5_SET_LIB_OPTIONS (
-     HDF5_TOOLS_LIB_NAME_RELEASE
-   HDF5_TOOLS_LIB_NAME_DEBUG
- )
-+if (COMMAND cotire)
-+cotire(${HDF5_TOOLS_LIB_TARGET})
-+endif()
- 
- ##############################################################################
- ##############################################################################

+ 0 - 38
lib/cotire/Patches/libpng-1.5.9.patch

@@ -1,38 +0,0 @@
-diff -rupN libpng-1.5.9/CMakeLists.txt libpng-1.5.9.cotire/CMakeLists.txt
---- libpng-1.5.9/CMakeLists.txt	2012-02-18 21:31:14.000000000 +0100
-+++ libpng-1.5.9.cotire/CMakeLists.txt	2012-03-24 18:08:54.000000000 +0100
-@@ -9,6 +9,8 @@
- cmake_minimum_required(VERSION 2.4.4)
- set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
- 
-+include("${CMAKE_SOURCE_DIR}/cotire.cmake")
-+
- if(UNIX AND NOT DEFINED CMAKE_BUILD_TYPE)
-   if(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 4)
-     # workaround CMake 2.4.x bug
-@@ -146,6 +148,12 @@ if(PNG_SHARED)
-     set_target_properties(${PNG_LIB_NAME} PROPERTIES IMPORT_PREFIX "lib")
-   endif()
-   target_link_libraries(${PNG_LIB_NAME} ${ZLIB_LIBRARY} ${M_LIBRARY})
-+  if (COMMAND cotire)
-+    cotire(${PNG_LIB_NAME})
-+    if (TARGET ${PNG_LIB_NAME}_unity)
-+      target_link_libraries(${PNG_LIB_NAME}_unity ${ZLIB_LIBRARY} ${M_LIBRARY})
-+    endif()
-+  endif()
- endif()
- 
- if(PNG_STATIC)
-@@ -157,6 +165,12 @@ if(PNG_STATIC)
-     set_target_properties(${PNG_LIB_NAME_STATIC} PROPERTIES PREFIX "lib")
-   endif()
-   target_link_libraries(${PNG_LIB_NAME_STATIC} ${ZLIB_LIBRARY} ${M_LIBRARY})
-+  if (COMMAND cotire)
-+    cotire(${PNG_LIB_NAME_STATIC})
-+    if (TARGET ${PNG_LIB_NAME_STATIC}_unity)
-+      target_link_libraries(${PNG_LIB_NAME_STATIC}_unity ${ZLIB_LIBRARY} ${M_LIBRARY})
-+    endif()
-+  endif()
- endif()
- 
- if(PNG_SHARED AND WIN32)

+ 0 - 69
lib/cotire/Patches/llvm-3.0.src.patch

@@ -1,69 +0,0 @@
-diff -rupN llvm-3.0.src/CMakeLists.txt llvm-3.0.src.cotire/CMakeLists.txt
---- llvm-3.0.src/CMakeLists.txt	2011-10-06 03:51:51.000000000 +0200
-+++ llvm-3.0.src.cotire/CMakeLists.txt	2012-03-26 20:59:22.000000000 +0200
-@@ -15,6 +15,7 @@ set(PACKAGE_VERSION "3.0")
- set_property(GLOBAL PROPERTY USE_FOLDERS ON)
- 
- include(VersionFromVCS)
-+include(cotire)
- 
- option(LLVM_APPEND_VC_REV
-   "Append the version control system revision id to LLVM version" OFF)
-diff -rupN llvm-3.0.src/cmake/modules/AddLLVM.cmake llvm-3.0.src.cotire/cmake/modules/AddLLVM.cmake
---- llvm-3.0.src/cmake/modules/AddLLVM.cmake	2011-07-30 10:47:05.000000000 +0200
-+++ llvm-3.0.src.cotire/cmake/modules/AddLLVM.cmake	2012-03-26 20:59:22.000000000 +0200
-@@ -25,6 +25,9 @@ macro(add_llvm_library name)
-       ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
-   endif()
-   set_target_properties(${name} PROPERTIES FOLDER "Libraries")
-+  if (COMMAND cotire)
-+      cotire(${name})
-+  endif()
- endmacro(add_llvm_library name)
- 
- macro(add_llvm_library_dependencies name)
-@@ -69,6 +72,9 @@ ${name} ignored.")
- 	LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
- 	ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
-     endif()
-+    if (COMMAND cotire)
-+       cotire(${name})
-+    endif()
-   endif()
- 
-   set_target_properties(${name} PROPERTIES FOLDER "Loadable modules")
-@@ -89,6 +95,9 @@ macro(add_llvm_executable name)
-     add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
-   endif( LLVM_COMMON_DEPENDS )
-   link_system_libs( ${name} )
-+  if (COMMAND cotire)
-+      cotire(${name})
-+  endif()
- endmacro(add_llvm_executable name)
- 
- 
-diff -rupN llvm-3.0.src/lib/Analysis/CMakeLists.txt llvm-3.0.src.cotire/lib/Analysis/CMakeLists.txt
---- llvm-3.0.src/lib/Analysis/CMakeLists.txt	2011-07-29 02:14:25.000000000 +0200
-+++ llvm-3.0.src.cotire/lib/Analysis/CMakeLists.txt	2012-03-26 20:59:36.000000000 +0200
-@@ -1,3 +1,7 @@
-+if (COMMAND cotire)
-+	set_source_files_properties (ConstantFolding.cpp PROPERTIES COTIRE_EXCLUDED TRUE)
-+endif()
-+
- add_llvm_library(LLVMAnalysis
-   AliasAnalysis.cpp
-   AliasAnalysisCounter.cpp
-diff -rupN llvm-3.0.src/lib/Support/CMakeLists.txt llvm-3.0.src.cotire/lib/Support/CMakeLists.txt
---- llvm-3.0.src/lib/Support/CMakeLists.txt	2011-09-13 21:42:16.000000000 +0200
-+++ llvm-3.0.src.cotire/lib/Support/CMakeLists.txt	2012-03-26 20:59:22.000000000 +0200
-@@ -4,6 +4,10 @@ if( MINGW )
-   set(LLVM_REQUIRES_EH 1)
- endif()
- 
-+if (COMMAND cotire)
-+	set_source_files_properties (IsInf.cpp IsNAN.cpp PROPERTIES COTIRE_EXCLUDED TRUE)
-+endif()
-+
- add_llvm_library(LLVMSupport
-   APFloat.cpp
-   APInt.cpp

+ 0 - 69
lib/cotire/Patches/llvm-3.1.src.patch

@@ -1,69 +0,0 @@
-diff -rupN llvm-3.1.src/CMakeLists.txt llvm-3.1.src.cotire/CMakeLists.txt
---- llvm-3.1.src/CMakeLists.txt	2012-05-16 00:06:08.000000000 +0200
-+++ llvm-3.1.src.cotire/CMakeLists.txt	2012-05-23 19:49:12.000000000 +0200
-@@ -18,6 +18,7 @@ set(PACKAGE_VERSION "${LLVM_VERSION_MAJO
- set_property(GLOBAL PROPERTY USE_FOLDERS ON)
- 
- include(VersionFromVCS)
-+include(cotire)
- 
- option(LLVM_APPEND_VC_REV
-   "Append the version control system revision id to LLVM version" OFF)
-diff -rupN llvm-3.1.src/cmake/modules/AddLLVM.cmake llvm-3.1.src.cotire/cmake/modules/AddLLVM.cmake
---- llvm-3.1.src/cmake/modules/AddLLVM.cmake	2011-11-29 20:25:30.000000000 +0100
-+++ llvm-3.1.src.cotire/cmake/modules/AddLLVM.cmake	2012-05-23 19:49:59.000000000 +0200
-@@ -25,6 +25,9 @@ macro(add_llvm_library name)
-       ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
-   endif()
-   set_target_properties(${name} PROPERTIES FOLDER "Libraries")
-+  if (COMMAND cotire)
-+      cotire(${name})
-+  endif()
- 
-   # Add the explicit dependency information for this library.
-   #
-@@ -68,6 +71,9 @@ ${name} ignored.")
- 	LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
- 	ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
-     endif()
-+    if (COMMAND cotire)
-+       cotire(${name})
-+    endif()
-   endif()
- 
-   set_target_properties(${name} PROPERTIES FOLDER "Loadable modules")
-@@ -88,6 +94,9 @@ macro(add_llvm_executable name)
-     add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
-   endif( LLVM_COMMON_DEPENDS )
-   link_system_libs( ${name} )
-+  if (COMMAND cotire)
-+      cotire(${name})
-+  endif()
- endmacro(add_llvm_executable name)
- 
- 
-diff -rupN llvm-3.1.src/lib/Analysis/CMakeLists.txt llvm-3.1.src.cotire/lib/Analysis/CMakeLists.txt
---- llvm-3.1.src/lib/Analysis/CMakeLists.txt	2012-03-16 06:51:52.000000000 +0100
-+++ llvm-3.1.src.cotire/lib/Analysis/CMakeLists.txt	2012-05-23 19:49:12.000000000 +0200
-@@ -1,3 +1,7 @@
-+if (COMMAND cotire)
-+	set_source_files_properties (ConstantFolding.cpp PROPERTIES COTIRE_EXCLUDED TRUE)
-+endif()
-+
- add_llvm_library(LLVMAnalysis
-   AliasAnalysis.cpp
-   AliasAnalysisCounter.cpp
-diff -rupN llvm-3.1.src/lib/Support/CMakeLists.txt llvm-3.1.src.cotire/lib/Support/CMakeLists.txt
---- llvm-3.1.src/lib/Support/CMakeLists.txt	2012-04-17 22:03:03.000000000 +0200
-+++ llvm-3.1.src.cotire/lib/Support/CMakeLists.txt	2012-05-23 19:49:12.000000000 +0200
-@@ -4,6 +4,10 @@ if( MINGW )
-   set(LLVM_REQUIRES_EH 1)
- endif()
- 
-+if (COMMAND cotire)
-+	set_source_files_properties (IsInf.cpp IsNAN.cpp PROPERTIES COTIRE_EXCLUDED TRUE)
-+endif()
-+
- add_llvm_library(LLVMSupport
-   APFloat.cpp
-   APInt.cpp

+ 0 - 128
lib/cotire/Patches/llvm-3.3.src.patch

@@ -1,128 +0,0 @@
-diff -rupN llvm-3.3.src/CMakeLists.txt llvm-3.3.src.cotire/CMakeLists.txt
---- llvm-3.3.src/CMakeLists.txt	2013-05-06 18:23:07.000000000 +0200
-+++ llvm-3.3.src.cotire/CMakeLists.txt	2013-10-13 10:05:20.000000000 +0200
-@@ -1,7 +1,7 @@
- # See docs/CMake.html for instructions about how to build LLVM with CMake.
- 
- project(LLVM)
--cmake_minimum_required(VERSION 2.8)
-+cmake_minimum_required(VERSION 2.8.11)
- 
- # Add path for custom modules
- set(CMAKE_MODULE_PATH
-@@ -21,6 +21,8 @@ if ( LLVM_USE_FOLDERS )
- endif()
- 
- include(VersionFromVCS)
-+include(cotire)
-+set_property(DIRECTORY PROPERTY COTIRE_UNITY_LINK_LIBRARIES_INIT "COPY_UNITY")
- 
- option(LLVM_APPEND_VC_REV
-   "Append the version control system revision id to LLVM version" OFF)
-@@ -187,7 +189,7 @@ option(LLVM_USE_OPROFILE
- # If enabled, verify we are on a platform that supports oprofile.
- if( LLVM_USE_OPROFILE )
-   if( NOT CMAKE_SYSTEM_NAME MATCHES "Linux" )
--    message(FATAL_ERROR "OProfile support is available on Linux only.") 
-+    message(FATAL_ERROR "OProfile support is available on Linux only.")
-   endif( NOT CMAKE_SYSTEM_NAME MATCHES "Linux" )
- endif( LLVM_USE_OPROFILE )
- 
-diff -rupN llvm-3.3.src/cmake/modules/AddLLVM.cmake llvm-3.3.src.cotire/cmake/modules/AddLLVM.cmake
---- llvm-3.3.src/cmake/modules/AddLLVM.cmake	2013-04-21 11:04:59.000000000 +0200
-+++ llvm-3.3.src.cotire/cmake/modules/AddLLVM.cmake	2013-10-13 10:43:04.000000000 +0200
-@@ -34,6 +34,10 @@ macro(add_llvm_library name)
-   # property has been set to an empty value.
-   get_property(lib_deps GLOBAL PROPERTY LLVMBUILD_LIB_DEPS_${name})
-   target_link_libraries(${name} ${lib_deps})
-+if (COMMAND cotire)
-+  set_target_properties(${name} PROPERTIES COTIRE_UNITY_SOURCE_POST_UNDEFS "DEBUG_TYPE")
-+  cotire(${name})
-+endif()
- endmacro(add_llvm_library name)
- 
- macro(add_llvm_loadable_module name)
-@@ -69,6 +73,10 @@ ${name} ignored.")
-         LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-         ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
-     endif()
-+if (COMMAND cotire)
-+  set_target_properties(${name} PROPERTIES COTIRE_UNITY_SOURCE_POST_UNDEFS "DEBUG_TYPE")
-+  cotire(${name})
-+endif()
-   endif()
- 
-   set_target_properties(${name} PROPERTIES FOLDER "Loadable modules")
-@@ -101,6 +109,10 @@ macro(add_llvm_tool name)
-     install(TARGETS ${name} RUNTIME DESTINATION bin)
-   endif()
-   set_target_properties(${name} PROPERTIES FOLDER "Tools")
-+if (COMMAND cotire)
-+  set_target_properties(${name} PROPERTIES COTIRE_UNITY_SOURCE_POST_UNDEFS "DEBUG_TYPE")
-+  cotire(${name})
-+endif()
- endmacro(add_llvm_tool name)
- 
- 
-@@ -114,12 +126,20 @@ macro(add_llvm_example name)
-     install(TARGETS ${name} RUNTIME DESTINATION examples)
-   endif()
-   set_target_properties(${name} PROPERTIES FOLDER "Examples")
-+if (COMMAND cotire)
-+  set_target_properties(${name} PROPERTIES COTIRE_UNITY_SOURCE_POST_UNDEFS "DEBUG_TYPE")
-+  cotire(${name})
-+endif()
- endmacro(add_llvm_example name)
- 
- 
- macro(add_llvm_utility name)
-   add_llvm_executable(${name} ${ARGN})
-   set_target_properties(${name} PROPERTIES FOLDER "Utils")
-+if (COMMAND cotire)
-+  set_target_properties(${name} PROPERTIES COTIRE_UNITY_SOURCE_POST_UNDEFS "DEBUG_TYPE")
-+  cotire(${name})
-+endif()
- endmacro(add_llvm_utility name)
- 
- 
-@@ -198,6 +218,10 @@ function(add_unittest test_suite test_na
-     set(target_compile_flags "${target_compile_flags} -Wno-variadic-macros")
-   endif ()
-   set_property(TARGET ${test_name} PROPERTY COMPILE_FLAGS "${target_compile_flags}")
-+if (COMMAND cotire)
-+  set_target_properties(${name} PROPERTIES COTIRE_UNITY_SOURCE_POST_UNDEFS "DEBUG_TYPE")
-+  cotire(${name})
-+endif()
- endfunction()
- 
- # This function provides an automatic way to 'configure'-like generate a file
-diff -rupN llvm-3.3.src/include/llvm/Transforms/Utils/BlackList.h llvm-3.3.src.cotire/include/llvm/Transforms/Utils/BlackList.h
---- llvm-3.3.src/include/llvm/Transforms/Utils/BlackList.h	2013-04-11 15:20:00.000000000 +0200
-+++ llvm-3.3.src.cotire/include/llvm/Transforms/Utils/BlackList.h	2013-10-13 11:52:41.000000000 +0200
-@@ -30,6 +30,9 @@
- //===----------------------------------------------------------------------===//
- //
- 
-+#ifndef LLVM_TRANSFORMS_UTILS_BLACKLIST_H
-+#define LLVM_TRANSFORMS_UTILS_BLACKLIST_H
-+
- #include "llvm/ADT/StringMap.h"
- 
- namespace llvm {
-@@ -57,3 +60,5 @@ class BlackList {
- };
- 
- }  // namespace llvm
-+
-+#endif
-diff -rupN llvm-3.3.src/lib/Support/CMakeLists.txt llvm-3.3.src.cotire/lib/Support/CMakeLists.txt
---- llvm-3.3.src/lib/Support/CMakeLists.txt	2013-04-23 10:28:39.000000000 +0200
-+++ llvm-3.3.src.cotire/lib/Support/CMakeLists.txt	2013-10-13 10:25:45.000000000 +0200
-@@ -1,3 +1,7 @@
-+if (COMMAND cotire)
-+	set_source_files_properties (IsInf.cpp IsNAN.cpp PROPERTIES COTIRE_EXCLUDED TRUE)
-+endif()
-+
- add_llvm_library(LLVMSupport
-   APFloat.cpp
-   APInt.cpp

+ 0 - 100
lib/cotire/Patches/llvm-3.4.src.patch

@@ -1,100 +0,0 @@
-diff -rupN llvm-3.4.src/CMakeLists.txt llvm-3.4.src.cotire/CMakeLists.txt
---- llvm-3.4.src/CMakeLists.txt	2013-11-25 19:34:26.000000000 +0100
-+++ llvm-3.4.src.cotire/CMakeLists.txt	2014-01-06 20:25:12.000000000 +0100
-@@ -1,7 +1,7 @@
- # See docs/CMake.html for instructions about how to build LLVM with CMake.
- 
- project(LLVM)
--cmake_minimum_required(VERSION 2.8)
-+cmake_minimum_required(VERSION 2.8.12)
- 
- # Add path for custom modules
- set(CMAKE_MODULE_PATH
-@@ -25,6 +25,8 @@ if ( LLVM_USE_FOLDERS )
- endif()
- 
- include(VersionFromVCS)
-+include(cotire)
-+set_property(DIRECTORY PROPERTY COTIRE_UNITY_LINK_LIBRARIES_INIT "COPY_UNITY")
- 
- option(LLVM_APPEND_VC_REV
-   "Append the version control system revision id to LLVM version" OFF)
-diff -rupN llvm-3.4.src/cmake/modules/AddLLVM.cmake llvm-3.4.src.cotire/cmake/modules/AddLLVM.cmake
---- llvm-3.4.src/cmake/modules/AddLLVM.cmake	2013-08-27 21:25:01.000000000 +0200
-+++ llvm-3.4.src.cotire/cmake/modules/AddLLVM.cmake	2014-01-06 20:25:50.000000000 +0100
-@@ -41,6 +41,10 @@ macro(add_llvm_library name)
-   # property has been set to an empty value.
-   get_property(lib_deps GLOBAL PROPERTY LLVMBUILD_LIB_DEPS_${name})
-   target_link_libraries(${name} ${lib_deps})
-+if (COMMAND cotire)
-+  set_target_properties(${name} PROPERTIES COTIRE_UNITY_SOURCE_POST_UNDEFS "DEBUG_TYPE")
-+  cotire(${name})
-+endif()
- endmacro(add_llvm_library name)
- 
- macro(add_llvm_loadable_module name)
-@@ -78,6 +82,10 @@ ${name} ignored.")
-           ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
-       endif()
-     endif()
-+if (COMMAND cotire)
-+  set_target_properties(${name} PROPERTIES COTIRE_UNITY_SOURCE_POST_UNDEFS "DEBUG_TYPE")
-+  cotire(${name})
-+endif()
-   endif()
- 
-   set_target_properties(${name} PROPERTIES FOLDER "Loadable modules")
-@@ -119,6 +127,10 @@ macro(add_llvm_tool name)
-     endif()
-   endif()
-   set_target_properties(${name} PROPERTIES FOLDER "Tools")
-+if (COMMAND cotire)
-+  set_target_properties(${name} PROPERTIES COTIRE_UNITY_SOURCE_POST_UNDEFS "DEBUG_TYPE")
-+  cotire(${name})
-+endif()
- endmacro(add_llvm_tool name)
- 
- 
-@@ -132,12 +144,20 @@ macro(add_llvm_example name)
-     install(TARGETS ${name} RUNTIME DESTINATION examples)
-   endif()
-   set_target_properties(${name} PROPERTIES FOLDER "Examples")
-+if (COMMAND cotire)
-+  set_target_properties(${name} PROPERTIES COTIRE_UNITY_SOURCE_POST_UNDEFS "DEBUG_TYPE")
-+  cotire(${name})
-+endif()
- endmacro(add_llvm_example name)
- 
- 
- macro(add_llvm_utility name)
-   add_llvm_executable(${name} ${ARGN})
-   set_target_properties(${name} PROPERTIES FOLDER "Utils")
-+if (COMMAND cotire)
-+  set_target_properties(${name} PROPERTIES COTIRE_UNITY_SOURCE_POST_UNDEFS "DEBUG_TYPE")
-+  cotire(${name})
-+endif()
- endmacro(add_llvm_utility name)
- 
- 
-@@ -245,6 +265,10 @@ function(add_unittest test_suite test_na
-     set(target_compile_flags "${target_compile_flags} -Wno-variadic-macros")
-   endif ()
-   set_property(TARGET ${test_name} PROPERTY COMPILE_FLAGS "${target_compile_flags}")
-+if (COMMAND cotire)
-+  set_target_properties(${name} PROPERTIES COTIRE_UNITY_SOURCE_POST_UNDEFS "DEBUG_TYPE")
-+  cotire(${name})
-+endif()
- endfunction()
- 
- # This function provides an automatic way to 'configure'-like generate a file
-diff -rupN llvm-3.4.src/lib/Support/CMakeLists.txt llvm-3.4.src.cotire/lib/Support/CMakeLists.txt
---- llvm-3.4.src/lib/Support/CMakeLists.txt	2013-09-04 18:00:12.000000000 +0200
-+++ llvm-3.4.src.cotire/lib/Support/CMakeLists.txt	2014-01-06 20:27:36.000000000 +0100
-@@ -1,3 +1,7 @@
-+if (COMMAND cotire)
-+	set_source_files_properties (IsInf.cpp IsNAN.cpp PROPERTIES COTIRE_EXCLUDED TRUE)
-+endif()
-+
- add_llvm_library(LLVMSupport
-   APFloat.cpp
-   APInt.cpp

+ 0 - 99
lib/cotire/Patches/llvm-3.5.src.patch

@@ -1,99 +0,0 @@
-diff -rupN --exclude=.DS_Store --exclude='*.pyc' llvm-3.5.0.src/CMakeLists.txt llvm-3.5.0.src.cotire/CMakeLists.txt
---- llvm-3.5.0.src/CMakeLists.txt	2014-07-04 06:23:26.000000000 +0200
-+++ llvm-3.5.0.src.cotire/CMakeLists.txt	2014-12-14 12:19:41.000000000 +0100
-@@ -1,6 +1,6 @@
- # See docs/CMake.html for instructions about how to build LLVM with CMake.
- 
--cmake_minimum_required(VERSION 2.8.8)
-+cmake_minimum_required(VERSION 2.8.12)
- 
- # FIXME: It may be removed when we use 2.8.12.
- if(CMAKE_VERSION VERSION_LESS 2.8.12)
-@@ -41,6 +41,8 @@ if ( LLVM_USE_FOLDERS )
- endif()
- 
- include(VersionFromVCS)
-+include(cotire)
-+set_property(DIRECTORY PROPERTY COTIRE_UNITY_LINK_LIBRARIES_INIT "COPY_UNITY")
- 
- option(LLVM_APPEND_VC_REV
-   "Append the version control system revision id to LLVM version" OFF)
-diff -rupN --exclude=.DS_Store --exclude='*.pyc' llvm-3.5.0.src/cmake/modules/AddLLVM.cmake llvm-3.5.0.src.cotire/cmake/modules/AddLLVM.cmake
---- llvm-3.5.0.src/cmake/modules/AddLLVM.cmake	2014-07-23 17:19:01.000000000 +0200
-+++ llvm-3.5.0.src.cotire/cmake/modules/AddLLVM.cmake	2014-12-14 12:28:35.000000000 +0100
-@@ -106,6 +106,10 @@ function(add_llvm_symbol_exports target_
-       set_property(TARGET ${target_name} APPEND_STRING PROPERTY
-                    LINK_FLAGS " /DEF:${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}")
-     endif()
-+if (COMMAND cotire)
-+  set_target_properties(${name} PROPERTIES COTIRE_UNITY_SOURCE_POST_UNDEFS "DEBUG_TYPE")
-+  cotire(${name})
-+endif()
-   endif()
- 
-   add_custom_target(${target_name}_exports DEPENDS ${native_export_file})
-@@ -394,6 +398,10 @@ macro(add_llvm_library name)
-     set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
-   endif()
-   set_target_properties(${name} PROPERTIES FOLDER "Libraries")
-+if (COMMAND cotire)
-+  set_target_properties(${name} PROPERTIES COTIRE_UNITY_SOURCE_POST_UNDEFS "DEBUG_TYPE")
-+  cotire(${name})
-+endif()
- endmacro(add_llvm_library name)
- 
- macro(add_llvm_loadable_module name)
-@@ -422,6 +430,10 @@ macro(add_llvm_loadable_module name)
-   endif()
- 
-   set_target_properties(${name} PROPERTIES FOLDER "Loadable modules")
-+if (COMMAND cotire)
-+  set_target_properties(${name} PROPERTIES COTIRE_UNITY_SOURCE_POST_UNDEFS "DEBUG_TYPE")
-+  cotire(${name})
-+endif()
- endmacro(add_llvm_loadable_module name)
- 
- 
-@@ -471,6 +483,10 @@ macro(add_llvm_tool name)
-     set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
-   endif()
-   set_target_properties(${name} PROPERTIES FOLDER "Tools")
-+if (COMMAND cotire)
-+  set_target_properties(${name} PROPERTIES COTIRE_UNITY_SOURCE_POST_UNDEFS "DEBUG_TYPE")
-+  cotire(${name})
-+endif()
- endmacro(add_llvm_tool name)
- 
- 
-@@ -483,12 +499,20 @@ macro(add_llvm_example name)
-     install(TARGETS ${name} RUNTIME DESTINATION examples)
-   endif()
-   set_target_properties(${name} PROPERTIES FOLDER "Examples")
-+if (COMMAND cotire)
-+  set_target_properties(${name} PROPERTIES COTIRE_UNITY_SOURCE_POST_UNDEFS "DEBUG_TYPE")
-+  cotire(${name})
-+endif()
- endmacro(add_llvm_example name)
- 
- 
- macro(add_llvm_utility name)
-   add_llvm_executable(${name} ${ARGN})
-   set_target_properties(${name} PROPERTIES FOLDER "Utils")
-+if (COMMAND cotire)
-+  set_target_properties(${name} PROPERTIES COTIRE_UNITY_SOURCE_POST_UNDEFS "DEBUG_TYPE")
-+  cotire(${name})
-+endif()
- endmacro(add_llvm_utility name)
- 
- 
-diff -rupN --exclude=.DS_Store --exclude='*.pyc' llvm-3.5.0.src/lib/Support/CMakeLists.txt llvm-3.5.0.src.cotire/lib/Support/CMakeLists.txt
---- llvm-3.5.0.src/lib/Support/CMakeLists.txt	2014-07-17 22:05:29.000000000 +0200
-+++ llvm-3.5.0.src.cotire/lib/Support/CMakeLists.txt	2014-12-14 12:17:10.000000000 +0100
-@@ -1,3 +1,7 @@
-+if (COMMAND cotire)
-+	set_source_files_properties (IsInf.cpp IsNAN.cpp PROPERTIES COTIRE_EXCLUDED TRUE)
-+endif()
-+
- add_llvm_library(LLVMSupport
-   APFloat.cpp
-   APInt.cpp

+ 0 - 37
lib/cotire/Patches/yaml-cpp.patch

@@ -1,37 +0,0 @@
-diff -rupN yaml-cpp/CMakeLists.txt yaml-cpp-cotire/CMakeLists.txt
---- yaml-cpp/CMakeLists.txt	2012-01-21 09:52:48.000000000 +0100
-+++ yaml-cpp-cotire/CMakeLists.txt	2012-03-24 17:14:15.000000000 +0100
-@@ -14,6 +14,7 @@ if(POLICY CMP0015)
- endif()
- 
- include(CheckCXXCompilerFlag)
-+include("${CMAKE_SOURCE_DIR}/cotire.cmake")
- 
- 
- ###
-@@ -235,6 +236,7 @@ add_library(yaml-cpp
- 	${contrib_private_headers}
- )
- 
-+cotire(yaml-cpp)
- set_target_properties(yaml-cpp PROPERTIES
- 	VERSION "${YAML_CPP_VERSION}"
- 	SOVERSION "${YAML_CPP_VERSION_MAJOR}.${YAML_CPP_VERSION_MINOR}"
-diff -rupN yaml-cpp/test/CMakeLists.txt yaml-cpp-cotire/test/CMakeLists.txt
---- yaml-cpp/test/CMakeLists.txt	2012-01-21 09:52:48.000000000 +0100
-+++ yaml-cpp-cotire/test/CMakeLists.txt	2012-02-19 10:21:36.000000000 +0100
-@@ -13,3 +13,5 @@ add_executable(run-tests
- target_link_libraries(run-tests yaml-cpp)
- 
- add_test(yaml-reader-test run-tests)
-+
-+cotire(run-tests)
-\ No newline at end of file
-diff -rupN yaml-cpp/util/CMakeLists.txt yaml-cpp-cotire/util/CMakeLists.txt
---- yaml-cpp/util/CMakeLists.txt	2012-01-21 09:52:48.000000000 +0100
-+++ yaml-cpp-cotire/util/CMakeLists.txt	2012-02-19 10:21:54.000000000 +0100
-@@ -1,2 +1,3 @@
- add_executable(parse parse.cpp)
- target_link_libraries(parse yaml-cpp)
-+cotire(parse)
-\ No newline at end of file

+ 0 - 23
lib/cotire/Patches/zlib-1.2.6.patch

@@ -1,23 +0,0 @@
-diff -rupN zlib-1.2.6/CMakeLists.txt zlib-1.2.6.cotire/CMakeLists.txt
---- zlib-1.2.6/CMakeLists.txt	2012-01-17 03:51:23.000000000 +0100
-+++ zlib-1.2.6.cotire/CMakeLists.txt	2012-03-24 21:08:41.000000000 +0100
-@@ -7,6 +7,8 @@ if(NOT DEFINED BUILD_SHARED_LIBS)
-     option(BUILD_SHARED_LIBS "Build a shared library form of zlib" ON)
- endif()
- 
-+include("${CMAKE_SOURCE_DIR}/cotire.cmake") 
-+
- include(CheckTypeSize)
- include(CheckFunctionExists)
- include(CheckIncludeFile)
-@@ -176,6 +178,10 @@ if(NOT SKIP_INSTALL_FILES AND NOT SKIP_I
-     install(FILES zlib.3 DESTINATION share/man/man3)
- endif()
- 
-+if (COMMAND cotire)
-+	cotire(zlib)
-+endif()
-+
- #============================================================================
- # Example binaries
- #============================================================================

+ 0 - 144
lib/cotire/README.md

@@ -1,144 +0,0 @@
-cotire
-======
-
-Cotire (compile time reducer) is a CMake module that speeds up the build process of CMake based
-build systems by fully automating techniques as [precompiled header][pch] usage and
-[single compilation unit][scu] builds for C and C++.
-
-The functionality provided by cotire has been superseded by features added to [CMake 3.16][cmkr].
-Support for [pre-compiling][cpch] and [unity builds][cscu] is now built into CMake. Thus, there
-will not be any further updates or support for this project.
-
-features
---------
-
-* Non-intrusive. Requires no source code modification and only minimal changes to CMake list files.
-* Automatically generates a [single compilation unit][scu] (aka unity source file) for a CMake target.
-* Automatically generates a [prefix header][pfh] by tracking includes used by a CMake target.
-* Automatically precompiles prefix header and applies resulting [precompiled header][pch] to a CMake target.
-* Alternatively, allows for using manually maintained unity source and prefix header files.
-* Supports C/C++ compilers Clang, GCC, Intel and Visual Studio C++.
-* Supports mixed language CMake targets.
-* Supports console (Makefile generator) and IDE (Visual Studio and Xcode) based builds.
-* Compatible with CMake single build type and CMake multi-configuration builds.
-* Compatible with most CMake generators (including [Ninja][ninja]).
-* Supports multi-core unity builds for some generators (make -j, [jom][jom], Visual Studio, Ninja).
-* Leverages native precompiled header generation features of IDEs (Visual Studio and Xcode).
-* Compatible with CMake's [cross-compiling][ccrc] support.
-* Compatible with compiler wrappers like [ccache][ccch].
-* Tested with Windows, Linux and OS X.
-* MIT licensed.
-
-requirements
-------------
-
-* [CMake 2.8.12][cmk] or newer. The executable `cmake` should be on the system path.
-* [Visual Studio C++][vslstd], [MinGW][mingw] or [Cygwin][cgwn] under Windows.
-* [Clang][clang] under Windows, Linux or OS X.
-* [GCC][gcc] under Linux or OS X.
-* [Intel C++ compiler][intel] under Windows, Linux or OS X.
-* [Xcode][xcdt] application or Xcode Command Line Tools under OS X.
-
-installation
-------------
-
-Copy the file `CMake/cotire.cmake` to the module directory of your CMake project. In the
-top-level `CMakeList.txt` file, add the module directory to the CMake module search path:
-
-    set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake")
-
-usage
------
-
-To use cotire in your CMake project, add the following include directive to the beginning of the
-top-level `CMakeList.txt`:
-
-    include(cotire)
-
-To speed the build process of a CMake library or executable target, just apply the `cotire`
-function to the target:
-
-    add_executable(MyExecutable ${MyExecutableSources})
-    target_link_libraries(MyExecutable ${MyExecutableLibraries})
-    cotire(MyExecutable)
-
-Cotire looks at the properties of the target provided by CMake (e.g., target type, source files,
-compile flags, preprocessor defines, include directories, ...) and sets up custom commands that
-will generate a unity source file, a prefix header and a precompiled header at build time
-specially tailored to the target.
-
-For the generation of the prefix header, cotire will automatically choose headers used by the
-target that are outside of the project directory and thus are likely to change infrequently.
-The precompiled prefix header is then applied to the target to speed up the compilation process.
-
-To use an existing manually maintained prefix header instead of the automatically generated one,
-set the `COTIRE_CXX_PREFIX_HEADER_INIT` property before invoking cotire:
-
-    set_target_properties(MyExecutable PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "stdafx.h")
-    cotire(MyExecutable)
-
-As a side effect, cotire generates a new target named `MyExecutable_unity`, which lets you perform
-a unity build for the original target. The unity target inherits all build settings from the
-original target, including linked library dependencies.
-
-For Makefile based generators you can then invoke a unity build that produces the same output as
-the original target, but does so much faster by entering:
-
-    $ make MyExecutable_unity
-
-See the advanced usage section of the [cotire manual][manual] for information on how to
-configure the cotire process (e.g., how to make the unity build use all available processor
-cores).
-
-The directory `Patches` contains patch files to enable cotire for some popular open sources
-packages that use CMake as a build system.
-
-speedup
--------
-
-Depending on factors like hardware, compiler, the number of files in the target and the complexity
-of the C/C++ code, the build process of targets that use a cotire generated precompiled header
-will be sped up from 10 to 40 percent. Using precompiled headers however is not without
-[issues][PCHH] and may not work for some programs.
-
-A unity build may be up to 90 percent faster than the one file at a time build of the original
-target. Single compilation unit builds however are very unlikely to work without source code
-modifications, because they [break][EoUB] the use of some C and C++ language features.
-
-Generally, modern C++ code which makes heavy use of header-only libraries will profit the most from
-cotiring.
-
-This [blog post][shrp] discusses speedup results obtained for real-world projects.
-
-known issues
-------------
-
-* CMake configure time will increase for cotired targets.
-* The size of the CMake build folder will increase, because precompiled headers are large binaries.
-* It is not possible to share precompiled headers generated by cotire between CMake targets.
-  Multiple targets can share a generated prefix header, though (see the [cotire manual][manual]).
-* Cotire is not compatible with [Xoreax IncrediBuild][XGE].
-
-[ccch]:https://ccache.samba.org/
-[ccrc]:https://cmake.org/Wiki/CMake_Cross_Compiling
-[cgwn]:https://www.cygwin.com/
-[clang]:https://clang.llvm.org/
-[cmk]:https://cmake.org/download/
-[gcc]:https://gcc.gnu.org/
-[manual]:https://github.com/sakra/cotire/blob/master/MANUAL.md
-[mingw]:http://www.mingw.org/
-[ninja]:https://ninja-build.org/
-[pch]:https://en.wikipedia.org/wiki/Precompiled_header
-[pfh]:https://en.wikipedia.org/wiki/Prefix_header
-[scu]:https://en.wikipedia.org/wiki/Single_Compilation_Unit
-[vslstd]:https://www.visualstudio.com/
-[xcdt]:https://developer.apple.com/xcode/
-[PCHH]:https://gcc.gnu.org/wiki/PCHHaters
-[EoUB]:http://altdevblog.com/2011/08/14/the-evils-of-unity-builds/
-[jom]:https://wiki.qt.io/Jom
-[intel]:https://software.intel.com/en-us/c-compilers
-[XGE]:https://www.incredibuild.com/
-[shrp]:https://unriskinsight.blogspot.co.at/2014/09/sharpen-your-tools.html
-[cmkr]:https://cmake.org/cmake/help/latest/release/3.16.html
-[cpch]:https://cmake.org/cmake/help/latest/command/target_precompile_headers.html
-[cscu]:https://cmake.org/cmake/help/v3.16/prop_tgt/UNITY_BUILD.html

+ 0 - 22
lib/cotire/license

@@ -1,22 +0,0 @@
-Copyright (c) 2012-2018 Sascha Kratky
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.

+ 0 - 31
lib/cotire/src/CMakeLists.txt

@@ -1,31 +0,0 @@
-# cotire example project
-
-add_executable(example main.cpp example.cpp log.cpp log.h example.h)
-
-# enable warnings
-if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-	set_target_properties(example PROPERTIES COMPILE_FLAGS "-Weverything")
-elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
-	set_target_properties(example PROPERTIES COMPILE_FLAGS "-Wall -Wextra")
-endif()
-
-cotire(example)
-
-# cotire sets the following properties
-get_target_property(_unitySource example COTIRE_CXX_UNITY_SOURCE)
-get_target_property(_prefixHeader example COTIRE_CXX_PREFIX_HEADER)
-get_target_property(_precompiledHeader example COTIRE_CXX_PRECOMPILED_HEADER)
-get_target_property(_unityTargetName example COTIRE_UNITY_TARGET_NAME)
-
-if (_unitySource)
-	message(STATUS "example unity source: ${_unitySource}")
-endif()
-if (_prefixHeader)
-	message(STATUS "example prefix header: ${_prefixHeader}")
-endif()
-if (_precompiledHeader)
-	message(STATUS "example precompiled header: ${_precompiledHeader}")
-endif()
-if (TARGET ${_unityTargetName})
-	message(STATUS "example unity target: ${_unityTargetName}")
-endif()

+ 0 - 24
lib/cotire/src/example.cpp

@@ -1,24 +0,0 @@
-// cotire example project
-
-#include "example.h"
-
-#ifndef NDEBUG
-#include <algorithm>
-#include <iterator>
-#endif
-
-namespace example {
-
-std::string get_message() {
-	char msg_chrs[] = { 'C', 'o', 't', 'i', 'r', 'e', 'd', '!' };
-#ifdef NDEBUG
-	return std::string(&msg_chrs[0], &msg_chrs[sizeof(msg_chrs)]);
-#else
-	std::string msg;
-	msg.reserve(sizeof(msg_chrs));
-	std::copy(msg_chrs, msg_chrs + sizeof(msg_chrs), std::back_inserter(msg));
-	return msg;
-#endif
-}
-
-}

+ 0 - 10
lib/cotire/src/example.h

@@ -1,10 +0,0 @@
-// cotire example project
-
-#include <string>
-
-namespace example {
-
-std::string get_message();
-
-}
-

+ 0 - 17
lib/cotire/src/log.cpp

@@ -1,17 +0,0 @@
-// cotire example project
-
-#include "log.h"
-
-#include <iostream>
-
-namespace logging {
-
-void error(const std::string& msg) {
-	std::cerr << msg << std::endl;
-}
-
-void info(const std::string& msg) {
-	std::cout << msg << std::endl;
-}
-
-}

+ 0 - 10
lib/cotire/src/log.h

@@ -1,10 +0,0 @@
-// cotire example project
-
-#include <string>
-
-namespace logging {
-
-void error(const std::string& msg);
-void info(const std::string& msg);
-
-}

+ 0 - 12
lib/cotire/src/main.cpp

@@ -1,12 +0,0 @@
-// cotire example project main
-
-#include <string>
-
-#include "example.h"
-#include "log.h"
-
-int main()
-{
-	std::string msg = example::get_message();
-	logging::info(msg);
-}

+ 0 - 48
lib/luabind/doc/adopt.rst

@@ -1,48 +0,0 @@
-adopt
-----------------
-
-Motivation
-~~~~~~~~~~
-
-Used to transfer ownership across language boundaries.
-
-Defined in
-~~~~~~~~~~
-
-.. parsed-literal::
-
-    #include <luabind/adopt_policy.hpp>
-
-Synopsis
-~~~~~~~~
-
-.. parsed-literal::
-
-    adopt(index)
-
-Parameters
-~~~~~~~~~~
-
-============= ===============================================================
-Parameter     Purpose
-============= ===============================================================
-``index``     The index which should transfer ownership, ``_N`` or ``result``
-============= ===============================================================
-
-Example
-~~~~~~~
-
-.. parsed-literal::
-
-    X* create()
-    {
-        return new X;
-    }
-
-    ...
-
-    module(L)
-    [
-        def("create", &create, **adopt(result)**)
-    ];
-

+ 0 - 93
lib/luabind/doc/building.rst

@@ -1,93 +0,0 @@
-Building luabind
-================
-
-Prerequisites
--------------
-
-Luabind depends on a number of Boost 1.34 libraries. It also depends on
-Boost Jam and Boost Build V2 to build the library and run the tests.
-Boost provides `precompiled bjam binaries`__ for a number of platforms.
-If there isn't a precompiled binary available for your platform, you may
-need to `build it yourself`__.
-
-__ http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=72941
-__ http://www.boost.org/doc/libs/1_36_0/doc/html/jam/building.html
-
-
-Windows
--------
-
-The environment varaible ``LUA_PATH`` needs to be set to point to a
-directory containing the Lua include directory and built libraries. At
-least for the purpose of running the test suite, the recommended way to
-get these is the `Lua Binaries`_ *Windows x86 DLL and Includes* package.
-
-Furthermore, the environment variable ``BOOST_ROOT`` must point to
-a Boost installation directory.
-
-.. _`Lua Binaries`: http://luabinaries.luaforge.net
-
-
-Linux and other \*nix flavors
------------------------------
-
-If your system already has Lua installed, it is very likely that the
-build system will automatically find it and just work. If you have
-Lua installed in a non-standard location, you may need to set
-``LUA_PATH`` to point to the installation prefix.
-
-``BOOST_ROOT`` can be set to a Boost installation directory. If left
-unset, the build system will try to use boost headers from the standard
-include path.
-
-MacOSX
-~~~~~~
-
-If you have both the 10.4 and 10.5 SDK installed, Boost Build seems to
-default to 10.4. Lua, at least when installed from MacPorts, will be
-linked with the 10.5 SDK. If the luabind build fails with link errors,
-you may need to explicitly build with the 10.5 SDK::
-
-  $ bjam macosx-version=10.5
-
-
-Building and testing
---------------------
-
-Building the default variant of the library, which is a shared debug
-library, is simply done by invoking ``bjam`` in the luabind root
-directory::
-
-  $ bjam
-  ...patience...
-  ...found 714 targets...
-  ...updating 23 targets...
-
-When building with GCC on Linux, this results in::
-
-  bin/gcc-4.2.3/debug/libluabind.so
-
-On Windows a dll and matching import library would be produced.
-
-To run the unit tests, invoke ``bjam`` with the ``test`` target::
-
-  $ bjam test
-
-This will build and run the unit tests in four different variants:
-debug, release, debug-static-lib, release-static-lib. A clean test run
-output should end with something like:
-
-.. parsed-literal::
-
-  ... updated *xxx* targets...
-
-A failed run would end with something like:
-
-.. parsed-literal::
-
-  ...failed updating *xxx* target...
-  ...skipped *xxx* targets...
-
-If you are not using Boost Build to build your application, and want to
-use the shared library variant, ``LUABIND_DYNAMIC_LINK`` needs to be
-defined to properly import symbols.

+ 0 - 153
lib/luabind/doc/changes.txt

@@ -1,153 +0,0 @@
-LUABIND 7.1 changes
-===================
-
-* Applied patches from Evan Wies to support lua 5.1
-* added a new assignment operator and a special value,
-  luabind::nil, to set table entries to nil. 
-
-
-LUABIND BETA 7 changes
-======================
-
-We have introduced a change that may break current code,
-nothing will break silently however.
-
-The change is that the previous way of writing virtual class
-wrappers was to have it contain an object that refered to
-the actual lua object. This would cause a dependency cycle
-and result in the object never being garbage collected until
-the whole lua state was closed. The new way is to use a newly
-introduced type called weak_ref, instead of the object.
-See docs for more info.
-
-
-Changes from beta6
-------------------
-
-* renamed get_globals() and get_registry() to globals()
-  and registry()
-* rewrote object and made a few changes:
-
-  * moved iterators out of the class and removed
-    begin/end/raw_begin/raw_end/array_begin/array_end.
-    See updated docs for how to use the iterators.
-  * removed array_iterator alltogether
-  * renamed pushvalue() to push()
-  * removed set()
-  * replaced the constructor that creates an object from
-    a stack value (with better syntax)
-  * moved out the member functions type(), at() and raw_at()
-    and made them free functions. (type(), gettable(), settable(),
-    rawget() and rawset())
-  * renamed lua_state() to interpreter()
-  * object now supports nested indexing (with []-operator) as
-    well as function calls directly on indexed values (i.e.
-    globals(L)["my_fun"](10)). The indexing has also been made
-    more efficient through the use of expression templates.
-
-* removed functor (use object with call_function() instead)
-
-* using boost-build, and has better support for building
-  as a dll. The makefiles still works.
-* removed the option LUABIND_DONT_COPY_STRING, this means
-  that luabind will not provide storage for name strings.
-  i.e. the strings sent to module, namespace_ and class_
-  are expected to have global storage (it's no problem as
-  long as you use string constants)
-
-
-wrappers
-........
-
-Wrapper classes now have to derive from wrap_base and they don't have
-to contain any references to the lua-part (this is done by the base
-class now). The overload of call_member() that previuosly took a
-weak_ref as first parameter is now a member function of the wrap_base
-class and no longer takes the self reference argument. Example:
-
-struct A
-{
-    virtual ~A() {}
-    virtual std::string f() { return "A:f()"; }
-};
-
-struct A_wrap : A, wrap_base
-{
-    virtual std::string f()
-    {
-        return call_member<std::string>("f");
-    }
-
-    static std::string default_f(A* p)
-    {
-        return p->A::f();
-    }
-};
-
-The changes when registering the virtual functions is that you now
-have to register both the virtual function _and_ the default
-implementation of the function (for static dispatch). Like this:
-
-module(L)
-[
-    class_<A, A_wrap>("A")
-        .def(constructor<>())
-        .def("f", &A::f, &A_wrap::default_f)
-]
-
-If you update your luabind version without changing the way you register
-virtual functions, it will still compile, but may give you runtime
-errors.
-
-With these changes adopt will work as expected on wrapped types (the
-weak reference will be transformed into a strong reference internally).
-
-These changes will also make dynamic function dispatch work from within
-lua (and not just from c++ into lua).
-
-
-policy placeholders
-...................
-
-luabind now handles member functions in a more general way.
-The self reference that is passed as first parameter to
-member functions is now refered to using the _1 placeholder
-(instead of self). This means that the first argument to a
-member function is refered to with _2.
-
-
-additions
-.........
-
-* added __newindex metatable entry on c++ classes
-* moved more code into cpp-files (hopefully reduces user
-  compile time slightly)
-* the iterators are now true models of ForwardIterator
-* error messages when writing non-matching type to a property
-  or attribute.
-* support for inner scopes
-* support for nil to holder_type conversion
-* wrappers for lua_resume() with the same syntax as
-  call_function() (resume_function() and resume())
-
-
-bugfixes
-........
-
-* bugs in the overload resolution could give internal errors
-  in some cases.
-* def_readonly and def_readwrite will now return references
-  if the type is not a primitive type. This will allow
-  chained . operators.
-* object_cast() of uninitialized objects works
-* supports strings with extra nulls in them (not for member
-  names though)
-* fixed reference leakage by reducing the amount of explicit
-  resource management.
-* fixed bug where matchers for getters and setters did not
-  propagate to derived classes.
-* fixed leak when using class wrappers. They had a reference
-  cycle that wouldn't get collected (until the lua_State was
-  closed).
-* lots of other fixes we can't remember 
-

+ 0 - 53
lib/luabind/doc/copy.rst

@@ -1,53 +0,0 @@
-copy
-----------------
-
-Motivation
-~~~~~~~~~~
-
-This will make a copy of the parameter. This is the default behavior when
-passing parameters by-value. Note that this can only be used when passing from
-C++ to Lua. This policy requires that the parameter type has an accessible copy
-constructor.
-
-Defined in
-~~~~~~~~~~
-
-.. parsed-literal::
-
-    #include <luabind/copy_policy.hpp>
-
-Synopsis
-~~~~~~~~
-
-.. parsed-literal::
-
-    copy(index)
-
-Parameters
-~~~~~~~~~~
-
-============= ===============================================================
-Parameter     Purpose
-============= ===============================================================
-``index``     The index to copy. ``result`` when used while wrapping C++
-              functions. ``_N`` when passing arguments to Lua.
-============= ===============================================================
-
-Example
-~~~~~~~
-
-.. parsed-literal::
-
-    X* get()
-    {
-        static X instance;
-        return &instance;
-    }
-
-    ...
-
-    module(L)
-    [
-        def("create", &create, **copy(result)**)
-    ];
-

+ 0 - 50
lib/luabind/doc/dependency.rst

@@ -1,50 +0,0 @@
-dependency
-----------------
-
-Motivation
-~~~~~~~~~~
-
-The dependency policy is used to create life-time dependencies between values.
-This is needed for example when returning internal references to some class.
-
-Defined in
-~~~~~~~~~~
-
-.. parsed-literal::
-
-    #include <luabind/dependency_policy.hpp>
-
-Synopsis
-~~~~~~~~
-
-.. parsed-literal::
-
-    dependency(nurse_index, patient_index)
-
-Parameters
-~~~~~~~~~~
-
-================= ==========================================================
-Parameter         Purpose
-================= ==========================================================
-``nurse_index``   The index which will keep the patient alive. 
-``patient_index`` The index which will be kept alive.
-================= ==========================================================
-
-Example
-~~~~~~~
-
-.. parsed-literal::
-
-    struct X
-    {
-        B member;
-        B& get() { return member; }
-    };
-
-    module(L)
-    [
-        class_<X>("X")
-            .def("get", &X::get, **dependency(result, _1)**)
-    ];
-

+ 0 - 46
lib/luabind/doc/discard_result.rst

@@ -1,46 +0,0 @@
-discard_result
-----------------
-
-Motivation
-~~~~~~~~~~
-
-This is a very simple policy which makes it possible to throw away 
-the value returned by a C++ function, instead of converting it to 
-Lua.
-
-Defined in
-~~~~~~~~~~
-
-.. parsed-literal::
-
-    #include <luabind/discard_result_policy.hpp>
-
-Synopsis
-~~~~~~~~
-
-.. parsed-literal::
-
-    discard_result
-
-Example
-~~~~~~~
-
-.. parsed-literal::
-
-    struct X
-    {
-        X& set(T n)
-        {
-            ...
-            return \*this;
-        }
-    };
-
-    ...
-
-    module(L)
-    [
-        class_<X>("X")
-            .def("set", &simple::set, **discard_result**)
-    ];
-

+ 0 - 2629
lib/luabind/doc/docs.rst

@@ -1,2629 +0,0 @@
-.. include:: version.rst
-
-+++++++++++++++++++
- luabind |version|
-+++++++++++++++++++
-
-:Author: Daniel Wallin, Arvid Norberg
-:Copyright: Copyright Daniel Wallin, Arvid Norberg 2003.
-:License: Permission is hereby granted, free of charge, to any person obtaining a
-          copy of this software and associated documentation files (the "Software"),
-          to deal in the Software without restriction, including without limitation
-          the rights to use, copy, modify, merge, publish, distribute, sublicense,
-          and/or sell copies of the Software, and to permit persons to whom the
-          Software is furnished to do so, subject to the following conditions:
-
-          The above copyright notice and this permission notice shall be included
-          in all copies or substantial portions of the Software.
-
-          THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
-          ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-          TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-          PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-          SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
-          ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-          ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-          OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
-          OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-.. _MIT license: http://www.opensource.org/licenses/mit-license.php
-.. _Boost: http://www.boost.org
-
-.. contents::
-    :depth: 2
-    :backlinks: none
-.. section-numbering::
-
-.. |...| unicode:: U+02026
-
-Introduction
-============
-
-Luabind is a library that helps you create bindings between C++ and Lua. It has
-the ability to expose functions and classes, written in C++, to Lua. It will
-also supply the functionality to define classes in Lua and let them derive from
-other Lua classes or C++ classes. Lua classes can override virtual functions
-from their C++ base classes. It is written towards Lua 5.0, and does not work
-with Lua 4.
-
-It is implemented utilizing template meta programming. That means that you
-don't need an extra preprocess pass to compile your project (it is done by the
-compiler). It also means you don't (usually) have to know the exact signature 
-of each function you register, since the library will generate code depending 
-on the compile-time type of the function (which includes the signature). The 
-main drawback of this approach is that the compilation time will increase for 
-the file that does the registration, it is therefore recommended that you 
-register everything in the same cpp-file.
-
-Luabind is released under the terms of the `MIT license`_.
-
-We are very interested in hearing about projects that use luabind, please let
-us know about your project.
-
-The main channel for help and feedback is the `luabind mailing list`_.
-There's also an IRC channel ``#luabind`` on irc.freenode.net.
-
-.. _`luabind mailing list`: https://lists.sourceforge.net/lists/listinfo/luabind-user
-
-
-Features
-========
-
-Luabind supports:
-
- - Overloaded free functions 
- - C++ classes in Lua 
- - Overloaded member functions 
- - Operators 
- - Properties 
- - Enums 
- - Lua functions in C++ 
- - Lua classes in C++ 
- - Lua classes (single inheritance) 
- - Derives from Lua or C++ classes 
- - Override virtual functions from C++ classes 
- - Implicit casts between registered types 
- - Best match signature matching 
- - Return value policies and parameter policies 
-
-
-Portability
-===========
-
-Luabind has been tested to work on the following compilers:
-
- - Visual Studio 7.1 
- - Intel C++ 6.0 (Windows) 
- - GCC 2.95.3 (cygwin) 
- - GCC 3.0.4 (Debian/Linux) 
- - GCC 3.1 (SunOS 5.8) 
- - GCC 3.2 (cygwin) 
- - GCC 3.3.1 (cygwin)
- - GCC 3.3 (Apple, MacOS X)
- - GCC 4.0 (Apple, MacOS X)
-
-It has been confirmed not to work with:
-
- - GCC 2.95.2 (SunOS 5.8) 
-
-Metrowerks 8.3 (Windows) compiles but fails the const-test. This 
-means that const member functions are treated as non-const member 
-functions.
-
-If you have tried luabind with a compiler not listed here, let us know 
-your result with it.
-
-.. include:: building.rst
-
-Basic usage
-===========
-
-To use luabind, you must include ``lua.h`` and luabind's main header file::
-
-    extern "C"
-    {
-        #include "lua.h"
-    }
-
-    #include <luabind/luabind.hpp>
-
-This includes support for both registering classes and functions. If you just
-want to have support for functions or classes you can include
-``luabind/function.hpp`` and ``luabind/class.hpp`` separately::
-
-    #include <luabind/function.hpp>
-    #include <luabind/class.hpp>
-
-The first thing you need to do is to call ``luabind::open(lua_State*)`` which
-will register the functions to create classes from Lua, and initialize some
-state-global structures used by luabind. If you don't call this function you
-will hit asserts later in the library. There is no corresponding close function
-because once a class has been registered in Lua, there really isn't any good
-way to remove it. Partly because any remaining instances of that class relies
-on the class being there. Everything will be cleaned up when the state is
-closed though.
-
-.. Isn't this wrong? Don't we include lua.h using lua_include.hpp ?
-
-Luabind's headers will never include ``lua.h`` directly, but through
-``<luabind/lua_include.hpp>``. If you for some reason need to include another
-Lua header, you can modify this file.
-
-
-Hello world
------------
-
-::
-
-    #include <iostream>
-    #include <luabind/luabind.hpp>
-
-    void greet()
-    {
-        std::cout << "hello world!\n";
-    }
-
-    extern "C" int init(lua_State* L)
-    {
-        using namespace luabind;
-
-        open(L);
-
-        module(L)
-        [
-            def("greet", &greet)
-        ];
-
-        return 0;
-    }
-
-::
-
-    Lua 5.0  Copyright (C) 1994-2003 Tecgraf, PUC-Rio
-    > loadlib('hello_world.dll', 'init')()
-    > greet()
-    Hello world!
-    >
-
-Scopes
-======
-
-Everything that gets registered in Lua is registered in a namespace (Lua
-tables) or in the global scope (called module). All registrations must be
-surrounded by its scope. To define a module, the ``luabind::module`` class is
-used. It is used like this::
-
-    module(L)
-    [
-        // declarations
-    ];
-
-This will register all declared functions or classes in the global namespace in
-Lua. If you want to have a namespace for your module (like the standard
-libraries) you can give a name to the constructor, like this::
-
-    module(L, "my_library")
-    [
-        // declarations
-    ];
-
-Here all declarations will be put in the my_library table.
-
-If you want nested namespace's you can use the ``luabind::namespace_`` class. It
-works exactly as ``luabind::module`` except that it doesn't take a lua_State*
-in it's constructor. An example of its usage could look like this::
-
-    module(L, "my_library")
-    [
-        // declarations
-
-        namespace_("detail")
-        [
-            // library-private declarations
-        ]
-    ];
-
-As you might have figured out, the following declarations are equivalent::
-
-    module(L)
-    [
-        namespace_("my_library")
-        [
-            // declarations
-        ]
-
-    ];
-
-::
-    
-    module(L, "my_library")
-    [
-        // declarations
-    ];
-
-Each declaration must be separated by a comma, like this::
-
-    module(L)
-    [
-        def("f", &f),
-        def("g", &g),
-        class_<A>("A")
-            .def(constructor<int, int>),
-        def("h", &h)
-    ];
-
-
-More about the actual declarations in the `Binding functions to Lua`_ and
-`Binding classes to Lua`_ sections.
-
-A word of caution, if you are in really bad need for performance, putting your
-functions in tables will increase the lookup time.
-
-
-Binding functions to Lua
-========================
-
-To bind functions to Lua you use the function ``luabind::def()``. It has the
-following synopsis::
-
-    template<class F, class policies>
-    void def(const char* name, F f, const Policies&);
-
-- name is the name the function will have within Lua. 
-- F is the function pointer you want to register. 
-- The Policies parameter is used to describe how parameters and return values 
-  are treated by the function, this is an optional parameter. More on this in 
-  the `policies`_ section.
-
-An example usage could be if you want to register the function ``float
-std::sin(float)``::
-
-    module(L)
-    [
-        def("sin", &std::sin)
-    ];
-
-Overloaded functions
---------------------
-
-If you have more than one function with the same name, and want to register
-them in Lua, you have to explicitly give the signature. This is to let C++ know
-which function you refer to. For example, if you have two functions, ``int
-f(const char*)`` and ``void f(int)``. ::
-
-    module(L)
-    [
-        def("f", (int(*)(const char*)) &f),
-        def("f", (void(*)(int)) &f)
-    ];
-
-Signature matching
-------------------
-
-luabind will generate code that checks the Lua stack to see if the values there
-can match your functions' signatures. It will handle implicit typecasts between
-derived classes, and it will prefer matches with the least number of implicit
-casts. In a function call, if the function is overloaded and there's no
-overload that match the parameters better than the other, you have an
-ambiguity. This will spawn a run-time error, stating that the function call is
-ambiguous. A simple example of this is to register one function that takes an
-int and one that takes a float. Since Lua doesn't distinguish between floats and
-integers, both will always match.
-
-Since all overloads are tested, it will always find the best match (not the
-first match). This also means that it can handle situations where the only
-difference in the signature is that one member function is const and the other
-isn't. 
-
-.. sidebar:: Ownership transfer
-
-   To correctly handle ownership transfer, create_a() would need an adopt
-   return value policy. More on this in the `Policies`_ section.
-
-For example, if the following function and class is registered:
-
-::
-   
-    struct A
-    {
-        void f();
-        void f() const;
-    };
-
-    const A* create_a();
-
-    struct B: A {};
-    struct C: B {};
-
-    void g(A*);
-    void g(B*);
-
-And the following Lua code is executed::
-
-    a1 = create_a()
-    a1:f() -- the const version is called
-
-    a2 = A()
-    a2:f() -- the non-const version is called
-
-    a = A()
-    b = B()
-    c = C()
-
-    g(a) -- calls g(A*)
-    g(b) -- calls g(B*)
-    g(c) -- calls g(B*)
-
-
-Calling Lua functions
----------------------
-
-To call a Lua function, you can either use ``call_function()`` or
-an ``object``.
-
-::
-
-    template<class Ret>
-    Ret call_function(lua_State* L, const char* name, ...)
-    template<class Ret>
-    Ret call_function(object const& obj, ...)
-
-There are two overloads of the ``call_function`` function, one that calls
-a function given its name, and one that takes an object that should be a Lua
-value that can be called as a function.
-
-The overload that takes a name can only call global Lua functions. The ...
-represents a variable number of parameters that are sent to the Lua
-function. This function call may throw ``luabind::error`` if the function
-call fails.
-
-The return value isn't actually Ret (the template parameter), but a proxy
-object that will do the function call. This enables you to give policies to the
-call. You do this with the operator[]. You give the policies within the
-brackets, like this::
-
-    int ret = call_function<int>(
-        L 
-      , "a_lua_function"
-      , new complex_class()
-    )[ adopt(_1) ];
-
-If you want to pass a parameter as a reference, you have to wrap it with the
-`Boost.Ref`__.
-
-__ http://www.boost.org/doc/html/ref.html
-
-Like this::
-
-	int ret = call_function(L, "fun", boost::ref(val));
-
-
-If you want to use a custom error handler for the function call, see
-``set_pcall_callback`` under `pcall errorfunc`_.
-
-Using Lua threads
------------------
-
-To start a Lua thread, you have to call ``lua_resume()``, this means that you
-cannot use the previous function ``call_function()`` to start a thread. You have
-to use
-
-::
-
-    template<class Ret>
-    Ret resume_function(lua_State* L, const char* name, ...)
-    template<class Ret>
-    Ret resume_function(object const& obj, ...)
-
-and
-
-::
-
-    template<class Ret>
-    Ret resume(lua_State* L, ...)
-
-The first time you start the thread, you have to give it a function to execute. i.e. you
-have to use ``resume_function``, when the Lua function yields, it will return the first
-value passed in to ``lua_yield()``. When you want to continue the execution, you just call
-``resume()`` on your ``lua_State``, since it's already executing a function, you don't pass
-it one. The parameters to ``resume()`` will be returned by ``yield()`` on the Lua side.
-
-For yielding C++-functions (without the support of passing data back and forth between the
-Lua side and the c++ side), you can use the yield_ policy.
-
-With the overload of ``resume_function`` that takes an object_, it is important that the
-object was constructed with the thread as its ``lua_State*``. Like this:
-
-.. parsed-literal::
-
-	lua_State* thread = lua_newthread(L);
-	object fun = get_global(**thread**)["my_thread_fun"];
-	resume_function(fun);
-
-
-Binding classes to Lua
-======================
-
-To register classes you use a class called ``class_``. Its name is supposed to
-resemble the C++ keyword, to make it look more intuitive. It has an overloaded
-member function ``def()`` that is used to register member functions, operators,
-constructors, enums and properties on the class. It will return its
-this-pointer, to let you register more members directly.
-
-Let's start with a simple example. Consider the following C++ class::
-
-    class testclass
-    {
-    public:
-        testclass(const std::string& s): m_string(s) {}
-        void print_string() { std::cout << m_string << "\n"; }
-
-    private:
-        std::string m_string;
-    };
-
-To register it with a Lua environment, write as follows (assuming you are using
-namespace luabind)::
-
-    module(L)
-    [
-        class_<testclass>("testclass")
-            .def(constructor<const std::string&>())
-            .def("print_string", &testclass::print_string)
-    ];
-
-This will register the class with the name testclass and constructor that takes
-a string as argument and one member function with the name ``print_string``.
-
-::
-
-    Lua 5.0  Copyright (C) 1994-2003 Tecgraf, PUC-Rio
-    > a = testclass('a string')
-    > a:print_string()
-    a string
-
-It is also possible to register free functions as member functions. The
-requirement on the function is that it takes a pointer, const pointer,
-reference or const reference to the class type as the first parameter. The rest
-of the parameters are the ones that are visible in Lua, while the object
-pointer is given as the first parameter. If we have the following C++ code::
-
-    struct A
-    {
-        int a;
-    };
-
-    int plus(A* o, int v) { return o->a + v; }
-
-You can register ``plus()`` as if it was a member function of A like this::
-
-    class_<A>("A")
-        .def("plus", &plus)
-
-``plus()`` can now be called as a member function on A with one parameter, int.
-If the object pointer parameter is const, the function will act as if it was a
-const member function (it can be called on const objects).
-
-
-Overloaded member functions
----------------------------
-
-When binding more than one overloads of a member function, or just binding
-one overload of an overloaded member function, you have to disambiguate
-the member function pointer you pass to ``def``. To do this, you can use an
-ordinary C-style cast, to cast it to the right overload. To do this, you have
-to know how to express member function types in C++, here's a short tutorial
-(for more info, refer to your favorite book on C++).
-
-The syntax for member function pointer follows:
-
-.. parsed-literal::
-
-    *return-value* (*class-name*::\*)(*arg1-type*, *arg2-type*, *...*)
-
-Here's an example illlustrating this::
-
-    struct A
-    {
-        void f(int);
-        void f(int, int);
-    };
-
-::
-
-    class_<A>()
-        .def("f", (void(A::*)(int))&A::f)
-
-This selects the first overload of the function ``f`` to bind. The second
-overload is not bound.
-
-
-Properties
-----------
-
-To register a global data member with a class is easily done. Consider the
-following class::
-
-    struct A
-    {
-        int a;
-    };
-
-This class is registered like this::
-
-    module(L)
-    [
-        class_<A>("A")
-            .def_readwrite("a", &A::a)
-    ];
-
-This gives read and write access to the member variable ``A::a``. It is also
-possible to register attributes with read-only access::
-
-    module(L)
-    [
-        class_<A>("A")
-            .def_readonly("a", &A::a)
-    ];
-
-When binding members that are a non-primitive type, the auto generated getter
-function will return a reference to it. This is to allow chained .-operators.
-For example, when having a struct containing another struct. Like this::
-
-    struct A { int m; };
-    struct B { A a; };
-
-When binding ``B`` to lua, the following expression code should work::
-
-    b = B()
-    b.a.m = 1
-    assert(b.a.m == 1)
-
-This requires the first lookup (on ``a``) to return a reference to ``A``, and
-not a copy. In that case, luabind will automatically use the dependency policy
-to make the return value dependent on the object in which it is stored. So, if
-the returned reference lives longer than all references to the object (b in
-this case) it will keep the object alive, to avoid being a dangling pointer.
-
-You can also register getter and setter functions and make them look as if they
-were a public data member. Consider the following class::
-
-    class A
-    {
-    public:
-        void set_a(int x) { a = x; }
-        int get_a() const { return a; }
-
-    private:
-        int a;
-    };
-
-It can be registered as if it had a public data member a like this::
-
-    class_<A>("A")
-        .property("a", &A::get_a, &A::set_a)
-
-This way the ``get_a()`` and ``set_a()`` functions will be called instead of
-just writing  to the data member. If you want to make it read only you can just
-omit the last parameter. Please note that the get function **has to be
-const**, otherwise it won't compile. This seems to be a common source of errors.
-
-
-Enums
------
-
-If your class contains enumerated constants (enums), you can register them as
-well to make them available in Lua. Note that they will not be type safe, all
-enums are integers in Lua, and all functions that takes an enum, will accept
-any integer. You register them like this::
-
-    module(L)
-    [
-        class_<A>("A")
-            .enum_("constants")
-            [
-                value("my_enum", 4),
-                value("my_2nd_enum", 7),
-                value("another_enum", 6)
-            ]
-    ];
-
-In Lua they are accessed like any data member, except that they are read-only
-and reached on the class itself rather than on an instance of the class.
-
-::
-
-    Lua 5.0  Copyright (C) 1994-2003 Tecgraf, PUC-Rio
-    > print(A.my_enum)
-    4
-    > print(A.another_enum)
-    6
-
-
-Operators
----------
-
-To bind operators you have to include ``<luabind/operator.hpp>``.
-
-The mechanism for registering operators on your class is pretty simple. You use
-a global name ``luabind::self`` to refer to the class itself and then you just
-write the operator expression inside the ``def()`` call. This class::
-
-    struct vec
-    {
-        vec operator+(int s);
-    };
-
-Is registered like this:
-
-.. parsed-literal::
-
-    module(L)
-    [
-        class_<vec>("vec")
-            .def(**self + int()**)
-    ];
-
-This will work regardless if your plus operator is defined inside your class or
-as a free function.
-
-If your operator is const (or, when defined as a free function, takes a const
-reference to the class itself) you have to use ``const_self`` instead of
-``self``. Like this:
-
-.. parsed-literal::
-
-    module(L)
-    [
-        class_<vec>("vec")
-            .def(**const_self** + int())
-    ];
-
-The operators supported are those available in Lua:
-
-.. parsed-literal::
-
-    +    -    \*    /    ==    <    <=
-
-This means, no in-place operators. The equality operator (``==``) has a little
-hitch; it will not be called if the references are equal. This means that the
-``==`` operator has to do pretty much what's it's expected to do.
-
-Lua does not support operators such as ``!=``, ``>`` or ``>=``. That's why you
-can only register the operators listed above. When you invoke one of the
-mentioned operators, lua will define it in terms of one of the available
-operators.
-
-In the above example the other operand type is instantiated by writing
-``int()``. If the operand type is a complex type that cannot easily be
-instantiated you can wrap the type in a class called ``other<>``. For example:
-
-To register this class, we don't want to instantiate a string just to register
-the operator.
-
-::
-
-    struct vec
-    {
-        vec operator+(std::string);
-    };
-
-Instead we use the ``other<>`` wrapper like this:
-
-.. parsed-literal::
-
-    module(L)
-    [
-        class_<vec>("vec")
-            .def(self + **other<std::string>()**)
-    ];
-
-To register an application (function call-) operator:
-
-.. parsed-literal::
-
-    module(L)
-    [
-        class_<vec>("vec")
-            .def( **self(int())** )
-    ];
-
-There's one special operator. In Lua it's called ``__tostring``, it's not
-really an operator. It is used for converting objects to strings in a standard
-way in Lua. If you register this functionality, you will be able to use the lua
-standard function ``tostring()`` for converting your object to a string.
-
-To implement this operator in C++ you should supply an ``operator<<`` for
-std::ostream. Like this example:
-
-.. parsed-literal::
-
-    class number {};
-    std::ostream& operator<<(std::ostream&, number&);
-
-    ...
-    
-    module(L)
-    [
-        class_<number>("number")
-            .def(**tostring(self)**)
-    ];
-
-
-Nested scopes and static functions
-----------------------------------
-
-It is possible to add nested scopes to a class. This is useful when you need 
-to wrap a nested class, or a static function.
-
-.. parsed-literal::
-
-    class_<foo>("foo")
-        .def(constructor<>())
-        **.scope
-        [
-            class_<inner>("nested"),
-            def("f", &f)
-        ]**;
-
-In this example, ``f`` will behave like a static member function of the class
-``foo``, and the class ``nested`` will behave like a nested class of ``foo``.
-
-It's also possible to add namespaces to classes using the same syntax.
-
-
-Derived classes
----------------
-  
-If you want to register classes that derives from other classes, you can
-specify a template parameter ``bases<>`` to the ``class_`` instantiation. The
-following hierarchy::
-   
-    struct A {};
-    struct B : A {};
-
-Would be registered like this::
-
-    module(L)
-    [
-        class_<A>("A"),
-        class_<B, A>("B")
-    ];
-
-If you have multiple inheritance you can specify more than one base. If B would
-also derive from a class C, it would be registered like this::
-
-    module(L)
-    [
-        class_<B, bases<A, C> >("B")
-    ];
-
-Note that you can omit ``bases<>`` when using single inheritance.
-
-.. note::
-   If you don't specify that classes derive from each other, luabind will not
-   be able to implicitly cast pointers between the types.
-
-
-Smart pointers
---------------
-
-When registering a class you can tell luabind to hold all instances
-explicitly created in Lua in a specific smart pointer type, rather than
-the default raw pointer. This is done by passing an additional template
-parameter to ``class_``:
-
-.. parsed-literal::
-
-    class_<X, **P**>(|...|)
-
-Where the requirements of ``P`` are:
-
-======================== =======================================
-Expression               Returns
-======================== =======================================
-``P(raw)``
-``get_pointer(p)``       Convertible to ``X*``
-======================== =======================================
-
-where:
-
-* ``raw`` is of type ``X*``
-* ``p`` is an instance of ``P``
-
-``get_pointer()`` overloads are provided for the smart pointers in
-Boost, and ``std::auto_ptr<>``. Should you need to provide your own
-overload, note that it is called unqualified and is expected to be found
-by *argument dependent lookup*. Thus it should be defined in the same
-namespace as the pointer type it operates on.
-
-For example:
-
-.. parsed-literal::
-
-    class_<X, **boost::scoped_ptr<X>** >("X")
-      .def(constructor<>())
-
-Will cause luabind to hold any instance created on the Lua side in a
-``boost::scoped_ptr<X>``. Note that this doesn't mean **all** instances
-will be held by a ``boost::scoped_ptr<X>``. If, for example, you
-register a function::
-
-    std::auto_ptr<X> make_X();
-
-the instance returned by that will be held in ``std::auto_ptr<X>``. This
-is handled automatically for all smart pointers that implement a
-``get_pointer()`` overload.
-
-.. important::
-
-    ``get_const_holder()`` has been removed. Automatic conversions
-    between ``smart_ptr<X>`` and ``smart_ptr<X const>`` no longer work.
-
-.. important::
-
-    ``__ok``  has been removed. Similar functionality can be implemented
-    for specific pointer types by doing something along the lines of:
-
-    .. parsed-literal::
-
-      bool is_non_null(std::auto_ptr<X> const& p)
-      {
-          return p.get();
-      }
-
-      |...|
-
-      def("is_non_null", &is_non_null)
-
-When registering a hierarchy of classes, where all instances are to be held
-by a smart pointer, all the classes should have the baseclass' holder type.
-Like this:
-
-.. parsed-literal::
-
-        module(L)
-        [
-            class_<base, boost::shared_ptr<base> >("base")
-                .def(constructor<>()),
-            class_<derived, base, **boost::shared_ptr<base>** >("derived")
-                .def(constructor<>())
-        ];
-
-Internally, luabind will do the necessary conversions on the raw pointers, which
-are first extracted from the holder type.
-
-
-Splitting class registrations
------------------------------
-
-In some situations it may be desirable to split a registration of a class
-across different compilation units. Partly to save rebuild time when changing
-in one part of the binding, and in some cases compiler limits may force you
-to split it. To do this is very simple. Consider the following sample code::
-
-    void register_part1(class_<X>& x)
-    {
-        x.def(/*...*/);
-    }
-
-    void register_part2(class_<X>& x)
-    {
-        x.def(/*...*/);
-    }
-
-    void register_(lua_State* L)
-    {
-        class_<X> x("x");
-
-        register_part1(x);
-        register_part2(x);
-
-        module(L) [ x ];
-    }
-
-Here, the class ``X`` is registered in two steps. The two functions
-``register_part1`` and ``register_part2`` may be put in separate compilation
-units.
-
-To separate the module registration and the classes to be registered, see
-`Splitting up the registration`_.
-
-
-Adding converters for user defined types
-========================================
-
-It is possible to get luabind to handle user defined types like it does
-the built in types by specializing ``luabind::default_converter<>``:
-
-::
-
-  struct int_wrapper
-  {
-      int_wrapper(int value)
-        : value(value)
-      {}
-
-      int value;
-  };
-
-  namespace luabind
-  {
-      template <>
-      struct default_converter<X>
-        : native_converter_base<X>
-      {
-          static int compute_score(lua_State* L, int index)
-          {
-              return lua_type(L, index) == LUA_TNUMBER ? 0 : -1;
-          }
-
-          X from(lua_State* L, int index)
-          {
-              return X(lua_tonumber(L, index));
-          }
-
-          void to(lua_State* L, X const& x)
-          {
-              lua_pushnumber(L, x.value);
-          }
-      };
-
-      template <>
-      struct default_converter<X const&>
-        : default_converter<X>
-      {};
-  }
-
-Note that ``default_converter<>`` is instantiated for the actual argument and
-return types of the bound functions. In the above example, we add a
-specialization for ``X const&`` that simply forwards to the ``X`` converter.
-This lets us export functions which accept ``X`` by const reference.
-
-``native_converter_base<>`` should be used as the base class for the
-specialized converters. It simplifies the converter interface, and
-provides a mean for backward compatibility since the underlying
-interface is in flux.
-
-
-Binding function objects with explicit signatures
-=================================================
-
-Using ``luabind::tag_function<>`` it is possible to export function objects
-from which luabind can't automatically deduce a signature. This can be used to
-slightly alter the signature of a bound function, or even to bind stateful
-function objects.
-
-Synopsis:
-
-.. parsed-literal::
-
-  template <class Signature, class F>
-  *implementation-defined* tag_function(F f);
-
-Where ``Signature`` is a function type describing the signature of ``F``.
-It can be used like this::
-
-  int f(int x);
-
-  // alter the signature so that the return value is ignored
-  def("f", tag_function<void(int)>(f));
-
-  struct plus
-  {
-      plus(int x)
-        : x(x)
-      {}
-
-      int operator()(int y) const
-      {
-          return x + y;
-      }
-  };
-
-  // bind a stateful function object
-  def("plus3", tag_function<int(int)>(plus(3)));
-
-
-Object
-======
-
-Since functions have to be able to take Lua values (of variable type) we need a
-wrapper around them. This wrapper is called ``luabind::object``. If the
-function you register takes an object, it will match any Lua value. To use it,
-you need to include ``<luabind/object.hpp>``.
-
-.. topic:: Synopsis
-
-    .. parsed-literal::
-
-        class object
-        {
-        public:
-            template<class T>
-            object(lua_State\*, T const& value);
-            object(from_stack const&);
-            object(object const&);
-            object();
-
-            ~object();
-
-            lua_State\* interpreter() const;
-            void push() const;
-            bool is_valid() const;
-            operator *safe_bool_type* () const;
-
-            template<class Key>
-            *implementation-defined* operator[](Key const&);
-
-            template<class T>
-            object& operator=(T const&);
-            object& operator=(object const&);
-
-            bool operator==(object const&) const;
-            bool operator<(object const&) const;
-            bool operator<=(object const&) const;
-            bool operator>(object const&) const;
-            bool operator>=(object const&) const;
-            bool operator!=(object const&) const;
-
-            template <class T>
-            *implementation-defined* operator[](T const& key) const
-
-            void swap(object&);
-
-            *implementation-defined* operator()();
-
-            template<class A0>
-            *implementation-defined* operator()(A0 const& a0);
-
-            template<class A0, class A1>
-            *implementation-defined* operator()(A0 const& a0, A1 const& a1);
-
-            /\* ... \*/
-        };
-
-When you have a Lua object, you can assign it a new value with the assignment
-operator (=). When you do this, the ``default_policy`` will be used to make the
-conversion from C++ value to Lua. If your ``luabind::object`` is a table you
-can access its members through the operator[] or the Iterators_. The value
-returned from the operator[] is a proxy object that can be used both for
-reading and writing values into the table (using operator=).
-
-Note that it is impossible to know if a Lua value is indexable or not
-(``lua_gettable`` doesn't fail, it succeeds or crashes). This means that if
-you're trying to index something that cannot be indexed, you're on your own.
-Lua will call its ``panic()`` function. See `lua panic`_.
-
-There are also free functions that can be used for indexing the table, see
-`Related functions`_.
-
-The constructor that takes a ``from_stack`` object is used when you want to
-initialize the object with a value from the lua stack. The ``from_stack``
-type has the following constructor::
-
-	 from_stack(lua_State* L, int index);
-
-The index is an ordinary lua stack index, negative values are indexed from the
-top of the stack. You use it like this::
-
-	 object o(from_stack(L, -1));
-
-This will create the object ``o`` and copy the value from the top of the lua stack.
-
-The ``interpreter()`` function returns the Lua state where this object is stored.
-If you want to manipulate the object with Lua functions directly you can push
-it onto the Lua stack by calling ``push()``.
-
-The operator== will call lua_equal() on the operands and return its result.
-
-The ``is_valid()`` function tells you whether the object has been initialized
-or not. When created with its default constructor, objects are invalid. To make
-an object valid, you can assign it a value. If you want to invalidate an object
-you can simply assign it an invalid object.
-
-The ``operator safe_bool_type()`` is equivalent to ``is_valid()``. This means
-that these snippets are equivalent::
-
-    object o;
-    // ...
-    if (o)
-    {
-        // ...
-    }
-
-    ...
-
-    object o;
-    // ...
-    if (o.is_valid())
-    {
-        // ...
-    }
-
-The application operator will call the value as if it was a function. You can
-give it any number of parameters (currently the ``default_policy`` will be used
-for the conversion). The returned object refers to the return value (currently
-only one return value is supported). This operator may throw ``luabind::error``
-if the function call fails. If you want to specify policies to your function
-call, you can use index-operator (operator[]) on the function call, and give
-the policies within the [ and ]. Like this::
-
-    my_function_object(
-        2
-      , 8
-      , new my_complex_structure(6)
-    ) [ adopt(_3) ];
-
-This tells luabind to make Lua adopt the ownership and responsibility for the
-pointer passed in to the lua-function.
-
-It's important that all instances of object have been destructed by the time
-the Lua state is closed. The object will keep a pointer to the lua state and
-release its Lua object in its destructor.
-
-Here's an example of how a function can use a table::
-
-    void my_function(object const& table)
-    {
-        if (type(table) == LUA_TTABLE)
-        {
-            table["time"] = std::clock();
-            table["name"] = std::rand() < 500 ? "unusual" : "usual";
-
-            std::cout << object_cast<std::string>(table[5]) << "\n";
-        }
-    }
-
-If you take a ``luabind::object`` as a parameter to a function, any Lua value
-will match that parameter. That's why we have to make sure it's a table before
-we index into it.
-
-::
-
-    std::ostream& operator<<(std::ostream&, object const&);
-
-There's a stream operator that makes it possible to print objects or use
-``boost::lexical_cast`` to convert it to a string. This will use lua's string
-conversion function. So if you convert a C++ object with a ``tostring``
-operator, the stream operator for that type will be used.
-
-Iterators
----------
-
-There are two kinds of iterators. The normal iterator that will use the metamethod
-of the object (if there is any) when the value is retrieved. This iterator is simply
-called ``luabind::iterator``. The other iterator is called ``luabind::raw_iterator``
-and will bypass the metamethod and give the true contents of the table. They have
-identical interfaces, which implements the ForwardIterator_ concept. Apart from
-the members of standard iterators, they have the following members and constructors:
-
-.. _ForwardIterator: http://www.sgi.com/tech/stl/ForwardIterator.html
-
-.. parsed-literal::
-
-    class iterator
-    {
-        iterator();
-        iterator(object const&);
-
-        object key() const;
-
-        *standard iterator members*
-    };
-
-The constructor that takes a ``luabind::object`` is actually a template that can be
-used with object. Passing an object as the parameter to the iterator will
-construct the iterator to refer to the first element in the object.
-
-The default constructor will initialize the iterator to the one-past-end
-iterator. This is used to test for the end of the sequence.
-
-The value type of the iterator is an implementation defined proxy type which
-supports the same operations as ``luabind::object``. Which means that in most
-cases you can just treat it as an ordinary object. The difference is that any
-assignments to this proxy will result in the value being inserted at the
-iterators position, in the table.
- 
-The ``key()`` member returns the key used by the iterator when indexing the
-associated Lua table.
-
-An example using iterators::
-
-    for (iterator i(globals(L)["a"]), end; i != end; ++i)
-    {
-      *i = 1;
-    }
-
-The iterator named ``end`` will be constructed using the default constructor
-and hence refer to the end of the sequence. This example will simply iterate
-over the entries in the global table ``a`` and set all its values to 1.
-
-Related functions
------------------
-
-There are a couple of functions related to objects and tables.
-
-::
-
-    int type(object const&);
-
-This function will return the lua type index of the given object.
-i.e. ``LUA_TNIL``, ``LUA_TNUMBER`` etc.
-
-::
-
-    template<class T, class K>
-    void settable(object const& o, K const& key, T const& value);
-    template<class K>
-    object gettable(object const& o, K const& key);
-    template<class T, class K>
-    void rawset(object const& o, K const& key, T const& value);
-    template<class K>
-    object rawget(object const& o, K const& key);
-
-These functions are used for indexing into tables. ``settable`` and ``gettable``
-translates into calls to ``lua_settable`` and ``lua_gettable`` respectively. Which
-means that you could just as well use the index operator of the object.
-
-``rawset`` and ``rawget`` will translate into calls to ``lua_rawset`` and
-``lua_rawget`` respectively. So they will bypass any metamethod and give you the
-true value of the table entry.
-
-::
-
-    template<class T>
-    T object_cast<T>(object const&);
-    template<class T, class Policies>
-    T object_cast<T>(object const&, Policies);
-
-    template<class T>
-    boost::optional<T> object_cast_nothrow<T>(object const&);
-    template<class T, class Policies>
-    boost::optional<T> object_cast_nothrow<T>(object const&, Policies);
-
-The ``object_cast`` function casts the value of an object to a C++ value.
-You can supply a policy to handle the conversion from lua to C++. If the cast
-cannot be made a ``cast_failed`` exception will be thrown. If you have
-defined LUABIND_NO_ERROR_CHECKING (see `Build options`_) no checking will occur,
-and if the cast is invalid the application may very well crash. The nothrow
-versions will return an uninitialized ``boost::optional<T>`` object, to
-indicate that the cast could not be performed.
-
-The function signatures of all of the above functions are really templates
-for the object parameter, but the intention is that you should only pass
-objects in there, that's why it's left out of the documentation.
-
-::
-
-    object globals(lua_State*);
-    object registry(lua_State*);
-
-These functions return the global environment table and the registry table respectively.
-
-::
-
-  object newtable(lua_State*);
-
-This function creates a new table and returns it as an object.
-
-::
-
-  object getmetatable(object const& obj);
-  void setmetatable(object const& obj, object const& metatable);
-
-These functions get and set the metatable of a Lua object.
-
-::
-
-  lua_CFunction tocfunction(object const& value);
-  template <class T> T* touserdata(object const& value)
-
-These extract values from the object at a lower level than ``object_cast()``.
-
-::
-
-  object getupvalue(object const& function, int index);
-  void setupvalue(object const& function, int index, object const& value);
-
-These get and set the upvalues of ``function``.
-
-Assigning nil
--------------
-
-To set a table entry to ``nil``, you can use ``luabind::nil``. It will avoid
-having to take the detour by first assigning ``nil`` to an object and then
-assign that to the table entry. It will simply result in a ``lua_pushnil()``
-call, instead of copying an object.
-
-Example::
-
-  using luabind;
-  object table = newtable(L);
-  table["foo"] = "bar";
-  
-  // now, clear the "foo"-field
-  table["foo"] = nil;
-
-
-Defining classes in Lua
-=======================
-
-In addition to binding C++ functions and classes with Lua, luabind also provide
-an OO-system in Lua. ::
-
-    class 'lua_testclass'
-
-    function lua_testclass:__init(name)
-        self.name = name
-    end
-
-    function lua_testclass:print()
-        print(self.name)
-    end
-
-    a = lua_testclass('example')
-    a:print()
-
-
-Inheritance can be used between lua-classes::
-
-    class 'derived' (lua_testclass)
-
-    function derived:__init()
-        lua_testclass.__init(self, 'derived name')
-    end
-
-    function derived:print()
-        print('Derived:print() -> ')
-        lua_testclass.print(self)
-    end
-
-The base class is initialized explicitly by calling its ``__init()``
-function.
-
-As you can see in this example, you can call the base class member functions.
-You can find all member functions in the base class, but you will have to give
-the this-pointer (``self``) as first argument.
-
-
-Deriving in lua
----------------
-
-It is also possible to derive Lua classes from C++ classes, and override
-virtual functions with Lua functions. To do this we have to create a wrapper
-class for our C++ base class. This is the class that will hold the Lua object
-when we instantiate a Lua class.
-
-::
-
-    class base
-    {
-    public:
-        base(const char* s)
-        { std::cout << s << "\n"; }
-
-        virtual void f(int a) 
-        { std::cout << "f(" << a << ")\n"; }
-    };
-
-    struct base_wrapper : base, luabind::wrap_base
-    {
-        base_wrapper(const char* s)
-            : base(s) 
-        {}
-
-        virtual void f(int a) 
-        { 
-            call<void>("f", a); 
-        }
-
-        static void default_f(base* ptr, int a)
-        {
-            return ptr->base::f(a);
-        }
-    };
-
-    ...
-
-    module(L)
-    [
-        class_<base, base_wrapper>("base")
-            .def(constructor<const char*>())
-            .def("f", &base::f, &base_wrapper::default_f)
-    ];
-
-.. Important::
-    Since MSVC6.5 doesn't support explicit template parameters
-    to member functions, instead of using the member function ``call()``
-    you call a free function ``call_member()`` and pass the this-pointer
-    as first parameter.
-
-Note that if you have both base classes and a base class wrapper, you must give
-both bases and the base class wrapper type as template parameter to 
-``class_`` (as done in the example above). The order in which you specify
-them is not important. You must also register both the static version and the
-virtual version of the function from the wrapper, this is necessary in order
-to allow luabind to use both dynamic and static dispatch when calling the function.
-
-.. Important::
-    It is extremely important that the signatures of the static (default) function
-    is identical to the virtual function. The fact that one of them is a free
-    function and the other a member function doesn't matter, but the parameters
-    as seen from lua must match. It would not have worked if the static function
-    took a ``base_wrapper*`` as its first argument, since the virtual function
-    takes a ``base*`` as its first argument (its this pointer). There's currently
-    no check in luabind to make sure the signatures match.
-
-If we didn't have a class wrapper, it would not be possible to pass a Lua class
-back to C++. Since the entry points of the virtual functions would still point
-to the C++ base class, and not to the functions defined in Lua. That's why we
-need one function that calls the base class' real function (used if the lua
-class doesn't redefine it) and one virtual function that dispatches the call
-into luabind, to allow it to select if a Lua function should be called, or if
-the original function should be called. If you don't intend to derive from a
-C++ class, or if it doesn't have any virtual member functions, you can register
-it without a class wrapper.
-
-You don't need to have a class wrapper in order to derive from a class, but if
-it has virtual functions you may have silent errors. 
-
-.. Unnecessary? The rule of thumb is: 
-  If your class has virtual functions, create a wrapper type, if it doesn't
-  don't create a wrapper type.
-
-The wrappers must derive from ``luabind::wrap_base``, it contains a Lua reference
-that will hold the Lua instance of the object to make it possible to dispatch
-virtual function calls into Lua. This is done through an overloaded member function::
-
-    template<class Ret>
-    Ret call(char const* name, ...)
-
-Its used in a similar way as ``call_function``, with the exception that it doesn't
-take a ``lua_State`` pointer, and the name is a member function in the Lua class.
-
-.. warning::
-
-	The current implementation of ``call_member`` is not able to distinguish const
-	member functions from non-const. If you have a situation where you have an overloaded
-	virtual function where the only difference in their signatures is their constness, the
-	wrong overload will be called by ``call_member``. This is rarely the case though.
-
-Object identity
-~~~~~~~~~~~~~~~
-
-When a pointer or reference to a registered class with a wrapper is passed
-to Lua, luabind will query for it's dynamic type. If the dynamic type
-inherits from ``wrap_base``, object identity is preserved.
-
-::
-
-    struct A { .. };
-    struct A_wrap : A, wrap_base { .. };
-
-    A* f(A* ptr) { return ptr; }
-
-    module(L)
-    [
-        class_<A, A_wrap>("A"),
-        def("f", &f)
-    ];
-
-::
-
-    > class 'B' (A)
-    > x = B()
-    > assert(x == f(x)) -- object identity is preserved when object is
-                        -- passed through C++
-
-This functionality relies on RTTI being enabled (that ``LUABIND_NO_RTTI`` is
-not defined).
-
-Overloading operators
----------------------
-
-You can overload most operators in Lua for your classes. You do this by simply
-declaring a member function with the same name as an operator (the name of the
-metamethods in Lua). The operators you can overload are:
-
- - ``__add``
- - ``__sub`` 
- - ``__mul`` 
- - ``__div`` 
- - ``__pow`` 
- - ``__lt`` 
- - ``__le`` 
- - ``__eq`` 
- - ``__call`` 
- - ``__unm`` 
- - ``__tostring``
- - ``__len``
-
-``__tostring`` isn't really an operator, but it's the metamethod that is called
-by the standard library's ``tostring()`` function. There's one strange behavior
-regarding binary operators. You are not guaranteed that the self pointer you
-get actually refers to an instance of your class. This is because Lua doesn't
-distinguish the two cases where you get the other operand as left hand value or
-right hand value. Consider the following examples::
-
-    class 'my_class'
-
-      function my_class:__init(v)
-          self.val = v
-      end
-        
-      function my_class:__sub(v)
-          return my_class(self.val - v.val)
-      end
-
-      function my_class:__tostring()
-          return self.val
-      end
-
-This will work well as long as you only subtracts instances of my_class with
-each other. But If you want to be able to subtract ordinary numbers from your
-class too, you have to manually check the type of both operands, including the
-self object. ::
-
-    function my_class:__sub(v)
-        if (type(self) == 'number') then
-            return my_class(self - v.val)
-
-        elseif (type(v) == 'number') then
-            return my_class(self.val - v)
-        
-        else
-            -- assume both operands are instances of my_class
-            return my_class(self.val - v.val)
-
-        end
-    end
-
-The reason why ``__sub`` is used as an example is because subtraction is not
-commutative (the order of the operands matters). That's why luabind cannot
-change order of the operands to make the self reference always refer to the
-actual class instance.
-
-If you have two different Lua classes with an overloaded operator, the operator
-of the right hand side type will be called. If the other operand is a C++ class
-with the same operator overloaded, it will be prioritized over the Lua class'
-operator. If none of the C++ overloads matches, the Lua class operator will be
-called.
-
-
-Finalizers
-----------
-
-If an object needs to perform actions when it's collected we provide a
-``__finalize`` function that can be overridden in lua-classes. The
-``__finalize`` functions will be called on all classes in the inheritance
-chain, starting with the most derived type. ::
-
-    ...
-
-    function lua_testclass:__finalize()
-        -- called when the an object is collected
-    end
-
-
-Slicing
--------
-
-If your lua C++ classes don't have wrappers (see `Deriving in lua`_) and
-you derive from them in lua, they may be sliced. Meaning, if an object
-is passed into C++ as a pointer to its base class, the lua part will be
-separated from the C++ base part. This means that if you call virtual
-functions on that C++ object, they will not be dispatched to the lua
-class. It also means that if you adopt the object, the lua part will be
-garbage collected.
-
-::
-
-	+--------------------+
-	| C++ object         |    <- ownership of this part is transferred
-	|                    |       to c++ when adopted
-	+--------------------+
-	| lua class instance |    <- this part is garbage collected when
-	| and lua members    |       instance is adopted, since it cannot
-	+--------------------+       be held by c++. 
-
-
-The problem can be illustrated by this example::
-
-    struct A {};
-
-    A* filter_a(A* a) { return a; }
-    void adopt_a(A* a) { delete a; }
-
-
-::
-
-    using namespace luabind;
-
-    module(L)
-    [
-        class_<A>("A"),
-        def("filter_a", &filter_a),
-        def("adopt_a", &adopt_a, adopt(_1))
-    ]
-
-
-In lua::
-
-    a = A()
-    b = filter_a(a)
-    adopt_a(b)
-
-In this example, lua cannot know that ``b`` actually is the same object as
-``a``, and it will therefore consider the object to be owned by the C++ side.
-When the ``b`` pointer then is adopted, a runtime error will be raised because
-an object not owned by lua is being adopted to C++.
-
-If you have a wrapper for your class, none of this will happen, see
-`Object identity`_.
-
-
-Exceptions
-==========
-
-If any of the functions you register throws an exception when called, that
-exception will be caught by luabind and converted to an error string and
-``lua_error()`` will be invoked. If the exception is a ``std::exception`` or a
-``const char*`` the string that is pushed on the Lua stack, as error message,
-will be the string returned by ``std::exception::what()`` or the string itself
-respectively. If the exception is unknown, a generic string saying that the
-function threw an exception will be pushed.
-
-If you have an exception type that isn't derived from
-``std::exception``, or you wish to change the error message from the
-default result of ``what()``, it is possible to register custom
-exception handlers::
-
-  struct my_exception
-  {};
-
-  void translate_my_exception(lua_State* L, my_exception const&)
-  {
-      lua_pushstring(L, "my_exception");
-  }
-
-  …
-
-  luabind::register_exception_handler<my_exception>(&translate_my_exception);
-
-``translate_my_exception()`` will be called by luabind whenever a
-``my_exception`` is caught. ``lua_error()`` will be called after the
-handler function returns, so it is expected that the function will push
-an error string on the stack.
-
-Any function that invokes Lua code may throw ``luabind::error``. This exception
-means that a Lua run-time error occurred. The error message is found on top of
-the Lua stack. The reason why the exception doesn't contain the error string
-itself is because it would then require heap allocation which may fail. If an
-exception class throws an exception while it is being thrown itself, the
-application will be terminated.
-
-Error's synopsis is::
-
-    class error : public std::exception
-    {
-    public:
-        error(lua_State*);
-        lua_State* state() const throw();
-        virtual const char* what() const throw();
-    };
-
-The state function returns a pointer to the Lua state in which the error was
-thrown. This pointer may be invalid if you catch this exception after the lua
-state is destructed. If the Lua state is valid you can use it to retrieve the
-error message from the top of the Lua stack.
-
-An example of where the Lua state pointer may point to an invalid state
-follows::
-
-    struct lua_state
-    {
-        lua_state(lua_State* L): m_L(L) {}
-        ~lua_state() { lua_close(m_L); }
-        operator lua_State*() { return m_L; }
-        lua_State* m_L;
-    };
-
-    int main()
-    {
-        try
-        {
-            lua_state L = lua_open();
-            /* ... */
-        }
-        catch(luabind::error& e)
-        {
-            lua_State* L = e.state();
-            // L will now point to the destructed
-            // Lua state and be invalid
-            /* ... */
-        }
-    }
-
-There's another exception that luabind may throw: ``luabind::cast_failed``,
-this exception is thrown from ``call_function<>`` or ``call_member<>``. It
-means that the return value from the Lua function couldn't be converted to
-a C++ value. It is also thrown from ``object_cast<>`` if the cast cannot
-be made.
-
-The synopsis for ``luabind::cast_failed`` is::
-
-    class cast_failed : public std::exception
-    {
-    public:
-        cast_failed(lua_State*);
-        lua_State* state() const throw();
-        LUABIND_TYPE_INFO info() const throw();
-        virtual const char* what() const throw();
-    };
-
-Again, the state member function returns a pointer to the Lua state where the
-error occurred. See the example above to see where this pointer may be invalid.
-
-The info member function returns the user defined ``LUABIND_TYPE_INFO``, which
-defaults to a ``const std::type_info*``. This type info describes the type that
-we tried to cast a Lua value to.
-
-If you have defined ``LUABIND_NO_EXCEPTIONS`` none of these exceptions will be
-thrown, instead you can set two callback functions that are called instead.
-These two functions are only defined if ``LUABIND_NO_EXCEPTIONS`` are defined.
-
-::
-
-    luabind::set_error_callback(void(*)(lua_State*))
-
-The function you set will be called when a runtime-error occur in Lua code. You
-can find an error message on top of the Lua stack. This function is not
-expected to return, if it does luabind will call ``std::terminate()``.
-
-::
-
-    luabind::set_cast_failed_callback(void(*)(lua_State*, LUABIND_TYPE_INFO))
-
-The function you set is called instead of throwing ``cast_failed``. This function
-is not expected to return, if it does luabind will call ``std::terminate()``.
-
-
-Policies
-========
-
-Sometimes it is necessary to control how luabind passes arguments and return
-value, to do this we have policies. All policies use an index to associate
-them with an argument in the function signature. These indices are ``result`` 
-and ``_N`` (where ``N >= 1``). When dealing with member functions ``_1`` refers
-to the ``this`` pointer.
-
-.. contents:: Policies currently implemented
-    :local:
-    :depth: 1
-
-.. include:: adopt.rst
-.. include:: dependency.rst
-.. include:: out_value.rst
-.. include:: pure_out_value.rst
-.. include:: return_reference_to.rst
-.. include:: copy.rst
-.. include:: discard_result.rst
-.. include:: return_stl_iterator.rst
-.. include:: raw.rst
-.. include:: yield.rst
-
-..  old policies section
-    ===================================================
-
-    Copy
-    ----
-
-    This will make a copy of the parameter. This is the default behavior when
-    passing parameters by-value. Note that this can only be used when passing from
-    C++ to Lua. This policy requires that the parameter type has a copy
-    constructor.
-
-    To use this policy you need to include ``luabind/copy_policy.hpp``.
-
-
-    Adopt
-    -----
-
-    This will transfer ownership of the parameter.
-
-    Consider making a factory function in C++ and exposing it to lua::
-
-        base* create_base()
-        {
-            return new base();
-        }
-
-        ...
-
-        module(L)
-        [
-            def("create_base", create_base)
-        ];
-
-    Here we need to make sure Lua understands that it should adopt the pointer
-    returned by the factory-function. This can be done using the adopt-policy.
-
-    ::
-
-        module(L)
-        [
-            def(L, "create_base", adopt(return_value))
-        ];
-
-    To specify multiple policies we just separate them with '+'.
-
-    ::
-
-        base* set_and_get_new(base* ptr)
-        {
-            base_ptrs.push_back(ptr);
-            return new base();
-        }
-
-        module(L)
-        [
-            def("set_and_get_new", &set_and_get_new, 
-                adopt(return_value) + adopt(_1))
-        ];
-
-    When Lua adopts a pointer, it will call delete on it. This means that it cannot
-    adopt pointers allocated with another allocator than new (no malloc for
-    example).
-
-    To use this policy you need to include ``luabind/adopt_policy.hpp``.
-
-
-    Dependency
-    ----------
-
-    The dependency policy is used to create life-time dependencies between values.
-    Consider the following example::
-
-        struct A
-        {
-            B member;
-
-            const B& get_member()
-            {
-                return member;
-            }
-        };
-
-    When wrapping this class, we would do something like::
-
-        module(L)
-        [
-            class_<A>("A")
-                .def(constructor<>())
-                .def("get_member", &A::get_member)
-        ];
-
-
-    However, since the return value of get_member is a reference to a member of A,
-    this will create some life-time issues. For example::
-
-        Lua 5.0  Copyright (C) 1994-2003 Tecgraf, PUC-Rio
-        a = A()
-        b = a:get_member() -- b points to a member of a
-        a = nil
-        collectgarbage(0)  -- since there are no references left to a, it is
-                           -- removed
-                           -- at this point, b is pointing into a removed object
-
-    When using the dependency-policy, it is possible to tell luabind to tie the
-    lifetime of one object to another, like this::
-
-        module(L)
-        [
-            class_<A>("A")
-                .def(constructor<>())
-                .def("get_member", &A::get_member, dependency(result, _1))
-        ];
-
-    This will create a dependency between the return-value of the function, and the
-    self-object. This means that the self-object will be kept alive as long as the
-    result is still alive. ::
-
-        Lua 5.0  Copyright (C) 1994-2003 Tecgraf, PUC-Rio
-        a = A()
-        b = a:get_member() -- b points to a member of a
-        a = nil
-        collectgarbage(0)  -- a is dependent on b, so it isn't removed
-        b = nil
-        collectgarbage(0)  -- all dependencies to a gone, a is removed
-
-    To use this policy you need to include ``luabind/dependency_policy.hpp``.
-
-
-    Return reference to
-    -------------------
-
-    It is very common to return references to arguments or the this-pointer to
-    allow for chaining in C++.
-
-    ::
-
-        struct A
-        {
-            float val;
-
-            A& set(float v)
-            {
-                val = v;
-                return *this;
-            }
-        };
-
-    When luabind generates code for this, it will create a new object for the
-    return-value, pointing to the self-object. This isn't a problem, but could be a
-    bit inefficient. When using the return_reference_to-policy we have the ability
-    to tell luabind that the return-value is already on the Lua stack.
-
-    ::
-
-        module(L)
-        [
-            class_<A>("A")
-                .def(constructor<>())
-                .def("set", &A::set, return_reference_to(_1))
-        ];
-
-    Instead of creating a new object, luabind will just copy the object that is
-    already on the stack.
-
-    .. warning:: 
-       This policy ignores all type information and should be used only it 
-       situations where the parameter type is a perfect match to the 
-       return-type (such as in the example).
-
-    To use this policy you need to include ``luabind/return_reference_to_policy.hpp``.
-
-
-    Out value
-    ---------
-
-    This policy makes it possible to wrap functions that take non const references
-    as its parameters with the intention to write return values to them.
-
-    ::
-
-        void f(float& val) { val = val + 10.f; }
-
-    or
-
-    ::
-
-        void f(float* val) { *val = *val + 10.f; }
-
-    Can be wrapped by doing::
-
-        module(L)
-        [
-            def("f", &f, out_value(_1))
-        ];
-
-    When invoking this function from Lua it will return the value assigned to its 
-    parameter.
-
-    ::
-
-        Lua 5.0  Copyright (C) 1994-2003 Tecgraf, PUC-Rio
-        > a = f(10)
-        > print(a)
-        20
-
-    When this policy is used in conjunction with user define types we often need 
-    to do ownership transfers.
-
-    ::
-
-        struct A;
-
-        void f1(A*& obj) { obj = new A(); }
-        void f2(A** obj) { *obj = new A(); }
-
-    Here we need to make sure luabind takes control over object returned, for 
-    this we use the adopt policy::
-
-        module(L)
-        [
-            class_<A>("A"),
-            def("f1", &f1, out_value(_1, adopt(_2)))
-            def("f2", &f2, out_value(_1, adopt(_2)))
-        ];
-
-    Here we are using adopt as an internal policy to out_value. The index 
-    specified, _2, means adopt will be used to convert the value back to Lua. 
-    Using _1 means the policy will be used when converting from Lua to C++.
-
-    To use this policy you need to include ``luabind/out_value_policy.hpp``.
-
-    Pure out value
-    --------------
-
-    This policy works in exactly the same way as out_value, except that it 
-    replaces the parameters with default-constructed objects.
-
-    ::
-
-        void get(float& x, float& y)
-        {
-            x = 3.f;
-            y = 4.f;
-        }
-
-        ...
-
-        module(L)
-        [
-            def("get", &get, 
-                pure_out_value(_1) + pure_out_value(_2))
-        ];
-
-    ::
-
-        Lua 5.0  Copyright (C) 1994-2003 Tecgraf, PUC-Rio
-        > x, y = get()
-        > print(x, y)
-        3    5
-
-    Like out_value, it is possible to specify an internal policy used then 
-    converting the values back to Lua.
-
-    ::
-
-        void get(test_class*& obj)
-        {
-            obj = new test_class();
-        }
-
-        ...
-
-        module(L)
-        [
-            def("get", &get, pure_out_value(_1, adopt(_1)))
-        ];
-
-
-    Discard result
-    --------------
-
-    This is a very simple policy which makes it possible to throw away 
-    the value returned by a C++ function, instead of converting it to 
-    Lua. This example makes sure the this reference never gets converted 
-    to Lua.
-
-    ::
-
-        struct simple
-        {
-            simple& set_name(const std::string& n)
-            {
-                name = n;
-                return *this;
-            }
-
-            std::string name;
-        };
-
-        ...
-
-        module(L)
-        [
-            class_<simple>("simple")
-                .def("set_name", &simple::set_name, discard_result)
-        ];
-
-    To use this policy you need to include ``luabind/discard_result_policy.hpp``.
-
-
-    Return STL iterator
-    -------------------
-
-    This policy converts an STL container to a generator function that can be used
-    in Lua to iterate over the container. It works on any container that defines
-    ``begin()`` and ``end()`` member functions (they have to return iterators). It
-    can be used like this::
-
-        struct A
-        {
-            std::vector<std::string> names;
-        };
-
-
-        module(L)
-        [
-            class_<A>("A")
-                .def_readwrite("names", &A::names, return_stl_iterator)
-        ];
-
-    The Lua code to iterate over the container::
-
-        a = A()
-
-        for name in a.names do
-          print(name)
-        end
-
-
-    To use this policy you need to include ``luabind/iterator_policy.hpp``.
-
-
-    Yield
-    -----    
-
-    This policy will cause the function to always yield the current thread when 
-    returning. See the Lua manual for restrictions on yield.
-
-
-Splitting up the registration
-=============================
-
-It is possible to split up a module registration into several
-translation units without making each registration dependent
-on the module it's being registered in.
-
-``a.cpp``::
-
-    luabind::scope register_a()
-    {
-        return 
-            class_<a>("a")
-                .def("f", &a::f)
-                ;
-    }
-
-``b.cpp``::
-
-    luabind::scope register_b()
-    {
-        return 
-            class_<b>("b")
-                .def("g", &b::g)
-                ;
-    }
-
-``module_ab.cpp``::
-
-    luabind::scope register_a();
-    luabind::scope register_b();
-
-    void register_module(lua_State* L)
-    {
-        module("b", L)
-        [
-            register_a(),
-            register_b()
-        ];
-    }
-
-
-Error Handling
-==============
-
-pcall errorfunc
----------------
-
-As mentioned in the `Lua documentation`_, it is possible to pass an
-error handler function to ``lua_pcall()``. Luabind makes use of 
-``lua_pcall()`` internally when calling member functions and free functions.
-It is possible to set the error handler function that Luabind will use
-globally::
-
-    typedef int(*pcall_callback_fun)(lua_State*);
-    void set_pcall_callback(pcall_callback_fun fn);
-
-This is primarily useful for adding more information to the error message
-returned by a failed protected call. For more information on how to use the
-pcall_callback function, see ``errfunc`` under the
-`pcall section of the lua manual`_.
-
-For more information on how to retrieve debugging information from lua, see
-`the debug section of the lua manual`_.
-
-The message returned by the ``pcall_callback`` is accessable as the top lua
-value on the stack. For example, if you would like to access it as a luabind
-object, you could do like this::
-
-    catch(error& e)
-    {
-        object error_msg(from_stack(e.state(), -1));
-        std::cout << error_msg << std::endl;
-    }
-
-.. _Lua documentation: http://www.lua.org/manual/5.0/manual.html
-.. _`pcall section of the lua manual`: http://www.lua.org/manual/5.0/manual.html#3.15
-.. _`the debug section of the lua manual`: http://www.lua.org/manual/5.0/manual.html#4
-
-file and line numbers
----------------------
-
-If you want to add file name and line number to the error messages generated
-by luabind you can define your own `pcall errorfunc`_. You may want to modify
-this callback to better suit your needs, but the basic functionality could be
-implemented like this::
-
-   int add_file_and_line(lua_State* L)
-   {
-      lua_Debug d;
-      lua_getstack(L, 1, &d);
-      lua_getinfo(L, "Sln", &d);
-      std::string err = lua_tostring(L, -1);
-      lua_pop(L, 1);
-      std::stringstream msg;
-      msg << d.short_src << ":" << d.currentline;
-
-      if (d.name != 0)
-      {
-         msg << "(" << d.namewhat << " " << d.name << ")";
-      }
-      msg << " " << err;
-      lua_pushstring(L, msg.str().c_str());
-      return 1;
-   }
-
-For more information about what kind of information you can add to the error
-message, see `the debug section of the lua manual`_.
-
-Note that the callback set by ``set_pcall_callback()`` will only be used when
-luabind executes lua code. Anytime when you call ``lua_pcall`` yourself, you
-have to supply your function if you want error messages translated.
-
-lua panic
----------
-
-When lua encounters a fatal error caused by a bug from the C/C++ side, it will
-call its internal panic function. This can happen, for example,  when you call
-``lua_gettable`` on a value that isn't a table. If you do the same thing from
-within lua, it will of course just fail with an error message.
-
-The default panic function will ``exit()`` the application. If you want to
-handle this case without terminating your application, you can define your own
-panic function using ``lua_atpanic``. The best way to continue from the panic
-function is to make sure lua is compiled as C++ and throw an exception from
-the panic function. Throwing an exception instead of using ``setjmp`` and
-``longjmp`` will make sure the stack is correctly unwound.
-
-When the panic function is called, the lua state is invalid, and the only
-allowed operation on it is to close it.
-
-For more information, see the `lua manual section 3.19`_.
-
-.. _`lua manual section 3.19`: http://www.lua.org/manual/5.0/manual.html#3.19
-
-structured exceptions (MSVC)
-----------------------------
-
-Since lua is generally built as a C library, any callbacks called from lua
-cannot under any circumstance throw an exception. Because of that, luabind has
-to catch all exceptions and translate them into proper lua errors (by calling
-``lua_error()``). This means we have a ``catch(...) {}`` in there.
-
-In Visual Studio, ``catch (...)`` will not only catch C++ exceptions, it will
-also catch structured exceptions, such as segmentation fault. This means that if
-your function, that gets called from luabind, makes an invalid memory
-adressing, you won't notice it. All that will happen is that lua will return
-an error message saying "unknown exception".
-
-To remedy this, you can create your own *exception translator*::
-
-   void straight_to_debugger(unsigned int, _EXCEPTION_POINTERS*)
-   { throw; }
-
-   #ifdef _MSC_VER
-      ::_set_se_translator(straight_to_debugger);
-   #endif
-
-This will make structured exceptions, like segmentation fault, to actually get
-caught by the debugger.
-
-
-Error messages
---------------
-
-These are the error messages that can be generated by luabind, with a more
-in-depth explanation.
-
-- .. parsed-literal::
-
-    the attribute '*class-name.attribute-name*' is read only
-
-  There is no data member named *attribute-name* in the class *class-name*,
-  or there's no setter-function registered on that property name. See the 
-  Properties_ section.
-
-- .. parsed-literal:: 
-
-    the attribute '*class-name.attribute-name*' is of type: (*class-name*) and does not match (*class_name*)
-
-  This error is generated if you try to assign an attribute with a value 
-  of a type that cannot be converted to the attributes type.
-
-
-- .. parsed-literal:: 
-
-    *class-name()* threw an exception, *class-name:function-name()* threw an exception
-
-  The class' constructor or member function threw an unknown exception.
-  Known exceptions are const char*, std::exception. See the 
-  `exceptions`_ section.
-
-- .. parsed-literal::
-
-    no overload of '*class-name:function-name*' matched the arguments (*parameter-types*)
-    no match for function call '*function-name*' with the parameters (*parameter-types*)
-    no constructor of *class-name* matched the arguments (*parameter-types*)
-    no operator *operator-name* matched the arguments (*parameter-types*)
-
-  No function/operator with the given name takes the parameters you gave 
-  it. You have either misspelled the function name, or given it incorrect
-  parameters. This error is followed by a list of possible candidate 
-  functions to help you figure out what parameter has the wrong type. If
-  the candidate list is empty there's no function at all with that name.
-  See the signature matching section.
-
-- .. parsed-literal::
-
-    call of overloaded '*class-name:function-name*(*parameter-types*)' is ambiguous
-    ambiguous match for function call '*function-name*' with the parameters (*parameter-types*)
-    call of overloaded constructor '*class-name*(*parameter-types*)' is ambiguous
-    call of overloaded operator *operator-name* (*parameter-types*) is ambiguous
-
-  This means that the function/operator you are trying to call has at least
-  one other overload that matches the arguments just as good as the first
-  overload.
-
-- .. parsed-literal::
-
-    cannot derive from C++ class '*class-name*'. It does not have a wrapped type.
-
-
-
-Build options
-=============
-
-There are a number of configuration options available when building luabind.
-It is very important that your project has the exact same configuration 
-options as the ones given when the library was build! The exceptions are the
-``LUABIND_MAX_ARITY`` and ``LUABIND_MAX_BASES`` which are template-based 
-options and only matters when you use the library (which means they can 
-differ from the settings of the library).
-
-The default settings which will be used if no other settings are given
-can be found in ``luabind/config.hpp``.
-
-If you want to change the settings of the library, you can modify the 
-config file. It is included and used by all makefiles. You can change paths
-to Lua and boost in there as well.
-
-LUABIND_MAX_ARITY
-    Controls the maximum arity of functions that are registered with luabind. 
-    You can't register functions that takes more parameters than the number 
-    this macro is set to. It defaults to 5, so, if your functions have greater 
-    arity you have to redefine it. A high limit will increase compilation time.
-
-LUABIND_MAX_BASES
-    Controls the maximum number of classes one class can derive from in 
-    luabind (the number of classes specified within ``bases<>``). 
-    ``LUABIND_MAX_BASES`` defaults to 4. A high limit will increase 
-    compilation time.
-
-LUABIND_NO_ERROR_CHECKING
-    If this macro is defined, all the Lua code is expected only to make legal 
-    calls. If illegal function calls are made (e.g. giving parameters that 
-    doesn't match the function signature) they will not be detected by luabind
-    and the application will probably crash. Error checking could be disabled 
-    when shipping a release build (given that no end-user has access to write 
-    custom Lua code). Note that function parameter matching will be done if a 
-    function is overloaded, since otherwise it's impossible to know which one 
-    was called. Functions will still be able to throw exceptions when error 
-    checking is disabled.
-
-    If a function throws an exception it will be caught by luabind and 
-    propagated with ``lua_error()``.
-
-LUABIND_NO_EXCEPTIONS
-    This define will disable all usage of try, catch and throw in luabind. 
-    This will in many cases disable run-time errors, when performing invalid 
-    casts or calling Lua functions that fails or returns values that cannot 
-    be converted by the given policy. luabind requires that no function called 
-    directly or indirectly by luabind throws an exception (throwing exceptions 
-    through Lua has undefined behavior).
-
-    Where exceptions are the only way to get an error report from luabind, 
-    they will be replaced with calls to the callback functions set with
-    ``set_error_callback()`` and ``set_cast_failed_callback()``.
-
-LUA_API
-    If you want to link dynamically against Lua, you can set this define to 
-    the import-keyword on your compiler and platform. On Windows in Visual Studio 
-    this should be ``__declspec(dllimport)`` if you want to link against Lua 
-    as a dll.
-
-LUABIND_DYNAMIC_LINK
-    Must be defined if you intend to link against the luabind shared
-    library.
-
-LUABIND_NO_RTTI
-    You can define this if you don't want luabind to use ``dynamic_cast<>``.
-    It will disable `Object identity`_.
-
-NDEBUG
-    This define will disable all asserts and should be defined in a release 
-    build.
-
-
-Implementation notes
-====================
-
-The classes and objects are implemented as user data in Lua. To make sure that
-the user data really is the internal structure it is supposed to be, we tag
-their metatables. A user data who's metatable contains a boolean member named
-``__luabind_classrep`` is expected to be a class exported by luabind. A user
-data who's metatable contains a boolean member named ``__luabind_class`` is
-expected to be an instantiation of a luabind class.
-
-This means that if you make your own user data and tags its metatable with the
-exact same names, you can very easily fool luabind and crash the application.
-
-In the Lua registry, luabind keeps an entry called ``__luabind_classes``. It
-should not be removed or overwritten.
-
-In the global table, a variable called ``super`` is used every time a
-constructor in a lua-class is called. This is to make it easy for that
-constructor to call its base class' constructor. So, if you have a global
-variable named super it may be overwritten. This is probably not the best
-solution, and this restriction may be removed in the future.
-
-.. note:: Deprecated
-
-  ``super()`` has been deprecated since version 0.8 in favor of directly
-  invoking the base class' ``__init()`` function::
-
-    function Derived:__init()
-        Base.__init(self)
-    end
-
-Luabind uses two upvalues for functions that it registers. The first is a
-userdata containing a list of overloads for the function, the other is a light
-userdata with the value 0x1337, this last value is used to identify functions
-registered by luabind. It should be virtually impossible to have such a pointer
-as secondary upvalue by pure chance. This means, if you are trying to replace
-an existing function with a luabind function, luabind will see that the
-secondary upvalue isn't the magic id number and replace it. If it can identify
-the function to be a luabind function, it won't replace it, but rather add
-another overload to it.
-
-Inside the luabind namespace, there's another namespace called detail. This
-namespace contains non-public classes and are not supposed to be used directly.
-
-
-FAQ
-===
-
-What's up with __cdecl and __stdcall?
-    If you're having problem with functions
-    that cannot be converted from ``void (__stdcall *)(int,int)`` to 
-    ``void (__cdecl*)(int,int)``. You can change the project settings to make the
-    compiler generate functions with __cdecl calling conventions. This is
-    a problem in developer studio.
-
-What's wrong with functions taking variable number of arguments?
-    You cannot register a function with ellipses in its signature. Since
-    ellipses don't preserve type safety, those should be avoided anyway.
-
-Internal structure overflow in VC
-    If you, in visual studio, get fatal error C1204: compiler limit :
-    internal structure overflow. You should try to split that compilation
-    unit up in smaller ones. See `Splitting up the registration`_ and
-    `Splitting class registrations`_.
-
-What's wrong with precompiled headers in VC?
-    Visual Studio doesn't like anonymous namespaces in its precompiled
-    headers. If you encounter this problem you can disable precompiled 
-    headers for the compilation unit (cpp-file) that uses luabind.
-
-error C1076: compiler limit - internal heap limit reached in VC
-    In visual studio you will probably hit this error. To fix it you have to
-    increase the internal heap with a command-line option. We managed to
-    compile the test suit with /Zm300, but you may need a larger heap then 
-    that.
-
-error C1055: compiler limit \: out of keys in VC
-    It seems that this error occurs when too many assert() are used in a
-    program, or more specifically, the __LINE__ macro. It seems to be fixed by
-    changing /ZI (Program database for edit and continue) to /Zi 
-    (Program database).
-
-How come my executable is huge?
-    If you're compiling in debug mode, you will probably have a lot of
-    debug-info and symbols (luabind consists of a lot of functions). Also, 
-    if built in debug mode, no optimizations were applied, luabind relies on 
-    that the compiler is able to inline functions. If you built in release 
-    mode, try running strip on your executable to remove export-symbols, 
-    this will trim down the size.
-
-    Our tests suggests that cygwin's gcc produces much bigger executables 
-    compared to gcc on other platforms and other compilers.
-
-.. HUH?! // check the magic number that identifies luabind's functions 
-
-Can I register class templates with luabind?
-    Yes you can, but you can only register explicit instantiations of the 
-    class. Because there's no Lua counterpart to C++ templates. For example, 
-    you can register an explicit instantiation of std::vector<> like this::
-
-        module(L)
-        [
-            class_<std::vector<int> >("vector")
-                .def(constructor<int>)
-                .def("push_back", &std::vector<int>::push_back)
-        ];
-
-.. Again, irrelevant to docs: Note that the space between the two > is required by C++.
-
-Do I have to register destructors for my classes?
-    No, the destructor of a class is always called by luabind when an 
-    object is collected. Note that Lua has to own the object to collect it.
-    If you pass it to C++ and gives up ownership (with adopt policy) it will 
-    no longer be owned by Lua, and not collected.
-
-    If you have a class hierarchy, you should make the destructor virtual if 
-    you want to be sure that the correct destructor is called (this apply to C++ 
-    in general).
-
-.. And again, the above is irrelevant to docs. This isn't a general C++ FAQ. But it saves us support questions.
-
-Fatal Error C1063 compiler limit \: compiler stack overflow in VC
-    VC6.5 chokes on warnings, if you are getting alot of warnings from your 
-    code try suppressing them with a pragma directive, this should solve the 
-    problem.
-
-Crashes when linking against luabind as a dll in Windows
-    When you build luabind, Lua and you project, make sure you link against 
-    the runtime dynamically (as a dll).
-
-I cannot register a function with a non-const parameter
-    This is because there is no way to get a reference to a Lua value. Have 
-    a look at out_value_ and pure_out_value_ policies.
-
-
-Known issues
-============
-
-- You cannot use strings with extra nulls in them as member names that refers
-  to C++ members.
-
-- If one class registers two functions with the same name and the same
-  signature, there's currently no error. The last registered function will
-  be the one that's used.
-
-- In VC7, classes can not be called test.
-
-- If you register a function and later rename it, error messages will use the
-  original function name.
-
-- luabind does not support class hierarchies with virtual inheritance. Casts are
-  done with static pointer offsets.
-
-
-Acknowledgments
-===============
-
-Written by Daniel Wallin and Arvid Norberg. © Copyright 2003.
-All rights reserved.
-
-Evan Wies has contributed with thorough testing, countless bug reports
-and feature ideas.
-
-This library was highly inspired by Dave Abrahams' Boost.Python_ library.
-
-.. _Boost.Python: http://www.boost.org/libraries/python
-

+ 0 - 210
lib/luabind/doc/luabind-logo-label.ps

@@ -1,210 +0,0 @@
-%!PS-Adobe-2.0 EPSF-2.0
-%%Title: Lua logo
-%%Creator: lua@tecgraf.puc-rio.br
-%%CreationDate: Wed Nov 29 19:04:04 EDT 2000
-%%BoundingBox: -45 0 1035 1080
-%%Pages: 1
-%%EndComments
-%%EndProlog
-
-%------------------------------------------------------------------------------
-%
-% Copyright (C) 1998-2000. All rights reserved.
-% Graphic design by Alexandre Nakonechny (nako@openlink.com.br).
-% PostScript programming by the Lua team (lua@tecgraf.puc-rio.br).
-%
-% Permission is hereby granted, without written agreement and without license 
-% or royalty fees, to use, copy, and distribute this logo for any purpose, 
-% including commercial applications, subject to the following conditions: 
-%
-% * The origin of this logo must not be misrepresented; you must not
-%   claim that you drew the original logo. We recommend that you give credit
-%   to the graphics designer in all printed matter that includes the logo.
-%
-% * The only modification you can make is to adapt the orbiting text to
-%   your product name.
-%
-% * The logo can be used in any scale as long as the relative proportions 
-%   of its elements are maintained.
-%
-%------------------------------------------------------------------------------
-
-/LABEL		(luabind) def
-
-%-- DO NOT CHANGE ANYTHING BELOW THIS LINE ------------------------------------
-
-/PLANETCOLOR	{0 0 0.5 setrgbcolor} bind def
-/HOLECOLOR	{1.0 setgray} bind def
-/ORBITCOLOR	{0.5 setgray} bind def
-/LOGOFONT	{/Helvetica 0.90} def
-/LABELFONT	{/Helvetica 0.36} def
-
-%------------------------------------------------------------------------------
-
-/MOONCOLOR	{PLANETCOLOR} bind def
-/LOGOCOLOR	{HOLECOLOR} bind def
-/LABELCOLOR	{ORBITCOLOR} bind def
-
-/LABELANGLE	125 def
-/LOGO		(Lua) def
-
-/DASHANGLE	10 def
-/HALFDASHANGLE	DASHANGLE 2 div def
-
-% moon radius. planet radius is 1.
-/r 1 2 sqrt 2 div sub def
-
-/D {0 360 arc fill} bind def
-/F {exch findfont exch scalefont setfont} bind def
-
-% place it nicely on the paper
-/RESOLUTION	1024 def
-RESOLUTION 2 div dup translate
-RESOLUTION 2 div 2 sqrt div dup scale
-
-%-------------------------------------------------------------------- planet --
-PLANETCOLOR
-0 0 1 D
-
-%---------------------------------------------------------------------- hole --
-HOLECOLOR
-1 2 r mul sub dup r D
-
-%---------------------------------------------------------------------- moon --
-MOONCOLOR
-1 1 r D
-
-%---------------------------------------------------------------------- logo --
-LOGOCOLOR
-LOGOFONT
-F
-LOGO stringwidth pop 2 div neg
--0.5 moveto
-LOGO show
-
-%------------------------------------------------------------------------------
-% based on code from Blue Book Program 10, on pages 167--169
-% available at ftp://ftp.adobe.com/pub/adobe/displaypostscript/bluebook.shar
-
-%	str ptsize centerangle radius	outsidecircletext	--
-/outsidecircletext {
-	circtextdict begin
-	/radius exch def
-	/centerangle exch def
-	/ptsize exch def
-	/str exch def
-
-	gsave
-	 str radius ptsize findhalfangle
-	 centerangle
-	 add rotate
-	 str
-		{ /charcode exch def
-		  ( ) dup 0 charcode put outsideplacechar
-		} forall
-	
-	grestore
-	end
-} def
-
-%	string radius ptsize	findhalfangle	halfangle
-/findhalfangle {
-	4 div add
-	exch
-	stringwidth pop 2 div
-	exch
-	2 mul 3.1415926535 mul div 360 mul
-} def
-
-/circtextdict 16 dict def
-circtextdict begin
-
- /outsideplacechar {
-	/char exch def
-	/halfangle char radius ptsize findhalfangle def
-	gsave
-	 halfangle neg rotate
-	 radius 0 translate
-	 -90 rotate
-	 char stringwidth pop 2 div neg 0 moveto
-	 char show
-	grestore
-	halfangle 2 mul neg rotate
- } def
-
-end
-
-%--------------------------------------------------------------------- label --
-LABELFONT
-F
-
-/LABELSIZE	LABELFONT exch pop def
-/LABELRADIUS	LABELSIZE 3 div 1 r add sub neg 1.02 mul def
-
-
-/HALFANGLE
-	LABEL LABELRADIUS LABELSIZE findhalfangle
-	HALFDASHANGLE div ceiling HALFDASHANGLE mul
-def
-
-/LABELANGLE
-	60 LABELANGLE HALFANGLE sub
-	lt
-	{
-	HALFANGLE
-	HALFANGLE DASHANGLE div floor DASHANGLE mul
-	eq
-		{LABELANGLE DASHANGLE div ceiling DASHANGLE mul}
-		{LABELANGLE HALFDASHANGLE sub DASHANGLE div round DASHANGLE mul HALFDASHANGLE add}
-	ifelse
-	}
-	{HALFANGLE 60 add}
-	ifelse
-def
-
-LABELCOLOR
-LABEL
-LABELSIZE
-LABELANGLE
-LABELRADIUS
-outsidecircletext
-
-%--------------------------------------------------------------------- orbit --
-ORBITCOLOR
-0.03 setlinewidth
-[1 r add 3.1415926535 180 div HALFDASHANGLE mul mul] 0 setdash
-newpath
-0 0
-1 r add
-3 copy
-30
-LABELANGLE HALFANGLE add
-arcn
-stroke
-60
-LABELANGLE HALFANGLE sub
-2 copy
-lt {arc stroke} {4 {pop} repeat} ifelse
-
-%------------------------------------------------------------------ copyright --
-/COPYRIGHT
-(Graphic design by A. Nakonechny. Copyright (c) 1998, All rights reserved.)
-def
-
-LABELCOLOR
-LOGOFONT
-32 div
-F
-2 sqrt 0.99 mul
-dup
-neg
-moveto
-COPYRIGHT
-90 rotate
-%show
-
-%---------------------------------------------------------------------- done --
-showpage
-
-%%Trailer
-%%EOF

BIN
lib/luabind/doc/luabind.png


+ 0 - 60
lib/luabind/doc/out_value.rst

@@ -1,60 +0,0 @@
-out_value
-----------------
-
-Motivation
-~~~~~~~~~~
-
-This policy makes it possible to wrap functions that take non-const references
-or pointer to non-const as it's parameters with the intention to write return 
-values to them. Since it's impossible to pass references to primitive types
-in lua, this policy will add another return value with the value after the
-call. If the function already has one return value, one instance of this
-policy will add another return value (read about multiple return values in
-the lua manual).
-
-Defined in
-~~~~~~~~~~
-
-.. parsed-literal::
-
-    #include <luabind/out_value_policy.hpp>
-
-Synopsis
-~~~~~~~~
-
-.. parsed-literal::
-
-    out_value(index, policies = none)
-
-
-Parameters
-~~~~~~~~~~
-
-=============== =============================================================
-Parameter       Purpose
-=============== =============================================================
-``index``       The index of the parameter to be used as an out parameter.
-``policies``    The policies used internally to convert the out parameter
-                to/from Lua. ``_1`` means **to** C++, ``_2`` means **from**
-                C++.
-=============== =============================================================
-
-Example
-~~~~~~~
-
-.. parsed-literal::
-
-    void f1(float& val) { val = val + 10.f; }
-    void f2(float\* val) { \*val = \*val + 10.f; }
-
-    module(L)
-    [
-        def("f", &f, **out_value(_1)**)
-    ];
-
-    Lua 5.0  Copyright (C) 1994-2003 Tecgraf, PUC-Rio
-    > print(f1(10))
-    20
-    > print(f2(10))
-    20
-

+ 0 - 58
lib/luabind/doc/pure_out_value.rst

@@ -1,58 +0,0 @@
-pure_out_value
-----------------
-
-Motivation
-~~~~~~~~~~
-
-This works exactly like ``out_value``, except that it will pass a
-default constructed object instead of converting an argument from
-Lua. This means that the parameter will be removed from the lua
-signature.
-
-Defined in
-~~~~~~~~~~
-
-.. parsed-literal::
-
-    #include <luabind/out_value_policy.hpp>
-
-Synopsis
-~~~~~~~~
-
-.. parsed-literal::
-
-    pure_out_value(index, policies = none)
-
-
-Parameters
-~~~~~~~~~~
-
-=============== =============================================================
-Parameter       Purpose
-=============== =============================================================
-``index``       The index of the parameter to be used as an out parameter.
-``policies``    The policies used internally to convert the out parameter
-                to Lua. ``_1`` is used as the internal index.
-=============== =============================================================
-
-Example
-~~~~~~~
-
-Note that no values are passed to the calls to ``f1`` and ``f2``.
-
-.. parsed-literal::
-
-    void f1(float& val) { val = 10.f; }
-    void f2(float\* val) { \*val = 10.f; }
-
-    module(L)
-    [
-        def("f", &f, **pure_out_value(_1)**)
-    ];
-
-    Lua 5.0  Copyright (C) 1994-2003 Tecgraf, PUC-Rio
-    > print(f1())
-    10
-    > print(f2())
-    10
-

+ 0 - 59
lib/luabind/doc/raw.rst

@@ -1,59 +0,0 @@
-raw
----
-
-.. note::
-
-    ``raw()`` has been deprecated. ``lua_State*`` parameters are
-    automatically handled by luabind.
-
-Motivation
-~~~~~~~~~~
-
-This converter policy will pass through the ``lua_State*`` unmodified.
-This can be useful for example when binding functions that need to 
-return a ``luabind::object``. The parameter will be removed from the
-function signature, decreasing the function arity by one.
-
-Defined in
-~~~~~~~~~~
-
-.. parsed-literal::
-
-    #include <luabind/raw_policy.hpp>
-
-Synopsis
-~~~~~~~~
-
-.. parsed-literal::
-
-    raw(index)
-
-Parameters
-~~~~~~~~~~
-
-============= ===============================================================
-Parameter     Purpose
-============= ===============================================================
-``index``     The index of the lua_State* parameter.
-============= ===============================================================
-
-Example
-~~~~~~~
-
-.. parsed-literal::
-
-    void greet(lua_State* L)
-    {
-        lua_pushstring(L, "hello");
-    }
-
-    ...
-
-    module(L)
-    [
-        def("greet", &greet, **raw(_1)**)
-    ];
-
-    > print(greet())
-    hello
-

+ 0 - 79
lib/luabind/doc/return_reference_to.rst

@@ -1,79 +0,0 @@
-return_reference_to
--------------------
-
-Motivation
-~~~~~~~~~~
-
-It is very common to return references to arguments or the this-pointer to
-allow for chaining in C++.
-
-::
-
-    struct A
-    {
-        float val;
-
-        A& set(float v)
-        {
-            val = v;
-            return *this;
-        }
-    };
-
-When luabind generates code for this, it will create a new object for the
-return-value, pointing to the self-object. This isn't a problem, but could be a
-bit inefficient. When using the return_reference_to-policy we have the ability
-to tell luabind that the return-value is already on the lua stack.
-
-Defined in
-~~~~~~~~~~
-
-.. parsed-literal::
-
-    #include <luabind/return_reference_to_policy.hpp>
-
-Synopsis
-~~~~~~~~
-
-.. parsed-literal::
-
-    return_reference_to(index)
-
-Parameters
-~~~~~~~~~~
-
-========= =============================================================
-Parameter Purpose
-========= =============================================================
-``index`` The argument index to return a reference to, any argument but
-          not ``result``.
-========= =============================================================
-
-Example
-~~~~~~~
-
-.. parsed-literal::
-
-    struct A
-    {
-        float val;
-
-        A& set(float v)
-        {
-            val = v;
-            return \*this;
-        }
-    };
-
-    module(L)
-    [
-        class_<A>("A")
-            .def(constructor<>())
-            .def("set", &A::set, **return_reference_to(_1)**)
-    ];
-
-.. warning:: 
-   This policy ignores all type information and should be used only it 
-   situations where the parameter type is a perfect match to the 
-   return-type (such as in the example).
-

+ 0 - 49
lib/luabind/doc/return_stl_iterator.rst

@@ -1,49 +0,0 @@
-return_stl_iterator
--------------------
-
-Motivation
-~~~~~~~~~~
-
-This policy converts an STL container to a generator function that can be used
-in lua to iterate over the container. It works on any container that defines
-``begin()`` and ``end()`` member functions (they have to return iterators).
-
-Defined in
-~~~~~~~~~~
-
-.. parsed-literal::
-
-    #include <luabind/iterator_policy.hpp>
-
-Synopsis
-~~~~~~~~
-
-.. parsed-literal::
-
-    return_stl_iterator
-
-Example
-~~~~~~~
-
-.. parsed-literal::
-
-    struct X
-    {
-        std::vector<std::string> names;
-    };
-
-    ...
-
-    module(L)
-    [
-        class_<A>("A")
-            .def_readwrite("names", &X::names, **return_stl_iterator**)
-    ];
-
-    ...
-
-    > a = A()
-    > for name in a.names do
-    >  print(name)
-    > end
-

+ 0 - 292
lib/luabind/doc/style.css

@@ -1,292 +0,0 @@
-/*
-:Author: David Goodger
-:Contact: goodger@users.sourceforge.net
-:date: $Date$
-:version: $Revision$
-:copyright: This stylesheet has been placed in the public domain.
-
-Default cascading style sheet for the HTML output of Docutils.
-*/
-
-p {
-  text-align: justify;
-}
-
-.first {
-  margin-top: 0 }
-
-.last {
-  margin-bottom: 0 }
-
-a.toc-backref {
-  text-decoration: none ;
-  color: black }
-
-dt { /* used in FAQ */
-  font-weight: bold ;
-  margin-bottom: 0.2em
-}
-
-dl {
-  margin-left: 0.5em ;
-  margin-right: 10em 
-}
-
-h3 {
-  font-size: 90%
-}
-
-dd {
-  margin-bottom: 0.5em }
-
-div.abstract {
-  margin: 2em 5em }
-
-div.abstract p.topic-title {
-  font-weight: bold ;
-  text-align: center }
-
-div.attention, div.caution, div.danger, div.error, div.hint,
-div.important, div.note, div.tip, div.warning, div.admonition {
-  margin: 2em ;
-  border: medium outset ;
-  padding: 1em }
-
-div.attention p.admonition-title, div.caution p.admonition-title,
-div.danger p.admonition-title, div.error p.admonition-title,
-div.warning p.admonition-title {
-  color: red ;
-  font-weight: bold ;
-  font-family: sans-serif }
-
-div.hint p.admonition-title, div.important p.admonition-title,
-div.note p.admonition-title, div.tip p.admonition-title,
-div.admonition p.admonition-title {
-  font-weight: bold ;
-  font-family: sans-serif }
-
-div.dedication {
-  margin: 2em 5em ;
-  text-align: center ;
-  font-style: italic }
-
-div.dedication p.topic-title {
-  font-weight: bold ;
-  font-style: normal }
-
-div.figure {
-  margin-left: 2em }
-
-div.footer, div.header {
-  font-size: smaller }
-
-div.sidebar {
-  margin-left: 1em ;
-  border: medium outset ;
-  padding: 0em 1em ;
-  background-color: #ffffee ;
-  width: 40% ;
-  float: right ;
-  clear: right }
-
-div.sidebar p.rubric {
-  font-family: sans-serif ;
-  font-size: medium }
-
-div.system-messages {
-  margin: 5em }
-
-div.system-messages h1 {
-  color: red }
-
-div.system-message {
-  border: medium outset ;
-  padding: 1em }
-
-div.system-message p.system-message-title {
-  color: red ;
-  font-weight: bold }
-
-div.topic {
-  margin: 2em }
-
-h1.title {
-  text-align: center }
-
-h2.subtitle {
-  text-align: center }
-
-hr {
-  width: 75% }
-
-ol.simple, ul.simple {
-  margin-bottom: 1em }
-
-ol.arabic {
-  list-style: decimal }
-
-ol.loweralpha {
-  list-style: lower-alpha }
-
-ol.upperalpha {
-  list-style: upper-alpha }
-
-ol.lowerroman {
-  list-style: lower-roman }
-
-ol.upperroman {
-  list-style: upper-roman }
-
-p.attribution {
-  text-align: right ;
-  margin-left: 50% }
-
-p.caption {
-  font-style: italic }
-
-p.credits {
-  font-style: italic ;
-  font-size: smaller }
-
-p.label {
-  white-space: nowrap }
-
-p.rubric {
-  font-weight: bold ;
-  font-size: larger ;
-  color: maroon ;
-  text-align: center }
-
-p.sidebar-title {
-  font-family: sans-serif ;
-  font-weight: bold ;
-  font-size: larger }
-
-p.sidebar-subtitle {
-  font-family: sans-serif ;
-  font-weight: bold }
-
-p.topic-title {
-  font-weight: bold }
-
-pre.address {
-  margin-bottom: 0 ;
-  margin-top: 0 ;
-  font-family: serif ;
-  font-size: 100% }
-
-pre.line-block {
-  font-family: serif ;
-  font-size: 100% }
-
-pre.literal-block, pre.doctest-block {
-  margin-left: 2em ;
-  margin-right: 2em ;
-/*  padding-left: 1em ;*/
-  background-color: #eeeeee ;
-/*  border-left: solid 3px #c0c0c0*/ }
-
-span.classifier {
-  font-family: sans-serif ;
-  font-style: oblique }
-
-span.classifier-delimiter {
-  font-family: sans-serif ;
-  font-weight: bold }
-
-span.interpreted {
-  font-family: sans-serif }
-
-span.option {
-  white-space: nowrap }
-
-span.option-argument {
-  font-style: italic }
-
-span.pre {
-  white-space: pre }
-
-span.problematic {
-  color: red }
-
-table {
-  margin-top: 0.5em ;
-  margin-bottom: 0.5em }
-
-table.citation {
-  border-left: solid thin gray ;
-  padding-left: 0.5ex }
-
-table.docinfo {
-  margin: 2em 4em ;
-  border: none }
-
-table.footnote {
-  border-left: solid thin black ;
-  padding-left: 0.5ex }
-
-td, th {
-  padding-left: 0.5em ;
-  padding-right: 0.5em ;
-  vertical-align: top }
-
-th.docinfo-name, th.field-name {
-  font-weight: bold ;
-  text-align: left ;
-  white-space: nowrap ;
-  border: none ;
-  background-color: #f0f0f0
- }
-
-h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
-  font-size: 100% ;
-  font-family: serif }
-
-/*h1 { font-family: Arial, Helvetica, sans-serif; font-weight: bold; text-align: left; font-size: 140%; }
-h2 { font-family: Arial, Helvetica, sans-serif; font-weight: bold; text-align: left; font-size: 110%; }
-h3 { font-family: "courier new", courier, monospace; font-weight: bold; text-align: left; font-size: 100%; }
-*/
-tt {
-  /*background-color: #eeeeee*/
-  color: #102eb0
-}
-
-ul.auto-toc {
-  list-style-type: none }
-
-/* --- */
-
-table {
-  border-collapse: collapse;
-  border: none;
-/*  border-bottom: 1px solid black;*/
-  margin-left: 1em;
-}
-
-td, th {
-  border: none;
-}
-
-th {
-/* border-top: 1px solid black;*/
-  border-bottom: 1px solid black;
-  text-align: left;
-}
-
-a:link
-{
-	font-weight: bold;
-	color: #003366;
-	text-decoration: none;
-}
-
-a:visited
-{
-	font-weight: bold;
-	color: #003366;
-	text-decoration: none;
-}
-
-h3 {
-  text-transform: uppercase 
-}

+ 0 - 39
lib/luabind/doc/yield.rst

@@ -1,39 +0,0 @@
-yield
-----------------
-
-Motivation
-~~~~~~~~~~
-
-Makes a C++ function yield when returning.
-
-Defined in
-~~~~~~~~~~
-
-.. parsed-literal::
-
-    #include <luabind/yield_policy.hpp>
-
-Synopsis
-~~~~~~~~
-
-.. parsed-literal::
-
-    yield
-
-Example
-~~~~~~~
-
-.. parsed-literal::
-
-    void do_thing_that_takes_time()
-    {
-        ...
-    }
-
-    ...
-
-    module(L)
-    [
-        def("do_thing_that_takes_time", &do_thing_that_takes_time, **yield**)
-    ];
-

+ 0 - 7
lib/luabind/examples/any_converter/Jamfile

@@ -1,7 +0,0 @@
-import modules ;
-
-exe any_converter
-    : any_converter.cpp 
-      /luabind//luabind
-    ;
-

+ 0 - 97
lib/luabind/examples/any_converter/any_converter.cpp

@@ -1,97 +0,0 @@
-#include <iostream>
-
-extern "C"
-{
-	#include "lua.h"
-	#include "lauxlib.h"
-	#include "lualib.h"
-}
-
-bool dostring(lua_State* L, const char* str)
-{
-	if (luaL_loadbuffer(L, str, std::strlen(str), str) || lua_pcall(L, 0, 0, 0))
-	{
-		const char* a = lua_tostring(L, -1);
-		std::cout << a << "\n";
-		lua_pop(L, 1);
-		return true;
-	}
-	return false;
-}
-
-#include <luabind/luabind.hpp>
-#include <luabind/detail/convert_to_lua.hpp>
-#include <boost/any.hpp>
-
-template<class T>
-struct convert_any
-{
-	static void convert(lua_State* L, const boost::any& a)
-	{
-		luabind::detail::convert_to_lua(L, *boost::any_cast<T>(&a));
-	}
-};
-
-std::map<const std::type_info*, void(*)(lua_State*, const boost::any&)> any_converters;
-
-template<class T>
-void register_any_converter()
-{
-	any_converters[&typeid(T)] = convert_any<T>::convert;
-}
-
-namespace luabind
-{
-	namespace converters
-	{
-		yes_t is_user_defined(by_value<boost::any>);
-		yes_t is_user_defined(by_const_reference<boost::any>);
-
-		void convert_cpp_to_lua(lua_State* L, const boost::any& a)
-		{
-			typedef void(*conv_t)(lua_State* L, const boost::any&);
-			conv_t conv = any_converters[&a.type()];
-			conv(L, a);
-		}
-	}
-}
-
-boost::any f(bool b)
-{
-	if (b) return "foobar";
-	else return 3.5f;
-}
-
-int main()
-{
-	register_any_converter<int>();
-	register_any_converter<float>();
-	register_any_converter<const char*>();
-	register_any_converter<std::string>();
-
-	lua_State* L = lua_open();
-#if LUA_VERSION_NUM >= 501 
-	luaL_openlibs(L);
-#else
-	lua_baselibopen(L);
-#endif
-
-	using namespace luabind;
-	
-	open(L);
-	module(L)
-	[
-		def("f", &f)
-	];
-
-	dostring(L, "print( f(true) )");
-	dostring(L, "print( f(false) )");
-	dostring(L, "function update(p) print(p) end");
-
-	boost::any param = std::string("foo");
-
-	luabind::call_function<void>(L, "update", param);
-
-	lua_close(L);
-}
-

+ 0 - 4
lib/luabind/examples/cln/README

@@ -1,4 +0,0 @@
-To build this example you need to have CLN installed. It can be found at
-
-http://www.ginac.de/CLN/
-

+ 0 - 122
lib/luabind/examples/cln/cln_test.cpp

@@ -1,122 +0,0 @@
-#include <cln/cln.h>
-
-extern "C"
-{
-	#include "lua.h"
-	#include "lualib.h"
-	#include "lauxlib.h"
-}
-
-#include <luabind/luabind.hpp>
-
-void bind_cln(lua_State* L)
-{
-	using namespace luabind;
-	using namespace cln;
-
-	module(L)
-	[
-		// real numbers
-		class_<cl_R>("cl_R")
-			.def(constructor<>())
-			.def(constructor<const cl_I&>())
-			.def(constructor<float>())
-			.def(constructor<const char*>())
-			.def(tostring(const_self))
-			.def(-self)
-			.def(const_self + const_self)
-			.def(const_self - const_self)
-			.def(const_self * const_self)
-			.def(const_self / const_self)
-			.def(const_self <= const_self)
-			.def(const_self < const_self)
-			.def(const_self == const_self)
-			.def(other<int>() + const_self)
-			.def(other<int>() - const_self)
-			.def(other<int>() * const_self)
-			.def(other<int>() / const_self)
-			.def(other<int>() <= const_self)
-			.def(other<int>() < const_self)
-			.def(const_self + other<int>())
-			.def(const_self - other<int>())
-			.def(const_self * other<int>())
-			.def(const_self / other<int>())
-			.def(const_self <= other<int>())
-			.def(const_self < other<int>())
-			,
-		
-		// rational numbers
-		class_<cl_RA, cl_R>("cl_RA")
-			.def(constructor<>())
-			.def(constructor<const cl_I&>())
-			.def(constructor<int>())
-			.def(constructor<const char*>())
-			.def(tostring(const_self))
-			.def(-self)
-			.def(const_self + const_self)
-			.def(const_self - const_self)
-			.def(const_self * const_self)
-			.def(const_self / const_self)
-			.def(const_self <= const_self)
-			.def(const_self < const_self)
-			.def(const_self == const_self)
-			.def(other<int>() + const_self)
-			.def(other<int>() - const_self)
-			.def(other<int>() * const_self)
-			.def(other<int>() / const_self)
-			.def(other<int>() <= const_self)
-			.def(other<int>() < const_self)
-			.def(const_self + other<int>())
-			.def(const_self - other<int>())
-			.def(const_self * other<int>())
-			.def(const_self / other<int>())
-			.def(const_self <= other<int>())
-			.def(const_self < other<int>())
-			,
-
-		// integers
-		class_<cl_I, cl_RA>("cl_I")
-			.def(constructor<>())
-			.def(constructor<const cl_I&>())
-			.def(constructor<int>())
-			.def(constructor<const char*>())
-			.def(tostring(const_self))
-			.def(-self)
-			.def(const_self + const_self)
-			.def(const_self - const_self)
-			.def(const_self * const_self)
-			.def(const_self <= const_self)
-			.def(const_self < const_self)
-			.def(const_self == const_self)
-			.def(other<int>() + const_self)
-			.def(other<int>() - const_self)
-			.def(other<int>() * const_self)
-			.def(other<int>() <= const_self)
-			.def(other<int>() < const_self)
-			.def(const_self + other<int>())
-			.def(const_self - other<int>())
-			.def(const_self * other<int>())
-			.def(const_self <= other<int>())
-			.def(const_self < other<int>())
-			,
-			
-		def("factorial", &cln::factorial),
-		def("sqrt", (const cl_R(*)(const cl_R&))&cln::sqrt)
-	];
-}
-
-int main()
-{
-	lua_State* L = lua_open();
-	lua_baselibopen(L);
-	lua_mathlibopen(L);
-	luabind::open(L);
-
-	bind_cln(L);
-
-	lua_dofile(L, "cln_test.lua");
-
-	lua_close(L);
-	return 0;
-}
-

+ 0 - 21
lib/luabind/examples/cln/cln_test.lua

@@ -1,21 +0,0 @@
-
-a = factorial(41)
-b = factorial(42)
-
-print('a = fac(41) = ' .. tostring(a))
-print('b = fac(42) = ' .. tostring(b))
-print('b / a = ' .. tostring(b / a))
-
-c = a * 42
-
-d = sqrt(cl_R(10))
-
-print('d = sqrt(10) = ' .. tostring(d))
-
-if c == b then print('equality operator test: ok') else print('equality operator test: failed') end
-
--- prints
--- a = fac(41) = 33452526613163807108170062053440751665152000000000
--- b = fac(42) = 1405006117752879898543142606244511569936384000000000
--- b / a = 42
--- d = sqrt(10) = 3.1622777

+ 0 - 12
lib/luabind/examples/filesystem/Jamfile

@@ -1,12 +0,0 @@
-import modules ;
-
-BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ;
-
-use-project /boost : $(BOOST_ROOT) ;
-
-exe filesystem
-    : filesystem.cpp 
-      /boost/filesystem//boost_filesystem/<link>static
-      /luabind//luabind
-    ;
-

+ 0 - 119
lib/luabind/examples/filesystem/directory_iterator.hpp

@@ -1,119 +0,0 @@
-// Copyright (c) 2003 Daniel Wallin and Arvid Norberg
-
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the "Software"),
-// to deal in the Software without restriction, including without limitation
-// the rights to use, copy, modify, merge, publish, distribute, sublicense,
-// and/or sell copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following conditions:
-
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
-// ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-// SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
-// ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
-// OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-#ifndef LUABIND_DIRECTORY_ITERATOR_HPP_INCLUDED
-#define LUABIND_DIRECTORY_ITERATOR_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-#include <luabind/detail/policy.hpp>
-#include <luabind/detail/implicit_cast.hpp>
-#include <luabind/detail/convert_to_lua.hpp>
-
-namespace luabind { namespace detail 
-{
-	template<class Iter>
-	struct dir_iterator_state
-	{
-		typedef dir_iterator_state<Iter> self_t;
-
-		static int step(lua_State* L)
-		{
-			self_t& state = *static_cast<self_t*>(lua_touserdata(L, lua_upvalueindex(1)));
-
-			if (state.start == state.end)
-			{
-				lua_pushnil(L);
-				return 1;
-			}
-			else
-			{
-				convert_to_lua(L, *state.start);
-			}
-
-			++state.start;
-
-			return 1;
-		}
-
-		dir_iterator_state(const Iter& s, const Iter& e)
-			: start(s)
-			, end(e)
-		{}
-
-		Iter start;
-		Iter end;
-	};
-
-	struct dir_iterator_converter
-	{
-		template<class T>
-		void apply(lua_State* L, const T& c)
-		{
-			typedef boost::filesystem::directory_iterator iter_t;
-			typedef dir_iterator_state<iter_t> state_t;
-
-			// note that this should be destructed, for now.. just hope that iterator
-			// is a pod
-			void* iter = lua_newuserdata(L, sizeof(state_t));
-			new (iter) state_t(iter_t(c), iter_t());
-			lua_pushcclosure(L, state_t::step, 1);
-		}
-
-		template<class T>
-		void apply(lua_State* L, T& c)
-		{
-			typedef boost::filesystem::directory_iterator iter_t;
-			typedef dir_iterator_state<iter_t> state_t;
-
-			// note that this should be destructed, for now.. just hope that iterator
-			// is a pod
-			void* iter = lua_newuserdata(L, sizeof(state_t));
-			new (iter) state_t(iter_t(c), iter_t());
-			lua_pushcclosure(L, state_t::step, 1);
-		}
-	};
-
-	struct dir_iterator_policy : conversion_policy<0>
-	{
-		static void precall(lua_State*, const index_map&) {}
-		static void postcall(lua_State*, const index_map&) {}
-
-		template<class T, class Direction>
-		struct generate_converter
-		{
-			typedef dir_iterator_converter type;
-		};
-	};
-
-}}
-
-namespace luabind
-{
-	namespace
-	{
-		LUABIND_ANONYMOUS_FIX detail::policy_cons<detail::dir_iterator_policy, detail::null_type> return_directory_iterator;
-	}
-}
-
-#endif // LUABIND_ITERATOR_POLICY_HPP_INCLUDED
-

+ 0 - 115
lib/luabind/examples/filesystem/filesystem.cpp

@@ -1,115 +0,0 @@
-#include <iostream>
-
-extern "C"
-{
-	#include "lua.h"
-	#include "lauxlib.h"
-	#include "lualib.h"
-}
-
-#include <luabind/luabind.hpp>
-#include <luabind/operator.hpp>
-#include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/path.hpp>
-
-#include "directory_iterator.hpp"
-
-const boost::filesystem::path& 
-identity(const boost::filesystem::path& x)
-{
-	return x;
-}
-
-void bind_filesystem(lua_State* L)
-{
-	using namespace luabind;
-	using namespace boost::filesystem;
-
-	namespace fs = boost::filesystem;
-	
-	module(L, "filesystem")
-	[
-		class_<fs::path>("path")
-			.def(constructor<>())
-			.def(constructor<const char*>())
-			.def("string", &fs::path::string)
-			.def("native_file_string", &fs::path::native_file_string)
-			.def("native_directory_string", &fs::path::native_directory_string)
-			.def("root_path", &fs::path::root_path)
-			.def("root_name", &fs::path::root_name)
-			.def("root_directory", &fs::path::root_directory)
-			.def("relative_path", &fs::path::relative_path)
-			.def("leaf", &fs::path::leaf)
-			.def("branch_path", &fs::path::branch_path)
-
-			.def("empty", &fs::path::empty)
-			.def("is_complete", &fs::path::is_complete)
-			.def("is_directory", &fs::is_directory)
-			.def("is_empty", &fs::is_empty)
-			.def("has_root_path", &fs::path::has_root_path)
-			.def("has_root_name", &fs::path::has_root_name)
-			.def("has_root_directory", &fs::path::has_root_directory)
-			.def("has_relative_path", &fs::path::has_relative_path)
-			.def("has_leaf", &fs::path::has_leaf)
-			.def("has_branch_path", &fs::path::has_branch_path)
-
-			.def(const_self / const_self)
-			.def(other<const char*>() / const_self)
-			.def(const_self / other<const char*>())
-
-//			.property("contents", &identity, return_directory_iterator)
-			,
-
-		def("exists", &fs::exists),
-		def("is_directory", &fs::is_directory),
-		def("is_empty", &fs::is_empty),
-		def("create_directory", &fs::create_directory),
-		def("remove", &fs::remove),
-		def("remove_all", &fs::remove_all),
-		def("rename", &fs::rename),
-		def("copy_file", &fs::copy_file),
-
-		def("initial_path", &fs::initial_path),
-		def("current_path", &fs::current_path),
-		def("complete", &fs::complete),
-		def("system_complete", &fs::system_complete)
-	];
-}
-
-int main(int argc, const char* argv[])
-{
-	lua_State* L = lua_open();
-	luaopen_base(L);
-	luaopen_string(L);
-	luaopen_table(L);
-	luaopen_math(L);
-	luaopen_io(L);
-	luaopen_debug(L);
-
-	if (argc < 2)
-	{
-		std::cout << "This example will bind parts of the boost.Filesystem library\n"
-			"and then run the given lua file.\n\n"
-			"usage: filesystem filename [args]\n";
-		return 1;
-	}
-	
-	using namespace luabind;
-
-	open(L);
-
-	bind_filesystem(L);
-	
-	object args = newtable(L);
-
-	for (int i = 0; i < argc; ++i)
-	{
-		args[i + 1] = argv[i];
-	}
-
-	args["n"] = argc;
-	globals(L)["args"] = args;
-
-	luaL_dofile(L, argv[1]);
-}
-

+ 0 - 180
lib/luabind/examples/filesystem/inspect.lua

@@ -1,180 +0,0 @@
--- base class for all inspectors
--- every derived class must implement inspect()
-
-class 'inspector'
-
-  function inspector:__init(name)
-    self.name = name
-    self.warnings = {}
-  end
-
-  function inspector:warning(path, str)
-    table.insert( self.warnings, { path, str } )
-  end
-
-  function inspector:report()
-    local output = function(_,x)
-        local name = x[1]:string()
-        print(name .. ": " .. x[2])
-    end
-
-    local cmp = function(a,b)
-        return a[1]:string() < b[1]:string()
-    end
-
-    local violations
-
-    if table.getn(self.warnings) ~= 0 then
-      violations = table.getn(self.warnings) .. " violations"
-    else
-      violations = "no violations"
-    end
-
-    print("\n-- " .. self.name .. " [" .. violations .. "]\n")
-
-    table.sort(self.warnings, cmp)
-    table.foreach(self.warnings, output)
-  end
-
-  inspector.inspect = nil
-
--- checks filename length
-class 'filename_length' (inspector)
-
-  function filename_length:__init(n)
-    super("filename length (" .. n .. " characters)")
-    self.maxlen = n
-  end
-
-  function filename_length:inspect(path)
-    local n = string.len(path:leaf())
-      if n > self.maxlen then
-        self:warning(path, n .. " characters in filename")
-      end
-  end
-
--- checks that the filename is all lowercase
-class 'filename_case' (inspector)
-
-  function filename_case:__init()
-    super("filename case")
-  end
-
-  function filename_case:inspect(path)
-    if string.lower(path:leaf()) ~= path:leaf() then
-      self:warning(path, "uppercase letters")
-    end
-  end
-
--- checks that the file doesn't contain tabs
-class 'tab_inspector' (inspector)
-
-  function tab_inspector:__init()
-    super("tab inspector")
-  end
-
-  function tab_inspector:inspect(path)
-    if has_endings(path:leaf(), ".hpp", ".cpp") then
-      for line in io.lines(path:string()) do
-        if string.find(line, '\t') ~= nil then
-          self:warning(path, "tabs in file")
-          return
-        end
-      end
-    end
-  end
-
--- checks that the file doesn't contain too long lines
-class 'line_length_inspector' (inspector)
-
-  function line_length_inspector:__init(n)
-    super("line length inspector (" .. n .. " characters)")
-    self.maxlen = n
-  end
-
-  function line_length_inspector:inspect(path)
-    if has_endings(path:leaf(), ".hpp", ".cpp") then
-      for line in io.lines(path:string()) do
-        if string.len(line) > self.maxlen then
-          self:warning(path, "lines too long " .. string.len(line))
-          return
-        end
-      end
-    end
-  end
-
--- checks for unmatched #define/#undef pairs
-class 'define_inspector' (inspector)
-
-  function define_inspector:__init()
-    super("define inspector")
-  end
-
-  function define_inspector:inspect(path)
-    if has_endings(path:leaf(), ".hpp") then
-
-      local defs = {}
-
-      for line in io.lines(path:string()) do
-        local pos, _, def = string.find(line, "#%s*define%s+([%w_]+)")
-        if pos ~= nil then defs[def] = true end
-        local pos, _, def = string.find(line, "#%s*undef%s+([%w_]+)")
-        if pos ~= nil then defs[def] = nil end
-      end
-
-      table.foreach(defs, function(def)
-              self:warning(path, def)
-            end)
-    end
-  end
-
--- helper functions
-
-function file_ending(name)
-  local pos = string.find(name, "%.")
-  if pos == nil then return ""
-  else
-    return string.sub(name, pos)
-  end
-end
-
-function has_endings(name, ...)
-  local ending = file_ending(name)
-  for _,i in arg do
-    if ending == i then return true end
-  end
-  return false
-end
-
-function recurse_dir(path)
-  for i in path.contents do
-    if i:is_directory() then recurse_dir(i)
-    else 
-      table.foreach(inspectors, function(_,x)
-              x:inspect(i)
-            end)
-      number_of_files = number_of_files + 1
-    end
-  end
-end
-
--- main
-
-inspectors = { filename_length(31), filename_case(), 
-               tab_inspector(), line_length_inspector(79),
-               define_inspector() }
-number_of_files = 0
-
-if args.n >= 3 then root = filesystem.path(args[3])
-else root = filesystem.initial_path() end
-
-print("inspecting '" .. root:string() .. "' ...")
-
-recurse_dir(root)
-
-print(" ** " .. number_of_files .. " files was inspected")
-
-table.foreach(inspectors, function(_,i)
-        i:report()
-      end)
-

+ 0 - 14
lib/luabind/examples/glut/Jamfile

@@ -1,14 +0,0 @@
-import modules ;
-
-lib glut : : <name>glut ;
-lib glu : : <name>glu ;
-lib gl : : <name>gl ;
-
-exe glut_bind
-    : glut_bind.cpp gl glu glut
-      /luabind//lualib
-      /luabind//luabind
-    ;
-
-stage . : glut_bind ;
- 

+ 0 - 182
lib/luabind/examples/glut/glut_bind.cpp

@@ -1,182 +0,0 @@
-extern "C"
-{
-	#include "lua.h"
-	#include "lauxlib.h"
-	#include "lualib.h"
-}
-
-#include <luabind/luabind.hpp>
-#include <luabind/class.hpp>
-#include <luabind/function.hpp>
-#include <luabind/object.hpp>
-
-
-#include <GL/glut.h>
-#include <GL/gl.h>
-#include <GL/glu.h>
-
-struct glut_constants {};
-struct gl_constants {};
-
-using luabind::object;
-
-namespace glut_bindings
-{
-	object displayfunc;
-
-	void displayfunc_callback()
-	{
-		displayfunc();
-	}
-
-	void set_displayfunc(object const& fun)
-	{
-		glutDisplayFunc(&displayfunc_callback);
-		displayfunc = fun;
-	}
-
-	object idlefunc;
-
-	void idlefunc_callback()
-	{
-		idlefunc();
-	}
-
-	void set_idlefunc(object const& fun)
-	{
-		glutIdleFunc(&idlefunc_callback);
-		idlefunc = fun;
-	}
-
-
-	object reshapefunc;
-
-	void reshapefunc_callback(int w, int h)
-	{
-		reshapefunc(w, h);
-	}
-
-	void set_reshapefunc(object const& fun)
-	{
-		reshapefunc = fun;
-	}
-
-	object keyboardfunc;
-
-	void keyboardfunc_callback(unsigned char key, int x, int y)
-	{
-		keyboardfunc(key, x, y);
-	}
-
-	void set_keyboardfunc(object const& fun)
-	{
-		glutKeyboardFunc(&keyboardfunc_callback);
-		keyboardfunc = fun;
-	}
-
-	object mousefunc;
-
-	void mousefunc_callback(int button, int state, int x, int y)
-	{
-		mousefunc(button, state, x, y);
-	}
-
-	void set_mousefunc(object const& fun)
-	{
-		mousefunc = fun;
-	}
-}
-
-void bind_glut(lua_State* L)
-{
-	using namespace luabind;
-	using namespace glut_bindings;
-
-	open(L);
-
-	module(L)
-	[	
-		def("glutInitWindowSize", &glutInitWindowSize),
-		def("glutInitWindowPosition", &glutInitWindowPosition),
-		def("glutInitDisplayMode", &glutInitDisplayMode),
-
-		class_<glut_constants>("glut")
-			.enum_("constants")
-			[
-				value("RGB", GLUT_RGB),
-				value("RGBA", GLUT_RGBA),
-				value("INDEX", GLUT_INDEX),
-				value("SINGLE", GLUT_SINGLE),
-				value("DOUBLE", GLUT_DOUBLE),
-				value("DEPTH", GLUT_DEPTH),
-				value("STENCIL", GLUT_STENCIL),
-				value("LEFT_BUTTON", GLUT_LEFT_BUTTON),
-				value("MIDDLE_BUTTON", GLUT_MIDDLE_BUTTON),
-				value("RIGHT_BUTTON", GLUT_RIGHT_BUTTON),
-				value("UP", GLUT_UP),
-				value("DOWN", GLUT_DOWN),
-				value("ELAPSED_TIME", GLUT_ELAPSED_TIME)
-			],
-
-		def("glutCreateWindow", &glutCreateWindow),
-		def("glutDestroyWindow", &glutDestroyWindow),
-		def("glutFullScreen", &glutFullScreen),
-		def("glutDisplayFunc", &set_displayfunc),
-		def("glutKeyboardFunc", &set_keyboardfunc),
-		def("glutReshapeFunc", &set_reshapefunc),
-		def("glutIdleFunc", &set_idlefunc),
-		def("glutMainLoop", &glutMainLoop),
-		def("glutSwapBuffers", &glutSwapBuffers),
-		def("glutGet", &glutGet),
-		def("glutSolidSphere", &glutSolidSphere),
-		def("glutWireSphere", &glutWireSphere),
-		def("glutWireTeapot", &glutWireTeapot),
-		def("glutSolidTeapot", &glutSolidTeapot),
-
-		// -- opengl
-
-		class_<gl_constants>("gl")
-			.enum_("constants")
-			[
-				value("COLOR_BUFFER_BIT", GL_COLOR_BUFFER_BIT),
-				value("DEPTH_BUFFER_BIT", GL_DEPTH_BUFFER_BIT),
-				value("TRIANGLES", GL_TRIANGLES),
-				value("MODELVIEW", GL_MODELVIEW),
-				value("PROJECTION", GL_PROJECTION)
-			],
-
-		def("glBegin", &glBegin),
-		def("glVertex3", &glVertex3f),
-		def("glEnd", &glEnd),
-		def("glClear", &glClear),
-		def("glPushMatrix", &glPushMatrix),
-		def("glPopMatrix", &glPopMatrix),
-		def("glRotate", &glRotatef),
-		def("glColor3", &glColor3f),
-		def("glColor4", &glColor4f),
-		def("glMatrixMode", &glMatrixMode),
-		def("glLoadIdentity", &glLoadIdentity),
-		def("glViewport", &glViewport),
-		def("glTranslate", &glTranslatef),
-
-		// -- glu
-
-		def("gluPerspective", &gluPerspective)
-	];
-}
-
-int main(int argc, char* argv[])
-{
-	lua_State* L = lua_open();
-	lua_baselibopen(L);
-	lua_mathlibopen(L);
-	bind_glut(L);
-
-	glutInit (&argc, argv);
-
-	lua_dofile(L, "glut_bindings.lua");
-
-	lua_close(L);
-	return 0;
-}
-

+ 0 - 79
lib/luabind/examples/glut/glut_bindings.lua

@@ -1,79 +0,0 @@
-quit = false
-
-function resize_func(w, h)
-	local ratio = w / h
-
-	print('====== resize')
-
-	glMatrixMode(gl.PROJECTION)
-	glLoadIdentity()
-
-	glViewport(0,0,w,h)
-
-	gluPerspective(45,ratio,1,1000)
-
-	glMatrixMode(gl.MODELVIEW)
-	glLoadIdentity()
-end
-
-angle = 0
-angle2 = 0
-previous_time = 0
-
-function display_func()
-
-	if quit then return end
-
-	local cur_time = glutGet(glut.ELAPSED_TIME)
-	local delta = (cur_time - previous_time) / 1000
-	previous_time = cur_time
-
-	glClear(gl.COLOR_BUFFER_BIT + gl.DEPTH_BUFFER_BIT)
-
-	glPushMatrix()
-
-	glTranslate(0,0,-5)
-	glRotate(angle, 0, 1, 0)
-	glRotate(angle2, 0, 0, 1)
-	glColor3(1,0,0)
---	glutWireSphere(0.75, 10, 10)
-	glutSolidTeapot(0.75)
---	glColor3(1,1,1)
---	glutWireTeapot(0.75)
-
-	glPopMatrix()
-
-	angle = angle + 200 * delta
-	angle2 = angle2 + 170 * delta
-
-	frames = frames + 1
-
-	if math.mod(frames, 100) == 0 then
-		local fps = frames * 1000 / (glutGet(glut.ELAPSED_TIME) - start_time);
-		print('fps: ' .. fps .. ' time: ' .. glutGet(glut.ELAPSED_TIME) .. ' frames: ' .. frames)
-	end
-
-	glutSwapBuffers()
-end
-
-function keyboard_func(key,x,y)
-	print('keyboard' .. key)
-	if key == 27 then glutDestroyWindow(window) quit = true end
-end
-
-glutInitWindowSize(600,600)
-glutInitWindowPosition(0,0)
-glutInitDisplayMode(glut.RGB + glut.DOUBLE + glut.DEPTH)
-window = glutCreateWindow("luabind, glut-bindings")
-glutDisplayFunc(display_func)
-glutIdleFunc(display_func)
-glutKeyboardFunc(keyboard_func)
-glutReshapeFunc(resize_func)
-
-resize_func(600,600)
-
-start_time = glutGet(glut.ELAPSED_TIME)
-frames = 0
-
-glutMainLoop()
-

+ 0 - 9
lib/luabind/examples/hello_world/Jamfile

@@ -1,9 +0,0 @@
-import modules ;
-
-use-project /luabind : ../../ ;
-
-lib hello_world 
-    : hello_world.cpp /luabind//luabind/<link>static /luabind//lua ;
-
-stage . : hello_world ;
-

+ 0 - 9
lib/luabind/examples/hello_world/README

@@ -1,9 +0,0 @@
-this example will build an extension module as a shared library, use
-loadlib() from within the lua interpreter to load the library, it will
-then export a function named greet() which you can call.
-
-> loadlib('hello_world.dll', 'init')()
-> greet()
-Hello world!
->
-

+ 0 - 51
lib/luabind/examples/hello_world/hello_world.cpp

@@ -1,51 +0,0 @@
-// Copyright (c) 2005 Daniel Wallin and Arvid Norberg
-
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the "Software"),
-// to deal in the Software without restriction, including without limitation
-// the rights to use, copy, modify, merge, publish, distribute, sublicense,
-// and/or sell copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following conditions:
-
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
-// ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-// SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
-// ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
-// OR OTHER DEALINGS IN THE SOFTWARE.
-
-extern "C"
-{
-	#include "lua.h"
-	#include "lualib.h"
-	#include "lauxlib.h"
-}
-
-#include <iostream>
-#include <luabind/luabind.hpp>
-
-void greet()
-{
-    std::cout << "hello world!\n";
-}
-
-extern "C" int init(lua_State* L)
-{
-    using namespace luabind;
-
-    open(L);
-
-    module(L)
-    [
-        def("greet", &greet)
-    ];
-
-    return 0;
-}
-

+ 0 - 0
lib/luabind/examples/hello_world/project-root.jam


+ 0 - 9
lib/luabind/examples/intrusive_ptr/Jamfile

@@ -1,9 +0,0 @@
-import modules ;
-
-exe intrusive_ptr
-    : intrusive_ptr.cpp 
-      /luabind//luabind
-    ;
-
-stage . : intrusive_ptr ;
-

+ 0 - 166
lib/luabind/examples/intrusive_ptr/intrusive_ptr.cpp

@@ -1,166 +0,0 @@
-#include <iostream>
-
-extern "C"
-{
-	#include "lua.h"
-	#include "lauxlib.h"
-	#include "lualib.h"
-}
-
-bool dostring(lua_State* L, const char* str)
-{
-	if (luaL_loadbuffer(L, str, std::strlen(str), str) || lua_pcall(L, 0, 0, 0))
-	{
-		const char* a = lua_tostring(L, -1);
-		std::cout << a << "\n";
-		lua_pop(L, 1);
-		return true;
-	}
-	return false;
-}
-
-#include <luabind/luabind.hpp>
-#include <boost/intrusive_ptr.hpp>
-
-namespace luabind
-{
-	namespace converters
-	{
-		// tell luabind that there is a converter for boost::intrusive_ptr<T>
-		template<class T>
-		yes_t is_user_defined(by_value<boost::intrusive_ptr<T> >);
-
-		template<class T>
-		yes_t is_user_defined(by_const_reference<boost::intrusive_ptr<T> >);
-
-		// function used to destruct the object in lua
-		template<class T>
-		struct decrement_ref_count
-		{
-			static void apply(void* ptr)
-			{
-				T* p = static_cast<T*>(ptr);
-				intrusive_ptr_release(p);
-			}
-		};
-
-		template<class T>
-		void convert_cpp_to_lua(lua_State* L, const boost::intrusive_ptr<T>& ptr)
-		{
-			if (!ptr)
-			{
-				lua_pushnil(L);
-				return;
-			}
-
-			T* raw_ptr = ptr.get();
-			// add reference to object, this will be released when the object is collected
-			intrusive_ptr_add_ref(raw_ptr);
-
-			detail::class_registry* registry = luabind::detail::class_registry::get_registry(L);
-			detail::class_rep* crep = registry->find_class(LUABIND_TYPEID(T));
-
-			assert(crep != 0 && "You are trying to convert an unregistered type");
-
-			// create the struct to hold the object
-			void* obj = lua_newuserdata(L, sizeof(detail::object_rep));
-			// we send 0 as destructor since we know it will never be called
-			new(obj) luabind::detail::object_rep(raw_ptr, crep, detail::object_rep::owner, decrement_ref_count<T>::apply);
-
-			// set the meta table
-			detail::getref(L, crep->metatable_ref());
-			lua_setmetatable(L, -2);
-		}
-
-		template<class T>
-		boost::intrusive_ptr<T>
-		convert_lua_to_cpp(lua_State* L, by_const_reference<boost::intrusive_ptr<T> >, int index)
-		{
-			typename detail::default_policy::template generate_converter<T*, detail::lua_to_cpp>::type converter;
-			T* ptr = converter.apply(L, LUABIND_DECORATE_TYPE(T*), index);
-			return boost::intrusive_ptr<T>(ptr);
-		}
-
-		template<class T>
-		boost::intrusive_ptr<T> convert_lua_to_cpp(lua_State* L, by_value<boost::intrusive_ptr<T> >, int index)
-		{
-			return convert_lua_to_cpp(L, by_const_reference<boost::intrusive_ptr<T> >(), index);
-		}
-
-		template<class T>
-		int match_lua_to_cpp(lua_State* L, by_value<boost::intrusive_ptr<T> >, int index)
-		{
-			typedef typename detail::default_policy::template generate_converter<T*, detail::lua_to_cpp>::type converter_t;
-			return converter_t::match(L, LUABIND_DECORATE_TYPE(T*), index);
-		}
-
-		template<class T>
-		int match_lua_to_cpp(lua_State* L, by_const_reference<boost::intrusive_ptr<T> >, int index)
-		{
-			typedef typename detail::default_policy::template generate_converter<T*, detail::lua_to_cpp>::type converter_t;
-			return converter_t::match(L, LUABIND_DECORATE_TYPE(T*), index);
-		}
-
-	}
-}
-
-struct A
-{
-	A()
-	: cnt(0) 
-	{}
-
-	~A() { std::cout << "free memory\n"; }
-	
-	int cnt;
-};
-
-void intrusive_ptr_add_ref(A* ptr)
-{
-	++ptr->cnt;
-	std::cout << "add ref\n";
-}
-
-void intrusive_ptr_release(A* ptr)
-{
-	--ptr->cnt;
-	std::cout << "release\n";
-	if (ptr->cnt == 0) delete ptr;
-}
-
-void f(boost::intrusive_ptr<A> ptr)
-{
-	std::cout << "count: " << ptr->cnt << "\n";
-}
-
-boost::intrusive_ptr<A> factory()
-{
-	return boost::intrusive_ptr<A>(new A());
-}
-
-int main()
-{
-	lua_State* L = lua_open();
-	lua_baselibopen(L);
-
-	luabind::open(L);
-	
-	using namespace luabind;
-
-	module(L)
-	[
-		class_<A>("A")
-			.def_readonly("cnt", &A::cnt),
-
-		def("factory", &factory),
-		def("f", &f)
-	];
-
-	dostring(L, "a = factory()");
-	dostring(L, "print('lua count: ' .. a.cnt)");
-	dostring(L, "f(a)");
-
-	lua_close(L);
-	return 0;
-}
-

+ 0 - 12
lib/luabind/examples/regexp/Jamfile

@@ -1,12 +0,0 @@
-import modules ;
-
-BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ;
-
-use-project /boost : $(BOOST_ROOT) ;
-
-exe regexp
-    : regex_wrap.cpp 
-      /boost/regex//boost_regex/<link>static
-      /luabind//luabind
-    ;
-

+ 0 - 12
lib/luabind/examples/regexp/regex.lua

@@ -1,12 +0,0 @@
-
-html_tag = regex("<(.*?)>")
-src = '<html>dadas<head>dsa</head></html>'
-
-while html_tag:search(src) do
-	print('tag: ' .. html_tag:what(1))
-	src = string.sub(src, html_tag:position(0) + html_tag:length(0))
-end
-
-print('-------------')
-
-

+ 0 - 58
lib/luabind/examples/regexp/regex_wrap.cpp

@@ -1,58 +0,0 @@
-#include <boost/cregex.hpp> 
-
-extern "C"
-{
-	#include "lua.h"
-	#include "lauxlib.h"
-	#include "lualib.h"
-}
-
-#include <luabind/luabind.hpp>
-
-namespace
-{
-	bool match(boost::RegEx& r, const char* s)
-	{
-		return r.Match(s);
-	}
-
-	bool search(boost::RegEx& r, const char* s)
-	{
-		return r.Search(s);
-	}
-} // namespace unnamed
-
-
-void wrap_regex(lua_State* L)
-{
-	using boost::RegEx;
-	using namespace luabind;
-
-	module(L)
-	[
-		class_<RegEx>("regex")
-			.def(constructor<const char*>())
-			.def(constructor<const char*, bool>())
-			.def("match", match)
-			.def("search", search)
-			.def("what", &RegEx::What)
-			.def("matched", &RegEx::Matched)
-			.def("length", &RegEx::Length)
-			.def("position", &RegEx::Position)
-	];
-}
-
-int main()
-{
-	lua_State* L = lua_open();
-	lua_baselibopen(L);
-	lua_strlibopen(L);
-	luabind::open(L);
-	
-	wrap_regex(L);
-	
-	lua_dofile(L, "regex.lua");
-	
-	lua_close(L);
-}
-

+ 0 - 51
lib/luajit/.travis.yml

@@ -1,51 +0,0 @@
-#
-# LuaDist Travis-CI Hook
-#
-
-# We assume C build environments
-language: C
-
-# Try using multiple Lua Implementations
-env:
-  - TOOL="gcc"                  # Use native compiler (GCC usually)
-  - TOOL="clang"                # Use clang
-  - TOOL="i686-w64-mingw32"     # 32bit MinGW
-  - TOOL="x86_64-w64-mingw32"   # 64bit MinGW
-  - TOOL="arm-linux-gnueabihf"  # ARM hard-float (hf), linux
-
-# Crosscompile builds may fail
-matrix:
-  allow_failures:
-    - env: TOOL="i686-w64-mingw32"
-    - env: TOOL="x86_64-w64-mingw32"
-    - env: TOOL="arm-linux-gnueabihf"
-
-# Install dependencies
-install:
-  - git clone git://github.com/LuaDist/Tools.git ~/_tools
-  - ~/_tools/travis/travis install
-
-# Bootstap
-before_script:
-  - ~/_tools/travis/travis bootstrap
-
-# Build the module
-script:
-  - ~/_tools/travis/travis build
-
-# Execute additional tests or commands
-after_script:
-  - ~/_tools/travis/travis test
-
-# Only watch the master branch
-branches:
-  only:
-    - master
-
-# Notify the LuaDist Dev group if needed
-notifications:
-  recipients:
-    - luadist-dev@googlegroups.com
-  email:
-    on_success: change
-    on_failure: always

+ 0 - 166
lib/luajit/doc/bluequad-print.css

@@ -1,166 +0,0 @@
-/* Copyright (C) 2004-2014 Mike Pall.
- *
- * You are welcome to use the general ideas of this design for your own sites.
- * But please do not steal the stylesheet, the layout or the color scheme.
- */
-body {
-  font-family: serif;
-  font-size: 11pt;
-  margin: 0 3em;
-  padding: 0;
-  border: none;
-}
-a:link, a:visited, a:hover, a:active {
-  text-decoration: none;
-  background: transparent;
-  color: #0000ff;
-}
-h1, h2, h3 {
-  font-family: sans-serif;
-  font-weight: bold;
-  text-align: left;
-  margin: 0.5em 0;
-  padding: 0;
-}
-h1 {
-  font-size: 200%;
-}
-h2 {
-  font-size: 150%;
-}
-h3 {
-  font-size: 125%;
-}
-p {
-  margin: 0 0 0.5em 0;
-  padding: 0;
-}
-ul, ol {
-  margin: 0.5em 0;
-  padding: 0 0 0 2em;
-}
-ul {
-  list-style: outside square;
-}
-ol {
-  list-style: outside decimal;
-}
-li {
-  margin: 0;
-  padding: 0;
-}
-dl {
-  margin: 1em 0;
-  padding: 1em;
-  border: 1px solid black;
-}
-dt {
-  font-weight: bold;
-  margin: 0;
-  padding: 0;
-}
-dt sup {
-  float: right;
-  margin-left: 1em;
-}
-dd {
-  margin: 0.5em 0 0 2em;
-  padding: 0;
-}
-table {
-  table-layout: fixed;
-  width: 100%;
-  margin: 1em 0;
-  padding: 0;
-  border: 1px solid black;
-  border-spacing: 0;
-  border-collapse: collapse;
-}
-tr {
-  margin: 0;
-  padding: 0;
-  border: none;
-}
-td {
-  text-align: left;
-  margin: 0;
-  padding: 0.2em 0.5em;
-  border-top: 1px solid black;
-  border-bottom: 1px solid black;
-}
-tr.separate td {
-  border-top: double;
-}
-tt, pre, code, kbd, samp {
-  font-family: monospace;
-  font-size: 75%;
-}
-kbd {
-  font-weight: bolder;
-}
-blockquote, pre {
-  margin: 1em 2em;
-  padding: 0;
-}
-img {
-  border: none;
-  vertical-align: baseline;
-  margin: 0;
-  padding: 0;
-}
-img.left {
-  float: left;
-  margin: 0.5em 1em 0.5em 0;
-}
-img.right {
-  float: right;
-  margin: 0.5em 0 0.5em 1em;
-}
-.flush {
-  clear: both;
-  visibility: hidden;
-}
-.hide, .noprint, #nav {
-  display: none !important;
-}
-.pagebreak {
-  page-break-before: always;
-}
-#site {
-  text-align: right;
-  font-family: sans-serif;
-  font-weight: bold;
-  margin: 0 1em;
-  border-bottom: 1pt solid black;
-}
-#site a {
-  font-size: 1.2em;
-}
-#site a:link, #site a:visited {
-  text-decoration: none;
-  font-weight: bold;
-  background: transparent;
-  color: #ffffff;
-}
-#logo {
-  color: #ff8000;
-}
-#head {
-  clear: both;
-  margin: 0 1em;
-}
-#main {
-  line-height: 1.3;
-  text-align: justify;
-  margin: 1em;
-}
-#foot {
-  clear: both;
-  font-size: 80%;
-  text-align: center;
-  margin: 0 1.25em;
-  padding: 0.5em 0 0 0;
-  border-top: 1pt solid black;
-  page-break-before: avoid;
-  page-break-after: avoid;
-}

+ 0 - 325
lib/luajit/doc/bluequad.css

@@ -1,325 +0,0 @@
-/* Copyright (C) 2004-2014 Mike Pall.
- *
- * You are welcome to use the general ideas of this design for your own sites.
- * But please do not steal the stylesheet, the layout or the color scheme.
- */
-/* colorscheme:
- *
- * site  |  head   #4162bf/white   | #6078bf/#e6ecff
- * ------+------   ----------------+-------------------
- * nav   |  main   #bfcfff         | #e6ecff/black
- *
- * nav:  hiback   loback     #c5d5ff #b9c9f9
- *       hiborder loborder   #e6ecff #97a7d7
- *       link     hover      #2142bf #ff0000
- *
- * link: link visited hover  #2142bf #8122bf #ff0000
- *
- * main: boxback  boxborder  #f0f4ff #bfcfff
- */
-body {
-  font-family: Verdana, Arial, Helvetica, sans-serif;
-  font-size: 10pt;
-  margin: 0;
-  padding: 0;
-  border: none;
-  background: #e0e0e0;
-  color: #000000;
-}
-a:link {
-  text-decoration: none;
-  background: transparent;
-  color: #2142bf;
-}
-a:visited {
-  text-decoration: none;
-  background: transparent;
-  color: #8122bf;
-}
-a:hover, a:active {
-  text-decoration: underline;
-  background: transparent;
-  color: #ff0000;
-}
-h1, h2, h3 {
-  font-weight: bold;
-  text-align: left;
-  margin: 0.5em 0;
-  padding: 0;
-  background: transparent;
-}
-h1 {
-  font-size: 200%;
-  line-height: 3em; /* really 6em relative to body, match #site span */
-  margin: 0;
-}
-h2 {
-  font-size: 150%;
-  color: #606060;
-}
-h3 {
-  font-size: 125%;
-  color: #404040;
-}
-p {
-  max-width: 600px;
-  margin: 0 0 0.5em 0;
-  padding: 0;
-}
-b {
-  color: #404040;
-}
-ul, ol {
-  max-width: 600px;
-  margin: 0.5em 0;
-  padding: 0 0 0 2em;
-}
-ul {
-  list-style: outside square;
-}
-ol {
-  list-style: outside decimal;
-}
-li {
-  margin: 0;
-  padding: 0;
-}
-dl {
-  max-width: 600px;
-  margin: 1em 0;
-  padding: 1em;
-  border: 1px solid #bfcfff;
-  background: #f0f4ff;
-}
-dt {
-  font-weight: bold;
-  margin: 0;
-  padding: 0;
-}
-dt sup {
-  float: right;
-  margin-left: 1em;
-  color: #808080;
-}
-dt a:visited {
-  text-decoration: none;
-  color: #2142bf;
-}
-dt a:hover, dt a:active {
-  text-decoration: none;
-  color: #ff0000;
-}
-dd {
-  margin: 0.5em 0 0 2em;
-  padding: 0;
-}
-div.tablewrap { /* for IE *sigh* */
-  max-width: 600px;
-}
-table {
-  table-layout: fixed;
-  border-spacing: 0;
-  border-collapse: collapse;
-  max-width: 600px;
-  width: 100%;
-  margin: 1em 0;
-  padding: 0;
-  border: 1px solid #bfcfff;
-}
-tr {
-  margin: 0;
-  padding: 0;
-  border: none;
-}
-tr.odd {
-  background: #f0f4ff;
-}
-tr.separate td {
-  border-top: 1px solid #bfcfff;
-}
-td {
-  text-align: left;
-  margin: 0;
-  padding: 0.2em 0.5em;
-  border: none;
-}
-tt, code, kbd, samp {
-  font-family: Courier New, Courier, monospace;
-  line-height: 1.2;
-  font-size: 110%;
-}
-kbd {
-  font-weight: bolder;
-}
-blockquote, pre {
-  max-width: 600px;
-  margin: 1em 2em;
-  padding: 0;
-}
-pre {
-  line-height: 1.1;
-}
-pre.code {
-  line-height: 1.4;
-  margin: 0.5em 0 1em 0.5em;
-  padding: 0.5em 1em;
-  border: 1px solid #bfcfff;
-  background: #f0f4ff;
-}
-pre.mark {
-  padding-left: 2em;
-}
-span.codemark {
-  position:absolute;
-  left: 16em;
-  color: #4040c0;
-}
-span.mark {
-  color: #4040c0;
-  font-family: Courier New, Courier, monospace;
-  line-height: 1.1;
-}
-img {
-  border: none;
-  vertical-align: baseline;
-  margin: 0;
-  padding: 0;
-}
-img.left {
-  float: left;
-  margin: 0.5em 1em 0.5em 0;
-}
-img.right {
-  float: right;
-  margin: 0.5em 0 0.5em 1em;
-}
-.indent {
-  padding-left: 1em;
-}
-.flush {
-  clear: both;
-  visibility: hidden;
-}
-.hide, .noscreen {
-  display: none !important;
-}
-.ext {
-  color: #ff8000;
-}
-.new {
-  font-size: 6pt;
-  vertical-align: middle;
-  background: #ff8000;
-  color: #ffffff;
-}
-#site {
-  clear: both;
-  float: left;
-  width: 13em;
-  text-align: center;
-  font-weight: bold;
-  margin: 0;
-  padding: 0;
-  background: transparent;
-  color: #ffffff;
-}
-#site a {
-  font-size: 200%;
-}
-#site a:link, #site a:visited {
-  text-decoration: none;
-  font-weight: bold;
-  background: transparent;
-  color: #ffffff;
-}
-#site span {
-  line-height: 3em; /* really 6em relative to body, match h1 */
-}
-#logo {
-  color: #ffb380;
-}
-#head {
-  margin: 0;
-  padding: 0 0 0 2em;
-  border-left: solid 13em #4162bf;
-  border-right: solid 3em #6078bf;
-  background: #6078bf;
-  color: #e6ecff;
-}
-#nav {
-  clear: both;
-  float: left;
-  overflow: hidden;
-  text-align: left;
-  line-height: 1.5;
-  width: 13em;
-  padding-top: 1em;
-  background: transparent;
-}
-#nav ul {
-  list-style: none outside;
-  margin: 0;
-  padding: 0;
-}
-#nav li {
-  margin: 0;
-  padding: 0;
-}
-#nav a {
-  display: block;
-  text-decoration: none;
-  font-weight: bold;
-  margin: 0;
-  padding: 2px 1em;
-  border-top: 1px solid transparent;
-  border-bottom: 1px solid transparent;
-  background: transparent;
-  color: #2142bf;
-}
-#nav a:hover, #nav a:active {
-  text-decoration: none;
-  border-top: 1px solid #97a7d7;
-  border-bottom: 1px solid #e6ecff;
-  background: #b9c9f9;
-  color: #ff0000;
-}
-#nav a.current, #nav a.current:hover, #nav a.current:active {
-  border-top: 1px solid #e6ecff;
-  border-bottom: 1px solid #97a7d7;
-  background: #c5d5ff;
-  color: #2142bf;
-}
-#nav ul ul a {
-  padding: 0 1em 0 1.7em;
-}
-#nav ul ul ul a {
-  padding: 0 0.5em 0 2.4em;
-}
-#main {
-  line-height: 1.5;
-  text-align: left;
-  margin: 0;
-  padding: 1em 2em;
-  border-left: solid 13em #bfcfff;
-  border-right: solid 3em #e6ecff;
-  background: #e6ecff;
-}
-#foot {
-  clear: both;
-  font-size: 80%;
-  text-align: center;
-  margin: 0;
-  padding: 0.5em;
-  background: #6078bf;
-  color: #ffffff;
-}
-#foot a:link, #foot a:visited {
-  text-decoration: underline;
-  background: transparent;
-  color: #ffffff;
-}
-#foot a:hover, #foot a:active {
-  text-decoration: underline;
-  background: transparent;
-  color: #bfcfff;
-}

+ 0 - 928
lib/luajit/doc/changes.html

@@ -1,928 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
-<title>LuaJIT Change History</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<meta name="Author" content="Mike Pall">
-<meta name="Copyright" content="Copyright (C) 2005-2014, Mike Pall">
-<meta name="Language" content="en">
-<link rel="stylesheet" type="text/css" href="bluequad.css" media="screen">
-<link rel="stylesheet" type="text/css" href="bluequad-print.css" media="print">
-<style type="text/css">
-div.major { max-width: 600px; padding: 1em; margin: 1em 0 1em 0; }
-</style>
-</head>
-<body>
-<div id="site">
-<a href="http://luajit.org"><span>Lua<span id="logo">JIT</span></span></a>
-</div>
-<div id="head">
-<h1>LuaJIT Change History</h1>
-</div>
-<div id="nav">
-<ul><li>
-<a href="luajit.html">LuaJIT</a>
-<ul><li>
-<a href="http://luajit.org/download.html">Download <span class="ext">&raquo;</span></a>
-</li><li>
-<a href="install.html">Installation</a>
-</li><li>
-<a href="running.html">Running</a>
-</li></ul>
-</li><li>
-<a href="extensions.html">Extensions</a>
-<ul><li>
-<a href="ext_ffi.html">FFI Library</a>
-<ul><li>
-<a href="ext_ffi_tutorial.html">FFI Tutorial</a>
-</li><li>
-<a href="ext_ffi_api.html">ffi.* API</a>
-</li><li>
-<a href="ext_ffi_semantics.html">FFI Semantics</a>
-</li></ul>
-</li><li>
-<a href="ext_jit.html">jit.* Library</a>
-</li><li>
-<a href="ext_c_api.html">Lua/C API</a>
-</li></ul>
-</li><li>
-<a href="status.html">Status</a>
-<ul><li>
-<a class="current" href="changes.html">Changes</a>
-</li></ul>
-</li><li>
-<a href="faq.html">FAQ</a>
-</li><li>
-<a href="http://luajit.org/performance.html">Performance <span class="ext">&raquo;</span></a>
-</li><li>
-<a href="http://wiki.luajit.org/">Wiki <span class="ext">&raquo;</span></a>
-</li><li>
-<a href="http://luajit.org/list.html">Mailing List <span class="ext">&raquo;</span></a>
-</li></ul>
-</div>
-<div id="main">
-<p>
-This is a list of changes between the released versions of LuaJIT.<br>
-The current <span style="color: #0000c0;">stable version</span> is <strong>LuaJIT&nbsp;2.0.3</strong>.<br>
-</p>
-<p>
-Please check the
-<a href="http://luajit.org/changes.html"><span class="ext">&raquo;</span>&nbsp;Online Change History</a>
-to see whether newer versions are available.
-</p>
-
-<div class="major" style="background: #d0d0ff;">
-<h2 id="LuaJIT-2.0.3">LuaJIT 2.0.3 &mdash; 2014-03-12</h2>
-<ul>
-<li>Add PS4 port.</li>
-<li>Add support for multilib distro builds.</li>
-<li>Fix OSX build.</li>
-<li>Fix MinGW build.</li>
-<li>Fix Xbox 360 build.</li>
-<li>Improve ULOAD forwarding for open upvalues.</li>
-<li>Fix GC steps threshold handling when called by JIT-compiled code.</li>
-<li>Fix argument checks for <tt>math.deg()</tt> and <tt>math.rad()</tt>.</li>
-<li>Fix <tt>jit.flush(func|true)</tt>.</li>
-<li>Respect <tt>jit.off(func)</tt> when returning to a function, too.</li>
-<li>Fix compilation of <tt>string.byte(s, nil, n)</tt>.</li>
-<li>Fix line number for relocated bytecode after closure fixup</li>
-<li>Fix frame traversal for backtraces.</li>
-<li>Fix ABC elimination.</li>
-<li>Fix handling of redundant PHIs.</li>
-<li>Fix snapshot restore for exit to function header.</li>
-<li>Fix type punning alias analysis for constified pointers</li>
-<li>Fix call unroll checks in the presence of metamethod frames.</li>
-<li>Fix initial maxslot for down-recursive traces.</li>
-<li>Prevent BASE register coalescing if parent uses <tt>IR_RETF</tt>.</li>
-<li>Don't purge modified function from stack slots in <tt>BC_RET</tt>.</li>
-<li>Fix recording of <tt>BC_VARG</tt>.</li>
-<li>Don't access dangling reference to reallocated IR.</li>
-<li>Fix frame depth display for bytecode dump in <tt>-jdump</tt>.</li>
-<li>ARM: Fix register allocation when rematerializing FPRs.</li>
-<li>x64: Fix store to upvalue for lightuserdata values.</li>
-<li>FFI: Add missing GC steps for callback argument conversions.</li>
-<li>FFI: Properly unload loaded DLLs.</li>
-<li>FFI: Fix argument checks for <tt>ffi.string()</tt>.</li>
-<li>FFI/x64: Fix passing of vector arguments to calls.</li>
-<li>FFI: Rehash finalizer table after GC cycle, if needed.</li>
-<li>FFI: Fix <tt>cts-&gt;L</tt> for cdata unsinking in snapshot restore.</li>
-</ul>
-
-<h2 id="LuaJIT-2.0.2">LuaJIT 2.0.2 &mdash; 2013-06-03</h2>
-<ul>
-<li>Fix memory access check for fast string interning.</li>
-<li>Fix MSVC intrinsics for older versions.</li>
-<li>Add missing GC steps for <tt>io.*</tt> functions.</li>
-<li>Fix spurious red zone overflows in machine code generation.</li>
-<li>Fix jump-range constrained mcode allocation.</li>
-<li>Inhibit DSE for implicit loads via calls.</li>
-<li>Fix builtin string to number conversion for overflow digits.</li>
-<li>Fix optional argument handling while recording builtins.</li>
-<li>Fix optional argument handling in <tt>table.concat()</tt>.</li>
-<li>Add partial support for building with MingW64 GCC 4.8-SEH.</li>
-<li>Add missing PHI barrier to <tt>string.sub(str, a, b) == kstr</tt> FOLD rule.</li>
-<li>Fix compatibility issues with Illumos.</li>
-<li>ARM: Fix cache flush/sync for exit stubs of JIT-compiled code.</li>
-<li>MIPS: Fix cache flush/sync for JIT-compiled code jump area.</li>
-<li>PPC: Add <tt>plt</tt> suffix for external calls from assembler code.</li>
-<li>FFI: Fix snapshot substitution in SPLIT pass.</li>
-<li>FFI/x86: Fix register allocation for 64 bit comparisons.</li>
-<li>FFI: Fix tailcall in lowest frame to C&nbsp;function with bool result.</li>
-<li>FFI: Ignore <tt>long</tt> type specifier in <tt>ffi.istype()</tt>.</li>
-<li>FFI: Fix calling conventions for 32 bit OSX and iOS simulator (struct returns).</li>
-<li>FFI: Fix calling conventions for ARM hard-float EABI (nested structs).</li>
-<li>FFI: Improve error messages for arithmetic and comparison operators.</li>
-<li>FFI: Insert no-op type conversion for pointer to integer cast.</li>
-<li>FFI: Fix unroll limit for <tt>ffi.fill()</tt>.</li>
-<li>FFI: Must sink <tt>XBAR</tt> together with <tt>XSTORE</tt>s.</li>
-<li>FFI: Preserve intermediate string for <tt>const&nbsp;char&nbsp;*</tt> conversion.</li>
-</ul>
-
-<h2 id="LuaJIT-2.0.1">LuaJIT 2.0.1 &mdash; 2013-02-19</h2>
-<ul>
-<li>Don't clear frame for out-of-memory error.</li>
-<li>Leave hook when resume catches error thrown from hook.</li>
-<li>Add missing GC steps for template table creation.</li>
-<li>Fix discharge order of comparisons in Lua parser.</li>
-<li>Improve buffer handling for <tt>io.read()</tt>.</li>
-<li>OSX: Add support for Mach-O object files to <tt>-b</tt> option.</li>
-<li>Fix PS3 port.</li>
-<li>Fix/enable Xbox 360 port.</li>
-<li>x86/x64: Always mark ref for shift count as non-weak.</li>
-<li>x64: Don't fuse implicitly 32-to-64 extended operands.</li>
-<li>ARM: Fix armhf call argument handling.</li>
-<li>ARM: Fix code generation for integer math.min/math.max.</li>
-<li>PPC/e500: Fix <tt>lj_vm_floor()</tt> for Inf/NaN.</li>
-<li>FFI: Change priority of table initializer variants for structs.</li>
-<li>FFI: Fix code generation for bool call result check on x86/x64.</li>
-<li>FFI: Load FFI library on-demand for bytecode with cdata literals.</li>
-<li>FFI: Fix handling of qualified transparent structs/unions.</li>
-</ul>
-
-<h2 id="LuaJIT-2.0.0">LuaJIT 2.0.0 &mdash; 2012-11-08</h2>
-<ul>
-<li>Correctness and completeness:
-<ul>
-  <li>Fix Android/x86 build.</li>
-  <li>Fix recording of equality comparisons with <tt>__eq</tt> metamethods.</li>
-  <li>Fix detection of immutable upvalues.</li>
-  <li>Replace error with PANIC for callbacks from JIT-compiled code.</li>
-  <li>Fix builtin string to number conversion for <tt>INT_MIN</tt>.</li>
-  <li>Don't create unneeded array part for template tables.</li>
-  <li>Fix <tt>CONV.num.int</tt> sinking.</li>
-  <li>Don't propagate implicitly widened number to index metamethods.</li>
-  <li>ARM: Fix ordered comparisons of number vs. non-number.</li>
-  <li>FFI: Fix code generation for replay of sunk float fields.</li>
-  <li>FFI: Fix signedness of bool.</li>
-  <li>FFI: Fix recording of bool call result check on x86/x64.</li>
-  <li>FFI: Fix stack-adjustment for <tt>__thiscall</tt> callbacks.</li>
-</ul></li>
-</ul>
-
-<h2 id="LuaJIT-2.0.0-beta11">LuaJIT 2.0.0-beta11 &mdash; 2012-10-16</h2>
-<ul>
-<li>New features:
-<ul>
-  <li>Use ARM VFP instructions, if available (build-time detection).</li>
-  <li>Add support for ARM hard-float EABI (<tt>armhf</tt>).</li>
-  <li>Add PS3 port.</li>
-  <li>Add many features from Lua&nbsp;5.2, e.g. <tt>goto</tt>/labels.
-  Refer to <a href="extensions.html#lua52">this list</a>.</li>
-  <li>FFI: Add parameterized C types.</li>
-  <li>FFI: Add support for copy constructors.</li>
-  <li>FFI: Equality comparisons never raise an error (treat as unequal instead).</li>
-  <li>FFI: Box all accessed or returned enums.</li>
-  <li>FFI: Check for <tt>__new</tt> metamethod when calling a constructor.</li>
-  <li>FFI: Handle <tt>__pairs</tt>/<tt>__ipairs</tt> metamethods for cdata objects.</li>
-  <li>FFI: Convert <tt>io.*</tt> file handle to <tt>FILE *</tt> pointer (but as a <tt>void *</tt>).</li>
-  <li>FFI: Detect and support type punning through unions.</li>
-  <li>FFI: Improve various error messages.</li>
-</ul></li>
-<li>Build-system reorganization:
-<ul>
-  <li>Reorganize directory layout:<br>
-  <tt>lib/*</tt> &rarr; <tt>src/jit/*</tt><br>
-  <tt>src/buildvm_*.dasc</tt> &rarr; <tt>src/vm_*.dasc</tt><br>
-  <tt>src/buildvm_*.h</tt> &rarr; removed<br>
-  <tt>src/buildvm*</tt> &rarr; <tt>src/host/*</tt></li>
-  <li>Add minified Lua interpreter plus Lua BitOp (<tt>minilua</tt>) to run DynASM.</li>
-  <li>Change DynASM bit operations to use Lua BitOp</li>
-  <li>Translate only <tt>vm_*.dasc</tt> for detected target architecture.</li>
-  <li>Improve target detection for <tt>msvcbuild.bat</tt>.</li>
-  <li>Fix build issues on Cygwin and MinGW with optional MSys.</li>
-  <li>Handle cross-compiles with FPU/no-FPU or hard-fp/soft-fp ABI mismatch.</li>
-  <li>Remove some library functions for no-JIT/no-FFI builds.</li>
-  <li>Add uninstall target to top-level Makefile.</li>
-</ul></li>
-<li>Correctness and completeness:
-<ul>
-  <li>Preserve snapshot #0 PC for all traces.</li>
-  <li>Fix argument checks for <tt>coroutine.create()</tt>.</li>
-  <li>Command line prints version and JIT status to <tt>stdout</tt>, not <tt>stderr</tt>.</li>
-  <li>Fix userdata <tt>__gc</tt> separations at Lua state close.</li>
-  <li>Fix <tt>TDUP</tt> to <tt>HLOAD</tt> forwarding for <tt>LJ_DUALNUM</tt> builds.</li>
-  <li>Fix buffer check in bytecode writer.</li>
-  <li>Make <tt>os.date()</tt> thread-safe.</li>
-  <li>Add missing declarations for MSVC intrinsics.</li>
-  <li>Fix dispatch table modifications for return hooks.</li>
-  <li>Workaround for MSVC conversion bug (<tt>double</tt> &rarr; <tt>uint32_t</tt> &rarr; <tt>int32_t</tt>).</li>
-  <li>Fix FOLD rule <tt>(i-j)-i => 0-j</tt>.</li>
-  <li>Never use DWARF unwinder on Windows.</li>
-  <li>Fix shrinking of direct mapped blocks in builtin allocator.</li>
-  <li>Limit recursion depth in <tt>string.match()</tt> et al.</li>
-  <li>Fix late despecialization of <tt>ITERN</tt> after loop has been entered.</li>
-  <li>Fix <tt>'f'</tt> and <tt>'L'</tt> options for <tt>debug.getinfo()</tt> and <tt>lua_getinfo()</tt>.</li>
-  <li>Fix <tt>package.searchpath()</tt>.</li>
-  <li>OSX: Change dylib names to be consistent with other platforms.</li>
-  <li>Android: Workaround for broken <tt>sprintf("%g",&nbsp;-0.0)</tt>.</li>
-  <li>x86: Remove support for ancient CPUs without <tt>CMOV</tt> (before Pentium Pro).</li>
-  <li>x86: Fix register allocation for calls returning register pair.</li>
-  <li>x86/x64: Fix fusion of unsigned byte comparisons with swapped operands.</li>
-  <li>ARM: Fix <tt>tonumber()</tt> argument check.</li>
-  <li>ARM: Fix modulo operator and <tt>math.floor()</tt>/<tt>math.ceil()</tt> for <tt>inf</tt>/<tt>nan</tt>.</li>
-  <li>ARM: Invoke SPLIT pass for leftover <tt>IR_TOBIT</tt>.</li>
-  <li>ARM: Fix BASE register coalescing.</li>
-  <li>PPC: Fix interpreter state setup in callbacks.</li>
-  <li>PPC: Fix <tt>string.sub()</tt> range check.</li>
-  <li>MIPS: Support generation of MIPS/MIPSEL bytecode object files.</li>
-  <li>MIPS: Fix calls to <tt>floor()</tt>/<tt>ceil()</tt><tt>/trunc()</tt>.</li>
-  <li>ARM/PPC: Detect more target architecture variants.</li>
-  <li>ARM/PPC/e500/MIPS: Fix tailcalls from fast functions, esp. <tt>tostring()</tt>.</li>
-  <li>ARM/PPC/MIPS: Fix rematerialization of FP constants.</li>
-  <li>FFI: Don't call <tt>FreeLibrary()</tt> on our own EXE/DLL.</li>
-  <li>FFI: Resolve metamethods for constructors, too.</li>
-  <li>FFI: Properly disable callbacks on iOS (would require executable memory).</li>
-  <li>FFI: Fix cdecl string parsing during recording.</li>
-  <li>FFI: Show address pointed to for <tt>tostring(ref)</tt>, too.</li>
-  <li>FFI: Fix alignment of C call argument/return structure.</li>
-  <li>FFI: Initialize all fields of standard types.</li>
-  <li>FFI: Fix callback handling when new C&nbsp;types are declared in callback.</li>
-  <li>FFI: Fix recording of constructors for pointers.</li>
-  <li>FFI: Always resolve metamethods for pointers to structs.</li>
-  <li>FFI: Correctly propagate alignment when interning nested types.</li>
-</ul></li>
-<li>Structural and performance enhancements:
-<ul>
-  <li>Add allocation sinking and store sinking optimization.</li>
-  <li>Constify immutable upvalues.</li>
-  <li>Add builtin string to integer or FP number conversion. Improves cross-platform consistency and correctness.</li>
-  <li>Create string hash slots in template tables for non-const values, too. Avoids later table resizes.</li>
-  <li>Eliminate <tt>HREFK</tt> guard for template table references.</li>
-  <li>Add various new FOLD rules.</li>
-  <li>Don't use stack unwinding for <tt>lua_yield()</tt> (slow on x64).</li>
-  <li>ARM, PPC, MIPS: Improve <tt>XLOAD</tt> operand fusion and register hinting.</li>
-  <li>PPC, MIPS: Compile <tt>math.sqrt()</tt> to sqrt instruction, if available.</li>
-  <li>FFI: Fold <tt>KPTR</tt> + constant offset in SPLIT pass.</li>
-  <li>FFI: Optimize/inline <tt>ffi.copy()</tt> and <tt>ffi.fill()</tt>.</li>
-  <li>FFI: Compile and optimize array/struct copies.</li>
-  <li>FFI: Compile <tt>ffi.typeof(cdata|ctype)</tt>, <tt>ffi.sizeof()</tt>, <tt>ffi.alignof()</tt>, <tt>ffi.offsetof()</tt> and <tt>ffi.gc()</tt>.</li>
-</ul></li>
-</ul>
-
-<h2 id="LuaJIT-2.0.0-beta10">LuaJIT 2.0.0-beta10 &mdash; 2012-05-09</h2>
-<ul>
-<li>New features:
-<ul>
-<li>The MIPS of LuaJIT is complete. It requires a CPU conforming to the
-MIPS32&nbsp;R1 architecture with hardware FPU. O32 hard-fp ABI,
-little-endian or big-endian.</li>
-<li>Auto-detect target arch via cross-compiler. No need for
-<tt>TARGET=arch</tt> anymore.</li>
-<li>Make DynASM compatible with Lua 5.2.</li>
-<li>From Lua 5.2: Try <tt>__tostring</tt> metamethod on non-string error
-messages..</li>
-</ul></li>
-<li>Correctness and completeness:
-<ul>
-<li>Fix parsing of hex literals with exponents.</li>
-<li>Fix bytecode dump for certain number constants.</li>
-<li>Fix argument type in error message for relative arguments.</li>
-<li>Fix argument error handling on Lua stacks without a frame.</li>
-<li>Add missing mcode limit check in assembler backend.</li>
-<li>Fix compilation on OpenBSD.</li>
-<li>Avoid recursive GC steps after GC-triggered trace exit.</li>
-<li>Replace <tt>&lt;unwind.h&gt;</tt> definitions with our own.</li>
-<li>Fix OSX build issues. Bump minimum required OSX version to 10.4.</li>
-<li>Fix discharge order of comparisons in Lua parser.</li>
-<li>Ensure running <tt>__gc</tt> of userdata created in <tt>__gc</tt>
-at state close.</li>
-<li>Limit number of userdata <tt>__gc</tt> separations at state close.</li>
-<li>Fix bytecode <tt>JMP</tt> slot range when optimizing
-<tt>and</tt>/<tt>or</tt> with constant LHS.</li>
-<li>Fix DSE of <tt>USTORE</tt>.</li>
-<li>Make <tt>lua_concat()</tt> work from C&nbsp;hook with partial frame.</li>
-<li>Add required PHIs for implicit conversions, e.g. via <tt>XREF</tt>
-forwarding.</li>
-<li>Add more comparison variants to Valgrind suppressions file.</li>
-<li>Disable loading bytecode with an extra header (BOM or <tt>#!</tt>).</li>
-<li>Fix PHI stack slot syncing.</li>
-<li>ARM: Reorder type/value tests to silence Valgrind.</li>
-<li>ARM: Fix register allocation for <tt>ldrd</tt>-optimized
-<tt>HREFK</tt>.</li>
-<li>ARM: Fix conditional branch fixup for <tt>OBAR</tt>.</li>
-<li>ARM: Invoke SPLIT pass for <tt>double</tt> args in FFI call.</li>
-<li>ARM: Handle all <tt>CALL*</tt> ops with <tt>double</tt> results in
-SPLIT pass.</li>
-<li>ARM: Fix rejoin of <tt>POW</tt> in SPLIT pass.</li>
-<li>ARM: Fix compilation of <tt>math.sinh</tt>, <tt>math.cosh</tt>,
-<tt>math.tanh</tt>.</li>
-<li>ARM, PPC: Avoid pointless arg clearing in <tt>BC_IFUNCF</tt>.</li>
-<li>PPC: Fix resume after yield from hook.</li>
-<li>PPC: Fix argument checking for <tt>rawget()</tt>.</li>
-<li>PPC: Fix fusion of floating-point <tt>XLOAD</tt>/<tt>XSTORE</tt>.</li>
-<li>PPC: Fix <tt>HREFK</tt> code generation for huge tables.</li>
-<li>PPC: Use builtin D-Cache/I-Cache sync code.</li>
-</ul></li>
-<li>FFI library:
-<ul>
-<li>Ignore empty statements in <tt>ffi.cdef()</tt>.</li>
-<li>Ignore number parsing errors while skipping definitions.</li>
-<li>Don't touch frame in callbacks with tailcalls to fast functions.</li>
-<li>Fix library unloading on POSIX systems.</li>
-<li>Finalize cdata before userdata when closing the state.</li>
-<li>Change <tt>ffi.load()</tt> library name resolution for Cygwin.</li>
-<li>Fix resolving of function name redirects on Windows/x86.</li>
-<li>Fix symbol resolving error messages on Windows.</li>
-<li>Fix blacklisting of C functions calling callbacks.</li>
-<li>Fix result type of pointer difference.</li>
-<li>Use correct PC in FFI metamethod error message.</li>
-<li>Allow <tt>'typedef _Bool int BOOL;'</tt> for the Windows API.</li>
-<li>Don't record test for bool result of call, if ignored.</li>
-</ul></li>
-</ul>
-
-<h2 id="LuaJIT-2.0.0-beta9">LuaJIT 2.0.0-beta9 &mdash; 2011-12-14</h2>
-<ul>
-<li>New features:
-<ul>
-<li>PPC port of LuaJIT is complete. Default is the dual-number port
-(usually faster). Single-number port selectable via <tt>src/Makefile</tt>
-at build time.</li>
-<li>Add FFI callback support.</li>
-<li>Extend <tt>-b</tt> to generate <tt>.c</tt>, <tt>.h</tt> or <tt>.obj/.o</tt>
-files with embedded bytecode.</li>
-<li>Allow loading embedded bytecode with <tt>require()</tt>.</li>
-<li>From Lua 5.2: Change to <tt>'\z'</tt> escape. Reject undefined escape
-sequences.</li>
-</ul></li>
-<li>Correctness and completeness:
-<ul>
-<li>Fix OSX 10.7 build. Fix <tt>install_name</tt> and versioning on OSX.</li>
-<li>Fix iOS build.</li>
-<li>Install <tt>dis_arm.lua</tt>, too.</li>
-<li>Mark installed shared library as executable.</li>
-<li>Add debug option to <tt>msvcbuild.bat</tt> and improve error handling.</li>
-<li>Fix data-flow analysis for iterators.</li>
-<li>Fix forced unwinding triggered by external unwinder.</li>
-<li>Record missing <tt>for</tt> loop slot loads (return to lower frame).</li>
-<li>Always use ANSI variants of Windows system functions.</li>
-<li>Fix GC barrier for multi-result table constructor (<tt>TSETM</tt>).</li>
-<li>Fix/add various FOLD rules.</li>
-<li>Add potential PHI for number conversions due to type instability.</li>
-<li>Do not eliminate PHIs only referenced from other PHIs.</li>
-<li>Correctly anchor implicit number to string conversions in Lua/C API.</li>
-<li>Fix various stack limit checks.</li>
-<li>x64: Use thread-safe exceptions for external unwinding (GCC platforms).</li>
-<li>x64: Fix result type of cdata index conversions.</li>
-<li>x64: Fix <tt>math.random()</tt> and <tt>bit.bswap()</tt> code generation.</li>
-<li>x64: Fix <tt>lightuserdata</tt> comparisons.</li>
-<li>x64: Always extend stack-passed arguments to pointer size.</li>
-<li>ARM: Many fixes to code generation backend.</li>
-<li>PPC/e500: Fix dispatch for binop metamethods.</li>
-<li>PPC/e500: Save/restore condition registers when entering/leaving the VM.</li>
-<li>PPC/e500: Fix write barrier in stores of strings to upvalues.</li>
-</ul></li>
-<li>FFI library:
-<ul>
-<li>Fix C comment parsing.</li>
-<li>Fix snapshot optimization for cdata comparisons.</li>
-<li>Fix recording of const/enum lookups in namespaces.</li>
-<li>Fix call argument and return handling for <tt>I8/U8/I16/U16</tt> types.</li>
-<li>Fix unfused loads of float fields.</li>
-<li>Fix <tt>ffi.string()</tt> recording.</li>
-<li>Save <tt>GetLastError()</tt> around <tt>ffi.load()</tt> and symbol
-resolving, too.</li>
-<li>Improve ld script detection in <tt>ffi.load()</tt>.</li>
-<li>Record loads/stores to external variables in namespaces.</li>
-<li>Compile calls to stdcall, fastcall and vararg functions.</li>
-<li>Treat function ctypes like pointers in comparisons.</li>
-<li>Resolve <tt>__call</tt> metamethod for pointers, too.</li>
-<li>Record C function calls with bool return values.</li>
-<li>Record <tt>ffi.errno()</tt>.</li>
-<li>x86: Fix number to <tt>uint32_t</tt> conversion rounding.</li>
-<li>x86: Fix 64 bit arithmetic in assembler backend.</li>
-<li>x64: Fix struct-by-value calling conventions.</li>
-<li>ARM: Ensure invocation of SPLIT pass for float conversions.</li>
-</ul></li>
-<li>Structural and performance enhancements:
-<ul>
-<li>Display trace types with <tt>-jv</tt> and <tt>-jdump</tt>.</li>
-<li>Record isolated calls. But prefer recording loops over calls.</li>
-<li>Specialize to prototype for non-monomorphic functions. Solves the
-trace-explosion problem for closure-heavy programming styles.</li>
-<li>Always generate a portable <tt>vmdef.lua</tt>. Easier for distros.</li>
-</ul></li>
-</ul>
-
-<h2 id="LuaJIT-2.0.0-beta8">LuaJIT 2.0.0-beta8 &mdash; 2011-06-23</h2>
-<ul>
-<li>New features:
-<ul>
-<li>Soft-float ARM port of LuaJIT is complete.</li>
-<li>Add support for bytecode loading/saving and <tt>-b</tt> command line
-option.</li>
-<li>From Lua 5.2: <tt>__len</tt> metamethod for tables
-(disabled by default).</li>
-</ul></li>
-<li>Correctness and completeness:
-<ul>
-<li>ARM: Misc. fixes for interpreter.</li>
-<li>x86/x64: Fix <tt>bit.*</tt> argument checking in interpreter.</li>
-<li>Catch early out-of-memory in memory allocator initialization.</li>
-<li>Fix data-flow analysis for paths leading to an upvalue close.</li>
-<li>Fix check for missing arguments in <tt>string.format()</tt>.</li>
-<li>Fix Solaris/x86 build (note: not a supported target).</li>
-<li>Fix recording of loops with instable directions in side traces.</li>
-<li>x86/x64: Fix fusion of comparisons with <tt>u8</tt>/<tt>u16</tt>
-<tt>XLOAD</tt>.</li>
-<li>x86/x64: Fix register allocation for variable shifts.</li>
-</ul></li>
-<li>FFI library:
-<ul>
-<li>Add <tt>ffi.errno()</tt>. Save <tt>errno</tt>/<tt>GetLastError()</tt>
-around allocations etc.</li>
-<li>Fix <tt>__gc</tt> for VLA/VLS cdata objects.</li>
-<li>Fix recording of casts from 32 bit cdata pointers to integers.</li>
-<li><tt>tonumber(cdata)</tt> returns <tt>nil</tt> for non-numbers.</li>
-<li>Show address pointed to for <tt>tostring(pointer)</tt>.</li>
-<li>Print <tt>NULL</tt> pointers as <tt>"cdata&lt;... *&gt;: NULL"</tt>.</li>
-<li>Support <tt>__tostring</tt> metamethod for pointers to structs, too.</li>
-</ul></li>
-<li>Structural and performance enhancements:
-<ul>
-<li>More tuning for loop unrolling heuristics.</li>
-<li>Flatten and compress in-memory debug info (saves ~70%).</li>
-</ul></li>
-</ul>
-
-<h2 id="LuaJIT-2.0.0-beta7">LuaJIT 2.0.0-beta7 &mdash; 2011-05-05</h2>
-<ul>
-<li>New features:
-<ul>
-<li>ARM port of the LuaJIT interpreter is complete.</li>
-<li>FFI library: Add <tt>ffi.gc()</tt>, <tt>ffi.metatype()</tt>,
-<tt>ffi.istype()</tt>.</li>
-<li>FFI library: Resolve ld script redirection in <tt>ffi.load()</tt>.</li>
-<li>From Lua 5.2: <tt>package.searchpath()</tt>, <tt>fp:read("*L")</tt>,
-<tt>load(string)</tt>.</li>
-<li>From Lua 5.2, disabled by default: empty statement,
-<tt>table.unpack()</tt>, modified <tt>coroutine.running()</tt>.</li>
-</ul></li>
-<li>Correctness and completeness:
-<ul>
-<li>FFI library: numerous fixes.</li>
-<li>Fix type mismatches in store-to-load forwarding.</li>
-<li>Fix error handling within metamethods.</li>
-<li>Fix <tt>table.maxn()</tt>.</li>
-<li>Improve accuracy of <tt>x^-k</tt> on x64.</li>
-<li>Fix code generation for Intel Atom in x64 mode.</li>
-<li>Fix narrowing of POW.</li>
-<li>Fix recording of retried fast functions.</li>
-<li>Fix code generation for <tt>bit.bnot()</tt> and multiplies.</li>
-<li>Fix error location within cpcall frames.</li>
-<li>Add workaround for old libgcc unwind bug.</li>
-<li>Fix <tt>lua_yield()</tt> and <tt>getmetatable(lightuserdata)</tt> on x64.</li>
-<li>Misc. fixes for PPC/e500 interpreter.</li>
-<li>Fix stack slot updates for down-recursion.</li>
-</ul></li>
-<li>Structural and performance enhancements:
-<ul>
-<li>Add dual-number mode (int/double) for the VM. Enabled for ARM.</li>
-<li>Improve narrowing of arithmetic operators and <tt>for</tt> loops.</li>
-<li>Tune loop unrolling heuristics and increase trace recorder limits.</li>
-<li>Eliminate dead slots in snapshots using bytecode data-flow analysis.</li>
-<li>Avoid phantom stores to proxy tables.</li>
-<li>Optimize lookups in empty proxy tables.</li>
-<li>Improve bytecode optimization of <tt>and</tt>/<tt>or</tt> operators.</li>
-</ul></li>
-</ul>
-
-<h2 id="LuaJIT-2.0.0-beta6">LuaJIT 2.0.0-beta6 &mdash; 2011-02-11</h2>
-<ul>
-<li>New features:
-<ul>
-<li>PowerPC/e500v2 port of the LuaJIT interpreter is complete.</li>
-<li>Various minor features from Lua 5.2: Hex escapes in literals,
-<tt>'\*'</tt> escape, reversible <tt>string.format("%q",s)</tt>,
-<tt>"%g"</tt> pattern, <tt>table.sort</tt> checks callbacks,
-<tt>os.exit(status|true|false[,close])</tt>.</li>
-<li>Lua 5.2 <tt>__pairs</tt> and <tt>__ipairs</tt> metamethods
-(disabled by default).</li>
-<li>Initial release of the FFI library.</li>
-</ul></li>
-<li>Correctness and completeness:
-<ul>
-<li>Fix <tt>string.format()</tt> for non-finite numbers.</li>
-<li>Fix memory leak when compiled to use the built-in allocator.</li>
-<li>x86/x64: Fix unnecessary resize in <tt>TSETM</tt> bytecode.</li>
-<li>Fix various GC issues with traces and <tt>jit.flush()</tt>.</li>
-<li>x64: Fix fusion of indexes for array references.</li>
-<li>x86/x64: Fix stack overflow handling for coroutine results.</li>
-<li>Enable low-2GB memory allocation on FreeBSD/x64.</li>
-<li>Fix <tt>collectgarbage("count")</tt> result if more than 2GB is in use.</li>
-<li>Fix parsing of hex floats.</li>
-<li>x86/x64: Fix loop branch inversion with trailing
-<tt>HREF+NE/EQ</tt>.</li>
-<li>Add <tt>jit.os</tt> string.</li>
-<li><tt>coroutine.create()</tt> permits running C functions, too.</li>
-<li>Fix OSX build to work with newer ld64 versions.</li>
-<li>Fix bytecode optimization of <tt>and</tt>/<tt>or</tt> operators.</li>
-</ul></li>
-<li>Structural and performance enhancements:
-<ul>
-<li>Emit specialized bytecode for <tt>pairs()</tt>/<tt>next()</tt>.</li>
-<li>Improve bytecode coalescing of <tt>nil</tt> constants.</li>
-<li>Compile calls to vararg functions.</li>
-<li>Compile <tt>select()</tt>.</li>
-<li>Improve alias analysis, esp. for loads from allocations.</li>
-<li>Tuning of various compiler heuristics.</li>
-<li>Refactor and extend IR conversion instructions.</li>
-<li>x86/x64: Various backend enhancements related to the FFI.</li>
-<li>Add SPLIT pass to split 64 bit IR instructions for 32 bit CPUs.</li>
-</ul></li>
-</ul>
-
-<h2 id="LuaJIT-2.0.0-beta5">LuaJIT 2.0.0-beta5 &mdash; 2010-08-24</h2>
-<ul>
-<li>Correctness and completeness:
-<ul>
-<li>Fix trace exit dispatch to function headers.</li>
-<li>Fix Windows and OSX builds with LUAJIT_DISABLE_JIT.</li>
-<li>Reorganize and fix placement of generated machine code on x64.</li>
-<li>Fix TNEW in x64 interpreter.</li>
-<li>Do not eliminate PHIs for values only referenced from side exits.</li>
-<li>OS-independent canonicalization of strings for non-finite numbers.</li>
-<li>Fix <tt>string.char()</tt> range check on x64.</li>
-<li>Fix <tt>tostring()</tt> resolving within <tt>print()</tt>.</li>
-<li>Fix error handling for <tt>next()</tt>.</li>
-<li>Fix passing of constant arguments to external calls on x64.</li>
-<li>Fix interpreter argument check for two-argument SSE math functions.</li>
-<li>Fix C frame chain corruption caused by <tt>lua_cpcall()</tt>.</li>
-<li>Fix return from <tt>pcall()</tt> within active hook.</li>
-</ul></li>
-<li>Structural and performance enhancements:
-<ul>
-<li>Replace on-trace GC frame syncing with interpreter exit.</li>
-<li>Improve hash lookup specialization by not removing dead keys during GC.</li>
-<li>Turn traces into true GC objects.</li>
-<li>Avoid starting a GC cycle immediately after library init.</li>
-<li>Add weak guards to improve dead-code elimination.</li>
-<li>Speed up string interning.</li>
-</ul></li>
-</ul>
-
-<h2 id="LuaJIT-2.0.0-beta4">LuaJIT 2.0.0-beta4 &mdash; 2010-03-28</h2>
-<ul>
-<li>Correctness and completeness:
-<ul>
-<li>Fix precondition for on-trace creation of table keys.</li>
-<li>Fix <tt>{f()}</tt> on x64 when table is resized.</li>
-<li>Fix folding of ordered comparisons with same references.</li>
-<li>Fix snapshot restores for multi-result bytecodes.</li>
-<li>Fix potential hang when recording bytecode with nested closures.</li>
-<li>Fix recording of <tt>getmetatable()</tt>, <tt>tonumber()</tt> and bad argument types.</li>
-<li>Fix SLOAD fusion across returns to lower frames.</li>
-</ul></li>
-<li>Structural and performance enhancements:
-<ul>
-<li>Add array bounds check elimination. <tt>-Oabc</tt> is enabled by default.</li>
-<li>More tuning for x64, e.g. smaller table objects.</li>
-</ul></li>
-</ul>
-
-<h2 id="LuaJIT-2.0.0-beta3">LuaJIT 2.0.0-beta3 &mdash; 2010-03-07</h2>
-<ul>
-<li>LuaJIT x64 port:
-<ul>
-<li>Port integrated memory allocator to Linux/x64, Windows/x64 and OSX/x64.</li>
-<li>Port interpreter and JIT compiler to x64.</li>
-<li>Port DynASM to x64.</li>
-<li>Many 32/64 bit cleanups in the VM.</li>
-<li>Allow building the interpreter with either x87 or SSE2 arithmetics.</li>
-<li>Add external unwinding and C++ exception interop (default on x64).</li>
-</ul></li>
-<li>Correctness and completeness:
-<ul>
-<li>Fix constructor bytecode generation for certain conditional values.</li>
-<li>Fix some cases of ordered string comparisons.</li>
-<li>Fix <tt>lua_tocfunction()</tt>.</li>
-<li>Fix cutoff register in JMP bytecode for some conditional expressions.</li>
-<li>Fix PHI marking algorithm for references from variant slots.</li>
-<li>Fix <tt>package.cpath</tt> for non-default PREFIX.</li>
-<li>Fix DWARF2 frame unwind information for interpreter on OSX.</li>
-<li>Drive the GC forward on string allocations in the parser.</li>
-<li>Implement call/return hooks (zero-cost if disabled).</li>
-<li>Implement yield from C hooks.</li>
-<li>Disable JIT compiler on older non-SSE2 CPUs instead of aborting.</li>
-</ul></li>
-<li>Structural and performance enhancements:
-<ul>
-<li>Compile recursive code (tail-, up- and down-recursion).</li>
-<li>Improve heuristics for bytecode penalties and blacklisting.</li>
-<li>Split CALL/FUNC recording and clean up fast function call semantics.</li>
-<li>Major redesign of internal function call handling.</li>
-<li>Improve FOR loop const specialization and integerness checks.</li>
-<li>Switch to pre-initialized stacks. Avoid frame-clearing.</li>
-<li>Colocation of prototypes and related data: bytecode, constants, debug info.</li>
-<li>Cleanup parser and streamline bytecode generation.</li>
-<li>Add support for weak IR references to register allocator.</li>
-<li>Switch to compressed, extensible snapshots.</li>
-<li>Compile returns to frames below the start frame.</li>
-<li>Improve alias analysis of upvalues using a disambiguation hash value.</li>
-<li>Compile floor/ceil/trunc to SSE2 helper calls or SSE4.1 instructions.</li>
-<li>Add generic C call handling to IR and backend.</li>
-<li>Improve KNUM fuse vs. load heuristics.</li>
-<li>Compile various <tt>io.*()</tt> functions.</li>
-<li>Compile <tt>math.sinh()</tt>, <tt>math.cosh()</tt>, <tt>math.tanh()</tt>
-and <tt>math.random()</tt>.</li>
-</ul></li>
-</ul>
-
-<h2 id="LuaJIT-2.0.0-beta2">LuaJIT 2.0.0-beta2 &mdash; 2009-11-09</h2>
-<ul>
-<li>Reorganize build system. Build static+shared library on POSIX.</li>
-<li>Allow C++ exception conversion on all platforms
-using a wrapper function.</li>
-<li>Automatically catch C++ exceptions and rethrow Lua error
-(DWARF2 only).</li>
-<li>Check for the correct x87 FPU precision at strategic points.</li>
-<li>Always use wrappers for libm functions.</li>
-<li>Resurrect metamethod name strings before copying them.</li>
-<li>Mark current trace, even if compiler is idle.</li>
-<li>Ensure FILE metatable is created only once.</li>
-<li>Fix type comparisons when different integer types are involved.</li>
-<li>Fix <tt>getmetatable()</tt> recording.</li>
-<li>Fix TDUP with dead keys in template table.</li>
-<li><tt>jit.flush(tr)</tt> returns status.
-Prevent manual flush of a trace that's still linked.</li>
-<li>Improve register allocation heuristics for invariant references.</li>
-<li>Compile the push/pop variants of <tt>table.insert()</tt> and
-<tt>table.remove()</tt>.</li>
-<li>Compatibility with MSVC <tt>link&nbsp/debug</tt>.</li>
-<li>Fix <tt>lua_iscfunction()</tt>.</li>
-<li>Fix <tt>math.random()</tt> when compiled with <tt>-fpic</tt> (OSX).</li>
-<li>Fix <tt>table.maxn()</tt>.</li>
-<li>Bump <tt>MACOSX_DEPLOYMENT_TARGET</tt> to <tt>10.4</tt></li>
-<li><tt>luaL_check*()</tt> and <tt>luaL_opt*()</tt> now support
-negative arguments, too.<br>
-This matches the behavior of Lua 5.1, but not the specification.</li>
-</ul>
-
-<h2 id="LuaJIT-2.0.0-beta1">LuaJIT 2.0.0-beta1 &mdash; 2009-10-31</h2>
-<ul>
-<li>This is the first public release of LuaJIT 2.0.</li>
-<li>The whole VM has been rewritten from the ground up, so there's
-no point in listing differences over earlier versions.</li>
-</ul>
-</div>
-
-<div class="major" style="background: #ffff80;">
-<h2 id="LuaJIT-1.1.8">LuaJIT 1.1.8 &mdash; 2012-04-16</h2>
-<ul>
-<li>Merged with Lua 5.1.5. Also integrated fixes for all
-<a href="http://www.lua.org/bugs.html#5.1.5"><span class="ext">&raquo;</span>&nbsp;<span class="ext">&raquo;</span>&nbsp;currently known bugs in Lua 5.1.5</a>.</li>
-</ul>
-
-<h2 id="LuaJIT-1.1.7">LuaJIT 1.1.7 &mdash; 2011-05-05</h2>
-<ul>
-<li>Added fixes for the
-<a href="http://www.lua.org/bugs.html#5.1.4"><span class="ext">&raquo;</span>&nbsp;currently known bugs in Lua 5.1.4</a>.</li>
-</ul>
-
-<h2 id="LuaJIT-1.1.6">LuaJIT 1.1.6 &mdash; 2010-03-28</h2>
-<ul>
-<li>Added fixes for the
-<a href="http://www.lua.org/bugs.html#5.1.4"><span class="ext">&raquo;</span>&nbsp;currently known bugs in Lua 5.1.4</a>.</li>
-<li>Removed wrong GC check in <tt>jit_createstate()</tt>.
-Thanks to Tim Mensch.</li>
-<li>Fixed bad assertions while compiling <tt>table.insert()</tt> and
-<tt>table.remove()</tt>.</li>
-</ul>
-
-<h2 id="LuaJIT-1.1.5">LuaJIT 1.1.5 &mdash; 2008-10-25</h2>
-<ul>
-<li>Merged with Lua 5.1.4. Fixes all
-<a href="http://www.lua.org/bugs.html#5.1.3"><span class="ext">&raquo;</span>&nbsp;known bugs in Lua 5.1.3</a>.</li>
-</ul>
-
-<h2 id="LuaJIT-1.1.4">LuaJIT 1.1.4 &mdash; 2008-02-05</h2>
-<ul>
-<li>Merged with Lua 5.1.3. Fixes all
-<a href="http://www.lua.org/bugs.html#5.1.2"><span class="ext">&raquo;</span>&nbsp;known bugs in Lua 5.1.2</a>.</li>
-<li>Fixed possible (but unlikely) stack corruption while compiling
-<tt>k^x</tt> expressions.</li>
-<li>Fixed DynASM template for cmpss instruction.</li>
-</ul>
-
-<h2 id="LuaJIT-1.1.3">LuaJIT 1.1.3 &mdash; 2007-05-24</h2>
-<ul>
-<li>Merged with Lua 5.1.2. Fixes all
-<a href="http://www.lua.org/bugs.html#5.1.1"><span class="ext">&raquo;</span>&nbsp;known bugs in Lua 5.1.1</a>.</li>
-<li>Merged pending Lua 5.1.x fixes: "return -nil" bug, spurious count hook call.</li>
-<li>Remove a (sometimes) wrong assertion in <tt>luaJIT_findpc()</tt>.</li>
-<li>DynASM now allows labels for displacements and <tt>.aword</tt>.</li>
-<li>Fix some compiler warnings for DynASM glue (internal API change).</li>
-<li>Correct naming for SSSE3 (temporarily known as SSE4) in DynASM and x86 disassembler.</li>
-<li>The loadable debug modules now handle redirection to stdout
-(e.g. <tt>-j&nbsp;trace=-</tt>).</li>
-</ul>
-
-<h2 id="LuaJIT-1.1.2">LuaJIT 1.1.2 &mdash; 2006-06-24</h2>
-<ul>
-<li>Fix MSVC inline assembly: use only local variables with
-<tt>lua_number2int()</tt>.</li>
-<li>Fix "attempt to call a thread value" bug on Mac OS X:
-make values of consts used as lightuserdata keys unique
-to avoid joining by the compiler/linker.</li>
-</ul>
-
-<h2 id="LuaJIT-1.1.1">LuaJIT 1.1.1 &mdash; 2006-06-20</h2>
-<ul>
-<li>Merged with Lua 5.1.1. Fixes all
-<a href="http://www.lua.org/bugs.html#5.1"><span class="ext">&raquo;</span>&nbsp;known bugs in Lua 5.1</a>.</li>
-<li>Enforce (dynamic) linker error for EXE/DLL version mismatches.</li>
-<li>Minor changes to DynASM: faster pre-processing, smaller encoding
-for some immediates.</li>
-</ul>
-<p>
-This release is in sync with Coco 1.1.1 (see the
-<a href="http://coco.luajit.org/changes.html"><span class="ext">&raquo;</span>&nbsp;Coco Change History</a>).
-</p>
-
-<h2 id="LuaJIT-1.1.0">LuaJIT 1.1.0 &mdash; 2006-03-13</h2>
-<ul>
-<li>Merged with Lua 5.1 (final).</li>
-
-<li>New JIT call frame setup:
-<ul>
-<li>The C stack is kept 16 byte aligned (faster).
-Mandatory for Mac OS X on Intel, too.</li>
-<li>Faster calling conventions for internal C helper functions.</li>
-<li>Better instruction scheduling for function prologue, OP_CALL and
-OP_RETURN.</li>
-</ul></li>
-
-<li>Miscellaneous optimizations:
-<ul>
-<li>Faster loads of FP constants. Remove narrow-to-wide store-to-load
-forwarding stalls.</li>
-<li>Use (scalar) SSE2 ops (if the CPU supports it) to speed up slot moves
-and FP to integer conversions.</li>
-<li>Optimized the two-argument form of <tt>OP_CONCAT</tt> (<tt>a..b</tt>).</li>
-<li>Inlined <tt>OP_MOD</tt> (<tt>a%b</tt>).
-With better accuracy than the C variant, too.</li>
-<li>Inlined <tt>OP_POW</tt> (<tt>a^b</tt>). Unroll <tt>x^k</tt> or
-use <tt>k^x = 2^(log2(k)*x)</tt> or call <tt>pow()</tt>.</li>
-</ul></li>
-
-<li>Changes in the optimizer:
-<ul>
-<li>Improved hinting for table keys derived from table values
-(<tt>t1[t2[x]]</tt>).</li>
-<li>Lookup hinting now works with arbitrary object types and
-supports index chains, too.</li>
-<li>Generate type hints for arithmetic and comparison operators,
-OP_LEN, OP_CONCAT and OP_FORPREP.</li>
-<li>Remove several hint definitions in favour of a generic COMBINE hint.</li>
-<li>Complete rewrite of <tt>jit.opt_inline</tt> module
-(ex <tt>jit.opt_lib</tt>).</li>
-</ul></li>
-
-<li>Use adaptive deoptimization:
-<ul>
-<li>If runtime verification of a contract fails, the affected
-instruction is recompiled and patched on-the-fly.
-Regular programs will trigger deoptimization only occasionally.</li>
-<li>This avoids generating code for uncommon fallback cases
-most of the time. Generated code is up to 30% smaller compared to
-LuaJIT&nbsp;1.0.3.</li>
-<li>Deoptimization is used for many opcodes and contracts:
-<ul>
-<li>OP_CALL, OP_TAILCALL: type mismatch for callable.</li>
-<li>Inlined calls: closure mismatch, parameter number and type mismatches.</li>
-<li>OP_GETTABLE, OP_SETTABLE: table or key type and range mismatches.</li>
-<li>All arithmetic and comparison operators, OP_LEN, OP_CONCAT,
-OP_FORPREP: operand type and range mismatches.</li>
-</ul></li>
-<li>Complete redesign of the debug and traceback info
-(bytecode &harr; mcode) to support deoptimization.
-Much more flexible and needs only 50% of the space.</li>
-<li>The modules <tt>jit.trace</tt>, <tt>jit.dumphints</tt> and
-<tt>jit.dump</tt> handle deoptimization.</li>
-</ul></li>
-
-<li>Inlined many popular library functions
-(for commonly used arguments only):
-<ul>
-<li>Most <tt>math.*</tt> functions (the 18 most used ones)
-[2x-10x faster].</li>
-<li><tt>string.len</tt>, <tt>string.sub</tt> and <tt>string.char</tt>
-[2x-10x faster].</li>
-<li><tt>table.insert</tt>, <tt>table.remove</tt> and <tt>table.getn</tt>
-[3x-5x faster].</li>
-<li><tt>coroutine.yield</tt> and <tt>coroutine.resume</tt>
-[3x-5x faster].</li>
-<li><tt>pairs</tt>, <tt>ipairs</tt> and the corresponding iterators
-[8x-15x faster].</li>
-</ul></li>
-
-<li>Changes in the core and loadable modules and the stand-alone executable:
-<ul>
-<li>Added <tt>jit.version</tt>, <tt>jit.version_num</tt>
-and <tt>jit.arch</tt>.</li>
-<li>Reorganized some internal API functions (<tt>jit.util.*mcode*</tt>).</li>
-<li>The <tt>-j dump</tt> output now shows JSUB names, too.</li>
-<li>New x86 disassembler module written in pure Lua. No dependency
-on ndisasm anymore. Flexible API, very compact (500 lines)
-and complete (x87, MMX, SSE, SSE2, SSE3, SSSE3, privileged instructions).</li>
-<li><tt>luajit -v</tt> prints the LuaJIT version and copyright
-on a separate line.</li>
-</ul></li>
-
-<li>Added SSE, SSE2, SSE3 and SSSE3 support to DynASM.</li>
-<li>Miscellaneous doc changes. Added a section about
-<a href="install.html#embedding">embedding LuaJIT</a>.</li>
-</ul>
-<p>
-This release is in sync with Coco 1.1.0 (see the
-<a href="http://coco.luajit.org/changes.html"><span class="ext">&raquo;</span>&nbsp;Coco Change History</a>).
-</p>
-</div>
-
-<div class="major" style="background: #ffffd0;">
-<h2 id="LuaJIT-1.0.3">LuaJIT 1.0.3 &mdash; 2005-09-08</h2>
-<ul>
-<li>Even more docs.</li>
-<li>Unified closure checks in <tt>jit.*</tt>.</li>
-<li>Fixed some range checks in <tt>jit.util.*</tt>.</li>
-<li>Fixed __newindex call originating from <tt>jit_settable_str()</tt>.</li>
-<li>Merged with Lua 5.1 alpha (including early bug fixes).</li>
-</ul>
-<p>
-This is the first public release of LuaJIT.
-</p>
-
-<h2 id="LuaJIT-1.0.2">LuaJIT 1.0.2 &mdash; 2005-09-02</h2>
-<ul>
-<li>Add support for flushing the Valgrind translation cache <br>
-(<tt>MYCFLAGS= -DUSE_VALGRIND</tt>).</li>
-<li>Add support for freeing executable mcode memory to the <tt>mmap()</tt>-based
-variant for POSIX systems.</li>
-<li>Reorganized the C&nbsp;function signature handling in
-<tt>jit.opt_lib</tt>.</li>
-<li>Changed to index-based hints for inlining C&nbsp;functions.
-Still no support in the backend for inlining.</li>
-<li>Hardcode <tt>HEAP_CREATE_ENABLE_EXECUTE</tt> value if undefined.</li>
-<li>Misc. changes to the <tt>jit.*</tt> modules.</li>
-<li>Misc. changes to the Makefiles.</li>
-<li>Lots of new docs.</li>
-<li>Complete doc reorg.</li>
-</ul>
-<p>
-Not released because Lua 5.1 alpha came out today.
-</p>
-
-<h2 id="LuaJIT-1.0.1">LuaJIT 1.0.1 &mdash; 2005-08-31</h2>
-<ul>
-<li>Missing GC step in <tt>OP_CONCAT</tt>.</li>
-<li>Fix result handling for C &ndash;> JIT calls.</li>
-<li>Detect CPU feature bits.</li>
-<li>Encode conditional moves (<tt>fucomip</tt>) only when supported.</li>
-<li>Add fallback instructions for FP compares.</li>
-<li>Add support for <tt>LUA_COMPAT_VARARG</tt>. Still disabled by default.</li>
-<li>MSVC needs a specific place for the <tt>CALLBACK</tt> attribute
-(David Burgess).</li>
-<li>Misc. doc updates.</li>
-</ul>
-<p>
-Interim non-public release.
-Special thanks to Adam D. Moss for reporting most of the bugs.
-</p>
-
-<h2 id="LuaJIT-1.0.0">LuaJIT 1.0.0 &mdash; 2005-08-29</h2>
-<p>
-This is the initial non-public release of LuaJIT.
-</p>
-</div>
-<br class="flush">
-</div>
-<div id="foot">
-<hr class="hide">
-Copyright &copy; 2005-2014 Mike Pall
-<span class="noprint">
-&middot;
-<a href="contact.html">Contact</a>
-</span>
-</div>
-</body>
-</html>

+ 0 - 102
lib/luajit/doc/contact.html

@@ -1,102 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
-<title>Contact</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<meta name="Author" content="Mike Pall">
-<meta name="Copyright" content="Copyright (C) 2005-2014, Mike Pall">
-<meta name="Language" content="en">
-<link rel="stylesheet" type="text/css" href="bluequad.css" media="screen">
-<link rel="stylesheet" type="text/css" href="bluequad-print.css" media="print">
-</head>
-<body>
-<div id="site">
-<a href="http://luajit.org"><span>Lua<span id="logo">JIT</span></span></a>
-</div>
-<div id="head">
-<h1>Contact</h1>
-</div>
-<div id="nav">
-<ul><li>
-<a href="luajit.html">LuaJIT</a>
-<ul><li>
-<a href="http://luajit.org/download.html">Download <span class="ext">&raquo;</span></a>
-</li><li>
-<a href="install.html">Installation</a>
-</li><li>
-<a href="running.html">Running</a>
-</li></ul>
-</li><li>
-<a href="extensions.html">Extensions</a>
-<ul><li>
-<a href="ext_ffi.html">FFI Library</a>
-<ul><li>
-<a href="ext_ffi_tutorial.html">FFI Tutorial</a>
-</li><li>
-<a href="ext_ffi_api.html">ffi.* API</a>
-</li><li>
-<a href="ext_ffi_semantics.html">FFI Semantics</a>
-</li></ul>
-</li><li>
-<a href="ext_jit.html">jit.* Library</a>
-</li><li>
-<a href="ext_c_api.html">Lua/C API</a>
-</li></ul>
-</li><li>
-<a href="status.html">Status</a>
-<ul><li>
-<a href="changes.html">Changes</a>
-</li></ul>
-</li><li>
-<a href="faq.html">FAQ</a>
-</li><li>
-<a href="http://luajit.org/performance.html">Performance <span class="ext">&raquo;</span></a>
-</li><li>
-<a href="http://wiki.luajit.org/">Wiki <span class="ext">&raquo;</span></a>
-</li><li>
-<a href="http://luajit.org/list.html">Mailing List <span class="ext">&raquo;</span></a>
-</li></ul>
-</div>
-<div id="main">
-<p>
-Please send general questions to the
-<a href="http://luajit.org/list.html"><span class="ext">&raquo;</span>&nbsp;LuaJIT mailing list</a>.
-You can also send any questions you have directly to me:
-</p>
-
-<script type="text/javascript">
-<!--
-var xS="@-:\" .0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ<abc>defghijklmnopqrstuvwxyz";function xD(s)
-{var len=s.length;var r="";for(var i=0;i<len;i++)
-{var c=s.charAt(i);var n=xS.indexOf(c);if(n!=-1)c=xS.charAt(69-n);r+=c;}
-document.write("<"+"p>"+r+"<"+"/p>\n");}
-//-->
-</script>
-<script type="text/javascript">
-<!--
-xD("fyZKB8xv\"FJytmz8.KAB0u52D")
-//--></script>
-<noscript>
-<p><img src="img/contact.png" alt="Contact info in image" width="170" height="13">
-</p>
-</noscript>
-
-<h2>Copyright</h2>
-<p>
-All documentation is
-Copyright &copy; 2005-2014 Mike Pall.
-</p>
-
-
-<br class="flush">
-</div>
-<div id="foot">
-<hr class="hide">
-Copyright &copy; 2005-2014 Mike Pall
-<span class="noprint">
-&middot;
-<a href="contact.html">Contact</a>
-</span>
-</div>
-</body>
-</html>

+ 0 - 187
lib/luajit/doc/ext_c_api.html

@@ -1,187 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
-<title>Lua/C API Extensions</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<meta name="Author" content="Mike Pall">
-<meta name="Copyright" content="Copyright (C) 2005-2014, Mike Pall">
-<meta name="Language" content="en">
-<link rel="stylesheet" type="text/css" href="bluequad.css" media="screen">
-<link rel="stylesheet" type="text/css" href="bluequad-print.css" media="print">
-</head>
-<body>
-<div id="site">
-<a href="http://luajit.org"><span>Lua<span id="logo">JIT</span></span></a>
-</div>
-<div id="head">
-<h1>Lua/C API Extensions</h1>
-</div>
-<div id="nav">
-<ul><li>
-<a href="luajit.html">LuaJIT</a>
-<ul><li>
-<a href="http://luajit.org/download.html">Download <span class="ext">&raquo;</span></a>
-</li><li>
-<a href="install.html">Installation</a>
-</li><li>
-<a href="running.html">Running</a>
-</li></ul>
-</li><li>
-<a href="extensions.html">Extensions</a>
-<ul><li>
-<a href="ext_ffi.html">FFI Library</a>
-<ul><li>
-<a href="ext_ffi_tutorial.html">FFI Tutorial</a>
-</li><li>
-<a href="ext_ffi_api.html">ffi.* API</a>
-</li><li>
-<a href="ext_ffi_semantics.html">FFI Semantics</a>
-</li></ul>
-</li><li>
-<a href="ext_jit.html">jit.* Library</a>
-</li><li>
-<a class="current" href="ext_c_api.html">Lua/C API</a>
-</li></ul>
-</li><li>
-<a href="status.html">Status</a>
-<ul><li>
-<a href="changes.html">Changes</a>
-</li></ul>
-</li><li>
-<a href="faq.html">FAQ</a>
-</li><li>
-<a href="http://luajit.org/performance.html">Performance <span class="ext">&raquo;</span></a>
-</li><li>
-<a href="http://wiki.luajit.org/">Wiki <span class="ext">&raquo;</span></a>
-</li><li>
-<a href="http://luajit.org/list.html">Mailing List <span class="ext">&raquo;</span></a>
-</li></ul>
-</div>
-<div id="main">
-<p>
-LuaJIT adds some extensions to the standard Lua/C API. The LuaJIT include
-directory must be in the compiler search path (<tt>-I<i>path</i></tt>)
-to be able to include the required header for C code:
-</p>
-<pre class="code">
-#include "luajit.h"
-</pre>
-<p>
-Or for C++ code:
-</p>
-<pre class="code">
-#include "lua.hpp"
-</pre>
-
-<h2 id="luaJIT_setmode"><tt>luaJIT_setmode(L, idx, mode)</tt>
-&mdash; Control VM</h2>
-<p>
-This is a C API extension to allow control of the VM from C code. The
-full prototype of <tt>LuaJIT_setmode</tt> is:
-</p>
-<pre class="code">
-LUA_API int luaJIT_setmode(lua_State *L, int idx, int mode);
-</pre>
-<p>
-The returned status is either success (<tt>1</tt>) or failure (<tt>0</tt>).
-The second argument is either <tt>0</tt> or a stack index (similar to the
-other Lua/C API functions).
-</p>
-<p>
-The third argument specifies the mode, which is 'or'ed with a flag.
-The flag can be <tt>LUAJIT_MODE_OFF</tt> to turn a feature on,
-<tt>LUAJIT_MODE_ON</tt> to turn a feature off, or
-<tt>LUAJIT_MODE_FLUSH</tt> to flush cached code.
-</p>
-<p>
-The following modes are defined:
-</p>
-
-<h3 id="mode_engine"><tt>luaJIT_setmode(L, 0, LUAJIT_MODE_ENGINE|flag)</tt></h3>
-<p>
-Turn the whole JIT compiler on or off or flush the whole cache of compiled code.
-</p>
-
-<h3 id="mode_func"><tt>luaJIT_setmode(L, idx, LUAJIT_MODE_FUNC|flag)</tt><br>
-<tt>luaJIT_setmode(L, idx, LUAJIT_MODE_ALLFUNC|flag)</tt><br>
-<tt>luaJIT_setmode(L, idx, LUAJIT_MODE_ALLSUBFUNC|flag)</tt></h3>
-<p>
-This sets the mode for the function at the stack index <tt>idx</tt> or
-the parent of the calling function (<tt>idx = 0</tt>). It either
-enables JIT compilation for a function, disables it and flushes any
-already compiled code or only flushes already compiled code. This
-applies recursively to all sub-functions of the function with
-<tt>LUAJIT_MODE_ALLFUNC</tt> or only to the sub-functions with
-<tt>LUAJIT_MODE_ALLSUBFUNC</tt>.
-</p>
-
-<h3 id="mode_trace"><tt>luaJIT_setmode(L, trace,<br>
-&nbsp;&nbsp;LUAJIT_MODE_TRACE|LUAJIT_MODE_FLUSH)</tt></h3>
-<p>
-Flushes the specified root trace and all of its side traces from the cache.
-The code for the trace will be retained as long as there are any other
-traces which link to it.
-</p>
-
-<h3 id="mode_wrapcfunc"><tt>luaJIT_setmode(L, idx, LUAJIT_MODE_WRAPCFUNC|flag)</tt></h3>
-<p>
-This mode defines a wrapper function for calls to C functions. If
-called with <tt>LUAJIT_MODE_ON</tt>, the stack index at <tt>idx</tt>
-must be a <tt>lightuserdata</tt> object holding a pointer to the wrapper
-function. From now on all C functions are called through the wrapper
-function. If called with <tt>LUAJIT_MODE_OFF</tt> this mode is turned
-off and all C functions are directly called.
-</p>
-<p>
-The wrapper function can be used for debugging purposes or to catch
-and convert foreign exceptions. But please read the section on
-<a href="extensions.html#exceptions">C++&nbsp;exception interoperability</a>
-first. Recommended usage can be seen in this C++ code excerpt:
-</p>
-<pre class="code">
-#include &lt;exception&gt;
-#include "lua.hpp"
-
-// Catch C++ exceptions and convert them to Lua error messages.
-// Customize as needed for your own exception classes.
-static int wrap_exceptions(lua_State *L, lua_CFunction f)
-{
-  try {
-    return f(L);  // Call wrapped function and return result.
-  } catch (const char *s) {  // Catch and convert exceptions.
-    lua_pushstring(L, s);
-  } catch (std::exception& e) {
-    lua_pushstring(L, e.what());
-  } catch (...) {
-    lua_pushliteral(L, "caught (...)");
-  }
-  return lua_error(L);  // Rethrow as a Lua error.
-}
-
-static int myinit(lua_State *L)
-{
-  ...
-  // Define wrapper function and enable it.
-  lua_pushlightuserdata(L, (void *)wrap_exceptions);
-  luaJIT_setmode(L, -1, LUAJIT_MODE_WRAPCFUNC|LUAJIT_MODE_ON);
-  lua_pop(L, 1);
-  ...
-}
-</pre>
-<p>
-Note that you can only define <b>a single global wrapper function</b>,
-so be careful when using this mechanism from multiple C++ modules.
-Also note that this mechanism is not without overhead.
-</p>
-<br class="flush">
-</div>
-<div id="foot">
-<hr class="hide">
-Copyright &copy; 2005-2014 Mike Pall
-<span class="noprint">
-&middot;
-<a href="contact.html">Contact</a>
-</span>
-</div>
-</body>
-</html>

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor