bfops
bfops

Reputation: 5678

Setting up SDL on Visual Studio with CMake

My primary IDE is Visual Studio 10.0, so MSVC is my compiler. I'm building a CMake-based project, and need to install SDL and SDL_Mixer. What's the proper way to go about this, so CMake recognizes I have these things installed?

Thanks!

Upvotes: 1

Views: 3098

Answers (1)

RobertJMaynard
RobertJMaynard

Reputation: 2257

To make sure your development machine will only compile if you have sdl set the REQUIRED flag on the find_package call like:

find_package ( SDL REQUIRED )
find_package ( SDL_mixer REQUIRED )

To make sure that SDL and SDL_mixer finds your install, set the environmental variables SDLDIR and SDLMIXERDIR to the correct directories. More information on the findSDL package can be found in the CMake documentation.

Upvotes: 3

Related Questions