deps-unix-common.cmake 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. # The unix common part expects DEP_CMAKE_OPTS to be set
  2. if (MINGW)
  3. set(TBB_MINGW_WORKAROUND "-flifetime-dse=1")
  4. else ()
  5. set(TBB_MINGW_WORKAROUND "")
  6. endif ()
  7. find_package(ZLIB QUIET)
  8. if (NOT ZLIB_FOUND)
  9. message(WARNING "No ZLIB dev package found in system, building static library. You should install the system package.")
  10. endif ()
  11. # TODO Evaluate expat modifications in the bundled version and test with system versions in various distros and OSX SDKs
  12. # find_package(EXPAT QUIET)
  13. # if (NOT EXPAT_FOUND)
  14. # message(WARNING "No EXPAT dev package found in system, building static library. Consider installing the system package.")
  15. # endif ()
  16. ExternalProject_Add(dep_tbb
  17. EXCLUDE_FROM_ALL 1
  18. URL "https://github.com/wjakob/tbb/archive/a0dc9bf76d0120f917b641ed095360448cabc85b.tar.gz"
  19. URL_HASH SHA256=0545cb6033bd1873fcae3ea304def720a380a88292726943ae3b9b207f322efe
  20. CMAKE_ARGS
  21. -DTBB_BUILD_SHARED=OFF
  22. -DTBB_BUILD_TESTS=OFF
  23. -DCMAKE_CXX_FLAGS=${TBB_MINGW_WORKAROUND}
  24. -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local
  25. ${DEP_CMAKE_OPTS}
  26. )
  27. ExternalProject_Add(dep_gtest
  28. EXCLUDE_FROM_ALL 1
  29. URL "https://github.com/google/googletest/archive/release-1.8.1.tar.gz"
  30. URL_HASH SHA256=9bf1fe5182a604b4135edc1a425ae356c9ad15e9b23f9f12a02e80184c3a249c
  31. CMAKE_ARGS -DBUILD_GMOCK=OFF ${DEP_CMAKE_OPTS} -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local
  32. )
  33. ExternalProject_Add(dep_cereal
  34. EXCLUDE_FROM_ALL 1
  35. URL "https://github.com/USCiLab/cereal/archive/v1.2.2.tar.gz"
  36. # URL_HASH SHA256=c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae
  37. CMAKE_ARGS
  38. -DJUST_INSTALL_CEREAL=on
  39. -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local
  40. ${DEP_CMAKE_OPTS}
  41. )
  42. ExternalProject_Add(dep_nlopt
  43. EXCLUDE_FROM_ALL 1
  44. URL "https://github.com/stevengj/nlopt/archive/v2.5.0.tar.gz"
  45. URL_HASH SHA256=c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae
  46. CMAKE_ARGS
  47. -DBUILD_SHARED_LIBS=OFF
  48. -DNLOPT_PYTHON=OFF
  49. -DNLOPT_OCTAVE=OFF
  50. -DNLOPT_MATLAB=OFF
  51. -DNLOPT_GUILE=OFF
  52. -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local
  53. ${DEP_CMAKE_OPTS}
  54. )
  55. ExternalProject_Add(dep_qhull
  56. EXCLUDE_FROM_ALL 1
  57. #URL "https://github.com/qhull/qhull/archive/v7.3.2.tar.gz"
  58. #URL_HASH SHA256=619c8a954880d545194bc03359404ef36a1abd2dde03678089459757fd790cb0
  59. GIT_REPOSITORY https://github.com/qhull/qhull.git
  60. GIT_TAG 7afedcc73666e46a9f1d74632412ebecf53b1b30 # v7.3.2 plus the mac build patch
  61. CMAKE_ARGS
  62. -DBUILD_SHARED_LIBS=OFF
  63. -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local
  64. ${DEP_CMAKE_OPTS}
  65. )
  66. ExternalProject_Add(dep_blosc
  67. EXCLUDE_FROM_ALL 1
  68. GIT_REPOSITORY https://github.com/Blosc/c-blosc.git
  69. GIT_TAG e63775855294b50820ef44d1b157f4de1cc38d3e #v1.17.0
  70. DEPENDS
  71. CMAKE_ARGS
  72. -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local
  73. -DBUILD_SHARED_LIBS=OFF
  74. -DCMAKE_POSITION_INDEPENDENT_CODE=ON
  75. -DCMAKE_DEBUG_POSTFIX=d
  76. -DBUILD_SHARED=OFF
  77. -DBUILD_STATIC=ON
  78. -DBUILD_TESTS=OFF
  79. -DBUILD_BENCHMARKS=OFF
  80. -DPREFER_EXTERNAL_ZLIB=ON
  81. PATCH_COMMAND ${GIT_EXECUTABLE} reset --hard && git clean -df &&
  82. ${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_SOURCE_DIR}/blosc-mods.patch
  83. )
  84. ExternalProject_Add(dep_openexr
  85. EXCLUDE_FROM_ALL 1
  86. GIT_REPOSITORY https://github.com/openexr/openexr.git
  87. GIT_TAG eae0e337c9f5117e78114fd05f7a415819df413a #v2.4.0
  88. CMAKE_ARGS
  89. -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local
  90. -DBUILD_SHARED_LIBS=OFF
  91. -DCMAKE_POSITION_INDEPENDENT_CODE=ON
  92. -DBUILD_TESTING=OFF
  93. -DPYILMBASE_ENABLE:BOOL=OFF
  94. -DOPENEXR_VIEWERS_ENABLE:BOOL=OFF
  95. -DOPENEXR_BUILD_UTILS:BOOL=OFF
  96. )
  97. ExternalProject_Add(dep_openvdb
  98. EXCLUDE_FROM_ALL 1
  99. GIT_REPOSITORY https://github.com/AcademySoftwareFoundation/openvdb.git
  100. GIT_TAG aebaf8d95be5e57fd33949281ec357db4a576c2e #v6.2.1
  101. DEPENDS dep_blosc dep_openexr dep_tbb
  102. CMAKE_ARGS
  103. -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local
  104. -DCMAKE_DEBUG_POSTFIX=d
  105. -DCMAKE_PREFIX_PATH=${DESTDIR}/usr/local
  106. -DBUILD_SHARED_LIBS=OFF
  107. -DCMAKE_POSITION_INDEPENDENT_CODE=ON
  108. -DOPENVDB_BUILD_PYTHON_MODULE=OFF
  109. -DUSE_BLOSC=ON
  110. -DOPENVDB_CORE_SHARED=OFF
  111. -DOPENVDB_CORE_STATIC=ON
  112. -DTBB_STATIC=ON
  113. -DOPENVDB_BUILD_VDB_PRINT=ON
  114. -DDISABLE_DEPENDENCY_VERSION_CHECKS=ON
  115. PATCH_COMMAND PATCH_COMMAND ${GIT_EXECUTABLE} checkout -f -- . && git clean -df &&
  116. ${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_SOURCE_DIR}/openvdb-mods.patch
  117. )