aboutsummaryrefslogtreecommitdiffstats
path: root/testing/mtex2mml/cmake-fix-install.patch
diff options
context:
space:
mode:
Diffstat (limited to 'testing/mtex2mml/cmake-fix-install.patch')
-rw-r--r--testing/mtex2mml/cmake-fix-install.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/testing/mtex2mml/cmake-fix-install.patch b/testing/mtex2mml/cmake-fix-install.patch
new file mode 100644
index 0000000000..48e59abf6a
--- /dev/null
+++ b/testing/mtex2mml/cmake-fix-install.patch
@@ -0,0 +1,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