2

I am installing libfreenect2 on Linux.

I am following the steps given in https://github.com/OpenKinect/libfreenect2.

Command

cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/freenect2"

gives me an error:

"CMake Error: The source directory "/home/shubham" does not appear to contain CMakeLists.txt.

When I searched for "CMakeLists.txt" file, it is in the libfreenect2 folder.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Shubham D
  • 79
  • 1
  • 7
  • 1
    So the first argument to `cmake` (`..`) should point to the directory which contains `CMakeLists.txt`. Probably, you forgot to create `build/` subdirectory in your project and going (`cd`) into it. (In other words, this line from the manual: `mkdir build && cd build` should be performed from the root directory of the project, which contains `CMakeLists.txt` file). – Tsyvarev Sep 17 '17 at 08:17
  • Thank you @Tsyvarev – Shubham D Sep 17 '17 at 08:31
  • @Tsyvarev Can you tell me what does "You need to specify cmake -Dfreenect2_DIR=$HOME/freenect2/lib/cmake/freenect2 for CMake based third-party application to find libfreenect2." this means? – Shubham D Sep 17 '17 at 08:36
  • 1
    You are installing `freenect2` which is **library**, so it is usefull only for other project, which uses this library. For such project, if it is written using CMake and uses `find_package(freenect2)` for work with the library, you should pass given argument to `cmake`. See also documentation for [find_package](https://cmake.org/cmake/help/v3.9/command/find_package.html) command. – Tsyvarev Sep 17 '17 at 09:49
  • Thanks @Tsyvarev – Shubham D Sep 18 '17 at 14:02

0 Answers0