Is it possible to use CMake to have multiple projects/programs (i.e., main
s) in the same folder structure? I've been working on learning C by building small console apps, and it would be nice to have a "global" build setup so I can have all the "sub-programs" (i.e., individual console apps) build together, rather than setting up a bunch of individual makefile
s and having to go in and make
them all individually...
for example, in a folder structure like:
/src
/utils
utils.h
utils.c
/ch01
/prog1
prog1.c
prog1dep.h
prog1dep.c
/prog2
prog2.c
/ch02
/prog3
prog3.c
prog3dep.h
prog3dep.c
where, for example prog1
consists of prog1.c
, prog1dep.c
, and prog1dep.h
(and potentially /utils
, a common dependency/utility across a subset of the programs); ideally the executables would build to /build
for easier management (i.e., running a specific one, removing, etc.).
For reference, I'm mainly using Linux Ubuntu with gcc
compiler.
Apologies in advance for the noob-ish question, I'm just at the point now venturing out of C hello world
land and very basic makefile
s, but I've heard CMake is more capable for this type of task...Thank you!