 -if(POLICY CMP0057)
 -  cmake_policy(SET CMP0057 NEW)
 -endif()
++# FindTBB
++# -------
++#
++# Find TBB include directories and libraries.
++#
++# Usage:
++#
 +#  find_package(TBB [major[.minor]] [EXACT]
 +#               [QUIET] [REQUIRED]
 +#               [[COMPONENTS] [components...]]
-+#               [OPTIONAL_COMPONENTS components...]) 
++#               [OPTIONAL_COMPONENTS components...])
 +#
-+# where the allowed components are tbbmalloc and tbb_preview. Users may modify 
++# where the allowed components are tbbmalloc and tbb_preview. Users may modify
 +# the behavior of this module with the following variables:
 +#
 +# * TBB_ROOT_DIR          - The base directory the of TBB installation.
 +# * TBB_INCLUDE_DIR       - The directory that contains the TBB headers files.
 +# * TBB_LIBRARY           - The directory that contains the TBB library files.
-+# * TBB_<library>_LIBRARY - The path of the TBB the corresponding TBB library. 
-+#                           These libraries, if specified, override the 
++# * TBB_<library>_LIBRARY - The path of the TBB the corresponding TBB library.
++#                           These libraries, if specified, override the
 +#                           corresponding library search results, where <library>
 +#                           may be tbb, tbb_debug, tbbmalloc, tbbmalloc_debug,
 +#                           tbb_preview, or tbb_preview_debug.

-# All rights reserved. This software is distributed under the
-# Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
+# Copyright (c) 2015 Justus Calvin
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
 #
-# Redistributions of source code must retain the above copyright
-# and license notice and the following restrictions and disclaimer.
+# FindTBB
+# -------
 #
-# *     Neither the name of DreamWorks Animation nor the names of
-# its contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
+# Find TBB include directories and libraries.
 #
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT

    )
+
+   if (OPENVDB_USE_STATIC_LIBS)
+    set_target_properties(OpenVDB::${COMPONENT} PROPERTIES
+      INTERFACE_COMPILE_DEFINITIONS "OPENVDB_STATICLIB;OPENVDB_OPENEXR_STATICLIB"
+    )
+   endif()
