Is there a way to use sdl-config in CMake?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Yes. Just use find_program()
to find it and execute_process()
to run it and capture its output. If you actually want to test for SDL and use it in your project, CMake comes with FindSDL.cmake
, so you could just put find_package(SDL)
in your CMakeLists.txt
and then just access SDL_CFLAGS
and so on directly.