Группа :: Engineering
Пакет: mbelib
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: cmakelibdir.patch
Скачать
Скачать
From 1b39cc973fef3b085f38625d36b6d9c6819df00a Mon Sep 17 00:00:00 2001
From: Jared Szechy <jared.szechy@gmail.com>
Date: Sun, 3 Dec 2017 12:27:47 -0500
Subject: [PATCH] Refactor install to allow overrides
Resolves #19
---
CMakeLists.txt | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bb2d6a3..117db7c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,11 +10,20 @@ ADD_LIBRARY(mbe-shared SHARED ${SRCS})
TARGET_LINK_LIBRARIES(mbe-static m)
TARGET_LINK_LIBRARIES(mbe-shared m)
-install(TARGETS mbe-static mbe-shared DESTINATION lib)
-install (FILES "${PROJECT_SOURCE_DIR}/mbelib.h" DESTINATION include)
-
-set_target_properties(mbe-static mbe-shared PROPERTIES OUTPUT_NAME mbe
- VERSION 1.0 SOVERSION 1 INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib )
+include(GNUInstallDirs)
+
+set_target_properties(mbe-static mbe-shared
+ PROPERTIES
+ OUTPUT_NAME mbe
+ VERSION 1.0
+ SOVERSION 1
+ INSTALL_NAME_DIR ${CMAKE_INSTALL_FULL_LIBDIR}
+ PUBLIC_HEADER "mbelib.h")
+
+install(TARGETS mbe-static mbe-shared
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
# uninstall target
configure_file(