[CMake] print path variables within submodules?

Carlton Banks noflaco at gmail.com
Mon Oct 30 17:29:32 EDT 2017


Hmm.. That worked.. I don’t know sometimes it does  not work.. weird.. 


> Den 30. okt. 2017 kl. 22.25 skrev Gonzalo Garramuño <ggarra13 at gmail.com>:
> 
> 
> 
> El 30/10/17 a las 14:59, Carlton Banks escribió:
>>> Den 30. okt. 2017 kl. 16.53 skrev Gonzalo Garramuño <ggarra13 at gmail.com>:
>>> 
>>> 
>>> 
>>> El 29/10/17 a las 09:02, Carlton Banks escribió:
>>>> I am using submodule cmake, in which the relative paths becomes a bit more confusing that I would have hoped.
>>>> 
>>>> 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 tried `message(${source_dir})` but the output is empty
>>>> 
>>> Try message( ${CMAKE_CURRENT_SOURCE_DIR} )
>> That just output an empty message...
>> 
> This works for me.  Try this simple CMakeLists.txt file:
> 
> set( PROJECT tryme )
> message( ${CMAKE_CURRENT_SOURCE_DIR} )
> 
> -- 
> Gonzalo Garramuño
> 



More information about the CMake mailing list