What is the most minimalistic way to create a CMakeLists.txt file that can distribute a SDL2 executable with dynamic libraries across Linux and Windows? That is I'm trying to get a cmake file that will emit an executable to a build directory in a project for something like:
#include "SDL.h"
int main()
{
SDL_Init();
SDL_Quit();
return 0;
}
So far I've only seen how to link against system libraries but this is inconsistent for Windows which doesn't automatically register libraries with their system path like Linux automatically does with package managers. I know that with Make you can specify a lib directory in the project and set a path to that during compilation, then you could use terminal commands to dump the lib in a folder with the executable.
I want my projects to have this automatic behavior -- that is anyone who downloads the source can just type cmake, then make, and have a standalone directory with the executable and required libs to run the program without having to set up their path. How would I be able to do this? or is this even the best way of deploying a cross platform application?
Aucun commentaire:
Enregistrer un commentaire