使用 CMake 在 Visual Studio 上设置 SDL

发布于 2024-10-01 19:06:41 字数 137 浏览 0 评论 0原文

我的主要 IDE 是 Visual Studio 10.0,所以 MSVC 是我的编译器。我正在构建一个基于 CMake 的项目,需要安装 SDL 和 SDL_Mixer。正确的方法是什么,以便 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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

迷路的信 2024-10-08 19:06:41

为了确保您的开发计算机只有在 sdl 在 find_package 调用上设置 REQUIRED 标志时才会编译,如下所示:

find_package ( SDL REQUIRED )
find_package ( SDL_mixer REQUIRED )

为了确保 SDL 和 SDL_mixer 找到您的安装,请将环境变量 SDLDIR 和 SDLMIXERDIR 设置到正确的目录。有关 findSDL 包的更多信息,请参阅 CMake 文档

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文