#Add shellscript command to CMake argument list

2 messages · Page 1 of 1 (latest)

south mantle
#

I'm using a library called Simple2D. It installs a simple2d binary, and you can run simple2d --libs to get the list of library and include directories you need for Simple2D projects. For example, you can run this to build a project with 1 source file:

cc triangle.c `simple2d --libs` -o triangle

simple2d --libs evaluates to this on a Mac:

-lsimple2d -I/usr/local/include/SDL2 -D_THREAD_SAFE
-L/usr/local/lib -lSDL2 -Wl,-framework,OpenGL -lSDL2_image -lSDL2_mixer -lSDL2_ttf

How can I evaluate that in CMake?

odd hemlock
#

I never install third-party libraries I use, I use cmake fetchcontent to bring these library targets directly into my cmake projects.