jackgerrits/opengl-car-game

I encountered some problems in compiling with cmake.

shenao1994 opened this issue · 3 comments

I use cmakegui to compile, but the following errors will be reported during the compilation process:`CMake Error at CMakeLists.txt:74 (find_package):
By not providing "Findglfw3.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "glfw3", but
CMake did not find one.

**Could not find a package configuration file provided by "glfw3" with any of
the following names:

glfw3Config.cmake
glfw3-config.cmake

Add the installation prefix of "glfw3" to CMAKE_PREFIX_PATH or set
"glfw3_DIR" to a directory containing one of the above files. If "glfw3"
provides a separate development package or SDK, be sure it has been
installed.**
I can't find the OpenGL library, but I don't know how to solve it. Can you help me solve it?Thanks!

CMake can't find the glfw3 dependency. Is it installed?

If you're using Windows I'd recommend using vcpkg for the dependencies. You'll need to install the deps:

vcpkg install --triplet x64-windows glfw3 glm

Then when using CMake GUI I think you can choose the toolchain file. In the end it needs to see these variables to find the dependencies:

  • -DCMAKE_TOOLCHAIN_FILE="[vcpkg root]\scripts\buildsystems\vcpkg.cmake"
  • -DVCPKG_TARGET_TRIPLET=x64-windows

CMake can't find the glfw3 dependency. Is it installed?

If you're using Windows I'd recommend using vcpkg for the dependencies. You'll need to install the deps:

vcpkg install --triplet x64-windows glfw3 glm

Then when using CMake GUI I think you can choose the toolchain file. In the end it needs to see these variables to find the dependencies:

  • -DCMAKE_TOOLCHAIN_FILE="[vcpkg root]\scripts\buildsystems\vcpkg.cmake"
  • -DVCPKG_TARGET_TRIPLET=x64-windows
  • -DCMAKE_TOOLCHAIN_FILE="[vcpkg root]\scripts\buildsystems\vcpkg.cmake"
  • -DVCPKG_TARGET_TRIPLET=x64-windows
    Sorry, I still don't know where to write these two lines of code. I'm very unfamiliar with cmake. Can you make it clearer? Thank you very much.

I don't often use CMake GUI, but from a quick look it looks like you press "Add Entry" to define variables. Not sure if it works the same way as command line usage of CMake.

image