From 1a9794155be9e76397ebd359baf9a8d1853d90b2 Mon Sep 17 00:00:00 2001 From: abalu Date: Tue, 23 Jul 2024 16:36:31 +0000 Subject: [PATCH] Add CMake installation rules This is necessary to install the header only library in a distro package. --- CMakeLists.txt | 3 +++ core/CMakeLists.txt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 17d0ba4..2404a92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,7 @@ project(prometheus-cpp-lite) + +include(GNUInstallDirs) + cmake_minimum_required(VERSION 3.2) option(PROMETHEUS_BUILD_EXAMPLES "Build with examples" OFF) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 3efae99..fb0223f 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -18,3 +18,6 @@ if(NOT WIN32) find_package(Threads) target_link_libraries(${PROJECT_NAME} INTERFACE ${CMAKE_THREAD_LIBS_INIT}) endif() + +install (TARGETS ${PROJECT_NAME}) +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) \ No newline at end of file