openvdb-mods.patch 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783
  1. From dbe038fce8a15ddc9a5c83ec5156d7bc9e178015 Mon Sep 17 00:00:00 2001
  2. From: tamasmeszaros <meszaros.q@gmail.com>
  3. Date: Wed, 16 Oct 2019 17:42:50 +0200
  4. Subject: [PATCH] Build fixes for PrusaSlicer integration
  5. Signed-off-by: tamasmeszaros <meszaros.q@gmail.com>
  6. ---
  7. CMakeLists.txt | 3 -
  8. cmake/FindBlosc.cmake | 218 ---------------
  9. cmake/FindCppUnit.cmake | 4 +-
  10. cmake/FindIlmBase.cmake | 337 ----------------------
  11. cmake/FindOpenEXR.cmake | 329 ----------------------
  12. cmake/FindOpenVDB.cmake | 19 +-
  13. cmake/FindTBB.cmake | 605 ++++++++++++++++++++--------------------
  14. openvdb/CMakeLists.txt | 13 +-
  15. openvdb/Grid.cc | 3 +
  16. openvdb/PlatformConfig.h | 9 +-
  17. openvdb/cmd/CMakeLists.txt | 4 +-
  18. openvdb/unittest/CMakeLists.txt | 3 +-
  19. openvdb/unittest/TestFile.cc | 2 +-
  20. 13 files changed, 336 insertions(+), 1213 deletions(-)
  21. delete mode 100644 cmake/FindBlosc.cmake
  22. delete mode 100644 cmake/FindIlmBase.cmake
  23. delete mode 100644 cmake/FindOpenEXR.cmake
  24. diff --git a/CMakeLists.txt b/CMakeLists.txt
  25. index 580b353..6d364c1 100644
  26. --- a/CMakeLists.txt
  27. +++ b/CMakeLists.txt
  28. @@ -267,12 +267,9 @@ endif()
  29. if(OPENVDB_INSTALL_CMAKE_MODULES)
  30. set(OPENVDB_CMAKE_MODULES
  31. - cmake/FindBlosc.cmake
  32. cmake/FindCppUnit.cmake
  33. cmake/FindJemalloc.cmake
  34. - cmake/FindIlmBase.cmake
  35. cmake/FindLog4cplus.cmake
  36. - cmake/FindOpenEXR.cmake
  37. cmake/FindOpenVDB.cmake
  38. cmake/FindTBB.cmake
  39. cmake/OpenVDBGLFW3Setup.cmake
  40. diff --git a/cmake/FindBlosc.cmake b/cmake/FindBlosc.cmake
  41. deleted file mode 100644
  42. index 5aacfdd..0000000
  43. --- a/cmake/FindBlosc.cmake
  44. +++ /dev/null
  45. @@ -1,218 +0,0 @@
  46. -# Copyright (c) DreamWorks Animation LLC
  47. -#
  48. -# All rights reserved. This software is distributed under the
  49. -# Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
  50. -#
  51. -# Redistributions of source code must retain the above copyright
  52. -# and license notice and the following restrictions and disclaimer.
  53. -#
  54. -# * Neither the name of DreamWorks Animation nor the names of
  55. -# its contributors may be used to endorse or promote products derived
  56. -# from this software without specific prior written permission.
  57. -#
  58. -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  59. -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  60. -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  61. -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  62. -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
  63. -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  64. -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  65. -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  66. -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  67. -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  68. -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  69. -# IN NO EVENT SHALL THE COPYRIGHT HOLDERS' AND CONTRIBUTORS' AGGREGATE
  70. -# LIABILITY FOR ALL CLAIMS REGARDLESS OF THEIR BASIS EXCEED US$250.00.
  71. -#
  72. -#[=======================================================================[.rst:
  73. -
  74. -FindBlosc
  75. ----------
  76. -
  77. -Find Blosc include dirs and libraries
  78. -
  79. -Use this module by invoking find_package with the form::
  80. -
  81. - find_package(Blosc
  82. - [version] [EXACT] # Minimum or EXACT version e.g. 1.5.0
  83. - [REQUIRED] # Fail with error if Blosc is not found
  84. - )
  85. -
  86. -IMPORTED Targets
  87. -^^^^^^^^^^^^^^^^
  88. -
  89. -``Blosc::blosc``
  90. - This module defines IMPORTED target Blosc::Blosc, if Blosc has been found.
  91. -
  92. -Result Variables
  93. -^^^^^^^^^^^^^^^^
  94. -
  95. -This will define the following variables:
  96. -
  97. -``Blosc_FOUND``
  98. - True if the system has the Blosc library.
  99. -``Blosc_VERSION``
  100. - The version of the Blosc library which was found.
  101. -``Blosc_INCLUDE_DIRS``
  102. - Include directories needed to use Blosc.
  103. -``Blosc_LIBRARIES``
  104. - Libraries needed to link to Blosc.
  105. -``Blosc_LIBRARY_DIRS``
  106. - Blosc library directories.
  107. -
  108. -Cache Variables
  109. -^^^^^^^^^^^^^^^
  110. -
  111. -The following cache variables may also be set:
  112. -
  113. -``Blosc_INCLUDE_DIR``
  114. - The directory containing ``blosc.h``.
  115. -``Blosc_LIBRARY``
  116. - The path to the Blosc library.
  117. -
  118. -Hints
  119. -^^^^^
  120. -
  121. -Instead of explicitly setting the cache variables, the following variables
  122. -may be provided to tell this module where to look.
  123. -
  124. -``BLOSC_ROOT``
  125. - Preferred installation prefix.
  126. -``BLOSC_INCLUDEDIR``
  127. - Preferred include directory e.g. <prefix>/include
  128. -``BLOSC_LIBRARYDIR``
  129. - Preferred library directory e.g. <prefix>/lib
  130. -``SYSTEM_LIBRARY_PATHS``
  131. - Paths appended to all include and lib searches.
  132. -
  133. -#]=======================================================================]
  134. -
  135. -mark_as_advanced(
  136. - Blosc_INCLUDE_DIR
  137. - Blosc_LIBRARY
  138. -)
  139. -
  140. -# Append BLOSC_ROOT or $ENV{BLOSC_ROOT} if set (prioritize the direct cmake var)
  141. -set(_BLOSC_ROOT_SEARCH_DIR "")
  142. -
  143. -if(BLOSC_ROOT)
  144. - list(APPEND _BLOSC_ROOT_SEARCH_DIR ${BLOSC_ROOT})
  145. -else()
  146. - set(_ENV_BLOSC_ROOT $ENV{BLOSC_ROOT})
  147. - if(_ENV_BLOSC_ROOT)
  148. - list(APPEND _BLOSC_ROOT_SEARCH_DIR ${_ENV_BLOSC_ROOT})
  149. - endif()
  150. -endif()
  151. -
  152. -# Additionally try and use pkconfig to find blosc
  153. -
  154. -find_package(PkgConfig)
  155. -pkg_check_modules(PC_Blosc QUIET blosc)
  156. -
  157. -# ------------------------------------------------------------------------
  158. -# Search for blosc include DIR
  159. -# ------------------------------------------------------------------------
  160. -
  161. -set(_BLOSC_INCLUDE_SEARCH_DIRS "")
  162. -list(APPEND _BLOSC_INCLUDE_SEARCH_DIRS
  163. - ${BLOSC_INCLUDEDIR}
  164. - ${_BLOSC_ROOT_SEARCH_DIR}
  165. - ${PC_Blosc_INCLUDE_DIRS}
  166. - ${SYSTEM_LIBRARY_PATHS}
  167. -)
  168. -
  169. -# Look for a standard blosc header file.
  170. -find_path(Blosc_INCLUDE_DIR blosc.h
  171. - NO_DEFAULT_PATH
  172. - PATHS ${_BLOSC_INCLUDE_SEARCH_DIRS}
  173. - PATH_SUFFIXES include
  174. -)
  175. -
  176. -if(EXISTS "${Blosc_INCLUDE_DIR}/blosc.h")
  177. - file(STRINGS "${Blosc_INCLUDE_DIR}/blosc.h"
  178. - _blosc_version_major_string REGEX "#define BLOSC_VERSION_MAJOR +[0-9]+ "
  179. - )
  180. - string(REGEX REPLACE "#define BLOSC_VERSION_MAJOR +([0-9]+).*$" "\\1"
  181. - _blosc_version_major_string "${_blosc_version_major_string}"
  182. - )
  183. - string(STRIP "${_blosc_version_major_string}" Blosc_VERSION_MAJOR)
  184. -
  185. - file(STRINGS "${Blosc_INCLUDE_DIR}/blosc.h"
  186. - _blosc_version_minor_string REGEX "#define BLOSC_VERSION_MINOR +[0-9]+ "
  187. - )
  188. - string(REGEX REPLACE "#define BLOSC_VERSION_MINOR +([0-9]+).*$" "\\1"
  189. - _blosc_version_minor_string "${_blosc_version_minor_string}"
  190. - )
  191. - string(STRIP "${_blosc_version_minor_string}" Blosc_VERSION_MINOR)
  192. -
  193. - unset(_blosc_version_major_string)
  194. - unset(_blosc_version_minor_string)
  195. -
  196. - set(Blosc_VERSION ${Blosc_VERSION_MAJOR}.${Blosc_VERSION_MINOR})
  197. -endif()
  198. -
  199. -# ------------------------------------------------------------------------
  200. -# Search for blosc lib DIR
  201. -# ------------------------------------------------------------------------
  202. -
  203. -set(_BLOSC_LIBRARYDIR_SEARCH_DIRS "")
  204. -list(APPEND _BLOSC_LIBRARYDIR_SEARCH_DIRS
  205. - ${BLOSC_LIBRARYDIR}
  206. - ${_BLOSC_ROOT_SEARCH_DIR}
  207. - ${PC_Blosc_LIBRARY_DIRS}
  208. - ${SYSTEM_LIBRARY_PATHS}
  209. -)
  210. -
  211. -# Static library setup
  212. -if(UNIX AND BLOSC_USE_STATIC_LIBS)
  213. - set(_BLOSC_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
  214. - set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
  215. -endif()
  216. -
  217. -set(BLOSC_PATH_SUFFIXES
  218. - lib64
  219. - lib
  220. -)
  221. -
  222. -find_library(Blosc_LIBRARY blosc
  223. - NO_DEFAULT_PATH
  224. - PATHS ${_BLOSC_LIBRARYDIR_SEARCH_DIRS}
  225. - PATH_SUFFIXES ${BLOSC_PATH_SUFFIXES}
  226. -)
  227. -
  228. -if(UNIX AND BLOSC_USE_STATIC_LIBS)
  229. - set(CMAKE_FIND_LIBRARY_SUFFIXES ${_BLOSC_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
  230. - unset(_BLOSC_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
  231. -endif()
  232. -
  233. -# ------------------------------------------------------------------------
  234. -# Cache and set Blosc_FOUND
  235. -# ------------------------------------------------------------------------
  236. -
  237. -include(FindPackageHandleStandardArgs)
  238. -find_package_handle_standard_args(Blosc
  239. - FOUND_VAR Blosc_FOUND
  240. - REQUIRED_VARS
  241. - Blosc_LIBRARY
  242. - Blosc_INCLUDE_DIR
  243. - VERSION_VAR Blosc_VERSION
  244. -)
  245. -
  246. -if(Blosc_FOUND)
  247. - set(Blosc_LIBRARIES ${Blosc_LIBRARY})
  248. - set(Blosc_INCLUDE_DIRS ${Blosc_INCLUDE_DIR})
  249. - set(Blosc_DEFINITIONS ${PC_Blosc_CFLAGS_OTHER})
  250. -
  251. - get_filename_component(Blosc_LIBRARY_DIRS ${Blosc_LIBRARY} DIRECTORY)
  252. -
  253. - if(NOT TARGET Blosc::blosc)
  254. - add_library(Blosc::blosc UNKNOWN IMPORTED)
  255. - set_target_properties(Blosc::blosc PROPERTIES
  256. - IMPORTED_LOCATION "${Blosc_LIBRARIES}"
  257. - INTERFACE_COMPILE_DEFINITIONS "${Blosc_DEFINITIONS}"
  258. - INTERFACE_INCLUDE_DIRECTORIES "${Blosc_INCLUDE_DIRS}"
  259. - )
  260. - endif()
  261. -elseif(Blosc_FIND_REQUIRED)
  262. - message(FATAL_ERROR "Unable to find Blosc")
  263. -endif()
  264. diff --git a/cmake/FindCppUnit.cmake b/cmake/FindCppUnit.cmake
  265. index e2beb93..a891624 100644
  266. --- a/cmake/FindCppUnit.cmake
  267. +++ b/cmake/FindCppUnit.cmake
  268. @@ -125,7 +125,7 @@ list(APPEND _CPPUNIT_INCLUDE_SEARCH_DIRS
  269. # Look for a standard cppunit header file.
  270. find_path(CppUnit_INCLUDE_DIR cppunit/Portability.h
  271. - NO_DEFAULT_PATH
  272. + # NO_DEFAULT_PATH
  273. PATHS ${_CPPUNIT_INCLUDE_SEARCH_DIRS}
  274. PATH_SUFFIXES include
  275. )
  276. @@ -177,7 +177,7 @@ set(CPPUNIT_PATH_SUFFIXES
  277. )
  278. find_library(CppUnit_LIBRARY cppunit
  279. - NO_DEFAULT_PATH
  280. + # NO_DEFAULT_PATH
  281. PATHS ${_CPPUNIT_LIBRARYDIR_SEARCH_DIRS}
  282. PATH_SUFFIXES ${CPPUNIT_PATH_SUFFIXES}
  283. )
  284. diff --git a/cmake/FindIlmBase.cmake b/cmake/FindIlmBase.cmake
  285. deleted file mode 100644
  286. index 9dbc252..0000000
  287. --- a/cmake/FindIlmBase.cmake
  288. +++ /dev/null
  289. @@ -1,337 +0,0 @@
  290. -# Copyright (c) DreamWorks Animation LLC
  291. -#
  292. -# All rights reserved. This software is distributed under the
  293. -# Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
  294. -#
  295. -# Redistributions of source code must retain the above copyright
  296. -# and license notice and the following restrictions and disclaimer.
  297. -#
  298. -# * Neither the name of DreamWorks Animation nor the names of
  299. -# its contributors may be used to endorse or promote products derived
  300. -# from this software without specific prior written permission.
  301. -#
  302. -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  303. -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  304. -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  305. -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  306. -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
  307. -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  308. -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  309. -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  310. -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  311. -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  312. -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  313. -# IN NO EVENT SHALL THE COPYRIGHT HOLDERS' AND CONTRIBUTORS' AGGREGATE
  314. -# LIABILITY FOR ALL CLAIMS REGARDLESS OF THEIR BASIS EXCEED US$250.00.
  315. -#
  316. -#[=======================================================================[.rst:
  317. -
  318. -FindIlmBase
  319. ------------
  320. -
  321. -Find IlmBase include dirs and libraries
  322. -
  323. -Use this module by invoking find_package with the form::
  324. -
  325. - find_package(IlmBase
  326. - [version] [EXACT] # Minimum or EXACT version
  327. - [REQUIRED] # Fail with error if IlmBase is not found
  328. - [COMPONENTS <libs>...] # IlmBase libraries by their canonical name
  329. - # e.g. "Half" for "libHalf"
  330. - )
  331. -
  332. -IMPORTED Targets
  333. -^^^^^^^^^^^^^^^^
  334. -
  335. -``IlmBase::Half``
  336. - The Half library target.
  337. -``IlmBase::Iex``
  338. - The Iex library target.
  339. -``IlmBase::IexMath``
  340. - The IexMath library target.
  341. -``IlmBase::IlmThread``
  342. - The IlmThread library target.
  343. -``IlmBase::Imath``
  344. - The Imath library target.
  345. -
  346. -Result Variables
  347. -^^^^^^^^^^^^^^^^
  348. -
  349. -This will define the following variables:
  350. -
  351. -``IlmBase_FOUND``
  352. - True if the system has the IlmBase library.
  353. -``IlmBase_VERSION``
  354. - The version of the IlmBase library which was found.
  355. -``IlmBase_INCLUDE_DIRS``
  356. - Include directories needed to use IlmBase.
  357. -``IlmBase_LIBRARIES``
  358. - Libraries needed to link to IlmBase.
  359. -``IlmBase_LIBRARY_DIRS``
  360. - IlmBase library directories.
  361. -``IlmBase_{COMPONENT}_FOUND``
  362. - True if the system has the named IlmBase component.
  363. -
  364. -Cache Variables
  365. -^^^^^^^^^^^^^^^
  366. -
  367. -The following cache variables may also be set:
  368. -
  369. -``IlmBase_INCLUDE_DIR``
  370. - The directory containing ``IlmBase/config-auto.h``.
  371. -``IlmBase_{COMPONENT}_LIBRARY``
  372. - Individual component libraries for IlmBase
  373. -``IlmBase_{COMPONENT}_DLL``
  374. - Individual component dlls for IlmBase on Windows.
  375. -
  376. -Hints
  377. -^^^^^
  378. -
  379. -Instead of explicitly setting the cache variables, the following variables
  380. -may be provided to tell this module where to look.
  381. -
  382. -``ILMBASE_ROOT``
  383. - Preferred installation prefix.
  384. -``ILMBASE_INCLUDEDIR``
  385. - Preferred include directory e.g. <prefix>/include
  386. -``ILMBASE_LIBRARYDIR``
  387. - Preferred library directory e.g. <prefix>/lib
  388. -``SYSTEM_LIBRARY_PATHS``
  389. - Paths appended to all include and lib searches.
  390. -
  391. -#]=======================================================================]
  392. -
  393. -# Support new if() IN_LIST operator
  394. -if(POLICY CMP0057)
  395. - cmake_policy(SET CMP0057 NEW)
  396. -endif()
  397. -
  398. -mark_as_advanced(
  399. - IlmBase_INCLUDE_DIR
  400. - IlmBase_LIBRARY
  401. -)
  402. -
  403. -set(_ILMBASE_COMPONENT_LIST
  404. - Half
  405. - Iex
  406. - IexMath
  407. - IlmThread
  408. - Imath
  409. -)
  410. -
  411. -if(IlmBase_FIND_COMPONENTS)
  412. - set(ILMBASE_COMPONENTS_PROVIDED TRUE)
  413. - set(_IGNORED_COMPONENTS "")
  414. - foreach(COMPONENT ${IlmBase_FIND_COMPONENTS})
  415. - if(NOT ${COMPONENT} IN_LIST _ILMBASE_COMPONENT_LIST)
  416. - list(APPEND _IGNORED_COMPONENTS ${COMPONENT})
  417. - endif()
  418. - endforeach()
  419. -
  420. - if(_IGNORED_COMPONENTS)
  421. - message(STATUS "Ignoring unknown components of IlmBase:")
  422. - foreach(COMPONENT ${_IGNORED_COMPONENTS})
  423. - message(STATUS " ${COMPONENT}")
  424. - endforeach()
  425. - list(REMOVE_ITEM IlmBase_FIND_COMPONENTS ${_IGNORED_COMPONENTS})
  426. - endif()
  427. -else()
  428. - set(ILMBASE_COMPONENTS_PROVIDED FALSE)
  429. - set(IlmBase_FIND_COMPONENTS ${_ILMBASE_COMPONENT_LIST})
  430. -endif()
  431. -
  432. -# Append ILMBASE_ROOT or $ENV{ILMBASE_ROOT} if set (prioritize the direct cmake var)
  433. -set(_ILMBASE_ROOT_SEARCH_DIR "")
  434. -
  435. -if(ILMBASE_ROOT)
  436. - list(APPEND _ILMBASE_ROOT_SEARCH_DIR ${ILMBASE_ROOT})
  437. -else()
  438. - set(_ENV_ILMBASE_ROOT $ENV{ILMBASE_ROOT})
  439. - if(_ENV_ILMBASE_ROOT)
  440. - list(APPEND _ILMBASE_ROOT_SEARCH_DIR ${_ENV_ILMBASE_ROOT})
  441. - endif()
  442. -endif()
  443. -
  444. -# Additionally try and use pkconfig to find IlmBase
  445. -
  446. -find_package(PkgConfig)
  447. -pkg_check_modules(PC_IlmBase QUIET IlmBase)
  448. -
  449. -# ------------------------------------------------------------------------
  450. -# Search for IlmBase include DIR
  451. -# ------------------------------------------------------------------------
  452. -
  453. -set(_ILMBASE_INCLUDE_SEARCH_DIRS "")
  454. -list(APPEND _ILMBASE_INCLUDE_SEARCH_DIRS
  455. - ${ILMBASE_INCLUDEDIR}
  456. - ${_ILMBASE_ROOT_SEARCH_DIR}
  457. - ${PC_IlmBase_INCLUDEDIR}
  458. - ${SYSTEM_LIBRARY_PATHS}
  459. -)
  460. -
  461. -# Look for a standard IlmBase header file.
  462. -find_path(IlmBase_INCLUDE_DIR IlmBaseConfig.h
  463. - NO_DEFAULT_PATH
  464. - PATHS ${_ILMBASE_INCLUDE_SEARCH_DIRS}
  465. - PATH_SUFFIXES include/OpenEXR OpenEXR
  466. -)
  467. -
  468. -if(EXISTS "${IlmBase_INCLUDE_DIR}/IlmBaseConfig.h")
  469. - # Get the ILMBASE version information from the config header
  470. - file(STRINGS "${IlmBase_INCLUDE_DIR}/IlmBaseConfig.h"
  471. - _ilmbase_version_major_string REGEX "#define ILMBASE_VERSION_MAJOR "
  472. - )
  473. - string(REGEX REPLACE "#define ILMBASE_VERSION_MAJOR" ""
  474. - _ilmbase_version_major_string "${_ilmbase_version_major_string}"
  475. - )
  476. - string(STRIP "${_ilmbase_version_major_string}" IlmBase_VERSION_MAJOR)
  477. -
  478. - file(STRINGS "${IlmBase_INCLUDE_DIR}/IlmBaseConfig.h"
  479. - _ilmbase_version_minor_string REGEX "#define ILMBASE_VERSION_MINOR "
  480. - )
  481. - string(REGEX REPLACE "#define ILMBASE_VERSION_MINOR" ""
  482. - _ilmbase_version_minor_string "${_ilmbase_version_minor_string}"
  483. - )
  484. - string(STRIP "${_ilmbase_version_minor_string}" IlmBase_VERSION_MINOR)
  485. -
  486. - unset(_ilmbase_version_major_string)
  487. - unset(_ilmbase_version_minor_string)
  488. -
  489. - set(IlmBase_VERSION ${IlmBase_VERSION_MAJOR}.${IlmBase_VERSION_MINOR})
  490. -endif()
  491. -
  492. -# ------------------------------------------------------------------------
  493. -# Search for ILMBASE lib DIR
  494. -# ------------------------------------------------------------------------
  495. -
  496. -set(_ILMBASE_LIBRARYDIR_SEARCH_DIRS "")
  497. -
  498. -# Append to _ILMBASE_LIBRARYDIR_SEARCH_DIRS in priority order
  499. -
  500. -list(APPEND _ILMBASE_LIBRARYDIR_SEARCH_DIRS
  501. - ${ILMBASE_LIBRARYDIR}
  502. - ${_ILMBASE_ROOT_SEARCH_DIR}
  503. - ${PC_IlmBase_LIBDIR}
  504. - ${SYSTEM_LIBRARY_PATHS}
  505. -)
  506. -
  507. -# Build suffix directories
  508. -
  509. -set(ILMBASE_PATH_SUFFIXES
  510. - lib64
  511. - lib
  512. -)
  513. -
  514. -if(UNIX)
  515. - list(INSERT ILMBASE_PATH_SUFFIXES 0 lib/x86_64-linux-gnu)
  516. -endif()
  517. -
  518. -set(_ILMBASE_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
  519. -
  520. -# library suffix handling
  521. -if(WIN32)
  522. - list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
  523. - "-${IlmBase_VERSION_MAJOR}_${IlmBase_VERSION_MINOR}.lib"
  524. - )
  525. -else()
  526. - if(ILMBASE_USE_STATIC_LIBS)
  527. - list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
  528. - "-${IlmBase_VERSION_MAJOR}_${IlmBase_VERSION_MINOR}.a"
  529. - )
  530. - else()
  531. - if(APPLE)
  532. - list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
  533. - "-${IlmBase_VERSION_MAJOR}_${IlmBase_VERSION_MINOR}.dylib"
  534. - )
  535. - else()
  536. - list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
  537. - "-${IlmBase_VERSION_MAJOR}_${IlmBase_VERSION_MINOR}.so"
  538. - )
  539. - endif()
  540. - endif()
  541. -endif()
  542. -
  543. -set(IlmBase_LIB_COMPONENTS "")
  544. -
  545. -foreach(COMPONENT ${IlmBase_FIND_COMPONENTS})
  546. - find_library(IlmBase_${COMPONENT}_LIBRARY ${COMPONENT}
  547. - NO_DEFAULT_PATH
  548. - PATHS ${_ILMBASE_LIBRARYDIR_SEARCH_DIRS}
  549. - PATH_SUFFIXES ${ILMBASE_PATH_SUFFIXES}
  550. - )
  551. - list(APPEND IlmBase_LIB_COMPONENTS ${IlmBase_${COMPONENT}_LIBRARY})
  552. -
  553. - if(WIN32 AND NOT ILMBASE_USE_STATIC_LIBS)
  554. - set(_ILMBASE_TMP ${CMAKE_FIND_LIBRARY_SUFFIXES})
  555. - set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
  556. - find_library(IlmBase_${COMPONENT}_DLL ${COMPONENT}
  557. - NO_DEFAULT_PATH
  558. - PATHS ${_ILMBASE_LIBRARYDIR_SEARCH_DIRS}
  559. - PATH_SUFFIXES bin
  560. - )
  561. - set(CMAKE_FIND_LIBRARY_SUFFIXES ${_ILMBASE_TMP})
  562. - unset(_ILMBASE_TMP)
  563. - endif()
  564. -
  565. - if(IlmBase_${COMPONENT}_LIBRARY)
  566. - set(IlmBase_${COMPONENT}_FOUND TRUE)
  567. - else()
  568. - set(IlmBase_${COMPONENT}_FOUND FALSE)
  569. - endif()
  570. -endforeach()
  571. -
  572. -# reset lib suffix
  573. -
  574. -set(CMAKE_FIND_LIBRARY_SUFFIXES ${_ILMBASE_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
  575. -unset(_ILMBASE_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
  576. -
  577. -# ------------------------------------------------------------------------
  578. -# Cache and set ILMBASE_FOUND
  579. -# ------------------------------------------------------------------------
  580. -
  581. -include(FindPackageHandleStandardArgs)
  582. -find_package_handle_standard_args(IlmBase
  583. - FOUND_VAR IlmBase_FOUND
  584. - REQUIRED_VARS
  585. - IlmBase_INCLUDE_DIR
  586. - IlmBase_LIB_COMPONENTS
  587. - VERSION_VAR IlmBase_VERSION
  588. - HANDLE_COMPONENTS
  589. -)
  590. -
  591. -if(IlmBase_FOUND)
  592. - set(IlmBase_LIBRARIES ${IlmBase_LIB_COMPONENTS})
  593. -
  594. - # We have to add both include and include/OpenEXR to the include
  595. - # path in case OpenEXR and IlmBase are installed separately
  596. -
  597. - set(IlmBase_INCLUDE_DIRS)
  598. - list(APPEND IlmBase_INCLUDE_DIRS
  599. - ${IlmBase_INCLUDE_DIR}/../
  600. - ${IlmBase_INCLUDE_DIR}
  601. - )
  602. - set(IlmBase_DEFINITIONS ${PC_IlmBase_CFLAGS_OTHER})
  603. -
  604. - set(IlmBase_LIBRARY_DIRS "")
  605. - foreach(LIB ${IlmBase_LIB_COMPONENTS})
  606. - get_filename_component(_ILMBASE_LIBDIR ${LIB} DIRECTORY)
  607. - list(APPEND IlmBase_LIBRARY_DIRS ${_ILMBASE_LIBDIR})
  608. - endforeach()
  609. - list(REMOVE_DUPLICATES IlmBase_LIBRARY_DIRS)
  610. -
  611. - # Configure imported targets
  612. -
  613. - foreach(COMPONENT ${IlmBase_FIND_COMPONENTS})
  614. - if(NOT TARGET IlmBase::${COMPONENT})
  615. - add_library(IlmBase::${COMPONENT} UNKNOWN IMPORTED)
  616. - set_target_properties(IlmBase::${COMPONENT} PROPERTIES
  617. - IMPORTED_LOCATION "${IlmBase_${COMPONENT}_LIBRARY}"
  618. - INTERFACE_COMPILE_OPTIONS "${IlmBase_DEFINITIONS}"
  619. - INTERFACE_INCLUDE_DIRECTORIES "${IlmBase_INCLUDE_DIRS}"
  620. - )
  621. - endif()
  622. - endforeach()
  623. -
  624. -elseif(IlmBase_FIND_REQUIRED)
  625. - message(FATAL_ERROR "Unable to find IlmBase")
  626. -endif()
  627. diff --git a/cmake/FindOpenEXR.cmake b/cmake/FindOpenEXR.cmake
  628. deleted file mode 100644
  629. index 339c1a2..0000000
  630. --- a/cmake/FindOpenEXR.cmake
  631. +++ /dev/null
  632. @@ -1,329 +0,0 @@
  633. -# Copyright (c) DreamWorks Animation LLC
  634. -#
  635. -# All rights reserved. This software is distributed under the
  636. -# Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
  637. -#
  638. -# Redistributions of source code must retain the above copyright
  639. -# and license notice and the following restrictions and disclaimer.
  640. -#
  641. -# * Neither the name of DreamWorks Animation nor the names of
  642. -# its contributors may be used to endorse or promote products derived
  643. -# from this software without specific prior written permission.
  644. -#
  645. -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  646. -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  647. -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  648. -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  649. -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
  650. -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  651. -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  652. -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  653. -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  654. -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  655. -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  656. -# IN NO EVENT SHALL THE COPYRIGHT HOLDERS' AND CONTRIBUTORS' AGGREGATE
  657. -# LIABILITY FOR ALL CLAIMS REGARDLESS OF THEIR BASIS EXCEED US$250.00.
  658. -#
  659. -#[=======================================================================[.rst:
  660. -
  661. -FindOpenEXR
  662. ------------
  663. -
  664. -Find OpenEXR include dirs and libraries
  665. -
  666. -Use this module by invoking find_package with the form::
  667. -
  668. - find_package(OpenEXR
  669. - [version] [EXACT] # Minimum or EXACT version
  670. - [REQUIRED] # Fail with error if OpenEXR is not found
  671. - [COMPONENTS <libs>...] # OpenEXR libraries by their canonical name
  672. - # e.g. "IlmImf" for "libIlmImf"
  673. - )
  674. -
  675. -IMPORTED Targets
  676. -^^^^^^^^^^^^^^^^
  677. -
  678. -``OpenEXR::IlmImf``
  679. - The IlmImf library target.
  680. -``OpenEXR::IlmImfUtil``
  681. - The IlmImfUtil library target.
  682. -
  683. -Result Variables
  684. -^^^^^^^^^^^^^^^^
  685. -
  686. -This will define the following variables:
  687. -
  688. -``OpenEXR_FOUND``
  689. - True if the system has the OpenEXR library.
  690. -``OpenEXR_VERSION``
  691. - The version of the OpenEXR library which was found.
  692. -``OpenEXR_INCLUDE_DIRS``
  693. - Include directories needed to use OpenEXR.
  694. -``OpenEXR_LIBRARIES``
  695. - Libraries needed to link to OpenEXR.
  696. -``OpenEXR_LIBRARY_DIRS``
  697. - OpenEXR library directories.
  698. -``OpenEXR_DEFINITIONS``
  699. - Definitions to use when compiling code that uses OpenEXR.
  700. -``OpenEXR_{COMPONENT}_FOUND``
  701. - True if the system has the named OpenEXR component.
  702. -
  703. -Cache Variables
  704. -^^^^^^^^^^^^^^^
  705. -
  706. -The following cache variables may also be set:
  707. -
  708. -``OpenEXR_INCLUDE_DIR``
  709. - The directory containing ``OpenEXR/config-auto.h``.
  710. -``OpenEXR_{COMPONENT}_LIBRARY``
  711. - Individual component libraries for OpenEXR
  712. -``OpenEXR_{COMPONENT}_DLL``
  713. - Individual component dlls for OpenEXR on Windows.
  714. -
  715. -Hints
  716. -^^^^^
  717. -
  718. -Instead of explicitly setting the cache variables, the following variables
  719. -may be provided to tell this module where to look.
  720. -
  721. -``OPENEXR_ROOT``
  722. - Preferred installation prefix.
  723. -``OPENEXR_INCLUDEDIR``
  724. - Preferred include directory e.g. <prefix>/include
  725. -``OPENEXR_LIBRARYDIR``
  726. - Preferred library directory e.g. <prefix>/lib
  727. -``SYSTEM_LIBRARY_PATHS``
  728. - Paths appended to all include and lib searches.
  729. -
  730. -#]=======================================================================]
  731. -
  732. -# Support new if() IN_LIST operator
  733. -if(POLICY CMP0057)
  734. - cmake_policy(SET CMP0057 NEW)
  735. -endif()
  736. -
  737. -mark_as_advanced(
  738. - OpenEXR_INCLUDE_DIR
  739. - OpenEXR_LIBRARY
  740. -)
  741. -
  742. -set(_OPENEXR_COMPONENT_LIST
  743. - IlmImf
  744. - IlmImfUtil
  745. -)
  746. -
  747. -if(OpenEXR_FIND_COMPONENTS)
  748. - set(OPENEXR_COMPONENTS_PROVIDED TRUE)
  749. - set(_IGNORED_COMPONENTS "")
  750. - foreach(COMPONENT ${OpenEXR_FIND_COMPONENTS})
  751. - if(NOT ${COMPONENT} IN_LIST _OPENEXR_COMPONENT_LIST)
  752. - list(APPEND _IGNORED_COMPONENTS ${COMPONENT})
  753. - endif()
  754. - endforeach()
  755. -
  756. - if(_IGNORED_COMPONENTS)
  757. - message(STATUS "Ignoring unknown components of OpenEXR:")
  758. - foreach(COMPONENT ${_IGNORED_COMPONENTS})
  759. - message(STATUS " ${COMPONENT}")
  760. - endforeach()
  761. - list(REMOVE_ITEM OpenEXR_FIND_COMPONENTS ${_IGNORED_COMPONENTS})
  762. - endif()
  763. -else()
  764. - set(OPENEXR_COMPONENTS_PROVIDED FALSE)
  765. - set(OpenEXR_FIND_COMPONENTS ${_OPENEXR_COMPONENT_LIST})
  766. -endif()
  767. -
  768. -# Append OPENEXR_ROOT or $ENV{OPENEXR_ROOT} if set (prioritize the direct cmake var)
  769. -set(_OPENEXR_ROOT_SEARCH_DIR "")
  770. -
  771. -if(OPENEXR_ROOT)
  772. - list(APPEND _OPENEXR_ROOT_SEARCH_DIR ${OPENEXR_ROOT})
  773. -else()
  774. - set(_ENV_OPENEXR_ROOT $ENV{OPENEXR_ROOT})
  775. - if(_ENV_OPENEXR_ROOT)
  776. - list(APPEND _OPENEXR_ROOT_SEARCH_DIR ${_ENV_OPENEXR_ROOT})
  777. - endif()
  778. -endif()
  779. -
  780. -# Additionally try and use pkconfig to find OpenEXR
  781. -
  782. -find_package(PkgConfig)
  783. -pkg_check_modules(PC_OpenEXR QUIET OpenEXR)
  784. -
  785. -# ------------------------------------------------------------------------
  786. -# Search for OpenEXR include DIR
  787. -# ------------------------------------------------------------------------
  788. -
  789. -set(_OPENEXR_INCLUDE_SEARCH_DIRS "")
  790. -list(APPEND _OPENEXR_INCLUDE_SEARCH_DIRS
  791. - ${OPENEXR_INCLUDEDIR}
  792. - ${_OPENEXR_ROOT_SEARCH_DIR}
  793. - ${PC_OpenEXR_INCLUDEDIR}
  794. - ${SYSTEM_LIBRARY_PATHS}
  795. -)
  796. -
  797. -# Look for a standard OpenEXR header file.
  798. -find_path(OpenEXR_INCLUDE_DIR OpenEXRConfig.h
  799. - NO_DEFAULT_PATH
  800. - PATHS ${_OPENEXR_INCLUDE_SEARCH_DIRS}
  801. - PATH_SUFFIXES include/OpenEXR OpenEXR
  802. -)
  803. -
  804. -if(EXISTS "${OpenEXR_INCLUDE_DIR}/OpenEXRConfig.h")
  805. - # Get the EXR version information from the config header
  806. - file(STRINGS "${OpenEXR_INCLUDE_DIR}/OpenEXRConfig.h"
  807. - _openexr_version_major_string REGEX "#define OPENEXR_VERSION_MAJOR "
  808. - )
  809. - string(REGEX REPLACE "#define OPENEXR_VERSION_MAJOR" ""
  810. - _openexr_version_major_string "${_openexr_version_major_string}"
  811. - )
  812. - string(STRIP "${_openexr_version_major_string}" OpenEXR_VERSION_MAJOR)
  813. -
  814. - file(STRINGS "${OpenEXR_INCLUDE_DIR}/OpenEXRConfig.h"
  815. - _openexr_version_minor_string REGEX "#define OPENEXR_VERSION_MINOR "
  816. - )
  817. - string(REGEX REPLACE "#define OPENEXR_VERSION_MINOR" ""
  818. - _openexr_version_minor_string "${_openexr_version_minor_string}"
  819. - )
  820. - string(STRIP "${_openexr_version_minor_string}" OpenEXR_VERSION_MINOR)
  821. -
  822. - unset(_openexr_version_major_string)
  823. - unset(_openexr_version_minor_string)
  824. -
  825. - set(OpenEXR_VERSION ${OpenEXR_VERSION_MAJOR}.${OpenEXR_VERSION_MINOR})
  826. -endif()
  827. -
  828. -# ------------------------------------------------------------------------
  829. -# Search for OPENEXR lib DIR
  830. -# ------------------------------------------------------------------------
  831. -
  832. -set(_OPENEXR_LIBRARYDIR_SEARCH_DIRS "")
  833. -
  834. -# Append to _OPENEXR_LIBRARYDIR_SEARCH_DIRS in priority order
  835. -
  836. -list(APPEND _OPENEXR_LIBRARYDIR_SEARCH_DIRS
  837. - ${OPENEXR_LIBRARYDIR}
  838. - ${_OPENEXR_ROOT_SEARCH_DIR}
  839. - ${PC_OpenEXR_LIBDIR}
  840. - ${SYSTEM_LIBRARY_PATHS}
  841. -)
  842. -
  843. -# Build suffix directories
  844. -
  845. -set(OPENEXR_PATH_SUFFIXES
  846. - lib64
  847. - lib
  848. -)
  849. -
  850. -if(UNIX )
  851. - list(INSERT OPENEXR_PATH_SUFFIXES 0 lib/x86_64-linux-gnu)
  852. -endif()
  853. -
  854. -set(_OPENEXR_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
  855. -
  856. -# library suffix handling
  857. -if(WIN32)
  858. - list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
  859. - "-${OpenEXR_VERSION_MAJOR}_${OpenEXR_VERSION_MINOR}.lib"
  860. - )
  861. -else()
  862. - if(OPENEXR_USE_STATIC_LIBS)
  863. - list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
  864. - "-${OpenEXR_VERSION_MAJOR}_${OpenEXR_VERSION_MINOR}.a"
  865. - )
  866. - else()
  867. - if(APPLE)
  868. - list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
  869. - "-${OpenEXR_VERSION_MAJOR}_${OpenEXR_VERSION_MINOR}.dylib"
  870. - )
  871. - else()
  872. - list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
  873. - "-${OpenEXR_VERSION_MAJOR}_${OpenEXR_VERSION_MINOR}.so"
  874. - )
  875. - endif()
  876. - endif()
  877. -endif()
  878. -
  879. -set(OpenEXR_LIB_COMPONENTS "")
  880. -
  881. -foreach(COMPONENT ${OpenEXR_FIND_COMPONENTS})
  882. - find_library(OpenEXR_${COMPONENT}_LIBRARY ${COMPONENT}
  883. - NO_DEFAULT_PATH
  884. - PATHS ${_OPENEXR_LIBRARYDIR_SEARCH_DIRS}
  885. - PATH_SUFFIXES ${OPENEXR_PATH_SUFFIXES}
  886. - )
  887. - list(APPEND OpenEXR_LIB_COMPONENTS ${OpenEXR_${COMPONENT}_LIBRARY})
  888. -
  889. - if(WIN32 AND NOT OPENEXR_USE_STATIC_LIBS)
  890. - set(_OPENEXR_TMP ${CMAKE_FIND_LIBRARY_SUFFIXES})
  891. - set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
  892. - find_library(OpenEXR_${COMPONENT}_DLL ${COMPONENT}
  893. - NO_DEFAULT_PATH
  894. - PATHS ${_OPENEXR_LIBRARYDIR_SEARCH_DIRS}
  895. - PATH_SUFFIXES bin
  896. - )
  897. - set(CMAKE_FIND_LIBRARY_SUFFIXES ${_OPENEXR_TMP})
  898. - unset(_OPENEXR_TMP)
  899. - endif()
  900. -
  901. - if(OpenEXR_${COMPONENT}_LIBRARY)
  902. - set(OpenEXR_${COMPONENT}_FOUND TRUE)
  903. - else()
  904. - set(OpenEXR_${COMPONENT}_FOUND FALSE)
  905. - endif()
  906. -endforeach()
  907. -
  908. -# reset lib suffix
  909. -
  910. -set(CMAKE_FIND_LIBRARY_SUFFIXES ${_OPENEXR_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
  911. -unset(_OPENEXR_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
  912. -
  913. -# ------------------------------------------------------------------------
  914. -# Cache and set OPENEXR_FOUND
  915. -# ------------------------------------------------------------------------
  916. -
  917. -include(FindPackageHandleStandardArgs)
  918. -find_package_handle_standard_args(OpenEXR
  919. - FOUND_VAR OpenEXR_FOUND
  920. - REQUIRED_VARS
  921. - OpenEXR_INCLUDE_DIR
  922. - OpenEXR_LIB_COMPONENTS
  923. - VERSION_VAR OpenEXR_VERSION
  924. - HANDLE_COMPONENTS
  925. -)
  926. -
  927. -if(OpenEXR_FOUND)
  928. - set(OpenEXR_LIBRARIES ${OpenEXR_LIB_COMPONENTS})
  929. -
  930. - # We have to add both include and include/OpenEXR to the include
  931. - # path in case OpenEXR and IlmBase are installed separately
  932. -
  933. - set(OpenEXR_INCLUDE_DIRS)
  934. - list(APPEND OpenEXR_INCLUDE_DIRS
  935. - ${OpenEXR_INCLUDE_DIR}/../
  936. - ${OpenEXR_INCLUDE_DIR}
  937. - )
  938. - set(OpenEXR_DEFINITIONS ${PC_OpenEXR_CFLAGS_OTHER})
  939. -
  940. - set(OpenEXR_LIBRARY_DIRS "")
  941. - foreach(LIB ${OpenEXR_LIB_COMPONENTS})
  942. - get_filename_component(_OPENEXR_LIBDIR ${LIB} DIRECTORY)
  943. - list(APPEND OpenEXR_LIBRARY_DIRS ${_OPENEXR_LIBDIR})
  944. - endforeach()
  945. - list(REMOVE_DUPLICATES OpenEXR_LIBRARY_DIRS)
  946. -
  947. - # Configure imported target
  948. -
  949. - foreach(COMPONENT ${OpenEXR_FIND_COMPONENTS})
  950. - if(NOT TARGET OpenEXR::${COMPONENT})
  951. - add_library(OpenEXR::${COMPONENT} UNKNOWN IMPORTED)
  952. - set_target_properties(OpenEXR::${COMPONENT} PROPERTIES
  953. - IMPORTED_LOCATION "${OpenEXR_${COMPONENT}_LIBRARY}"
  954. - INTERFACE_COMPILE_OPTIONS "${OpenEXR_DEFINITIONS}"
  955. - INTERFACE_INCLUDE_DIRECTORIES "${OpenEXR_INCLUDE_DIRS}"
  956. - )
  957. - endif()
  958. - endforeach()
  959. -elseif(OpenEXR_FIND_REQUIRED)
  960. - message(FATAL_ERROR "Unable to find OpenEXR")
  961. -endif()
  962. diff --git a/cmake/FindOpenVDB.cmake b/cmake/FindOpenVDB.cmake
  963. index 63a2eda..6211071 100644
  964. --- a/cmake/FindOpenVDB.cmake
  965. +++ b/cmake/FindOpenVDB.cmake
  966. @@ -244,7 +244,7 @@ set(OpenVDB_LIB_COMPONENTS "")
  967. foreach(COMPONENT ${OpenVDB_FIND_COMPONENTS})
  968. set(LIB_NAME ${COMPONENT})
  969. - find_library(OpenVDB_${COMPONENT}_LIBRARY ${LIB_NAME}
  970. + find_library(OpenVDB_${COMPONENT}_LIBRARY ${LIB_NAME} lib${LIB_NAME}
  971. NO_DEFAULT_PATH
  972. PATHS ${_OPENVDB_LIBRARYDIR_SEARCH_DIRS}
  973. PATH_SUFFIXES ${OPENVDB_PATH_SUFFIXES}
  974. @@ -282,16 +282,13 @@ find_package_handle_standard_args(OpenVDB
  975. # ------------------------------------------------------------------------
  976. # Set the ABI number the library was built against. Uses vdb_print
  977. +find_program(OPENVDB_PRINT vdb_print
  978. + PATHS ${_OPENVDB_INSTALL}/bin ${OpenVDB_INCLUDE_DIR}
  979. + NO_DEFAULT_PATH)
  980. if(_OPENVDB_INSTALL)
  981. OPENVDB_ABI_VERSION_FROM_PRINT(
  982. - "${_OPENVDB_INSTALL}/bin/vdb_print"
  983. - ABI OpenVDB_ABI
  984. - )
  985. -else()
  986. - # Try and find vdb_print from the include path
  987. - OPENVDB_ABI_VERSION_FROM_PRINT(
  988. - "${OpenVDB_INCLUDE_DIR}/../bin/vdb_print"
  989. + "${OPENVDB_PRINT}"
  990. ABI OpenVDB_ABI
  991. )
  992. endif()
  993. @@ -472,6 +469,12 @@ foreach(COMPONENT ${OpenVDB_FIND_COMPONENTS})
  994. INTERFACE_LINK_LIBRARIES "${_OPENVDB_VISIBLE_DEPENDENCIES}" # visible deps (headers)
  995. INTERFACE_COMPILE_FEATURES cxx_std_11
  996. )
  997. +
  998. + if (OPENVDB_USE_STATIC_LIBS)
  999. + set_target_properties(OpenVDB::${COMPONENT} PROPERTIES
  1000. + INTERFACE_COMPILE_DEFINITIONS "OPENVDB_STATICLIB;OPENVDB_OPENEXR_STATICLIB"
  1001. + )
  1002. + endif()
  1003. endif()
  1004. endforeach()
  1005. diff --git a/cmake/FindTBB.cmake b/cmake/FindTBB.cmake
  1006. index bdf9c81..c6bdec9 100644
  1007. --- a/cmake/FindTBB.cmake
  1008. +++ b/cmake/FindTBB.cmake
  1009. @@ -1,333 +1,332 @@
  1010. -# Copyright (c) DreamWorks Animation LLC
  1011. +# The MIT License (MIT)
  1012. #
  1013. -# All rights reserved. This software is distributed under the
  1014. -# Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
  1015. +# Copyright (c) 2015 Justus Calvin
  1016. +#
  1017. +# Permission is hereby granted, free of charge, to any person obtaining a copy
  1018. +# of this software and associated documentation files (the "Software"), to deal
  1019. +# in the Software without restriction, including without limitation the rights
  1020. +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1021. +# copies of the Software, and to permit persons to whom the Software is
  1022. +# furnished to do so, subject to the following conditions:
  1023. +#
  1024. +# The above copyright notice and this permission notice shall be included in all
  1025. +# copies or substantial portions of the Software.
  1026. +#
  1027. +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1028. +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1029. +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1030. +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1031. +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1032. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  1033. +# SOFTWARE.
  1034. +
  1035. #
  1036. -# Redistributions of source code must retain the above copyright
  1037. -# and license notice and the following restrictions and disclaimer.
  1038. +# FindTBB
  1039. +# -------
  1040. #
  1041. -# * Neither the name of DreamWorks Animation nor the names of
  1042. -# its contributors may be used to endorse or promote products derived
  1043. -# from this software without specific prior written permission.
  1044. +# Find TBB include directories and libraries.
  1045. #
  1046. -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  1047. -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  1048. -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  1049. -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  1050. -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
  1051. -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  1052. -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  1053. -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  1054. -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  1055. -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  1056. -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  1057. -# IN NO EVENT SHALL THE COPYRIGHT HOLDERS' AND CONTRIBUTORS' AGGREGATE
  1058. -# LIABILITY FOR ALL CLAIMS REGARDLESS OF THEIR BASIS EXCEED US$250.00.
  1059. +# Usage:
  1060. #
  1061. -#[=======================================================================[.rst:
  1062. -
  1063. -FindTBB
  1064. --------
  1065. -
  1066. -Find Tbb include dirs and libraries
  1067. -
  1068. -Use this module by invoking find_package with the form::
  1069. -
  1070. - find_package(TBB
  1071. - [version] [EXACT] # Minimum or EXACT version
  1072. - [REQUIRED] # Fail with error if Tbb is not found
  1073. - [COMPONENTS <libs>...] # Tbb libraries by their canonical name
  1074. - # e.g. "tbb" for "libtbb"
  1075. - )
  1076. -
  1077. -IMPORTED Targets
  1078. -^^^^^^^^^^^^^^^^
  1079. -
  1080. -``TBB::tbb``
  1081. - The tbb library target.
  1082. -``TBB::tbbmalloc``
  1083. - The tbbmalloc library target.
  1084. -``TBB::tbbmalloc_proxy``
  1085. - The tbbmalloc_proxy library target.
  1086. -
  1087. -Result Variables
  1088. -^^^^^^^^^^^^^^^^
  1089. -
  1090. -This will define the following variables:
  1091. -
  1092. -``Tbb_FOUND``
  1093. - True if the system has the Tbb library.
  1094. -``Tbb_VERSION``
  1095. - The version of the Tbb library which was found.
  1096. -``Tbb_INCLUDE_DIRS``
  1097. - Include directories needed to use Tbb.
  1098. -``Tbb_LIBRARIES``
  1099. - Libraries needed to link to Tbb.
  1100. -``Tbb_LIBRARY_DIRS``
  1101. - Tbb library directories.
  1102. -``TBB_{COMPONENT}_FOUND``
  1103. - True if the system has the named TBB component.
  1104. -
  1105. -Cache Variables
  1106. -^^^^^^^^^^^^^^^
  1107. -
  1108. -The following cache variables may also be set:
  1109. -
  1110. -``Tbb_INCLUDE_DIR``
  1111. - The directory containing ``tbb/tbb_stddef.h``.
  1112. -``Tbb_{COMPONENT}_LIBRARY``
  1113. - Individual component libraries for Tbb
  1114. -
  1115. -Hints
  1116. -^^^^^
  1117. -
  1118. -Instead of explicitly setting the cache variables, the following variables
  1119. -may be provided to tell this module where to look.
  1120. -
  1121. -``TBB_ROOT``
  1122. - Preferred installation prefix.
  1123. -``TBB_INCLUDEDIR``
  1124. - Preferred include directory e.g. <prefix>/include
  1125. -``TBB_LIBRARYDIR``
  1126. - Preferred library directory e.g. <prefix>/lib
  1127. -``SYSTEM_LIBRARY_PATHS``
  1128. - Paths appended to all include and lib searches.
  1129. -
  1130. -#]=======================================================================]
  1131. -
  1132. -# Support new if() IN_LIST operator
  1133. -if(POLICY CMP0057)
  1134. - cmake_policy(SET CMP0057 NEW)
  1135. -endif()
  1136. +# find_package(TBB [major[.minor]] [EXACT]
  1137. +# [QUIET] [REQUIRED]
  1138. +# [[COMPONENTS] [components...]]
  1139. +# [OPTIONAL_COMPONENTS components...])
  1140. +#
  1141. +# where the allowed components are tbbmalloc and tbb_preview. Users may modify
  1142. +# the behavior of this module with the following variables:
  1143. +#
  1144. +# * TBB_ROOT_DIR - The base directory the of TBB installation.
  1145. +# * TBB_INCLUDE_DIR - The directory that contains the TBB headers files.
  1146. +# * TBB_LIBRARY - The directory that contains the TBB library files.
  1147. +# * TBB_<library>_LIBRARY - The path of the TBB the corresponding TBB library.
  1148. +# These libraries, if specified, override the
  1149. +# corresponding library search results, where <library>
  1150. +# may be tbb, tbb_debug, tbbmalloc, tbbmalloc_debug,
  1151. +# tbb_preview, or tbb_preview_debug.
  1152. +# * TBB_USE_DEBUG_BUILD - The debug version of tbb libraries, if present, will
  1153. +# be used instead of the release version.
  1154. +# * TBB_STATIC - Static linking of libraries with a _static suffix.
  1155. +# For example, on Windows a tbb_static.lib will be searched for
  1156. +# instead of tbb.lib.
  1157. +#
  1158. +# Users may modify the behavior of this module with the following environment
  1159. +# variables:
  1160. +#
  1161. +# * TBB_INSTALL_DIR
  1162. +# * TBBROOT
  1163. +# * LIBRARY_PATH
  1164. +#
  1165. +# This module will set the following variables:
  1166. +#
  1167. +# * TBB_FOUND - Set to false, or undefined, if we haven’t found, or
  1168. +# don’t want to use TBB.
  1169. +# * TBB_<component>_FOUND - If False, optional <component> part of TBB sytem is
  1170. +# not available.
  1171. +# * TBB_VERSION - The full version string
  1172. +# * TBB_VERSION_MAJOR - The major version
  1173. +# * TBB_VERSION_MINOR - The minor version
  1174. +# * TBB_INTERFACE_VERSION - The interface version number defined in
  1175. +# tbb/tbb_stddef.h.
  1176. +# * TBB_<library>_LIBRARY_RELEASE - The path of the TBB release version of
  1177. +# <library>, where <library> may be tbb, tbb_debug,
  1178. +# tbbmalloc, tbbmalloc_debug, tbb_preview, or
  1179. +# tbb_preview_debug.
  1180. +# * TBB_<library>_LIBRARY_DEGUG - The path of the TBB release version of
  1181. +# <library>, where <library> may be tbb, tbb_debug,
  1182. +# tbbmalloc, tbbmalloc_debug, tbb_preview, or
  1183. +# tbb_preview_debug.
  1184. +#
  1185. +# The following varibles should be used to build and link with TBB:
  1186. +#
  1187. +# * TBB_INCLUDE_DIRS - The include directory for TBB.
  1188. +# * TBB_LIBRARIES - The libraries to link against to use TBB.
  1189. +# * TBB_LIBRARIES_RELEASE - The release libraries to link against to use TBB.
  1190. +# * TBB_LIBRARIES_DEBUG - The debug libraries to link against to use TBB.
  1191. +# * TBB_DEFINITIONS - Definitions to use when compiling code that uses
  1192. +# TBB.
  1193. +# * TBB_DEFINITIONS_RELEASE - Definitions to use when compiling release code that
  1194. +# uses TBB.
  1195. +# * TBB_DEFINITIONS_DEBUG - Definitions to use when compiling debug code that
  1196. +# uses TBB.
  1197. +#
  1198. +# This module will also create the "tbb" target that may be used when building
  1199. +# executables and libraries.
  1200. -mark_as_advanced(
  1201. - Tbb_INCLUDE_DIR
  1202. - Tbb_LIBRARY
  1203. -)
  1204. -
  1205. -set(_TBB_COMPONENT_LIST
  1206. - tbb
  1207. - tbbmalloc
  1208. - tbbmalloc_proxy
  1209. -)
  1210. -
  1211. -if(TBB_FIND_COMPONENTS)
  1212. - set(_TBB_COMPONENTS_PROVIDED TRUE)
  1213. - set(_IGNORED_COMPONENTS "")
  1214. - foreach(COMPONENT ${TBB_FIND_COMPONENTS})
  1215. - if(NOT ${COMPONENT} IN_LIST _TBB_COMPONENT_LIST)
  1216. - list(APPEND _IGNORED_COMPONENTS ${COMPONENT})
  1217. - endif()
  1218. - endforeach()
  1219. +unset(TBB_FOUND CACHE)
  1220. +unset(TBB_INCLUDE_DIRS CACHE)
  1221. +unset(TBB_LIBRARIES)
  1222. +unset(TBB_LIBRARIES_DEBUG)
  1223. +unset(TBB_LIBRARIES_RELEASE)
  1224. - if(_IGNORED_COMPONENTS)
  1225. - message(STATUS "Ignoring unknown components of TBB:")
  1226. - foreach(COMPONENT ${_IGNORED_COMPONENTS})
  1227. - message(STATUS " ${COMPONENT}")
  1228. - endforeach()
  1229. - list(REMOVE_ITEM TBB_FIND_COMPONENTS ${_IGNORED_COMPONENTS})
  1230. - endif()
  1231. -else()
  1232. - set(_TBB_COMPONENTS_PROVIDED FALSE)
  1233. - set(TBB_FIND_COMPONENTS ${_TBB_COMPONENT_LIST})
  1234. -endif()
  1235. +include(FindPackageHandleStandardArgs)
  1236. +
  1237. +find_package(Threads QUIET REQUIRED)
  1238. -# Append TBB_ROOT or $ENV{TBB_ROOT} if set (prioritize the direct cmake var)
  1239. -set(_TBB_ROOT_SEARCH_DIR "")
  1240. +if(NOT TBB_FOUND)
  1241. -if(TBB_ROOT)
  1242. - list(APPEND _TBB_ROOT_SEARCH_DIR ${TBB_ROOT})
  1243. -else()
  1244. - set(_ENV_TBB_ROOT $ENV{TBB_ROOT})
  1245. - if(_ENV_TBB_ROOT)
  1246. - list(APPEND _TBB_ROOT_SEARCH_DIR ${_ENV_TBB_ROOT})
  1247. + ##################################
  1248. + # Check the build type
  1249. + ##################################
  1250. +
  1251. + if(NOT DEFINED TBB_USE_DEBUG_BUILD)
  1252. + if(CMAKE_BUILD_TYPE MATCHES "(Debug|DEBUG|debug)")
  1253. + set(TBB_BUILD_TYPE DEBUG)
  1254. + else()
  1255. + set(TBB_BUILD_TYPE RELEASE)
  1256. + endif()
  1257. + elseif(TBB_USE_DEBUG_BUILD)
  1258. + set(TBB_BUILD_TYPE DEBUG)
  1259. + else()
  1260. + set(TBB_BUILD_TYPE RELEASE)
  1261. endif()
  1262. -endif()
  1263. +
  1264. + ##################################
  1265. + # Set the TBB search directories
  1266. + ##################################
  1267. +
  1268. + # Define search paths based on user input and environment variables
  1269. + set(TBB_SEARCH_DIR ${TBB_ROOT_DIR} $ENV{TBB_INSTALL_DIR} $ENV{TBBROOT})
  1270. +
  1271. + # Define the search directories based on the current platform
  1272. + if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
  1273. + set(TBB_DEFAULT_SEARCH_DIR "C:/Program Files/Intel/TBB"
  1274. + "C:/Program Files (x86)/Intel/TBB")
  1275. +
  1276. + # Set the target architecture
  1277. + if(CMAKE_SIZEOF_VOID_P EQUAL 8)
  1278. + set(TBB_ARCHITECTURE "intel64")
  1279. + else()
  1280. + set(TBB_ARCHITECTURE "ia32")
  1281. + endif()
  1282. -# Additionally try and use pkconfig to find Tbb
  1283. -
  1284. -find_package(PkgConfig)
  1285. -pkg_check_modules(PC_Tbb QUIET tbb)
  1286. -
  1287. -# ------------------------------------------------------------------------
  1288. -# Search for tbb include DIR
  1289. -# ------------------------------------------------------------------------
  1290. -
  1291. -set(_TBB_INCLUDE_SEARCH_DIRS "")
  1292. -list(APPEND _TBB_INCLUDE_SEARCH_DIRS
  1293. - ${TBB_INCLUDEDIR}
  1294. - ${_TBB_ROOT_SEARCH_DIR}
  1295. - ${PC_Tbb_INCLUDE_DIRS}
  1296. - ${SYSTEM_LIBRARY_PATHS}
  1297. -)
  1298. -
  1299. -# Look for a standard tbb header file.
  1300. -find_path(Tbb_INCLUDE_DIR tbb/tbb_stddef.h
  1301. - NO_DEFAULT_PATH
  1302. - PATHS ${_TBB_INCLUDE_SEARCH_DIRS}
  1303. - PATH_SUFFIXES include
  1304. -)
  1305. -
  1306. -if(EXISTS "${Tbb_INCLUDE_DIR}/tbb/tbb_stddef.h")
  1307. - file(STRINGS "${Tbb_INCLUDE_DIR}/tbb/tbb_stddef.h"
  1308. - _tbb_version_major_string REGEX "#define TBB_VERSION_MAJOR "
  1309. - )
  1310. - string(REGEX REPLACE "#define TBB_VERSION_MAJOR" ""
  1311. - _tbb_version_major_string "${_tbb_version_major_string}"
  1312. - )
  1313. - string(STRIP "${_tbb_version_major_string}" Tbb_VERSION_MAJOR)
  1314. -
  1315. - file(STRINGS "${Tbb_INCLUDE_DIR}/tbb/tbb_stddef.h"
  1316. - _tbb_version_minor_string REGEX "#define TBB_VERSION_MINOR "
  1317. - )
  1318. - string(REGEX REPLACE "#define TBB_VERSION_MINOR" ""
  1319. - _tbb_version_minor_string "${_tbb_version_minor_string}"
  1320. - )
  1321. - string(STRIP "${_tbb_version_minor_string}" Tbb_VERSION_MINOR)
  1322. -
  1323. - unset(_tbb_version_major_string)
  1324. - unset(_tbb_version_minor_string)
  1325. -
  1326. - set(Tbb_VERSION ${Tbb_VERSION_MAJOR}.${Tbb_VERSION_MINOR})
  1327. -endif()
  1328. + # Set the TBB search library path search suffix based on the version of VC
  1329. + if(WINDOWS_STORE)
  1330. + set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc11_ui")
  1331. + elseif(MSVC14)
  1332. + set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc14")
  1333. + elseif(MSVC12)
  1334. + set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc12")
  1335. + elseif(MSVC11)
  1336. + set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc11")
  1337. + elseif(MSVC10)
  1338. + set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc10")
  1339. + endif()
  1340. -# ------------------------------------------------------------------------
  1341. -# Search for TBB lib DIR
  1342. -# ------------------------------------------------------------------------
  1343. + # Add the library path search suffix for the VC independent version of TBB
  1344. + list(APPEND TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc_mt")
  1345. +
  1346. + elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
  1347. + # OS X
  1348. + set(TBB_DEFAULT_SEARCH_DIR "/opt/intel/tbb")
  1349. +
  1350. + # TODO: Check to see which C++ library is being used by the compiler.
  1351. + if(NOT ${CMAKE_SYSTEM_VERSION} VERSION_LESS 13.0)
  1352. + # The default C++ library on OS X 10.9 and later is libc++
  1353. + set(TBB_LIB_PATH_SUFFIX "lib/libc++" "lib")
  1354. + else()
  1355. + set(TBB_LIB_PATH_SUFFIX "lib")
  1356. + endif()
  1357. + elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
  1358. + # Linux
  1359. + set(TBB_DEFAULT_SEARCH_DIR "/opt/intel/tbb")
  1360. +
  1361. + # TODO: Check compiler version to see the suffix should be <arch>/gcc4.1 or
  1362. + # <arch>/gcc4.1. For now, assume that the compiler is more recent than
  1363. + # gcc 4.4.x or later.
  1364. + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
  1365. + set(TBB_LIB_PATH_SUFFIX "lib/intel64/gcc4.4")
  1366. + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
  1367. + set(TBB_LIB_PATH_SUFFIX "lib/ia32/gcc4.4")
  1368. + endif()
  1369. + endif()
  1370. +
  1371. + ##################################
  1372. + # Find the TBB include dir
  1373. + ##################################
  1374. +
  1375. + find_path(TBB_INCLUDE_DIRS tbb/tbb.h
  1376. + HINTS ${TBB_INCLUDE_DIR} ${TBB_SEARCH_DIR}
  1377. + PATHS ${TBB_DEFAULT_SEARCH_DIR}
  1378. + PATH_SUFFIXES include)
  1379. +
  1380. + ##################################
  1381. + # Set version strings
  1382. + ##################################
  1383. +
  1384. + if(TBB_INCLUDE_DIRS)
  1385. + file(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _tbb_version_file)
  1386. + string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1"
  1387. + TBB_VERSION_MAJOR "${_tbb_version_file}")
  1388. + string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1"
  1389. + TBB_VERSION_MINOR "${_tbb_version_file}")
  1390. + string(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1"
  1391. + TBB_INTERFACE_VERSION "${_tbb_version_file}")
  1392. + set(TBB_VERSION "${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR}")
  1393. + endif()
  1394. -set(_TBB_LIBRARYDIR_SEARCH_DIRS "")
  1395. + ##################################
  1396. + # Find TBB components
  1397. + ##################################
  1398. -# Append to _TBB_LIBRARYDIR_SEARCH_DIRS in priority order
  1399. + if(TBB_VERSION VERSION_LESS 4.3)
  1400. + set(TBB_SEARCH_COMPOMPONENTS tbb_preview tbbmalloc tbb)
  1401. + else()
  1402. + set(TBB_SEARCH_COMPOMPONENTS tbb_preview tbbmalloc_proxy tbbmalloc tbb)
  1403. + endif()
  1404. -set(_TBB_LIBRARYDIR_SEARCH_DIRS "")
  1405. -list(APPEND _TBB_LIBRARYDIR_SEARCH_DIRS
  1406. - ${TBB_LIBRARYDIR}
  1407. - ${_TBB_ROOT_SEARCH_DIR}
  1408. - ${PC_Tbb_LIBRARY_DIRS}
  1409. - ${SYSTEM_LIBRARY_PATHS}
  1410. -)
  1411. + if(TBB_STATIC)
  1412. + set(TBB_STATIC_SUFFIX "_static")
  1413. + endif()
  1414. -set(TBB_PATH_SUFFIXES
  1415. - lib64
  1416. - lib
  1417. -)
  1418. + # Find each component
  1419. + foreach(_comp ${TBB_SEARCH_COMPOMPONENTS})
  1420. + if(";${TBB_FIND_COMPONENTS};tbb;" MATCHES ";${_comp};")
  1421. -# platform branching
  1422. + unset(TBB_${_comp}_LIBRARY_DEBUG CACHE)
  1423. + unset(TBB_${_comp}_LIBRARY_RELEASE CACHE)
  1424. -if(UNIX)
  1425. - list(INSERT TBB_PATH_SUFFIXES 0 lib/x86_64-linux-gnu)
  1426. -endif()
  1427. + # Search for the libraries
  1428. + find_library(TBB_${_comp}_LIBRARY_RELEASE ${_comp}${TBB_STATIC_SUFFIX}
  1429. + HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR}
  1430. + PATHS ${TBB_DEFAULT_SEARCH_DIR} ENV LIBRARY_PATH
  1431. + PATH_SUFFIXES ${TBB_LIB_PATH_SUFFIX})
  1432. -if(APPLE)
  1433. - if(TBB_FOR_CLANG)
  1434. - list(INSERT TBB_PATH_SUFFIXES 0 lib/libc++)
  1435. - endif()
  1436. -elseif(WIN32)
  1437. - if(MSVC10)
  1438. - set(TBB_VC_DIR vc10)
  1439. - elseif(MSVC11)
  1440. - set(TBB_VC_DIR vc11)
  1441. - elseif(MSVC12)
  1442. - set(TBB_VC_DIR vc12)
  1443. - endif()
  1444. - list(INSERT TBB_PATH_SUFFIXES 0 lib/intel64/${TBB_VC_DIR})
  1445. -else()
  1446. - if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
  1447. - if(TBB_MATCH_COMPILER_VERSION)
  1448. - string(REGEX MATCHALL "[0-9]+" GCC_VERSION_COMPONENTS ${CMAKE_CXX_COMPILER_VERSION})
  1449. - list(GET GCC_VERSION_COMPONENTS 0 GCC_MAJOR)
  1450. - list(GET GCC_VERSION_COMPONENTS 1 GCC_MINOR)
  1451. - list(INSERT TBB_PATH_SUFFIXES 0 lib/intel64/gcc${GCC_MAJOR}.${GCC_MINOR})
  1452. - else()
  1453. - list(INSERT TBB_PATH_SUFFIXES 0 lib/intel64/gcc4.4)
  1454. - endif()
  1455. - endif()
  1456. -endif()
  1457. + find_library(TBB_${_comp}_LIBRARY_DEBUG ${_comp}${TBB_STATIC_SUFFIX}_debug
  1458. + HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR}
  1459. + PATHS ${TBB_DEFAULT_SEARCH_DIR} ENV LIBRARY_PATH
  1460. + PATH_SUFFIXES ${TBB_LIB_PATH_SUFFIX})
  1461. -if(UNIX AND TBB_USE_STATIC_LIBS)
  1462. - set(_TBB_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
  1463. - set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
  1464. -endif()
  1465. + if(TBB_${_comp}_LIBRARY_DEBUG)
  1466. + list(APPEND TBB_LIBRARIES_DEBUG "${TBB_${_comp}_LIBRARY_DEBUG}")
  1467. + endif()
  1468. + if(TBB_${_comp}_LIBRARY_RELEASE)
  1469. + list(APPEND TBB_LIBRARIES_RELEASE "${TBB_${_comp}_LIBRARY_RELEASE}")
  1470. + endif()
  1471. + if(TBB_${_comp}_LIBRARY_${TBB_BUILD_TYPE} AND NOT TBB_${_comp}_LIBRARY)
  1472. + set(TBB_${_comp}_LIBRARY "${TBB_${_comp}_LIBRARY_${TBB_BUILD_TYPE}}")
  1473. + endif()
  1474. -set(Tbb_LIB_COMPONENTS "")
  1475. -
  1476. -foreach(COMPONENT ${TBB_FIND_COMPONENTS})
  1477. - find_library(Tbb_${COMPONENT}_LIBRARY ${COMPONENT}
  1478. - NO_DEFAULT_PATH
  1479. - PATHS ${_TBB_LIBRARYDIR_SEARCH_DIRS}
  1480. - PATH_SUFFIXES ${TBB_PATH_SUFFIXES}
  1481. - )
  1482. -
  1483. - # On Unix, TBB sometimes uses linker scripts instead of symlinks, so parse the linker script
  1484. - # and correct the library name if so
  1485. - if(UNIX AND EXISTS ${Tbb_${COMPONENT}_LIBRARY})
  1486. - # Ignore files where the first four bytes equals the ELF magic number
  1487. - file(READ ${Tbb_${COMPONENT}_LIBRARY} Tbb_${COMPONENT}_HEX OFFSET 0 LIMIT 4 HEX)
  1488. - if(NOT ${Tbb_${COMPONENT}_HEX} STREQUAL "7f454c46")
  1489. - # Read the first 1024 bytes of the library and match against an "INPUT (file)" regex
  1490. - file(READ ${Tbb_${COMPONENT}_LIBRARY} Tbb_${COMPONENT}_ASCII OFFSET 0 LIMIT 1024)
  1491. - if("${Tbb_${COMPONENT}_ASCII}" MATCHES "INPUT \\(([^(]+)\\)")
  1492. - # Extract the directory and apply the matched text (in brackets)
  1493. - get_filename_component(Tbb_${COMPONENT}_DIR "${Tbb_${COMPONENT}_LIBRARY}" DIRECTORY)
  1494. - set(Tbb_${COMPONENT}_LIBRARY "${Tbb_${COMPONENT}_DIR}/${CMAKE_MATCH_1}")
  1495. + if(TBB_${_comp}_LIBRARY AND EXISTS "${TBB_${_comp}_LIBRARY}")
  1496. + set(TBB_${_comp}_FOUND TRUE)
  1497. + else()
  1498. + set(TBB_${_comp}_FOUND FALSE)
  1499. endif()
  1500. +
  1501. + # Mark internal variables as advanced
  1502. + mark_as_advanced(TBB_${_comp}_LIBRARY_RELEASE)
  1503. + mark_as_advanced(TBB_${_comp}_LIBRARY_DEBUG)
  1504. + mark_as_advanced(TBB_${_comp}_LIBRARY)
  1505. +
  1506. endif()
  1507. - endif()
  1508. + endforeach()
  1509. - list(APPEND Tbb_LIB_COMPONENTS ${Tbb_${COMPONENT}_LIBRARY})
  1510. + ##################################
  1511. + # Set compile flags and libraries
  1512. + ##################################
  1513. - if(Tbb_${COMPONENT}_LIBRARY)
  1514. - set(TBB_${COMPONENT}_FOUND TRUE)
  1515. - else()
  1516. - set(TBB_${COMPONENT}_FOUND FALSE)
  1517. + set(TBB_DEFINITIONS_RELEASE "")
  1518. + set(TBB_DEFINITIONS_DEBUG "TBB_USE_DEBUG=1")
  1519. +
  1520. + if(TBB_LIBRARIES_${TBB_BUILD_TYPE})
  1521. + set(TBB_LIBRARIES "${TBB_LIBRARIES_${TBB_BUILD_TYPE}}")
  1522. + endif()
  1523. +
  1524. + if(NOT MSVC AND NOT TBB_LIBRARIES)
  1525. + set(TBB_LIBRARIES ${TBB_LIBRARIES_RELEASE})
  1526. endif()
  1527. -endforeach()
  1528. -if(UNIX AND TBB_USE_STATIC_LIBS)
  1529. - set(CMAKE_FIND_LIBRARY_SUFFIXES ${_TBB_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
  1530. - unset(_TBB_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
  1531. -endif()
  1532. + set(TBB_DEFINITIONS "")
  1533. + if (MSVC AND TBB_STATIC)
  1534. + set(TBB_DEFINITIONS __TBB_NO_IMPLICIT_LINKAGE)
  1535. + endif ()
  1536. +
  1537. + unset (TBB_STATIC_SUFFIX)
  1538. +
  1539. + find_package_handle_standard_args(TBB
  1540. + REQUIRED_VARS TBB_INCLUDE_DIRS TBB_LIBRARIES
  1541. + FAIL_MESSAGE "TBB library cannot be found. Consider set TBBROOT environment variable."
  1542. + HANDLE_COMPONENTS
  1543. + VERSION_VAR TBB_VERSION)
  1544. +
  1545. + ##################################
  1546. + # Create targets
  1547. + ##################################
  1548. +
  1549. + if(NOT CMAKE_VERSION VERSION_LESS 3.0 AND TBB_FOUND)
  1550. + add_library(TBB::tbb UNKNOWN IMPORTED)
  1551. + set_target_properties(TBB::tbb PROPERTIES
  1552. + INTERFACE_COMPILE_DEFINITIONS "${TBB_DEFINITIONS}"
  1553. + INTERFACE_LINK_LIBRARIES "Threads::Threads;${CMAKE_DL_LIBS}"
  1554. + INTERFACE_INCLUDE_DIRECTORIES ${TBB_INCLUDE_DIRS}
  1555. + IMPORTED_LOCATION ${TBB_LIBRARIES})
  1556. + if(TBB_LIBRARIES_RELEASE AND TBB_LIBRARIES_DEBUG)
  1557. + set_target_properties(TBB::tbb PROPERTIES
  1558. + INTERFACE_COMPILE_DEFINITIONS "${TBB_DEFINITIONS};$<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:${TBB_DEFINITIONS_DEBUG}>;$<$<CONFIG:Release>:${TBB_DEFINITIONS_RELEASE}>"
  1559. + IMPORTED_LOCATION_DEBUG ${TBB_LIBRARIES_DEBUG}
  1560. + IMPORTED_LOCATION_RELWITHDEBINFO ${TBB_LIBRARIES_RELEASE}
  1561. + IMPORTED_LOCATION_RELEASE ${TBB_LIBRARIES_RELEASE}
  1562. + IMPORTED_LOCATION_MINSIZEREL ${TBB_LIBRARIES_RELEASE}
  1563. + )
  1564. + endif()
  1565. + endif()
  1566. -# ------------------------------------------------------------------------
  1567. -# Cache and set TBB_FOUND
  1568. -# ------------------------------------------------------------------------
  1569. + mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARIES)
  1570. +
  1571. + unset(TBB_ARCHITECTURE)
  1572. + unset(TBB_BUILD_TYPE)
  1573. + unset(TBB_LIB_PATH_SUFFIX)
  1574. + unset(TBB_DEFAULT_SEARCH_DIR)
  1575. +
  1576. + if(TBB_DEBUG)
  1577. + message(STATUS " TBB_FOUND = ${TBB_FOUND}")
  1578. + message(STATUS " TBB_INCLUDE_DIRS = ${TBB_INCLUDE_DIRS}")
  1579. + message(STATUS " TBB_DEFINITIONS = ${TBB_DEFINITIONS}")
  1580. + message(STATUS " TBB_LIBRARIES = ${TBB_LIBRARIES}")
  1581. + message(STATUS " TBB_DEFINITIONS_DEBUG = ${TBB_DEFINITIONS_DEBUG}")
  1582. + message(STATUS " TBB_LIBRARIES_DEBUG = ${TBB_LIBRARIES_DEBUG}")
  1583. + message(STATUS " TBB_DEFINITIONS_RELEASE = ${TBB_DEFINITIONS_RELEASE}")
  1584. + message(STATUS " TBB_LIBRARIES_RELEASE = ${TBB_LIBRARIES_RELEASE}")
  1585. + endif()
  1586. -include(FindPackageHandleStandardArgs)
  1587. -find_package_handle_standard_args(TBB
  1588. - FOUND_VAR TBB_FOUND
  1589. - REQUIRED_VARS
  1590. - Tbb_INCLUDE_DIR
  1591. - Tbb_LIB_COMPONENTS
  1592. - VERSION_VAR Tbb_VERSION
  1593. - HANDLE_COMPONENTS
  1594. -)
  1595. -
  1596. -if(TBB_FOUND)
  1597. - set(Tbb_LIBRARIES
  1598. - ${Tbb_LIB_COMPONENTS}
  1599. - )
  1600. - set(Tbb_INCLUDE_DIRS ${Tbb_INCLUDE_DIR})
  1601. - set(Tbb_DEFINITIONS ${PC_Tbb_CFLAGS_OTHER})
  1602. -
  1603. - set(Tbb_LIBRARY_DIRS "")
  1604. - foreach(LIB ${Tbb_LIB_COMPONENTS})
  1605. - get_filename_component(_TBB_LIBDIR ${LIB} DIRECTORY)
  1606. - list(APPEND Tbb_LIBRARY_DIRS ${_TBB_LIBDIR})
  1607. - endforeach()
  1608. - list(REMOVE_DUPLICATES Tbb_LIBRARY_DIRS)
  1609. -
  1610. - # Configure imported targets
  1611. -
  1612. - foreach(COMPONENT ${TBB_FIND_COMPONENTS})
  1613. - if(NOT TARGET TBB::${COMPONENT})
  1614. - add_library(TBB::${COMPONENT} UNKNOWN IMPORTED)
  1615. - set_target_properties(TBB::${COMPONENT} PROPERTIES
  1616. - IMPORTED_LOCATION "${Tbb_${COMPONENT}_LIBRARY}"
  1617. - INTERFACE_COMPILE_OPTIONS "${Tbb_DEFINITIONS}"
  1618. - INTERFACE_INCLUDE_DIRECTORIES "${Tbb_INCLUDE_DIR}"
  1619. - )
  1620. - endif()
  1621. - endforeach()
  1622. -elseif(TBB_FIND_REQUIRED)
  1623. - message(FATAL_ERROR "Unable to find TBB")
  1624. endif()
  1625. diff --git a/openvdb/CMakeLists.txt b/openvdb/CMakeLists.txt
  1626. index 89301bd..df27aae 100644
  1627. --- a/openvdb/CMakeLists.txt
  1628. +++ b/openvdb/CMakeLists.txt
  1629. @@ -78,7 +78,7 @@ else()
  1630. endif()
  1631. find_package(TBB ${MINIMUM_TBB_VERSION} REQUIRED COMPONENTS tbb)
  1632. -if(${Tbb_VERSION} VERSION_LESS FUTURE_MINIMUM_TBB_VERSION)
  1633. +if(${TBB_VERSION} VERSION_LESS FUTURE_MINIMUM_TBB_VERSION)
  1634. message(DEPRECATION "Support for TBB versions < ${FUTURE_MINIMUM_TBB_VERSION} "
  1635. "is deprecated and will be removed.")
  1636. endif()
  1637. @@ -185,11 +185,6 @@ if(WIN32)
  1638. endif()
  1639. endif()
  1640. -# @todo Should be target definitions
  1641. -if(WIN32)
  1642. - add_definitions(-D_WIN32 -DNOMINMAX -DOPENVDB_DLL)
  1643. -endif()
  1644. -
  1645. ##### Core library configuration
  1646. set(OPENVDB_LIBRARY_SOURCE_FILES
  1647. @@ -374,10 +369,16 @@ set(OPENVDB_LIBRARY_UTIL_INCLUDE_FILES
  1648. if(OPENVDB_CORE_SHARED)
  1649. add_library(openvdb_shared SHARED ${OPENVDB_LIBRARY_SOURCE_FILES})
  1650. + if(WIN32)
  1651. + target_compile_definitions(openvdb_shared PUBLIC OPENVDB_DLL)
  1652. + endif()
  1653. endif()
  1654. if(OPENVDB_CORE_STATIC)
  1655. add_library(openvdb_static STATIC ${OPENVDB_LIBRARY_SOURCE_FILES})
  1656. + if(WIN32)
  1657. + target_compile_definitions(openvdb_static PUBLIC OPENVDB_STATICLIB)
  1658. + endif()
  1659. endif()
  1660. # Alias either the shared or static library to the generic OpenVDB
  1661. diff --git a/openvdb/Grid.cc b/openvdb/Grid.cc
  1662. index 0015f81..cb6084a 100644
  1663. --- a/openvdb/Grid.cc
  1664. +++ b/openvdb/Grid.cc
  1665. @@ -35,6 +35,9 @@
  1666. #include <boost/algorithm/string/trim.hpp>
  1667. #include <tbb/mutex.h>
  1668. +// WTF??? Somehow from stdlib.h
  1669. +#undef min
  1670. +#undef max
  1671. namespace openvdb {
  1672. OPENVDB_USE_VERSION_NAMESPACE
  1673. diff --git a/openvdb/PlatformConfig.h b/openvdb/PlatformConfig.h
  1674. index 20ad9a3..c2dd1ef 100644
  1675. --- a/openvdb/PlatformConfig.h
  1676. +++ b/openvdb/PlatformConfig.h
  1677. @@ -44,9 +44,12 @@
  1678. // By default, assume that we're dynamically linking OpenEXR, unless
  1679. // OPENVDB_OPENEXR_STATICLIB is defined.
  1680. - #if !defined(OPENVDB_OPENEXR_STATICLIB) && !defined(OPENEXR_DLL)
  1681. - #define OPENEXR_DLL
  1682. - #endif
  1683. + // Meszaros Tamas: Why? OpenEXR and its imported targets have OPENEXR_DLL
  1684. + // in INTERFACE_COMPILE_DEFINITIONS if build with it.
  1685. + // #if !defined(OPENVDB_OPENEXR_STATICLIB) && !defined(OPENEXR_DLL)
  1686. + // #define OPENEXR_DLL
  1687. + // static_assert(false, "This is bad: OPENEXR_DLL");
  1688. + // #endif
  1689. #endif // _WIN32
  1690. diff --git a/openvdb/cmd/CMakeLists.txt b/openvdb/cmd/CMakeLists.txt
  1691. index 57fbec0..55b3850 100644
  1692. --- a/openvdb/cmd/CMakeLists.txt
  1693. +++ b/openvdb/cmd/CMakeLists.txt
  1694. @@ -74,8 +74,9 @@ if(WIN32)
  1695. endif()
  1696. endif()
  1697. +# @todo Should be target definitions
  1698. if(WIN32)
  1699. - add_definitions(-D_WIN32 -DNOMINMAX -DOPENVDB_DLL)
  1700. + add_definitions(-D_WIN32 -DNOMINMAX)
  1701. endif()
  1702. # rpath handling
  1703. @@ -88,7 +89,6 @@ if(OPENVDB_ENABLE_RPATH)
  1704. ${IlmBase_LIBRARY_DIRS}
  1705. ${Log4cplus_LIBRARY_DIRS}
  1706. ${Blosc_LIBRARY_DIRS}
  1707. - ${Tbb_LIBRARY_DIRS}
  1708. )
  1709. if(OPENVDB_BUILD_CORE)
  1710. list(APPEND RPATHS ${CMAKE_INSTALL_PREFIX}/lib)
  1711. diff --git a/openvdb/unittest/CMakeLists.txt b/openvdb/unittest/CMakeLists.txt
  1712. index c9e0c34..7e261c0 100644
  1713. --- a/openvdb/unittest/CMakeLists.txt
  1714. +++ b/openvdb/unittest/CMakeLists.txt
  1715. @@ -71,8 +71,9 @@ if(WIN32)
  1716. link_directories(${Boost_LIBRARY_DIR})
  1717. endif()
  1718. +# @todo Should be target definitions
  1719. if(WIN32)
  1720. - add_definitions(-D_WIN32 -DNOMINMAX -DOPENVDB_DLL)
  1721. + add_definitions(-D_WIN32 -DNOMINMAX)
  1722. endif()
  1723. ##### VDB unit tests
  1724. diff --git a/openvdb/unittest/TestFile.cc b/openvdb/unittest/TestFile.cc
  1725. index df51830..0ab0c12 100644
  1726. --- a/openvdb/unittest/TestFile.cc
  1727. +++ b/openvdb/unittest/TestFile.cc
  1728. @@ -2573,7 +2573,7 @@ TestFile::testBlosc()
  1729. outdata(new char[decompbufbytes]);
  1730. for (int compcode = 0; compcode <= BLOSC_ZLIB; ++compcode) {
  1731. - char* compname = nullptr;
  1732. + const char* compname = nullptr;
  1733. if (0 > blosc_compcode_to_compname(compcode, &compname)) continue;
  1734. /// @todo This changes the compressor setting globally.
  1735. if (blosc_set_compressor(compname) < 0) continue;
  1736. --
  1737. 2.16.2.windows.1