From 8828114dbef295af1c21e4cd040fee9bf1ae4a89 Mon Sep 17 00:00:00 2001 From: Sugnan Prabhu S Date: Mon, 7 Aug 2017 13:28:37 +0530 Subject: [PATCH] Independent install for libcoav and coav-control Install libcoav and headers if target coav-control is not enabled. Signed-off-by: Sugnan Prabhu S --- CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dcf03d1..a7bcc2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -151,17 +151,19 @@ target_link_libraries(coav PUBLIC ${LIBRARIES} PRIVATE mavlink_vehicles) -install(TARGETS coav DESTINATION ${CMAKE_INSTALL_LIBDIR}) - configure_file(include/coav.hh.in include/coav/coav.hh) -install(DIRECTORY ${CMAKE_BINARY_DIR}/include/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) # Extra targets if (${WITH_TOOLS}) add_subdirectory(tools/coav-control) endif() +if (NOT TARGET coav-control) + install(TARGETS coav DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(DIRECTORY ${CMAKE_BINARY_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +endif() + if (${WITH_SAMPLES}) add_subdirectory(samples) endif()