<commit_before>cmake_minimum_required(VERSION 3.18)

# CMP0091 allows for MSVC ABI targetting via CMAKE_MSVC_RUNTIME_LIBRARY
# from CMake 3.15 and above. Must come before project().
if(POLICY CMP0091)
  cmake_policy(SET CMP0091 NEW)
endif()

if(POLICY CMP0074)
  cmake_policy(SET CMP0074 NEW)
endif()

#project(vdb_tool LANGUAGES CXX)

#set(CMAKE_CXX_STANDARD 14)

if(NOT CMAKE_BUILD_TYPE)
  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
      "Choose the type of build, supported options are: Debug Release."
      FORCE)
endif()

list(APPEND CMAKE_MODULE_PATH ${OPENVDB_CMAKE_PATH})

# Pseudo library to manage dependencies
add_library(vdb_tool_common INTERFACE)

# Optional components
option(BUILD_TEST "Build unit tests" OFF)

option(VDB_TOOL_USE_NANO "Compile with NanoVDB support" ON)
option(VDB_TOOL_NANO_USE_ZIP "Compile NanoVDB with zip compression support. Requires VDB_TOOL_USE_NANO=ON to have effect" ON)
option(VDB_TOOL_NANO_USE_BLOSC "Compile NanoVDB with Blosc compression support. Requires VDB_TOOL_USE_NANO=ON to have effect" ON)
option(VDB_TOOL_USE_PNG "Compile with PNG support" OFF)
option(VDB_TOOL_USE_EXR "Compile with EXR support" OFF)
option(VDB_TOOL_USE_JPG "Compile with JPG support" OFF)
option(VDB_TOOL_USE_ABC "Compile with Alembic support" OFF)
option(VDB_TOOL_USE_ALL "Compile with all optional components" OFF)
if(VDB_TOOL_USE_ALL)
  set(VDB_TOOL_USE_NANO ON)
  set(VDB_TOOL_USE_PNG ON)
  set(VDB_TOOL_USE_EXR ON)
  set(VDB_TOOL_USE_JPG ON)
  set(VDB_TOOL_USE_ABC ON)
endif()

if(VDB_TOOL_USE_NANO)
  add_compile_definitions("VDB_TOOL_USE_NANO")
  if(VDB_TOOL_NANO_USE_ZIP)
    add_compile_definitions("NANOVDB_USE_ZIP")
    find_package(ZLIB REQUIRED)
    target_link_libraries(vdb_tool_common INTERFACE ZLIB::ZLIB)
  endif()
  if(VDB_TOOL_NANO_USE_BLOSC)
    add_compile_definitions("NANOVDB_USE_BLOSC")
    find_package(Blosc REQUIRED)
    target_link_libraries(vdb_tool_common INTERFACE blosc)
  endif()
  if(OPENVDB_BUILD_NANOVDB)
    target_include_directories(vdb_tool_common INTERFACE ../../nanovdb/)
  endif()
endif()

if(VDB_TOOL_USE_PNG)
  add_compile_definitions("VDB_TOOL_USE_PNG")
  if(WIN32)
    find_package(libpng CONFIG REQUIRED)
  else()
    find_package(PNG REQUIRED)
  endif()
  target_link_libraries(vdb_tool_common INTERFACE png)
endif()

if(VDB_TOOL_USE_JPG)
  add_compile_definitions("VDB_TOOL_USE_JPG")
  find_package(JPEG REQUIRED)
  target_link_libraries(vdb_tool_common INTERFACE ${JPEG_LIBRARIES})
  target_include_directories(vdb_tool_common INTERFACE ${JPEG_INCLUDE_DIR})
endif()

if(VDB_TOOL_USE_EXR)
  add_compile_definitions("VDB_TOOL_USE_EXR")
  find_package(OpenEXR REQUIRED)<commit_msg>Try to fix compile problems in MacOS.<commit_after>cmake_minimum_required(VERSION 3.18)

# CMP0091 allows for MSVC ABI targetting via CMAKE_MSVC_RUNTIME_LIBRARY
# from CMake 3.15 and above. Must come before project().
if(POLICY CMP0091)
  cmake_policy(SET CMP0091 NEW)
endif()

if(POLICY CMP0074)
  cmake_policy(SET CMP0074 NEW)
endif()

#project(vdb_tool LANGUAGES CXX)

#set(CMAKE_CXX_STANDARD 14)

if(NOT CMAKE_BUILD_TYPE)
  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
      "Choose the type of build, supported options are: Debug Release."
      FORCE)
endif()

list(APPEND CMAKE_MODULE_PATH ${OPENVDB_CMAKE_PATH})

# Pseudo library to manage dependencies
add_library(vdb_tool_common INTERFACE)

# Optional components
option(BUILD_TEST "Build unit tests" OFF)

option(VDB_TOOL_USE_NANO "Compile with NanoVDB support" ON)
option(VDB_TOOL_NANO_USE_ZIP "Compile NanoVDB with zip compression support. Requires VDB_TOOL_USE_NANO=ON to have effect" ON)
option(VDB_TOOL_NANO_USE_BLOSC "Compile NanoVDB with Blosc compression support. Requires VDB_TOOL_USE_NANO=ON to have effect" ON)
option(VDB_TOOL_USE_PNG "Compile with PNG support" OFF)
option(VDB_TOOL_USE_EXR "Compile with EXR support" OFF)
option(VDB_TOOL_USE_JPG "Compile with JPG support" OFF)
option(VDB_TOOL_USE_ABC "Compile with Alembic support" OFF)
option(VDB_TOOL_USE_ALL "Compile with all optional components" OFF)
if(VDB_TOOL_USE_ALL)
  set(VDB_TOOL_USE_NANO ON)
  set(VDB_TOOL_USE_PNG ON)
  set(VDB_TOOL_USE_EXR ON)
  set(VDB_TOOL_USE_JPG ON)
  set(VDB_TOOL_USE_ABC ON)
endif()

if(VDB_TOOL_USE_NANO)
  add_compile_definitions("VDB_TOOL_USE_NANO")
  if(VDB_TOOL_NANO_USE_ZIP)
    add_compile_definitions("NANOVDB_USE_ZIP")
    find_package(ZLIB REQUIRED)
    target_link_libraries(vdb_tool_common INTERFACE ZLIB::ZLIB)
  endif()
  if(VDB_TOOL_NANO_USE_BLOSC)
    add_compile_definitions("NANOVDB_USE_BLOSC")
    find_package(Blosc REQUIRED)
    target_link_libraries(vdb_tool_common INTERFACE blosc)
  endif()
  target_include_directories(vdb_tool_common INTERFACE ../../nanovdb/)
endif()

if(VDB_TOOL_USE_PNG)
  add_compile_definitions("VDB_TOOL_USE_PNG")
  if(WIN32)
    find_package(libpng CONFIG REQUIRED)
  else()
    find_package(PNG REQUIRED)
  endif()
  target_link_libraries(vdb_tool_common INTERFACE png)
endif()

if(VDB_TOOL_USE_JPG)
  add_compile_definitions("VDB_TOOL_USE_JPG")
  find_package(JPEG REQUIRED)
  target_link_libraries(vdb_tool_common INTERFACE ${JPEG_LIBRARIES})
  target_include_directories(vdb_tool_common INTERFACE ${JPEG_INCLUDE_DIR})
endif()

if(VDB_TOOL_USE_EXR)
  add_compile_definitions("VDB_TOOL_USE_EXR")
  find_package(OpenEXR REQUIRED)
{'fraction_non_alphanumeric': 0.07577475434618292, 'fraction_numerical': 0.011337868480725623, 'mean_word_length': 7.044072948328267, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '911657', 'n_tokens_mistral': 2269, 'n_tokens_neox': 2057, 'n_words': 401}