# HG changeset patch # User František Kučera # Date 1545166973 -3600 # Node ID f2c97faab8d9519473afecdb0b5dd16f52b8281e # Parent 930b8f1b836eb56a6414527effd0da15fe566b4d cmake: install Projects can be build using (PREFIX and VERSION are optional): rm -rf /tmp/relpipe/ && rm -rf ../xxx/* && cmake -DCMAKE_INSTALL_PREFIX:PATH=/tmp/relpipe/usr -DPROJECT_VERSION=1.2.3 ../../ && make && make install && find /tmp/relpipe/ -type f INSTALL_RPATH_USE_LINK_PATH will retain the build-time paths to libraries and get rid of the message: 'Set runtime path of .. to ""'. diff -r 930b8f1b836e -r f2c97faab8d9 src/CMakeLists.txt --- a/src/CMakeLists.txt Sun Dec 09 23:27:21 2018 +0100 +++ b/src/CMakeLists.txt Tue Dec 18 22:02:53 2018 +0100 @@ -35,3 +35,6 @@ # Link libraries: target_link_libraries(${EXECUTABLE_FILE} ${RELPIPE_LIBS_LIBRARIES}) +set_property(TARGET ${EXECUTABLE_FILE} PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) + +install(TARGETS ${EXECUTABLE_FILE} DESTINATION bin)