I’m trying to build OpenGL sample code in nVidia’s github repo on a remote ubuntu where I am only a normal user and therefore can’t use sudo apt-get install
to install packages into system. The sample I’m trying to build is gl_cadscene_rendertechniques
. At the cmake
phase, it complains that it could not find Xcursor
. I found that the complaint arose from line 177 of nvpro-samples/nvpro_core/third_party/glfw/CMakeLists.txt
:
if (NOT X11_Xcursor_INCLUDE_PATH)
So, I installed Xcursor’s development package libxcursor-dev
, among others, in my user space. Then I set the value of X11_Xcursor_INCLUDE_PATH
to the path that contains Xcursor’s header X11/Xcursor/Xcursor.h
, i.e., the parent directory of X11
, by -D
command-line option of cmake
. After that, cmake
finished successfully. At the make
phase, however, I received an error
In file included from $HOME/nvpro-samples/nvpro_core/third_party/glfw/src/internal.h:188,
from $HOME/nvpro-samples/nvpro_core/third_party/glfw/src/context.c:30:
$HOME/nvpro-samples/nvpro_core/third_party/glfw/src/x11_platform.h:37:10: fatal error: X11/Xcursor/Xcursor.h: No such file or directory
37 | #include <X11/Xcursor/Xcursor.h>
| ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
My question is: since I have told cmake
the directory containing the header X11/Xcursor/Xcursor.h
via variable X11_Xcursor_INCLUDE_PATH
, why can’t cmake
set the gcc
’s -I
option accordingly? Does the sample code attempt to form the -I
option in generated Makefile
using values in X11_Xcursor_INCLUDE_PATH
variable? If so, did I miss anything in the cmake
phase for this purpose?
PS, I know I can set environment variable to specify additional include path during make
, but I just want to know if I can use the value of X11_Xcursor_INCLUDE_PATH
variable set in cmake
command line to specify this. Thanks.