From 3c1f55768ffd9ae4c26a9c1c30fd30c11082cd4b Mon Sep 17 00:00:00 2001 From: Riyyi Date: Sat, 29 Jan 2022 21:59:51 +0100 Subject: [PATCH] CMake: Add installation of the program binary --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 751cfc5..2a11039 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,9 @@ set(PROJECT "stowage") cmake_minimum_required(VERSION 3.16 FATAL_ERROR) project(${PROJECT} CXX) +set(CMAKE_INSTALL_PREFIX /usr) +include(GNUInstallDirs) + # ------------------------------------------ # Setup C++ compiler @@ -71,6 +74,10 @@ list(REMOVE_ITEM TEST_SOURCES "${CMAKE_SOURCE_DIR}/src/main.cpp") add_executable(${PROJECT} ${PROJECT_SOURCES}) target_link_libraries(${PROJECT}) +install(TARGETS ${PROJECT} + DESTINATION ${CMAKE_INSTALL_BINDIR} + CONFIGURATIONS Release) + # ------------------------------------------ # Execute target