[CMake] Querying project dependencies from the UNIX command-line

ardi ardillasdelmonte at gmail.com
Wed Jul 18 05:31:50 EDT 2018


Hi!

I've never used CMake (well, I'm continuously using it but as a user
only, for building projects, not for maintaining them) . It's quite
possible that I'll adopt CMake for maintaining my projects (I'm in the
process of locating good references for learning "Modern CMake" --I
want to start directly at Modern CMake, and avoiding as much
old-fashioned practices as possible).

However, before learning and adopting CMake, there's a feature that I
need, and I don't know if CMake provides it, or if I'll need to use an
additional tool for it. And that feature is querying dependencies.

For example, I'd like to type "somecommand /path/to/someproject" at
the UNIX command line, and get this output:

Project /path/to/someproject requires the following to be built:
wxWidgets >= 3.0.0
CUDA >= 7.0.0
OpenCV >= 3.3

Furthermore, if another command could show optional requisites, it
would be really great: "anothercommand /path/to/someproject"

Project /path/to/someproject can optionally use the following when being built:
libtiff >= 4.0.0
libzip >= 1.5.0

So, can I get this functionality from plain CMake/CPack ? Or would I
need additional tools (Note: I know about Hunter, but first I'd like
to know if plain CMake does already offer this feature).

Thanks!

ardi


More information about the CMake mailing list