leapMotion.inc 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. //-----------------------------------------------------------------------------
  3. // Copyright (c) 2012 GarageGames, LLC
  4. //
  5. // Permission is hereby granted, free of charge, to any person obtaining a copy
  6. // of this software and associated documentation files (the "Software"), to
  7. // deal in the Software without restriction, including without limitation the
  8. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  9. // sell copies of the Software, and to permit persons to whom the Software is
  10. // furnished to do so, subject to the following conditions:
  11. //
  12. // The above copyright notice and this permission notice shall be included in
  13. // all copies or substantial portions of the Software.
  14. //
  15. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  20. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  21. // IN THE SOFTWARE.
  22. //-----------------------------------------------------------------------------
  23. beginModule( 'leapMotion' );
  24. // Look for the optional global from the project.conf.
  25. global $LEAPMOTION_SDK_PATH;
  26. if (!$LEAPMOTION_SDK_PATH)
  27. {
  28. // First look for an environment var.
  29. $LEAPMOTION_SDK_PATH = getenv( "TORQUE_LEAPMOTION_PATH" );
  30. if (strlen($LEAPMOTION_SDK_PATH) == 0 || !file_exists($LEAPMOTION_SDK_PATH))
  31. {
  32. // Sometimes users get confused and use this var.
  33. $LEAPMOTION_SDK_PATH = getenv( "LEAPMOTION_SDK_PATH" );
  34. }
  35. // We need forward slashes for paths.
  36. $LEAPMOTION_SDK_PATH = str_replace( "\\", "/", $LEAPMOTION_SDK_PATH);
  37. // Remove trailing slashes.
  38. $LEAPMOTION_SDK_PATH = rtrim($LEAPMOTION_SDK_PATH, " /");
  39. }
  40. // If we still don't have the SDK path then let the user know.
  41. if (!file_exists($LEAPMOTION_SDK_PATH))
  42. {
  43. trigger_error(
  44. "\n*******************************************************************".
  45. "\n".
  46. "\n We were not able to find a valid path to the Leap Motion SDK!".
  47. "\n".
  48. "\n You must install the latest Sixense SDK and set the path via a".
  49. "\n \$LEAPMOTION_SDK_PATH variable in your buildFiles/project.conf file".
  50. "\n or by setting the TORQUE_LEAPMOTION_PATH system environment variable".
  51. "\n (may require a reboot).".
  52. "\n".
  53. "\n*******************************************************************".
  54. "\n", E_USER_ERROR );
  55. }
  56. // Only Windows is supported at this time
  57. if ( T3D_Generator::$platform == "win32" )
  58. {
  59. // Source
  60. addEngineSrcDir( "platform/input/leapMotion" );
  61. // Includes
  62. addIncludePath( $LEAPMOTION_SDK_PATH . "/include" );
  63. // Libs
  64. addProjectLibDir( $LEAPMOTION_SDK_PATH . "/lib/x86" );
  65. addProjectLibInput( "Leap.lib", "Leapd.lib" );
  66. // File Copy for Release
  67. copyFileToProject( $LEAPMOTION_SDK_PATH . "/lib/x86/Leap.dll", "/game/Leap.dll" );
  68. // File Copy for Debug
  69. copyFileToProject( $LEAPMOTION_SDK_PATH . "/lib/x86/Leapd.dll", "/game/Leapd.dll" );
  70. }
  71. endModule();
  72. ?>