<commit_before>###########################################################################
# Disable insource build

if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
	message(FATAL_ERROR
		"CMake generation for Cycles is not allowed within the source directory!"
		"\n Remove the CMakeCache.txt file and try again from another folder, e.g.:"
		"\n "
		"\n rm CMakeCache.txt"
		"\n cd .."
		"\n mkdir cmake-make"
		"\n cd cmake-make"
		"\n cmake ../cycles"
	)
endif()

###########################################################################
# Policies

cmake_minimum_required(VERSION 3.10)

# So library linking is more sane.
cmake_policy(SET CMP0003 NEW)

# So syntax problems are errors.
cmake_policy(SET CMP0010 NEW)

# So BUILDINFO and BLENDERPATH strings are automatically quoted.
cmake_policy(SET CMP0005 NEW)

# Input directories must have CMakeLists.txt
cmake_policy(SET CMP0014 NEW)

# Compile definitions.
cmake_policy(SET CMP0043 NEW)

# Use ROOT variables in find_package.
cmake_policy(SET CMP0074 NEW)

###########################################################################
# Initialize project.

project(Cycles)

###########################################################################
# Macros and utilities.

list(APPEND CMAKE_MODULE_PATH
	"${PROJECT_SOURCE_DIR}/src/cmake"
	"${PROJECT_SOURCE_DIR}/src/cmake/Modules"
)

include(compiler_utils)
include(macros)

###########################################################################
# Global settings.

# Avoid having empty buildtype.
set(CMAKE_BUILD_TYPE_INIT "Release")


# Some stuff is different when building stabdalone Cycles from inside
# Blender source code and when building it from it's own repository.
set(CYCLES_STANDALONE_REPOSITORY TRUE)

# Force standalone build.
set(WITH_CYCLES_STANDALONE TRUE)

# Global compile definitions since add_definitions() adds for all.
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
  $<$<CONFIG:Debug>:DEBUG;_DEBUG>
  $<$<CONFIG:Release>:NDEBUG>
  $<$<CONFIG:MinSizeRel>:NDEBUG>
  $<$<CONFIG:RelWithDebInfo>:NDEBUG>
)

###########################################################################
# Options.

option(WITH_CPU_SSE                 "Enable SIMD instruction if they're detected on the host machine" ON)
option(WITH_CYCLES_STANDALONE_GUI   "Build Cycles standalone with GUI" ON)
option(WITH_CYCLES_OSL              "Build Cycles with OSL support" ON)
option(WITH_CYCLES_OPENCOLORIO      "Build Cycles with OpenColorIO support" ON)
option(WITH_CYCLES_OPENSUBDIV       "Build Cycles with OpenSubdiv support" ON)
option(WITH_CYCLES_OPENIMAGEDENOISE "Build Cycles with OpenImageDenoise support" ON)
option(WITH_CYCLES_OPENVDB          "Build Cycles with OpenVDB support" ON)
option(WITH_CYCLES_EMBREE           "Build Cycles with embree support" ON)
option(WITH_CYCLES_LOGGING          "Build Cycles with logging support" OFF)
option(WITH_CYCLES_DEBUG            "Build Cycles with with extra debug capabilties" OFF)
option(WITH_CYCLES_CUDA_BINARIES    "Build Cycles CUDA binaries" OFF)
set(CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 sm_35 sm_50 sm_52 CACHE STRING "CUDA architectures to build binaries for")
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
if(UNIX AND NOT APPLE)
  option(WITH_CXX11_ABI              "Build with glibc C++11 ABI. Precompiled libraries are built with the older ABI" ON)
endif()

option(WITH_CUDA_DYNLOAD           "Dynamically load CUDA libraries at runtime" ON)
mark_as_advanced(WITH_CUDA_DYNLOAD)

# ====== Tangent Rez Deps
option(BUILD_WITH_REZ "Build with rez" ON)
if(${BUILD_WITH_REZ})
    include(${CMAKE_CURRENT_SOURCE_DIR}/rez_deps.cmake)
else()
    set(USE_OPENGL TRUE)
endif()

include(external_libs)

###########################################################################
# Configuration.

include(CheckCXXCompilerFlag)
include(configure_build)

###########################################################################<commit_msg>add use_opengl define<commit_after>###########################################################################
# Disable insource build

if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
	message(FATAL_ERROR
		"CMake generation for Cycles is not allowed within the source directory!"
		"\n Remove the CMakeCache.txt file and try again from another folder, e.g.:"
		"\n "
		"\n rm CMakeCache.txt"
		"\n cd .."
		"\n mkdir cmake-make"
		"\n cd cmake-make"
		"\n cmake ../cycles"
	)
endif()

###########################################################################
# Policies

cmake_minimum_required(VERSION 3.10)

# So library linking is more sane.
cmake_policy(SET CMP0003 NEW)

# So syntax problems are errors.
cmake_policy(SET CMP0010 NEW)

# So BUILDINFO and BLENDERPATH strings are automatically quoted.
cmake_policy(SET CMP0005 NEW)

# Input directories must have CMakeLists.txt
cmake_policy(SET CMP0014 NEW)

# Compile definitions.
cmake_policy(SET CMP0043 NEW)

# Use ROOT variables in find_package.
cmake_policy(SET CMP0074 NEW)

###########################################################################
# Initialize project.

project(Cycles)

###########################################################################
# Macros and utilities.

list(APPEND CMAKE_MODULE_PATH
	"${PROJECT_SOURCE_DIR}/src/cmake"
	"${PROJECT_SOURCE_DIR}/src/cmake/Modules"
)

include(compiler_utils)
include(macros)

###########################################################################
# Global settings.

# Avoid having empty buildtype.
set(CMAKE_BUILD_TYPE_INIT "Release")


# Some stuff is different when building stabdalone Cycles from inside
# Blender source code and when building it from it's own repository.
set(CYCLES_STANDALONE_REPOSITORY TRUE)

# Force standalone build.
set(WITH_CYCLES_STANDALONE TRUE)

# Global compile definitions since add_definitions() adds for all.
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
  $<$<CONFIG:Debug>:DEBUG;_DEBUG>
  $<$<CONFIG:Release>:NDEBUG>
  $<$<CONFIG:MinSizeRel>:NDEBUG>
  $<$<CONFIG:RelWithDebInfo>:NDEBUG>
)

###########################################################################
# Options.

option(WITH_CPU_SSE                 "Enable SIMD instruction if they're detected on the host machine" ON)
option(WITH_CYCLES_STANDALONE_GUI   "Build Cycles standalone with GUI" ON)
option(WITH_CYCLES_OSL              "Build Cycles with OSL support" ON)
option(WITH_CYCLES_OPENCOLORIO      "Build Cycles with OpenColorIO support" ON)
option(WITH_CYCLES_OPENSUBDIV       "Build Cycles with OpenSubdiv support" ON)
option(WITH_CYCLES_OPENIMAGEDENOISE "Build Cycles with OpenImageDenoise support" ON)
option(WITH_CYCLES_OPENVDB          "Build Cycles with OpenVDB support" ON)
option(WITH_CYCLES_EMBREE           "Build Cycles with embree support" ON)
option(WITH_CYCLES_LOGGING          "Build Cycles with logging support" OFF)
option(WITH_CYCLES_DEBUG            "Build Cycles with with extra debug capabilties" OFF)
option(WITH_CYCLES_CUDA_BINARIES    "Build Cycles CUDA binaries" OFF)
set(CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 sm_35 sm_50 sm_52 CACHE STRING "CUDA architectures to build binaries for")
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
if(UNIX AND NOT APPLE)
  option(WITH_CXX11_ABI              "Build with glibc C++11 ABI. Precompiled libraries are built with the older ABI" ON)
endif()

option(WITH_CUDA_DYNLOAD           "Dynamically load CUDA libraries at runtime" ON)
mark_as_advanced(WITH_CUDA_DYNLOAD)

# ====== Tangent Rez Deps
option(BUILD_WITH_REZ "Build with rez" ON)
if(${BUILD_WITH_REZ})
    include(${CMAKE_CURRENT_SOURCE_DIR}/rez_deps.cmake)
else()
    set(USE_OPENGL TRUE)
    add_definitions(-DUSE_OPENGL)
endif()

include(external_libs)

###########################################################################
# Configuration.

include(CheckCXXCompilerFlag)
include(configure_build)

###########################################################################
{'fraction_non_alphanumeric': 0.22136340598074, 'fraction_numerical': 0.010897110998479472, 'mean_word_length': 6.041034790365745, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '1622540', 'n_tokens_mistral': 2550, 'n_tokens_neox': 2361, 'n_words': 623}