billyquith / GWork

Skinnable GUI with useful widget collection. Fork of GWEN.
https://billyquith.github.io/GWork/
Other
218 stars 30 forks source link

Can't find SDL2 when generating project on Windows using cmake #58

Closed e3dos closed 7 years ago

e3dos commented 7 years ago

I tried using cmake, but it gives the following error:

CMake Error at C:/Program Files/CMake/share/cmake-3.9/Modules/FindPackageHandleS
tandardArgs.cmake:137 (message):
  Could NOT find SDL2 (missing: SDL2_LIBRARY SDL2_INCLUDE_DIR)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.9/Modules/FindPackageHandleStandardArgs.c
make:377 (_FPHSA_FAILURE_MESSAGE)
  cmake/Modules/FindSDL2.cmake:169 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  cmake/Config.cmake:121 (find_package)
  CMakeLists.txt:29 (include)

how to proceed?

eXpl0it3r commented 7 years ago

The error already tells you what the issue is. It couldn't find SDL2. So you need to set SDL2_PATH to tell CMake where to find SDL2.

billyquith commented 7 years ago

Hi. The error you are reporting is not an error with cmake or the GWork project settings. As @eXpl0it3r mentions, the error is telling you that SDL2 cannot be found. This might be because you don't have it installed, or because there is no standard install directory on Windows, unlike UNIX. If you look in the FindSDL.cmake file you'll see a list of paths where cmake looks for SDL2. When you generate your project you could pass in SDL2_PATH=<my SDL2 install location>. E.g.

cmake .. -G <project type> SDL2_PATH="c:\install"

Where c:\install contains the SDL2 include and lib directories.

If you haven't used cmake before I'd suggest reading their docs. There are also plenty of tutorials you can find by Googling.

billyquith commented 7 years ago

Closing as not a bug.