[CMake] How to get special target's source directory

Loaden loaden at gmail.com
Fri Sep 7 00:03:11 EDT 2012


>
> INCLUDE_DIRECTORIES( ${FOO_SOURCE_DIR} )
> # "FOO" here comes from the PROJECT() line in the other CMakeLists.txt
>
I don't want to add project(FOO) in my target'sCMakeLists.txt.
Because it is really not a real project, only a library target.
Does there exist other way?

> I've seen your English improve a lot over the last half year, so I would
> not
> be sorry for that :-)
>
Thanks! :-)

2012/9/7 Sascha Cunz <sascha-ml at babbelbox.org>

> If you have in one CMakeLists.txt:
>
> PROJECT( FOO )
> ADD_LIBRARY( fooLibrary source.cpp )
>
> then you can simply do in another CMakeLists.txt:
>
> INCLUDE_DIRECTORIES( ${FOO_SOURCE_DIR} )
> # "FOO" here comes from the PROJECT() line in the other CMakeLists.txt
>
> > Sorry for my poor English.
> > English is not my native language.
>
> I've seen your English improve a lot over the last half year, so I would
> not
> be sorry for that :-) Anyway, I'd guess it's at least about half (2/3?) the
> world that doesn't speak English natively.
>



-- 
Best Regards
Yuchen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120907/49570f46/attachment.htm>


More information about the CMake mailing list