Target_link_libraries(prj PackageName::Libraries) I am wondering if this is a valid pattern below? find_package(PackageName) This means I will compile a lot of dependencies my self. Ultimately I would like to be able to do find my dependencies in the CMAKE_INSTALL_PREFIX and make sure to have reproducible builds and not use system libraries. I’m having trouble distinguishing the best way to include dependencies. Including SDL2 headers for your project must happen after SDL2 built by itself.Ĭhange the order then it’ll work: #. If you set SDL2 inside a folder and use add_subdirectory to build it and include_directories to include the headers, the order matters. I just encountered this “ Wrong SDL_config.h” problem with CMake and figured it out. has a patch that is supposed to fix that problem, but hasn’t been merged yet. So people usually end up copying a FindSDL2.cmake from some other project (originally based on FindSDL.cmake for SDL1.2 that’s shipped with cmake), but that’s not really great of course… Using SDL2 with cmake currently sucks because cmake doesn’t provide a FindSDL2.cmake and SDL2 doesn’t provide it (or anything else for integration) either. +1 from my side, too.Am um 21:06 schrieb Daniel Gibson : The trick to building the SDL source and linking it to my project as I got a “Wrong SDL_config.h” error multiple times. It appeared to work until I tried building my little program in Visual To add the SDL2 source as a subdirectory that is built as part of my Naturally I used cmake with my little program with the intent Would like for users to just type “cmake” and it makes the whole Need to create separate binaries or have multi-leveled build process. My intention was to allow this little program to beĭistributed via source and built on multiple platforms so I wouldn’t I decided to write a little program to try integrating the SDL2 source Supposed to fix that problem, but hasn’t been merged yet. With cmake), but that’s not really great of course… Project (originally based on FindSDL.cmake for SDL1.2 that’s shipped So people usually end up copying a FindSDL2.cmake from some other Using SDL2 with cmake currently sucks because cmake doesn’t provide aįindSDL2.cmake and SDL2 doesn’t provide it (or anything else for
0 Comments
Leave a Reply. |