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

Loaden loaden at gmail.com
Thu Sep 6 20:43:02 EDT 2012


Hi, list!
I have a library target named 'TestLib', path is
"./src/libs/testlib_src_dir'
And now I made a execute named 'TestApp', path is './src/app'

I try to link TestLib using:
target_link_libraries(TestApp TestLib)

My question:
How to get the 'TestLib' target's source direcory (want get
'./src/libs/testlib_src_dir')?

I read the documents, and want to using:
get_target_properies(libdir TestLib XXX)
in TestApp's CMakeLists.txt. But I can't get what is the XXX name?

For now, I have to using:
include_directory(../libs/testlib_src_dir) in TestApp's CMakeLists.txt.
But I thought there possible exist an better way to solved my problem.

I need some tips, and want your help.
Thanks a lot!

Sorry for my poor English.
English is not my native language.

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


More information about the CMake mailing list