<commit_before># Copyright (c) 2012-2019 DreamWorks Animation LLC
#
# All rights reserved. This software is distributed under the
# Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
#
# Redistributions of source code must retain the above copyright
# and license notice and the following restrictions and disclaimer.
#
# *     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.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# IN NO EVENT SHALL THE COPYRIGHT HOLDERS' AND CONTRIBUTORS' AGGREGATE
# LIABILITY FOR ALL CLAIMS REGARDLESS OF THEIR BASIS EXCEED US$250.00.
#
#[=======================================================================[

  CMake Configuration for OpenVDB Python bindings

#]=======================================================================]

PROJECT ( OpenVDBPython )
CMAKE_MINIMUM_REQUIRED ( VERSION 3.3 )
# Monitoring <PackageName>_ROOT variables
IF ( POLICY CMP0074 )
  CMAKE_POLICY ( SET CMP0074 NEW )
ENDIF ()

###### OpenVDB Python Options

OPTION ( USE_NUMPY [=[
Build the python library with numpy support. Currently requires CMake 3.12.]=] OFF )
OPTION ( OPENVDB_PYTHON_WRAP_ALL_GRID_TYPES [=[
Expose (almost) all of the grid types in the python module. Otherwise, only FloatGrid, BoolGrid and
Vec3SGrid will be exposed (see, e.g., exportIntGrid() in python/pyIntGrid.cc). Compiling the Python
module with this ON can be very memory-intensive.]=] OFF )

SET ( PYTHON_VERSION "2.7" CACHE STRING "The python version to use when building the OpenVDB
  Python module. Note that the available version of Boost.Python should also match this." )

#########################################################################

MESSAGE ( STATUS "----------------------------------------------------" )
MESSAGE ( STATUS "------------ Configuring OpenVDBPython -------------" )
MESSAGE ( STATUS "----------------------------------------------------" )

##########################################################################

# Collect and configure lib dependencies

IF ( NOT OPENVDB_BUILD_CORE )
  FIND_PACKAGE ( OpenVDB REQUIRED )
  SET ( OPENVDB_LIB OpenVDB::openvdb )
ELSE ()
  SET ( OPENVDB_LIB openvdb_shared )
  INCLUDE_DIRECTORIES ( ../../ )
ENDIF ()

FIND_PACKAGE ( IlmBase REQUIRED COMPONENTS Half )
FIND_PACKAGE ( TBB REQUIRED COMPONENTS tbb )
FIND_PACKAGE ( ZLIB REQUIRED )

IF ( USE_LOG4CPLUS )
  FIND_PACKAGE ( Log4cplus REQUIRED )
ENDIF ()

IF ( USE_BLOSC )
  FIND_PACKAGE ( Blosc ${MINIMUM_BLOSC_VERSION} REQUIRED )
ENDIF ()

SET ( OPENVDB_PYTHON_DEPS )

# If CMake is < 3.12, use the old style python search and alias the variables
# Note that the Interpreter component is only required for the python test
IF ( ${CMAKE_VERSION} VERSION_LESS 3.12 )
  IF ( USE_NUMPY )
    MESSAGE ( FATAL_ERROR "No CMake support for FindPackage ( NumPy ) currently "
      "available for OpenVDB. Requires CMake 3.12." )
  ENDIF ()

  FIND_PACKAGE ( PythonInterp ${PYTHON_VERSION} REQUIRED )
  FIND_PACKAGE ( PythonLibs ${PYTHON_VERSION} REQUIRED )

  SET ( Python_VERSION_MAJOR ${PYTHON_VERSION_MAJOR} )
  SET ( Python_VERSION_MINOR ${PYTHON_VERSION_MINOR} )
  SET ( Python_EXECUTABLE ${PYTHON_EXECUTABLE} )
  SET ( OPENVDB_PYTHON_DEPS ${PYTHON_LIBRARIES} )
  GET_FILENAME_COMPONENT ( Python_LIBRARY_DIRS ${OPENVDB_PYTHON_DEPS} DIRECTORY )<commit_msg>Fixed CMake version requirement for NumPy<commit_after># Copyright (c) 2012-2019 DreamWorks Animation LLC
#
# All rights reserved. This software is distributed under the
# Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
#
# Redistributions of source code must retain the above copyright
# and license notice and the following restrictions and disclaimer.
#
# *     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.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# IN NO EVENT SHALL THE COPYRIGHT HOLDERS' AND CONTRIBUTORS' AGGREGATE
# LIABILITY FOR ALL CLAIMS REGARDLESS OF THEIR BASIS EXCEED US$250.00.
#
#[=======================================================================[

  CMake Configuration for OpenVDB Python bindings

#]=======================================================================]

PROJECT ( OpenVDBPython )
CMAKE_MINIMUM_REQUIRED ( VERSION 3.3 )
# Monitoring <PackageName>_ROOT variables
IF ( POLICY CMP0074 )
  CMAKE_POLICY ( SET CMP0074 NEW )
ENDIF ()

###### OpenVDB Python Options

OPTION ( USE_NUMPY [=[
Build the python library with numpy support. Currently requires CMake 3.14.]=] OFF )
OPTION ( OPENVDB_PYTHON_WRAP_ALL_GRID_TYPES [=[
Expose (almost) all of the grid types in the python module. Otherwise, only FloatGrid, BoolGrid and
Vec3SGrid will be exposed (see, e.g., exportIntGrid() in python/pyIntGrid.cc). Compiling the Python
module with this ON can be very memory-intensive.]=] OFF )

SET ( PYTHON_VERSION "2.7" CACHE STRING "The python version to use when building the OpenVDB
  Python module. Note that the available version of Boost.Python should also match this." )

#########################################################################

MESSAGE ( STATUS "----------------------------------------------------" )
MESSAGE ( STATUS "------------ Configuring OpenVDBPython -------------" )
MESSAGE ( STATUS "----------------------------------------------------" )

##########################################################################

# Collect and configure lib dependencies

IF ( NOT OPENVDB_BUILD_CORE )
  FIND_PACKAGE ( OpenVDB REQUIRED )
  SET ( OPENVDB_LIB OpenVDB::openvdb )
ELSE ()
  SET ( OPENVDB_LIB openvdb_shared )
  INCLUDE_DIRECTORIES ( ../../ )
ENDIF ()

FIND_PACKAGE ( IlmBase REQUIRED COMPONENTS Half )
FIND_PACKAGE ( TBB REQUIRED COMPONENTS tbb )
FIND_PACKAGE ( ZLIB REQUIRED )

IF ( USE_LOG4CPLUS )
  FIND_PACKAGE ( Log4cplus REQUIRED )
ENDIF ()

IF ( USE_BLOSC )
  FIND_PACKAGE ( Blosc ${MINIMUM_BLOSC_VERSION} REQUIRED )
ENDIF ()

# NumPy requires CMake 3.14
IF ( USE_NUMPY AND ( ${CMAKE_VERSION} VERSION_LESS 3.14 ) )
  MESSAGE ( FATAL_ERROR "No CMake support for FindPackage ( NumPy ) currently "
    "available for OpenVDB. Requires CMake 3.14." )
ENDIF ()

SET ( OPENVDB_PYTHON_DEPS )

# If CMake is < 3.12, use the old style python search and alias the variables
# Note that the Interpreter component is only required for the python test
IF ( ${CMAKE_VERSION} VERSION_LESS 3.12 )
  FIND_PACKAGE ( PythonInterp ${PYTHON_VERSION} REQUIRED )
  FIND_PACKAGE ( PythonLibs ${PYTHON_VERSION} REQUIRED )

  SET ( Python_VERSION_MAJOR ${PYTHON_VERSION_MAJOR} )
  SET ( Python_VERSION_MINOR ${PYTHON_VERSION_MINOR} )
  SET ( Python_EXECUTABLE ${PYTHON_EXECUTABLE} )
  SET ( OPENVDB_PYTHON_DEPS ${PYTHON_LIBRARIES} )
  GET_FILENAME_COMPONENT ( Python_LIBRARY_DIRS ${OPENVDB_PYTHON_DEPS} DIRECTORY )
{'fraction_non_alphanumeric': 0.16462471749732366, 'fraction_numerical': 0.011181158558344237, 'mean_word_length': 4.245165315034311, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2949120', 'n_tokens_mistral': 2638, 'n_tokens_neox': 2378, 'n_words': 885}