zint / zint-gpl-only

Zint Barcode Generator
https://zint.org.uk/
GNU General Public License v3.0
525 stars 138 forks source link

Fix FindZint.cmake dest dir #49

Closed staniek closed 2 years ago

staniek commented 8 years ago

Hi! While building zint with custom prefix it tries to install to /usr because of using CMAKE_ROOT.

This patch fixes both cases:

index 0e57cb2..da1f568 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -87,7 +87,13 @@ CONFIGURE_FILE(
 ADD_CUSTOM_TARGET(uninstall
   "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")

-install(FILES cmake/modules/FindZint.cmake DESTINATION ${CMAKE_ROOT}/Modules COMPONENT Devel)
+if (DATA_INSTALL_DIR)
+    set(CMAKE_MODULES_INSTALL_PATH ${DATA_INSTALL_DIR}/cmake/modules)
+else (DATA_INSTALL_DIR)
+    set(CMAKE_MODULES_INSTALL_PATH ${CMAKE_ROOT}/Modules)
+endif(DATA_INSTALL_DIR)
+
+install(FILES cmake/modules/FindZint.cmake DESTINATION ${CMAKE_MODULES_INSTALL_PATH} COMPONENT Devel)

 # This needs to be run very last so other parts of the scripts can take
 # advantage of this.
oehhar commented 8 years ago

Hi Jaroslaw,

thank you for the patch. I will look into it.

Thank you, Harald

Am 09.09.2015 um 14:00 schrieb Jaroslaw Staniek:

Hi! While building zint with custom prefix it tries to install to /usr because of using CMAKE_ROOT.

This patch fixes both cases:

index 0e57cb2..da1f568 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -87,7 +87,13 @@ CONFIGURE_FILE(
 ADD_CUSTOM_TARGET(uninstall
   "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")

-install(FILES cmake/modules/FindZint.cmake DESTINATION ${CMAKE_ROOT}/Modules COMPONENT Devel)
+if (DATA_INSTALL_DIR)
+    set(CMAKE_MODULES_INSTALL_PATH ${DATA_INSTALL_DIR}/cmake/modules)
+else (DATA_INSTALL_DIR)
+    set(CMAKE_MODULES_INSTALL_PATH ${CMAKE_ROOT}/Modules)
+endif(DATA_INSTALL_DIR)
+
+install(FILES cmake/modules/FindZint.cmake DESTINATION ${CMAKE_MODULES_INSTALL_PATH} COMPONENT Devel)

 # This needs to be run very last so other parts of the scripts can take
 # advantage of this.

Reply to this email directly or view it on GitHub: https://github.com/zint/zint/issues/49

ELMICRON Dr. Harald Oehlmann GmbH Koesener Str. 85 06618 Naumburg Germany Phone: +49 (0)3445 78112-0 Fax: +49 (0)3445 78112-19 www.Elmicron.de German legal references: Geschaeftsfuehrer: Dr. Harald Oehlmann, Jens Oehlmann UST Nr. / VAT ID No.: DE206105272 HRB 212803 Stendal

oehhar commented 8 years ago

Jaroslaw, I am sorry, I am on the zint at sourceforge, which seams to be a different one than this one. Could you check, if the patch makes sense there too ?

The copy of the ticket is here: https://sourceforge.net/p/zint/tickets/3/ The commit is here: https://sourceforge.net/p/zint/code/ci/96974d2cd1deac76622211092a37e8fbb05ef888/tree/

Please use the upper ticket to comment.

Thank you, Harald

oehhar commented 8 years ago

Jaroslaw, I am sorry, I am on the zint at sourceforge, which seams to be a different one than this one. Could you check, if the patch makes sense there too ?

The copy of the ticket is here: https://sourceforge.net/p/zint/tickets/3/ The commit is here: https://sourceforge.net/p/zint/code/ci/96974d2cd1deac76622211092a37e8fbb05ef888/tree/

Please use the upper ticket to comment.

Thank you, Harald

gitlost commented 2 years ago

Marked as closed on SourceForge so closing this now, thanks all!