From 35244d0e224706cad9e6b7f26d03e3e2101ff139 Mon Sep 17 00:00:00 2001 From: Kai-Uwe Hermann Date: Wed, 24 Jan 2024 19:47:54 +0100 Subject: [PATCH] Add option to just install the library target Signed-off-by: Kai-Uwe Hermann --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3894586b7..fcc1204ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,7 @@ option(BUILD_TESTING "Run unit tests" OFF) option(CMAKE_RUN_CLANG_TIDY "Run clang-tidy" OFF) option(LIBOCPP_BUILD_EXAMPLES "Build charge_point and central_system binaries." OFF) option(OCPP_INSTALL "Install the library (shared data might be installed anyway)" ${EVC_MAIN_PROJECT}) +option(LIBOCPP_INSTALL_LIBRARY "Install the libocpp library (for example when built as a shared library)" OFF) # dependencies find_package(Boost COMPONENTS program_options regex system thread REQUIRED) @@ -75,6 +76,13 @@ if (OCPP_INSTALL) ) endif() +if (LIBOCPP_INSTALL_LIBRARY) + install( + TARGETS ocpp + LIBRARY + ) +endif() + if(LIBOCPP16_BUILD_EXAMPLES) message("Building libocpp 1.6 example binaries.")