[CMake] print path variables within submodules?

Nicholas Devenish ndevenish at gmail.com
Mon Oct 30 09:39:41 EDT 2017


Hi Carlton,

On Sun, Oct 29, 2017 at 12:02 PM, Carlton Banks <noflaco at gmail.com> wrote:
>
> Is there a way to print the path like ${source_dir} and so on within the
> CMAKElist, so I can keep track of the paths defined?


I found understanding exactly what you are asking for a little unclear, but
possibly you are looking for CMAKE_CURRENT_SOURCE_DIR - the path to the
source directory currently being processed? This should work to display it:

message(${CMAKE_CURRENT_SOURCE_DIR})

the problem probably being that cmake doesn't usually define a variable
named "source_dir" - unless you've defined one yourself.

Otherwise there's a list of everything CMake defines at
https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20171030/61626614/attachment.html>


More information about the CMake mailing list