Hi, On Thu, Dec 6, 2012 at 5:13 PM, Mateusz Loskot <mate...@loskot.net> wrote: > The CMake 2.8.10 manual includes the following statement in the paragraph > about link_directories() command: > > "Library locations returned by find_package() and find_library() are > absolute paths." > > Would it be possible to include similar clarification in the sections for > find_package() and find_library()? > > A user of my library asked why > XXX_INCLUDE_DIR takes directory location, but > XXX_LIBRARIES takes absolute path to library file(s). > > I've found it difficult to explain the rationale really. > I could not find any back up in the manual.
Thats two unrelated things really. For libraries cmake needs to know the absolute path if possible to setup proper dependencies in target_link_libraries and to make sure that the linker links against exactly that library and not some library with the same name that happens to be in a directory further in the front of the linker commandline. For include directories things are different, since the mechanism for those is different. In particular the pre-processor does not allow include files to be listed on the commandline. Instead you give it a couple of directories where to search. Dependencies of this are generated by CMake parsing the source files. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake