logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

opencolorio-1.1.0-use-GNUInstallDirs-and-fix-cmake-install-location.patch (4002B)


  1. From c43cc918c3e79e324f11ca47e95bfe36e9e0dd15 Mon Sep 17 00:00:00 2001
  2. From: Jonathan Scruggs <j.scruggs@gmail.com>
  3. Date: Sun, 14 Jan 2018 19:59:31 +0000
  4. Subject: [PATCH] Add GNUInstallDirs variables and fix install location for
  5. cmake files
  6. GNUInstallDirs is supported on all platforms and variables are set
  7. to the standard GNU locations.
  8. This patch corrects the location where the CMake files are
  9. installed.
  10. Signed-off by: Jonathan Scruggs <j.scruggs@gmail.com>
  11. ---
  12. CMakeLists.txt | 9 +++++----
  13. docs/CMakeLists.txt | 4 ++--
  14. export/pkgconfig/OpenColorIO.pc.in | 6 ++----
  15. 3 files changed, 9 insertions(+), 10 deletions(-)
  16. diff --git a/CMakeLists.txt b/CMakeLists.txt
  17. index b05c7e4..452fa1e 100644
  18. --- a/CMakeLists.txt
  19. +++ b/CMakeLists.txt
  20. @@ -59,6 +59,7 @@ endif()
  21. include(ParseArguments)
  22. include(OCIOMacros)
  23. include(ExternalProject)
  24. +include(GNUInstallDirs)
  25. enable_language(CXX)
  26. @@ -531,7 +532,7 @@ endif()
  27. configure_file(${CMAKE_SOURCE_DIR}/share/ocio/setup_ocio.sh.in
  28. ${CMAKE_CURRENT_BINARY_DIR}/share/ocio/setup_ocio.sh @ONLY)
  29. -INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/share/ocio/setup_ocio.sh DESTINATION share/ocio/)
  30. +INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/share/ocio/setup_ocio.sh DESTINATION ${CMAKE_INSTALL_DATADIR}/ocio/)
  31. ###############################################################################
  32. ### CPACK ###
  33. @@ -596,7 +597,7 @@ if(TARGET OpenColorIO_STATIC)
  34. set(OCIO_STATIC_COMPILE_DEFINITIONS )
  35. endif()
  36. endif()
  37. -install(EXPORT OpenColorIO DESTINATION cmake)
  38. +install(EXPORT OpenColorIO DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/OpenColorIO)
  39. file(WRITE "${CMAKE_BINARY_DIR}/OpenColorIOConfig.cmake"
  40. "
  41. get_filename_component(OpenColorIO_DIR \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)
  42. @@ -608,7 +609,7 @@ file(WRITE "${CMAKE_BINARY_DIR}/OpenColorIOConfig.cmake"
  43. ## targets libraries + associated definitions
  44. if(NOT TARGET OpenColorIO)
  45. - include(\"\${OpenColorIO_DIR}/cmake/OpenColorIO.cmake\") ## thanks to imported target
  46. + include(\"\${OpenColorIO_DIR}/${CMAKE_INSTALL_LIBDIR}/cmake/OpenColorIO/OpenColorIO.cmake\") ## thanks to imported target
  47. if(TARGET OpenColorIO AND NOT OpenColorIO_USE_STATIC)
  48. message(STATUS \"shared target OpenColorIO : see OpenColorIO_LIBRARY\")
  49. set(OpenColorIO_LIBRARY OpenColorIO)
  50. @@ -646,4 +647,4 @@ file(WRITE "${CMAKE_BINARY_DIR}/OpenColorIOConfig.cmake"
  51. message(STATUS OPENCOLORIO_FOUND=\${OPENCOLORIO_FOUND})
  52. "
  53. )
  54. -install(FILES "${CMAKE_BINARY_DIR}/OpenColorIOConfig.cmake" DESTINATION .)
  55. +install(FILES "${CMAKE_BINARY_DIR}/OpenColorIOConfig.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/OpenColorIO)
  56. diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
  57. index 3fd0299..a822a19 100644
  58. --- a/docs/CMakeLists.txt
  59. +++ b/docs/CMakeLists.txt
  60. @@ -138,7 +138,7 @@ add_custom_target(doc ALL
  61. add_dependencies(doc Sphinx)
  62. install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/build-html/
  63. - DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/OpenColorIO/html
  64. + DESTINATION ${CMAKE_INSTALL_DOCDIR}/html
  65. PATTERN .* EXCLUDE
  66. )
  67. @@ -166,6 +166,6 @@ if(PDFLATEX_COMPILER)
  68. add_dependencies(pdf latex)
  69. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/build-latex/OpenColorIO.pdf
  70. - DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/OpenColorIO/)
  71. + DESTINATION ${CMAKE_INSTALL_DOCDIR})
  72. endif()
  73. diff --git a/export/pkgconfig/OpenColorIO.pc.in b/export/pkgconfig/OpenColorIO.pc.in
  74. index 81ab4ce3..c4553a4f 100644
  75. --- a/export/pkgconfig/OpenColorIO.pc.in
  76. +++ b/export/pkgconfig/OpenColorIO.pc.in
  77. @@ -1,7 +1,5 @@
  78. -prefix=@CMAKE_INSTALL_PREFIX@
  79. -exec_prefix=@CMAKE_INSTALL_EXEC_PREFIX@
  80. -includedir=${prefix}/include
  81. -libdir=${exec_prefix}/lib@LIB_SUFFIX@
  82. +libdir=@CMAKE_INSTALL_FULL_LIBDIR@
  83. +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
  84. Name: OpenColorIO
  85. Description: A color management framework for visual effects and animation
  86. --
  87. 2.15.1