On Saturday 19 October 2013, you wrote: > On Sat, Oct 19, 2013 at 11:28:53AM +0400, Игорь Пашев wrote: > > 2013/10/19 Magnus Therning <[email protected]>: > > > Is it possible to put the include path in some property on the library > > > as well, to avoid using a separate variable for that? > > > > SET_TARGET_PROPERTIES (target PROPERTIES <VARIABLE-NAME> > > <VARIABLE-VALUE>) > > Of course, but then how do I use it conveniently? > > Would it be possible, by choosing a good property name, to simply do > > target_include_directories(one_test PRIVATE > target > ) > > Or would I have to > > get_target_property(INC_DIR target <variable-name>) > target_include_directories(one_test PRIVATE > ${INC_DIR} > ) > > in which case using a property wouldn't give me very much.
This depends on which version of cmake you are using. If you require a very recent one, i.e. 2.8.11 or newer, you can set INTERFACE_INCLUDE_DIRECTORIES, and then you'll get the include dirs automatically when linking against the target, I think. Alex -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
