From 7390446b63f0346ab5534f17a675089e10f3da56 Mon Sep 17 00:00:00 2001 From: Nicholas O'Connor Date: Thu, 23 Mar 2017 13:36:38 -0700 Subject: [PATCH] install rules --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index bd2a699..e3b04d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,13 @@ project(cellar CXX) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) +# for installation rules, from CMake wiki +SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib/cellar") + +# add the automatically determined parts of the RPATH +# which point to directories outside the build tree to the install RPATH +SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + find_package(PythonInterp) find_package(Boost 1.63 REQUIRED COMPONENTS filesystem) @@ -43,3 +50,8 @@ add_custom_target(cog ALL DEPENDS ${coggedfiles}) add_executable(cellar ${src}/cellar.cpp ${src}/commands.cpp ${src}/fs.cpp ${src}/version.cpp) target_link_libraries(cellar ${Boost_LIBRARIES} bottles) + +install(TARGETS cellar bottles + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib/cellar + ARCHIVE DESTINATION share/cellar)