![]() This page is licensed under a Creative Commons Attribution-NoDerivatives 4.0 International License. ![]() Buildingįollowing the standard cmake procedure: mkdir build Target_link_libraries (MyProject SDL2::Main SDL2::Net SDL2::Mixer SDL2::Image SDL2::TTF SDL2::GFX)Īnd thats it! Now you can remove the SDL2 components you don't want to use. If you are on Linux and only need SDL2 you don't even need the FindSDL2. We are excited to see how the open-source community works together to implement new ideas for the debugger. The debugger uses the widely supported Debug Adapter Protocol, which is compatible with many development environments. Using these Find modules will also work on Windows. CMake 3.27 will ship with Visual Studio in a later release in 17.8. I have SDL2 installed and can easily use it via findpackage (SDL2 REQUIRED) and then add the include directories and link SDL2. I am on MacOS Mojave (10.14.3) and he is on Windows 10. Download SDLgpu (SDL2gpu for SDL2) development libraries and source code. They can be based of the ones that work for SDL 1.2 which are included in CMake already. Multiplatform SDL2 CMake setup Hello, I and a friend want to work on an SDL2 project together. Download SDL2 development libraries and source code. Or you can use this simple command: cd cmake Basically you need a FindSDL2.cmake and FindSDL2image.cmake module. You can find the cmake files to find SDL2 and it's components here Here is a common directory structure when using cmake to find packages: ├── cmake vcvars64.bat This sets necessary environment variables for running the cl.exe compiler. Make sure you create your main () function like so: int main (int argc, char argv ) If you want explanations. sudo apt install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-net-dev libsdl2-ttf-dev libsdl2-gfx-dev How to build SDL applications on Windows build.bat will get you started compiling an SDL application with Visual C++. ![]() Of course, using a package manager such as vcpkg would be the best. I only know about the debian based ones, if you are on another distro you should look them up. Just make sure your friend follows the installation correctly and SDL2 should have FindSDL.cmake or something like that which will be used by findpackage (SDL2 REQUIRED) The trick is usually to add installation paths with -DCMAKEPREFIXPATHC:\path\to\sdl. Most common distributions have cmake available on their package manager repostories: # Debian based ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |