All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yordan Karadzhov <ykaradzhov@vmware.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org, y.karadz@gmail.com,
	Yordan Karadzhov <ykaradzhov@vmware.com>
Subject: [PATCH 5/5] kernel-shark: Install public interface headers
Date: Thu, 23 May 2019 18:18:12 +0300	[thread overview]
Message-ID: <20190523151812.31391-6-ykaradzhov@vmware.com> (raw)
In-Reply-To: <20190523151812.31391-1-ykaradzhov@vmware.com>

Installing the header files included in the public interfaces of
the KernelShark libraries will make possible the libraries to be used
for development.

A symbolic link that points to the latest versions of the libraries is
added to INSTALL_PREFIX/lib/kernelshark

Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
---
 kernel-shark/README             |  4 ++++
 kernel-shark/src/CMakeLists.txt | 42 +++++++++++++++++++++++++++++++--
 2 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/kernel-shark/README b/kernel-shark/README
index 379c390..573e279 100644
--- a/kernel-shark/README
+++ b/kernel-shark/README
@@ -44,6 +44,10 @@ as a CMake Command-Line option.
 2.1.3 By default, installation prefix is "/usr/local". It can be changed using
 -D_INSTALL_PREFIX= as a CMake Command-Line option.
 
+2.1.4 In order to install a development version (including headers e.t.c) add
+-D_DEVEL=1 as a CMake Command-Line option.
+
+
 Example:
     cmake -D_DOXYGEN_DOC=1 -D_DEBUG=1 -D_INSTALL_PREFIX=/usr ../
 
diff --git a/kernel-shark/src/CMakeLists.txt b/kernel-shark/src/CMakeLists.txt
index 6cbc00f..6dd9b5a 100644
--- a/kernel-shark/src/CMakeLists.txt
+++ b/kernel-shark/src/CMakeLists.txt
@@ -1,5 +1,13 @@
 message("\n src ...")
 
+macro(install_symlink filepath sympath)
+    install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${filepath} ${sympath})")
+    install(CODE "LIST(APPEND CMAKE_INSTALL_MANIFEST_FILES ${sympath})")
+    install(CODE "message(\"-- Created symlink: ${sympath} -> ${filepath}\")")
+endmacro(install_symlink)
+
+set(KS_INCLUDS_DESTINATION "${_INSTALL_PREFIX}/include/${KS_APP_NAME}")
+
 message(STATUS "libkshark")
 add_library(kshark SHARED libkshark.c
                           libkshark-model.c
@@ -14,6 +22,22 @@ target_link_libraries(kshark ${CMAKE_DL_LIBS}
 
 set_target_properties(kshark  PROPERTIES SUFFIX	".so.${KS_VERSION_STRING}")
 
+install(TARGETS kshark LIBRARY DESTINATION ${_INSTALL_PREFIX}/lib/${KS_APP_NAME})
+
+if (_DEVEL)
+
+    install_symlink("libkshark.so.${KS_VERSION_STRING}"
+                    "${_INSTALL_PREFIX}/lib/${KS_APP_NAME}/libkshark.so")
+
+    install(FILES "${KS_DIR}/src/libkshark.h"
+            DESTINATION ${KS_INCLUDS_DESTINATION})
+    install(FILES "${KS_DIR}/src/libkshark-plugin.h"
+            DESTINATION ${KS_INCLUDS_DESTINATION})
+    install(FILES "${KS_DIR}/src/libkshark-model.h"
+            DESTINATION ${KS_INCLUDS_DESTINATION})
+
+endif (_DEVEL)
+
 if (OPENGL_FOUND AND GLUT_FOUND)
 
     message(STATUS "libkshark-plot")
@@ -26,6 +50,20 @@ if (OPENGL_FOUND AND GLUT_FOUND)
 
     set_target_properties(kshark-plot PROPERTIES  SUFFIX ".so.${KS_VERSION_STRING}")
 
+    install(TARGETS kshark-plot LIBRARY DESTINATION ${_INSTALL_PREFIX}/lib/${KS_APP_NAME})
+
+    if (_DEVEL)
+
+        install_symlink("libkshark-plot.so.${KS_VERSION_STRING}"
+                        "${_INSTALL_PREFIX}/lib/${KS_APP_NAME}/libkshark-plot.so")
+
+        install(FILES "${KS_DIR}/src/KsPlotTools.hpp"
+                DESTINATION ${KS_INCLUDS_DESTINATION})
+        install(FILES "${KS_DIR}/src/libkshark-plot.h"
+                DESTINATION ${KS_INCLUDS_DESTINATION})
+
+    endif (_DEVEL)
+
 endif (OPENGL_FOUND AND GLUT_FOUND)
 
 if (Qt5Widgets_FOUND AND Qt5Network_FOUND)
@@ -77,9 +115,9 @@ if (Qt5Widgets_FOUND AND Qt5Network_FOUND)
     add_executable(kshark-record        kshark-record.cpp)
     target_link_libraries(kshark-record kshark-gui)
 
-    install(TARGETS ${KS_APP_NAME} kshark-record kshark kshark-plot kshark-gui
+    install(TARGETS ${KS_APP_NAME} kshark-record kshark-gui
             RUNTIME DESTINATION ${_INSTALL_PREFIX}/bin/
-            LIBRARY DESTINATION ${_INSTALL_PREFIX}/lib/${KS_APP_NAME}/)
+            LIBRARY DESTINATION ${_INSTALL_PREFIX}/lib/${KS_APP_NAME})
 
     install(FILES "${KS_DIR}/${KS_APP_NAME}.desktop"
             DESTINATION ${_INSTALL_PREFIX}/share/applications/)
-- 
2.20.1


      parent reply	other threads:[~2019-05-23 15:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-23 15:18 [PATCH 0/5] Nodifications needed by the NumPy interface Yordan Karadzhov
2019-05-23 15:18 ` [PATCH 1/5] kernel-shark: Add new dataloading method to be used by the NumPu interface Yordan Karadzhov
2019-05-29 17:36   ` Steven Rostedt
2019-05-30 14:25     ` Yordan Karadzhov (VMware)
2019-05-23 15:18 ` [PATCH 2/5] kernel-shark: Use full paths for non-standard library headers Yordan Karadzhov
2019-05-23 15:18 ` [PATCH 3/5] kernel-shark: Use the shared versions of the trace-cmd libraries Yordan Karadzhov
2019-05-23 15:18 ` [PATCH 4/5] trace-cmd: Install public interface headers Yordan Karadzhov
2019-05-23 15:18 ` Yordan Karadzhov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190523151812.31391-6-ykaradzhov@vmware.com \
    --to=ykaradzhov@vmware.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=y.karadz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.