legion-16.08.0-multilib.patch 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. From f9b71c86098c16436c3a51d8706f52f720ef008d Mon Sep 17 00:00:00 2001
  2. From: Christoph Junghans <junghans@lanl.gov>
  3. Date: Fri, 2 Sep 2016 15:54:49 -0600
  4. Subject: [PATCH] cmake: support multilib
  5. ---
  6. CMakeLists.txt | 26 ++++++++++++++++----------
  7. runtime/CMakeLists.txt | 8 ++++----
  8. 2 files changed, 20 insertions(+), 14 deletions(-)
  9. diff --git a/CMakeLists.txt b/CMakeLists.txt
  10. index 726e8e4..181a2bd 100644
  11. --- a/CMakeLists.txt
  12. +++ b/CMakeLists.txt
  13. @@ -20,12 +20,18 @@ project(Legion)
  14. #------------------------------------------------------------------------------#
  15. # Some boilerplate to setup nice output directories
  16. #------------------------------------------------------------------------------#
  17. +
  18. +#for multilib distros
  19. +if (NOT DEFINED LIB)
  20. + set(LIB "lib")
  21. +endif(NOT DEFINED LIB)
  22. +
  23. list(INSERT CMAKE_MODULE_PATH 0 "${Legion_SOURCE_DIR}/cmake")
  24. if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
  25. - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${Legion_BINARY_DIR}/lib)
  26. + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${Legion_BINARY_DIR}/${LIB})
  27. endif()
  28. if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
  29. - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${Legion_BINARY_DIR}/lib)
  30. + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${Legion_BINARY_DIR}/${LIB})
  31. endif()
  32. if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
  33. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${Legion_BINARY_DIR}/bin)
  34. @@ -50,7 +56,7 @@ option(Legion_USE_HWLOC "Use hwloc for topology awareness" OFF)
  35. if(Legion_USE_HWLOC)
  36. find_package(HWLOC REQUIRED)
  37. install(FILES ${Legion_SOURCE_DIR}/cmake/FindHWLOC.cmake
  38. - DESTINATION lib/cmake/Legion
  39. + DESTINATION ${LIB}/cmake/Legion
  40. )
  41. endif()
  42. @@ -69,7 +75,7 @@ if(Legion_USE_GASNet)
  43. mark_as_advanced(GASNet_CONDUIT)
  44. find_package(GASNet REQUIRED)
  45. install(FILES ${Legion_SOURCE_DIR}/cmake/FindGASNet.cmake
  46. - DESTINATION lib/cmake/Legion
  47. + DESTINATION ${LIB}/cmake/Legion
  48. )
  49. endif()
  50. @@ -81,7 +87,7 @@ if(Legion_USE_LLVM)
  51. set(Legion_LLVM_COMPONENTS irreader jit mcjit x86)
  52. find_package(LLVM REQUIRED COMPONENTS ${Legion_LLVM_COMPONENTS})
  53. install(FILES ${Legion_SOURCE_DIR}/cmake/FindLLVM.cmake
  54. - DESTINATION lib/cmake/Legion
  55. + DESTINATION ${LIB}/cmake/Legion
  56. )
  57. endif()
  58. @@ -97,10 +103,10 @@ if(Legion_USE_CUDA)
  59. endif()
  60. find_package(CUDA REQUIRED)
  61. install(FILES ${Legion_SOURCE_DIR}/cmake/FindCUDA.cmake
  62. - DESTINATION lib/cmake/Legion
  63. + DESTINATION ${LIB}/cmake/Legion
  64. )
  65. install(FILES ${Legion_SOURCE_DIR}/cmake/newcmake/FindCUDA.cmake
  66. - DESTINATION lib/cmake/Legion/newcmake
  67. + DESTINATION ${LIB}/cmake/Legion/newcmake
  68. )
  69. endif()
  70. @@ -128,7 +134,7 @@ export(EXPORT LegionTargets
  71. install(EXPORT LegionTargets
  72. NAMESPACE Legion::
  73. FILE LegionTargets.cmake
  74. - DESTINATION lib/cmake/Legion
  75. + DESTINATION ${LIB}/cmake/Legion
  76. )
  77. configure_file(
  78. @@ -137,7 +143,7 @@ configure_file(
  79. @ONLY
  80. )
  81. install(FILES ${Legion_BINARY_DIR}/LegionConfigCommon.cmake
  82. - DESTINATION lib/cmake/Legion
  83. + DESTINATION ${LIB}/cmake/Legion
  84. )
  85. configure_file(
  86. @@ -147,7 +153,7 @@ configure_file(
  87. )
  88. install(FILES cmake/LegionConfig-install.cmake
  89. - DESTINATION lib/cmake/Legion
  90. + DESTINATION ${LIB}/cmake/Legion
  91. RENAME LegionConfig.cmake
  92. )
  93. diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt
  94. index e21e141..91f6a03 100644
  95. --- a/runtime/CMakeLists.txt
  96. +++ b/runtime/CMakeLists.txt
  97. @@ -176,8 +176,8 @@ target_include_directories(LowLevelRuntime
  98. )
  99. install(TARGETS LowLevelRuntime EXPORT LegionTargets
  100. - LIBRARY DESTINATION lib
  101. - ARCHIVE DESTINATION lib
  102. + LIBRARY DESTINATION ${LIB}
  103. + ARCHIVE DESTINATION ${LIB}
  104. RUNTIME DESTINATION bin
  105. )
  106. @@ -244,8 +244,8 @@ target_include_directories(HighLevelRuntime
  107. )
  108. install(TARGETS HighLevelRuntime EXPORT LegionTargets
  109. - LIBRARY DESTINATION lib
  110. - ARCHIVE DESTINATION lib
  111. + LIBRARY DESTINATION ${LIB}
  112. + ARCHIVE DESTINATION ${LIB}
  113. RUNTIME DESTINATION bin
  114. )
  115. --
  116. 2.7.3