cbuchner1 / driver_leap

OpenVR Driver for Leap Motion
BSD 3-Clause "New" or "Revised" License
220 stars 73 forks source link

How to get this running from source code? #22

Open FDanner opened 7 years ago

FDanner commented 7 years ago

hello world, I would like to play around with the code and try to tweak some stuff. I have Visual Studio 15 but no experience with it at all. Just opening the project and hitting compile does obviously not work. I'm a web developer(php, javascript etc.) so excuse my noobish question. I think if I could only get it running from a self compiled source I might be able to find some improvements by trial and error :) I'd like to tweak gestures and map some actions to hardware buttons (keyboard or gamepad). Can anyone provide a foolproof step by step guide how to get this running from source?

ajayyy commented 7 years ago

First, I'd like to see what you come up with when your done because it sounds interesting. Second, do you have the code in visual studio now? You also need Open VR SDK 1.0.0

FDanner commented 7 years ago

Thank you for your input. OpenVR missing was part of the problem and also LeapSDK. I got both and found out that I have to set the paths in the "Paths.props"-file. After having tried the newest OpenVR version I got version 1.0.0. Unfortunatly I still get errors when trying to build the project in visual studio 15. (I translate from german): "rapidjson/document.h" no such file or directory unexpected end of file while searching for precompiled header, maybe you forgot to add "#include pch.h" to the source", any idea how to solve this?

FDanner commented 7 years ago

I got rapidjson from https://github.com/miloyip/rapidjson and copied the folder "rapidjson/include/rapidjson" to "driver_leap\tools\config_tool\rapidjson" and the error about rapidjson went away. Then second error about "pch.h" remained. I found "leap_driver > properties > C/C++ > precompiled Headers > disabled" makes this error go away, I dont know what this is and get other errors now about mkdir and copying files fails with "code 4" ...I'll try again another day.

ajayyy commented 7 years ago

My computer is currently broken, but when I get it working I can try to see how I got it working

ajayyy commented 7 years ago

@FDanner Did you get it working? M computer is now working so I could check how I got it working for you.

FDanner commented 7 years ago

Hi ajayyy,

I got it partly working. The postbuild still fails. There is the following line in "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets" that makes the build fail:

When I comment the line out the build works. I could manually overwrite the leap.dll with my selfcompiled leap.dll and append "hello world" to a logfile with my source modification :)

Without commenting the line out it's failing, seams like it's trying to copy files and create directories but fails with "Code 4" whatever that means... any idea?

PS: One more feature I would like to add is to disable the driver for SteamVR Apps that have native leapmotion support like Bigscreen Beta or Altspace. Having virtual steam controllers and virtual hands at the same time in too much :)

FDanner commented 7 years ago

found the postbuild commands in driver_leap.vcxproj

mkdir "$(InstallDir)\bin\Win64" makes it fail because the directory already exists

xcopy /s /i /y "$(SolutionDir)\resources" "$(InstallDir)\resources" makes it fail because the source directory does not exist, what is this, am I missing something?

It compiles successfully with both commented out.

ajayyy commented 7 years ago

@FDanner That's weird, didn't have that error. So, you got it working?

FDanner commented 7 years ago

it's working now. Just managed to use the shift key for the system menu instead of the timeout gesture.

ajayyy commented 7 years ago

@FDanner Awesome.

zivzv commented 7 years ago

@FDanner Hi

encountered the same errors as you.

i fix the:

include pch.h by disable precompiled header

the Code 4 by change the settings in driver_leap - preprocessor definitions - to all yes

and SDKDDKVer.h/windows.h by add their location u=in - additional include dirctories

but now i get the “Only Win32 target is supported!” error

Were you able to fix it?

Hawat3000 commented 6 years ago

Edit: Fixed: Ok, I was fetching OpenVR v1. not 0.9.19

I am trying to make Alpha 0.3 works from source code but the driver_leap.cpp give me 70 errors. I think I have not taken any steps step... Basic errors like: