sueda / fbx-extract

Extracts data from an fbx file
MIT License
42 stars 4 forks source link

CMake Error: Environment variable for GLM_INCLUDE_DIR #4

Open domattioli opened 2 years ago

domattioli commented 2 years ago

I git cloned the GLM library to the same directory that I've cloned fbx-extract. I went into the glm library and performed the cmake command:

/usr/include/glm/cmake$ cmake ..
-- GLM: Version 0.9.9.9
GLM: GCC - GNU compiler
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/include/glm/cmake

Following your instructions, I get a CMake error:

/usr/include/fbx-extract/build$ sudo cmake ..
CMake Error at CMakeLists.txt:31 (MESSAGE):
  Please point the environment variable GLM_INCLUDE_DIR to the root directory
  of your GLM installation.

-- Configuring incomplete, errors occurred!
See also "/usr/include/fbx-extract/build/CMakeFiles/CMakeOutput.log".

I'm using Ubuntu on Windows. Here is the end of my ~/.profile file: export GLM_INCLUDE_DIR="/usr/include/glm"

And a sanity check:

/usr/include/fbx-extract/build$ echo $GLM_INCLUDE_DIR
/usr/include/glm

What have I done wrong?

domattioli commented 2 years ago

Here is the CMakeOutput.log file.

sueda commented 2 years ago

Please see the writeup here on setting up the environment.

domattioli commented 2 years ago

I did follow the write-up, installing each of GLM, GLEW, and GLFW. My environment variable also includes the respective directories as I have shown above, however, fbx-extract's cmake output suggests that there is a mismatch between it's reading of the environment variable and the actual value.

sueda commented 2 years ago

What does ls $GLM_INCLUDE_DIR output?

➜  ~ ls $GLM_INCLUDE_DIR
CMakeLists.txt copying.txt    glm            readme.md      util
cmake          doc            manual.md      test
domattioli commented 2 years ago
$ ls $GLM_INCLUDE_DIR
CMakeCache.txt  CMakeLists.txt       Makefile  cmake_install.cmake  doc  manual.md  test
CMakeFiles      CTestTestfile.cmake  cmake     copying.txt          glm  readme.md  util

The build succeeds if I go into the CMakeLists.txt file and hardcode the directory for GLM.

sueda commented 2 years ago

It may be a version issue. Maybe it would be better to include the GLM source in the project to increase compatibility. I'll keep this issue open for now. (Good to hear you got it to work by hardcoding.)

sascharo commented 2 years ago

I had the same error, but it was built after setting CMAKE_PROJECT_NAME as a user env to the latest GLM I had cloned from GitHub. I used CLion.