aboutsummaryrefslogtreecommitdiffstats
path: root/testing/mtex2mml/cmake-fix-install.patch
blob: 48e59abf6ab19adc2a6fa5f9c3e8615de2a4bc57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From 5169eaf0eefd635f18a04e4d403e6beb97c5b679 Mon Sep 17 00:00:00 2001
From: Jakub Jirutka <jakub@jirutka.cz>
Date: Fri, 24 Mar 2017 20:39:23 +0100
Subject: [PATCH] Fix cmake rules to install executable, libraries and headers

I should note that I don't have much experience with CMake, so I'm not
sure if this solution is _correct_. However, it works as expected.

Fixes #58

Upstream-Issue: https://github.com/gjtorikian/mtex2MML/pull/60
---
 CMakeLists.txt        | 7 ++++++-
 src/libmtex2MML.pc.in | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a19eab4..f4d6bcc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,7 +42,7 @@ set(MTEX2MML_VERSION_STRING "${MTEX2MML_VERSION_MAJOR}.${MTEX2MML_VERSION_MINOR}
 #
 set(BIN_INSTALL_DIR bin CACHE PATH "Where to install binaries to.")
 set(LIB_INSTALL_DIR lib CACHE PATH "Where to install libraries to.")
-set(INCLUDE_INSTALL_DIR include CACHE PATH "Where to install headers to.")
+set(INCLUDE_INSTALL_DIR include/${PROJECT_NAME} CACHE PATH "Where to install headers to.")
 
 #
 #
@@ -107,6 +107,11 @@ add_library(${STATICLIBRARY} STATIC
 )
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/libmtex2MML.pc.in
 ${CMAKE_CURRENT_BINARY_DIR}/libmtex2MML.pc @ONLY)
+
+install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${BIN_INSTALL_DIR})
+install(TARGETS ${LIBRARY} LIBRARY DESTINATION ${LIB_INSTALL_DIR})
+install(TARGETS ${STATICLIBRARY} ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
+install(FILES ${SRC_H} DESTINATION ${INCLUDE_INSTALL_DIR})
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libmtex2MML.pc
   DESTINATION lib/pkgconfig)
 
diff --git a/src/libmtex2MML.pc.in b/src/libmtex2MML.pc.in
index 0bc2557..b49c75f 100644
--- a/src/libmtex2MML.pc.in
+++ b/src/libmtex2MML.pc.in
@@ -7,4 +7,4 @@ Name: libmtex2MML
 Description: A Bison grammar to convert TeX math into MathML.
 Version: @PROJECT_VERSION@
 Libs: -L${libdir} -lmtex2MML
-Cflags: -I${includedir}
+Cflags: -I${includedir}/mtex2MML