8d48ee8da42de2d878db7b42586db8b3c67f83e1.patch 3.9 KB

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