I'm working around this now by making Foobar_LIBRARY_DIRS absolute, get_filename_component(Foobar_LIBRARY_DIRS_ABS ${Foobar_LIBRARY_DIRS} REALPATH)
The hint to CMakePackageConfigHelpers certainly contain the proper bug fix, so I forwarded this to the Foobar devs. Thanks! --Nico On Mon, Sep 3, 2012 at 10:01 AM, Markus Blatt <mar...@dr-blatt.de> wrote: > On Mon, Sep 03, 2012 at 12:54:09AM +0200, Nico Schlömer wrote: >> In an attempt to make Foobar relocatable, the library and header >> directories are specified in >> /usr/share/cmake/Foobar/FoobarConfig.cmake as >> >> SET(Foobar_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/../../../include/foobar") >> SET(Foobar_LIBRARY_DIRS "${CMAKE_CURRENT_LIST_DIR}/../../../lib") >> >> All of this seems correct. >> When running CMake on a project with FIND_PACKAGE(Foobar), the user is >> swamped with warnings of the kind >> >> ==================== *snip* ==================== >> CMake Warning at test/CMakeLists.txt:81 (ADD_EXECUTABLE): >> Cannot generate a safe runtime search path for target operatorTest because >> files in some directories may conflict with libraries in implicit >> directories: >> >> runtime library [libblas.so.3] in /usr/lib may be hidden by files in: >> /usr/share/cmake/Foobar/../../../lib >> >> Some of these libraries may not be found correctly. >> ==================== *snap* ==================== >> >> When I edit /usr/share/cmake/Foobar/FoobarConfig.cmake to read >> >> SET(Foobar_LIBRARY_DIRS "/usr/lib"), >> >> those warnings disappear. > > I think CMake relies on absolute pathes. You might want to do > something like this : > > get_filename_component(_dir "${CMAKE_CURRENT_LIST_FILE}" PATH) > get_filename_component(_prefix "${_dir}/../../.." ABSOLUTE) > SET(Foobar_INCLUDE_DIRS "${_prefix}/include/foobar") > SET(Foobar_LIBRARY_DIRS "${_prefix}/lib") > > > In newer versions there are also some macros/functions in > CMakePackageConfigHelpers that help > producing portable package configuration files. > > Cheers, > > Markus > > -- > Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de > Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany, USt-Id: DE279960836 > -- > > 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 -- 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