On 12.09.2015 15:04, Wojciech Mamrak wrote:
install(TARGETS foo
         EXPORT FooTargets
         ARCHIVE DESTINATION "${INSTALL_LIBDIR}")

Your target's install DESTINATION is absolute which is why the exported location is absolute as well.

e.g. using "DESTINATION lib" instead of "DESTINATION /foo/bar/lib" should make both your install and export relative (relocatable). For the regular "install" target install destinations are appended to CMAKE_INSTALL_PREFIX[1].

Nils

[1] http://www.cmake.org/cmake/help/v3.3/variable/CMAKE_INSTALL_PREFIX.html
--

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://public.kitware.com/mailman/listinfo/cmake

Reply via email to