0001-Respect-solarus-install-variables.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. From 265c1fcc47b4981f5ed6eaa127d87924fa8e13b1 Mon Sep 17 00:00:00 2001
  2. From: orbea <orbea@riseup.net>
  3. Date: Mon, 19 Aug 2019 15:50:42 -0700
  4. Subject: [PATCH] Respect solarus install variables.
  5. ---
  6. CMakeLists.txt | 18 ++++++++++++++----
  7. 1 file changed, 14 insertions(+), 4 deletions(-)
  8. diff --git a/CMakeLists.txt b/CMakeLists.txt
  9. index 6a9f7bb2..bbea7efd 100644
  10. --- a/CMakeLists.txt
  11. +++ b/CMakeLists.txt
  12. @@ -3,6 +3,16 @@ project(ZBOM)
  13. set(quest_name "zbom")
  14. +set(SOLARUS_INSTALL_DATAROOTDIR "share" CACHE PATH "dataroot dir")
  15. +set(SOLARUS_INSTALL_DATADIR "${SOLARUS_INSTALL_DATAROOTDIR}/solarus" CACHE PATH "data dir")
  16. +set(SOLARUS_INSTALL_BINDIR "bin" CACHE PATH "bin dir")
  17. +
  18. +if (IS_ABSOLUTE ${SOLARUS_INSTALL_DATADIR})
  19. + set(SOLARUS_INSTALL_ABSOLUTE_DATADIR ${SOLARUS_INSTALL_DATADIR})
  20. +else()
  21. + set(SOLARUS_INSTALL_ABSOLUTE_DATADIR ${CMAKE_INSTALL_PREFIX}/${SOLARUS_INSTALL_DATADIR})
  22. +endif()
  23. +
  24. # data files list
  25. file(GLOB_RECURSE data_files
  26. RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/data
  27. @@ -46,8 +56,8 @@ add_custom_target(${quest_name}_data
  28. # create a script that executes the engine with this quest
  29. add_custom_command(
  30. OUTPUT ${quest_name}
  31. - COMMAND echo '\#!/bin/bash' > ${quest_name}
  32. - COMMAND echo 'solarus ${CMAKE_INSTALL_PREFIX}/share/solarus/${quest_name} $*' >> ${quest_name}
  33. + COMMAND echo '\#!/bin/sh' > ${quest_name}
  34. + COMMAND echo 'solarus-run ${SOLARUS_INSTALL_ABSOLUTE_DATADIR}/${quest_name} $$*' >> ${quest_name}
  35. )
  36. add_custom_target(${quest_name}_command
  37. ALL
  38. @@ -56,10 +66,10 @@ add_custom_target(${quest_name}_command
  39. # install the data archive
  40. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/data.solarus
  41. - DESTINATION share/solarus/${quest_name}
  42. + DESTINATION ${SOLARUS_INSTALL_DATADIR}/${quest_name}
  43. )
  44. # install the script
  45. install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${quest_name}
  46. - DESTINATION bin
  47. + DESTINATION ${SOLARUS_INSTALL_BINDIR}
  48. )
  49. --
  50. 2.22.0