UI: Console Text Operations #108626

Manually merged
Campbell Barton merged 13 commits from Harley/blender:ConsoleSelect into main 2023-09-22 05:42:35 +02:00
3795 changed files with 272697 additions and 583230 deletions
Showing only changes of commit 7b0f949e3b - Show all commits

File diff suppressed because it is too large Load Diff

View File

@ -116,7 +116,8 @@ ExternalProject_Add(external_usd
# usd_hydra.diff also included the blender changes and usd_pull_1965 and has been edited to remove those sections.
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/usd/src/external_usd < ${PATCH_DIR}/usd.diff &&
${PATCH_CMD} -p 1 -d ${BUILD_DIR}/usd/src/external_usd < ${PATCH_DIR}/usd_pull_1965.diff &&
${PATCH_CMD} -p 1 -d ${BUILD_DIR}/usd/src/external_usd < ${PATCH_DIR}/usd_hydra.diff
${PATCH_CMD} -p 1 -d ${BUILD_DIR}/usd/src/external_usd < ${PATCH_DIR}/usd_hydra.diff &&
${PATCH_CMD} -p 1 -d ${BUILD_DIR}/usd/src/external_usd < ${PATCH_DIR}/usd_core_profile.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/usd -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${USD_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/usd
)

View File

@ -16,7 +16,7 @@ set(ZLIB_HASH 9b8aa094c4e5765dabf4da391f00d15c)
set(ZLIB_HASH_TYPE MD5)
set(ZLIB_FILE zlib-${ZLIB_VERSION}.tar.gz)
set(ZLIB_CPE "cpe:2.3:a:zlib:zlib:${ZLIB_VERSION}:*:*:*:*:*:*:*")
#set(ZLIB_HOMEPAGE https://zlib.net)
set(ZLIB_HOMEPAGE https://zlib.net)
set(OPENAL_VERSION 1.21.1)
set(OPENAL_URI http://openal-soft.org/openal-releases/openal-soft-${OPENAL_VERSION}.tar.bz2)

View File

@ -269,6 +269,20 @@ DEPS_CRITICAL_SUBPACKAGES = (
DISTRO_ID_ARCH: "dbus",
},
),
Package(name="OpenGL Library",
distro_package_names={DISTRO_ID_DEBIAN: "libgl-dev",
DISTRO_ID_FEDORA: "mesa-libGL-devel",
DISTRO_ID_SUSE: "Mesa-libGL-devel",
DISTRO_ID_ARCH: "libglvnd",
},
),
Package(name="EGL Library",
distro_package_names={DISTRO_ID_DEBIAN: "libegl-dev",
DISTRO_ID_FEDORA: "mesa-libEGL-devel",
DISTRO_ID_SUSE: "Mesa-libEGL-devel",
DISTRO_ID_ARCH: None, # Included in `libglvnd`.
},
),
)

View File

@ -14,14 +14,14 @@ if [ `id -u` -ne 0 ]; then
fi
# Required by: config manager command below to enable powertools.
dnf install 'dnf-command(config-manager)'
dnf -y install 'dnf-command(config-manager)'
# Packages `ninja-build` and `meson` are not available unless CBR or PowerTools repositories are enabled.
# See: https://wiki.rockylinux.org/rocky/repo/#notes-on-unlisted-repositories
dnf config-manager --set-enabled powertools
# Required by: epel-release has the patchelf and rubygem-asciidoctor packages
dnf install epel-release
dnf -y install epel-release
# `yum-config-manager` does not come in the default minimal install,
# so make sure it is installed and available.

View File

@ -75,3 +75,18 @@ index 46e4529..8e86486 100644
return false;
}
diff --git a/src/liboslexec/CMakeLists.txt b/src/liboslexec/CMakeLists.txt
index 6bb0d175..19f13513 100644
--- a/src/liboslexec/CMakeLists.txt
+++ b/src/liboslexec/CMakeLists.txt
@@ -148,7 +148,9 @@ file (GLOB exec_headers "*.h")
file (GLOB compiler_headers "../liboslcomp/*.h")
FLEX_BISON ( osolex.l osogram.y oso lib_src exec_headers )
-FLEX_BISON ( ../liboslcomp/osllex.l ../liboslcomp/oslgram.y osl lib_src compiler_headers )
+if (BUILD_SHARED_LIBS)
+ FLEX_BISON ( ../liboslcomp/osllex.l ../liboslcomp/oslgram.y osl lib_src compiler_headers )
+endif()
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS" )

View File

@ -0,0 +1,415 @@
diff --git a/pxr/imaging/hdSt/indirectDrawBatch.cpp b/pxr/imaging/hdSt/indirectDrawBatch.cpp
index ec9b224..bf59cdf 100644
--- a/pxr/imaging/hdSt/indirectDrawBatch.cpp
+++ b/pxr/imaging/hdSt/indirectDrawBatch.cpp
@@ -109,11 +109,17 @@ HdSt_IndirectDrawBatch::HdSt_IndirectDrawBatch(
, _allowGpuFrustumCulling(allowGpuFrustumCulling)
, _instanceCountOffset(0)
, _cullInstanceCountOffset(0)
+ , _vao(0)
{
_Init(drawItemInstance);
}
-HdSt_IndirectDrawBatch::~HdSt_IndirectDrawBatch() = default;
+HdSt_IndirectDrawBatch::~HdSt_IndirectDrawBatch()
+{
+ if (_vao) {
+ glDeleteVertexArrays(1, &_vao);
+ }
+}
/*virtual*/
void
@@ -1146,6 +1152,14 @@ HdSt_IndirectDrawBatch::_ExecuteDraw(
state.instancePrimvarBars);
}
+ // OpenGL core profile requries a VAO for binding buffers.
+ if (capabilities->GetCoreProfile()) {
+ if (!_vao) {
+ glCreateVertexArrays(1, &_vao);
+ }
+ glBindVertexArray(_vao);
+ }
+
state.BindResourcesForDrawing(renderPassState, *capabilities);
HdSt_GeometricShaderSharedPtr geometricShader = state.geometricShader;
@@ -1374,6 +1388,15 @@ HdSt_IndirectDrawBatch::_ExecuteFrustumCull(
cullingProgram.GetGeometricShader());
Hgi * hgi = resourceRegistry->GetHgi();
+ HgiCapabilities const *capabilities = hgi->GetCapabilities();
+
+ // OpenGL core profile requries a VAO for binding buffers.
+ if (capabilities->GetCoreProfile()) {
+ if (!_vao) {
+ glCreateVertexArrays(1, &_vao);
+ }
+ glBindVertexArray(_vao);
+ }
HgiGraphicsPipelineSharedPtr const & pso =
_GetCullPipeline(resourceRegistry,
diff --git a/pxr/imaging/hdSt/indirectDrawBatch.h b/pxr/imaging/hdSt/indirectDrawBatch.h
index 44971f5..4292aa3 100644
--- a/pxr/imaging/hdSt/indirectDrawBatch.h
+++ b/pxr/imaging/hdSt/indirectDrawBatch.h
@@ -195,6 +195,8 @@ private:
int _instanceCountOffset;
int _cullInstanceCountOffset;
+
+ uint32_t _vao;
};
diff --git a/pxr/imaging/hdSt/renderPassState.cpp b/pxr/imaging/hdSt/renderPassState.cpp
index da0e4f3..8f87fc1 100644
--- a/pxr/imaging/hdSt/renderPassState.cpp
+++ b/pxr/imaging/hdSt/renderPassState.cpp
@@ -769,7 +769,9 @@ HdStRenderPassState::Bind(HgiCapabilities const &hgiCapabilities)
// If not using GL_MULTISAMPLE, use GL_POINT_SMOOTH to render points as
// circles instead of square.
// XXX Switch points rendering to emit quad with FS that draws circle.
- glEnable(GL_POINT_SMOOTH);
+ if (!hgiCapabilities.GetCoreProfile()) {
+ glEnable(GL_POINT_SMOOTH);
+ }
}
}
@@ -813,7 +815,9 @@ HdStRenderPassState::Unbind(HgiCapabilities const &hgiCapabilities)
}
glEnable(GL_MULTISAMPLE);
- glDisable(GL_POINT_SMOOTH);
+ if (!hgiCapabilities.GetCoreProfile()) {
+ glDisable(GL_POINT_SMOOTH);
+ }
}
void
diff --git a/pxr/imaging/hgi/capabilities.h b/pxr/imaging/hgi/capabilities.h
index ae2ecb4..c86afcb 100644
--- a/pxr/imaging/hgi/capabilities.h
+++ b/pxr/imaging/hgi/capabilities.h
@@ -52,6 +52,11 @@ public:
HGI_API
virtual int GetShaderVersion() const = 0;
+ HGI_API
+ virtual bool GetCoreProfile() const {
+ return false;
+ }
+
HGI_API
size_t GetMaxUniformBlockSize() const {
return _maxUniformBlockSize;
diff --git a/pxr/imaging/hgiGL/blitCmds.cpp b/pxr/imaging/hgiGL/blitCmds.cpp
index ce62f41..20888a1 100644
--- a/pxr/imaging/hgiGL/blitCmds.cpp
+++ b/pxr/imaging/hgiGL/blitCmds.cpp
@@ -136,7 +136,7 @@ HgiGLBlitCmds::_Submit(Hgi* hgi, HgiSubmitWaitType wait)
// Capture OpenGL state before executing the 'ops' and restore it when this
// function ends. We do this defensively because parts of our pipeline may
// not set and restore all relevant gl state.
- HgiGL_ScopedStateHolder openglStateGuard;
+ HgiGL_ScopedStateHolder openglStateGuard(*hgi->GetCapabilities());
HgiGL* hgiGL = static_cast<HgiGL*>(hgi);
HgiGLDevice* device = hgiGL->GetPrimaryDevice();
diff --git a/pxr/imaging/hgiGL/capabilities.cpp b/pxr/imaging/hgiGL/capabilities.cpp
index 8711a62..e11324b 100644
--- a/pxr/imaging/hgiGL/capabilities.cpp
+++ b/pxr/imaging/hgiGL/capabilities.cpp
@@ -57,6 +57,7 @@ static const int _DefaultMaxClipDistances = 8;
HgiGLCapabilities::HgiGLCapabilities()
: _glVersion(0)
, _glslVersion(_DefaultGLSLVersion)
+ , _coreProfile(false)
{
_LoadCapabilities();
}
@@ -131,6 +132,11 @@ HgiGLCapabilities::_LoadCapabilities()
&uniformBufferOffsetAlignment);
_uniformBufferOffsetAlignment = uniformBufferOffsetAlignment;
}
+ if (_glVersion >= 320) {
+ GLint profileMask = 0;
+ glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &profileMask);
+ _coreProfile = (profileMask & GL_CONTEXT_CORE_PROFILE_BIT);
+ }
if (_glVersion >= 430) {
GLint maxShaderStorageBlockSize = 0;
glGetIntegerv(GL_MAX_SHADER_STORAGE_BLOCK_SIZE,
@@ -259,4 +265,9 @@ HgiGLCapabilities::GetShaderVersion() const {
return _glslVersion;
}
+bool
+HgiGLCapabilities::GetCoreProfile() const {
+ return _coreProfile;
+}
+
PXR_NAMESPACE_CLOSE_SCOPE
diff --git a/pxr/imaging/hgiGL/capabilities.h b/pxr/imaging/hgiGL/capabilities.h
index 3c8f026..2f25b44 100644
--- a/pxr/imaging/hgiGL/capabilities.h
+++ b/pxr/imaging/hgiGL/capabilities.h
@@ -52,6 +52,9 @@ public:
HGIGL_API
int GetShaderVersion() const override;
+ HGIGL_API
+ bool GetCoreProfile() const override;
+
private:
void _LoadCapabilities();
@@ -60,6 +63,9 @@ private:
// GLSL version
int _glslVersion; // 400, 410, ...
+
+ // Core Profile
+ bool _coreProfile;
};
PXR_NAMESPACE_CLOSE_SCOPE
diff --git a/pxr/imaging/hgiGL/graphicsCmds.cpp b/pxr/imaging/hgiGL/graphicsCmds.cpp
index 5e17416..e59ae35 100644
--- a/pxr/imaging/hgiGL/graphicsCmds.cpp
+++ b/pxr/imaging/hgiGL/graphicsCmds.cpp
@@ -249,7 +249,7 @@ HgiGLGraphicsCmds::_Submit(Hgi* hgi, HgiSubmitWaitType wait)
// Capture OpenGL state before executing the 'ops' and restore it when this
// function ends. We do this defensively because parts of our pipeline may
// not set and restore all relevant gl state.
- HgiGL_ScopedStateHolder openglStateGuard;
+ HgiGL_ScopedStateHolder openglStateGuard(*hgi->GetCapabilities());
// Resolve multisample textures
HgiGL* hgiGL = static_cast<HgiGL*>(hgi);
diff --git a/pxr/imaging/hgiGL/graphicsPipeline.cpp b/pxr/imaging/hgiGL/graphicsPipeline.cpp
index 6983dd1..a1c7af7 100644
--- a/pxr/imaging/hgiGL/graphicsPipeline.cpp
+++ b/pxr/imaging/hgiGL/graphicsPipeline.cpp
@@ -42,7 +42,12 @@ HgiGLGraphicsPipeline::HgiGLGraphicsPipeline(
{
}
-HgiGLGraphicsPipeline::~HgiGLGraphicsPipeline() = default;
+HgiGLGraphicsPipeline::~HgiGLGraphicsPipeline()
+{
+ if (_vao) {
+ glDeleteVertexArrays(1, &_vao);
+ }
+}
void
HgiGLGraphicsPipeline::BindPipeline()
@@ -50,6 +55,7 @@ HgiGLGraphicsPipeline::BindPipeline()
if (_vao) {
glBindVertexArray(0);
glDeleteVertexArrays(1, &_vao);
+ _vao = 0;
}
if (!_descriptor.vertexBuffers.empty()) {
@@ -108,6 +114,8 @@ HgiGLGraphicsPipeline::BindPipeline()
glBindVertexArray(_vao);
}
+ const bool coreProfile = _hgi->GetCapabilities()->GetCoreProfile();
+
//
// Depth Stencil State
//
@@ -172,7 +180,9 @@ HgiGLGraphicsPipeline::BindPipeline()
// If not using GL_MULTISAMPLE, use GL_POINT_SMOOTH to render points as
// circles instead of square.
// XXX Switch points rendering to emit quad with FS that draws circle.
- glEnable(GL_POINT_SMOOTH);
+ if (!coreProfile) {
+ glEnable(GL_POINT_SMOOTH);
+ }
}
if (_descriptor.multiSampleState.alphaToCoverageEnable) {
glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE);
@@ -207,7 +217,7 @@ HgiGLGraphicsPipeline::BindPipeline()
glFrontFace(GL_CCW);
}
- if (_descriptor.rasterizationState.lineWidth != 1.0f) {
+ if (!coreProfile && _descriptor.rasterizationState.lineWidth != 1.0f) {
glLineWidth(_descriptor.rasterizationState.lineWidth);
}
diff --git a/pxr/imaging/hgiGL/scopedStateHolder.cpp b/pxr/imaging/hgiGL/scopedStateHolder.cpp
index 89cd0ac..5c65753 100644
--- a/pxr/imaging/hgiGL/scopedStateHolder.cpp
+++ b/pxr/imaging/hgiGL/scopedStateHolder.cpp
@@ -26,6 +26,7 @@
#include "pxr/imaging/hgiGL/scopedStateHolder.h"
#include "pxr/imaging/hgiGL/conversions.h"
#include "pxr/imaging/hgiGL/diagnostic.h"
+#include "pxr/imaging/hgiGL/hgi.h"
#include "pxr/base/trace/trace.h"
#include "pxr/base/tf/diagnostic.h"
@@ -33,8 +34,10 @@
PXR_NAMESPACE_OPEN_SCOPE
-HgiGL_ScopedStateHolder::HgiGL_ScopedStateHolder()
- : _restoreRenderBuffer(0)
+HgiGL_ScopedStateHolder::HgiGL_ScopedStateHolder(
+ HgiCapabilities const& capabilities)
+ : _coreProfile(capabilities.GetCoreProfile())
+ , _restoreRenderBuffer(0)
, _restoreVao(0)
, _restoreDepthTest(false)
, _restoreDepthWriteMask(false)
@@ -115,7 +118,9 @@ HgiGL_ScopedStateHolder::HgiGL_ScopedStateHolder()
glGetBooleanv(
GL_SAMPLE_ALPHA_TO_ONE,
(GLboolean*)&_restoreSampleAlphaToOne);
- glGetFloatv(GL_LINE_WIDTH, &_lineWidth);
+ if (!_coreProfile) {
+ glGetFloatv(GL_LINE_WIDTH, &_lineWidth);
+ }
glGetBooleanv(GL_CULL_FACE, (GLboolean*)&_cullFace);
glGetIntegerv(GL_CULL_FACE_MODE, &_cullMode);
glGetIntegerv(GL_FRONT_FACE, &_frontFace);
@@ -139,7 +144,9 @@ HgiGL_ScopedStateHolder::HgiGL_ScopedStateHolder()
}
glGetBooleanv(GL_MULTISAMPLE, (GLboolean*)&_restoreMultiSample);
- glGetBooleanv(GL_POINT_SMOOTH, (GLboolean*)&_restorePointSmooth);
+ if (!_coreProfile) {
+ glGetBooleanv(GL_POINT_SMOOTH, (GLboolean*)&_restorePointSmooth);
+ }
HGIGL_POST_PENDING_GL_ERRORS();
#if defined(GL_KHR_debug)
@@ -235,7 +242,9 @@ HgiGL_ScopedStateHolder::~HgiGL_ScopedStateHolder()
_restoreViewport[2], _restoreViewport[3]);
glBindVertexArray(_restoreVao);
glBindRenderbuffer(GL_RENDERBUFFER, _restoreRenderBuffer);
- glLineWidth(_lineWidth);
+ if (!_coreProfile) {
+ glLineWidth(_lineWidth);
+ }
if (_cullFace) {
glEnable(GL_CULL_FACE);
} else {
@@ -285,10 +294,12 @@ HgiGL_ScopedStateHolder::~HgiGL_ScopedStateHolder()
glDisable(GL_MULTISAMPLE);
}
- if (_restorePointSmooth) {
- glEnable(GL_POINT_SMOOTH);
- } else {
- glDisable(GL_POINT_SMOOTH);
+ if (!_coreProfile) {
+ if (_restorePointSmooth) {
+ glEnable(GL_POINT_SMOOTH);
+ } else {
+ glDisable(GL_POINT_SMOOTH);
+ }
}
static const GLuint samplers[8] = {0};
diff --git a/pxr/imaging/hgiGL/scopedStateHolder.h b/pxr/imaging/hgiGL/scopedStateHolder.h
index d006480..be6698e 100644
--- a/pxr/imaging/hgiGL/scopedStateHolder.h
+++ b/pxr/imaging/hgiGL/scopedStateHolder.h
@@ -32,6 +32,7 @@
PXR_NAMESPACE_OPEN_SCOPE
+class HgiCapabilities;
/// \class HgiGLScopedStateHolder
///
@@ -50,7 +51,7 @@ class HgiGL_ScopedStateHolder final
{
public:
HGIGL_API
- HgiGL_ScopedStateHolder();
+ HgiGL_ScopedStateHolder(HgiCapabilities const& capabilities);
HGIGL_API
~HgiGL_ScopedStateHolder();
@@ -59,6 +60,8 @@ private:
HgiGL_ScopedStateHolder& operator=(const HgiGL_ScopedStateHolder&) = delete;
HgiGL_ScopedStateHolder(const HgiGL_ScopedStateHolder&) = delete;
+ bool _coreProfile;
+
int32_t _restoreRenderBuffer;
int32_t _restoreVao;
diff --git a/pxr/imaging/hgiInterop/opengl.cpp b/pxr/imaging/hgiInterop/opengl.cpp
index 683c058..e921c2a 100644
--- a/pxr/imaging/hgiInterop/opengl.cpp
+++ b/pxr/imaging/hgiInterop/opengl.cpp
@@ -110,6 +110,7 @@ HgiInteropOpenGL::HgiInteropOpenGL()
, _fsDepth(0)
, _prgNoDepth(0)
, _prgDepth(0)
+ , _vao(0)
, _vertexBuffer(0)
{
_vs = _CompileShader(_vertexFullscreen, GL_VERTEX_SHADER);
@@ -117,6 +118,7 @@ HgiInteropOpenGL::HgiInteropOpenGL()
_fsDepth = _CompileShader(_fragmentDepthFullscreen, GL_FRAGMENT_SHADER);
_prgNoDepth = _LinkProgram(_vs, _fsNoDepth);
_prgDepth = _LinkProgram(_vs, _fsDepth);
+ glCreateVertexArrays(1, &_vao);
_vertexBuffer = _CreateVertexBuffer();
TF_VERIFY(glGetError() == GL_NO_ERROR);
}
@@ -129,6 +131,7 @@ HgiInteropOpenGL::~HgiInteropOpenGL()
glDeleteProgram(_prgNoDepth);
glDeleteProgram(_prgDepth);
glDeleteBuffers(1, &_vertexBuffer);
+ glDeleteVertexArrays(1, &_vao);
TF_VERIFY(glGetError() == GL_NO_ERROR);
}
@@ -202,10 +205,13 @@ HgiInteropOpenGL::CompositeToInterop(
}
// Get the current array buffer binding state
+ GLint restoreVao = 0;
+ glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &restoreVao);
GLint restoreArrayBuffer = 0;
glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &restoreArrayBuffer);
// Vertex attributes
+ glBindVertexArray(_vao);
const GLint locPosition = glGetAttribLocation(prg, "position");
glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer);
glVertexAttribPointer(locPosition, 4, GL_FLOAT, GL_FALSE,
@@ -271,6 +277,7 @@ HgiInteropOpenGL::CompositeToInterop(
glDisableVertexAttribArray(locPosition);
glDisableVertexAttribArray(locUv);
glBindBuffer(GL_ARRAY_BUFFER, restoreArrayBuffer);
+ glBindVertexArray(restoreVao);
if (!blendEnabled) {
glDisable(GL_BLEND);
diff --git a/pxr/imaging/hgiInterop/opengl.h b/pxr/imaging/hgiInterop/opengl.h
index 18840a9..27434ac 100644
--- a/pxr/imaging/hgiInterop/opengl.h
+++ b/pxr/imaging/hgiInterop/opengl.h
@@ -62,6 +62,7 @@ private:
uint32_t _fsDepth;
uint32_t _prgNoDepth;
uint32_t _prgDepth;
+ uint32_t _vao;
uint32_t _vertexBuffer;
};

View File

@ -13,9 +13,13 @@
# ALEMBIC_FOUND, If false, do not try to use Alembic.
#
# If ALEMBIC_ROOT_DIR was defined in the environment, use it.
IF(NOT ALEMBIC_ROOT_DIR AND NOT $ENV{ALEMBIC_ROOT_DIR} STREQUAL "")
# If `ALEMBIC_ROOT_DIR` was defined in the environment, use it.
IF(DEFINED ALEMBIC_ROOT_DIR)
# Pass.
ELSEIF(DEFINED ENV{ALEMBIC_ROOT_DIR})
SET(ALEMBIC_ROOT_DIR $ENV{ALEMBIC_ROOT_DIR})
ELSE()
SET(ALEMBIC_ROOT_DIR "")
ENDIF()
SET(_alembic_SEARCH_DIRS

View File

@ -15,9 +15,13 @@
# also defined, but not for general use are
# BLOSC_LIBRARY, where to find the Blosc library.
# If BLOSC_ROOT_DIR was defined in the environment, use it.
IF(NOT BLOSC_ROOT_DIR AND NOT $ENV{BLOSC_ROOT_DIR} STREQUAL "")
# If `BLOSC_ROOT_DIR` was defined in the environment, use it.
IF(DEFINED BLOSC_ROOT_DIR)
# Pass.
ELSEIF(DEFINED ENV{BLOSC_ROOT_DIR})
SET(BLOSC_ROOT_DIR $ENV{BLOSC_ROOT_DIR})
ELSE()
SET(BLOSC_ROOT_DIR "")
ENDIF()
SET(_blosc_SEARCH_DIRS

View File

@ -12,9 +12,13 @@
# BROTLI_FOUND, If false, do not try to use Brotli.
#
# If BROTLI_ROOT_DIR was defined in the environment, use it.
IF(NOT BROTLI_ROOT_DIR AND NOT $ENV{BROTLI_ROOT_DIR} STREQUAL "")
# If `BROTLI_ROOT_DIR` was defined in the environment, use it.
IF(DEFINED BROTLI_ROOT_DIR)
# Pass.
ELSEIF(DEFINED ENV{BROTLI_ROOT_DIR})
SET(BROTLI_ROOT_DIR $ENV{BROTLI_ROOT_DIR})
ELSE()
SET(BROTLI_ROOT_DIR "")
ENDIF()
SET(_BROTLI_SEARCH_DIRS

View File

@ -12,9 +12,13 @@
# This can also be an environment variable.
# CLANG_FOUND, If false, do not try to use Clang.
# If CLANG_ROOT_DIR was defined in the environment, use it.
if(NOT CLANG_ROOT_DIR AND NOT $ENV{CLANG_ROOT_DIR} STREQUAL "")
# If `CLANG_ROOT_DIR` was defined in the environment, use it.
if(DEFINED CLANG_ROOT_DIR)
# Pass.
elseif(DEFINED ENV{CLANG_ROOT_DIR})
set(CLANG_ROOT_DIR $ENV{CLANG_ROOT_DIR})
else()
set(CLANG_ROOT_DIR "")
endif()
if(NOT LLVM_ROOT_DIR)

View File

@ -18,9 +18,13 @@
#
# CLANG_TIDY_FOUND, If false, do not try to use Eigen3.
# If CLANG_TIDY_ROOT_DIR was defined in the environment, use it.
if(NOT CLANG_TIDY_ROOT_DIR AND NOT $ENV{CLANG_TIDY_ROOT_DIR} STREQUAL "")
# If `CLANG_TIDY_ROOT_DIR` was defined in the environment, use it.
if(DEFINED CLANG_TIDY_ROOT_DIR)
# Pass.
elseif(DEFINED ENV{CLANG_TIDY_ROOT_DIR})
set(CLANG_TIDY_ROOT_DIR $ENV{CLANG_TIDY_ROOT_DIR})
else()
set(CLANG_TIDY_ROOT_DIR "")
endif()
set(_clang_tidy_SEARCH_DIRS

View File

@ -11,9 +11,13 @@
# This can also be an environment variable.
# EIGEN3_FOUND, If false, do not try to use Eigen3.
# If EIGEN3_ROOT_DIR was defined in the environment, use it.
IF(NOT EIGEN3_ROOT_DIR AND NOT $ENV{EIGEN3_ROOT_DIR} STREQUAL "")
# If `EIGEN3_ROOT_DIR` was defined in the environment, use it.
IF(DEFINED EIGEN3_ROOT_DIR)
# Pass.
ELSEIF(DEFINED ENV{EIGEN3_ROOT_DIR})
SET(EIGEN3_ROOT_DIR $ENV{EIGEN3_ROOT_DIR})
ELSE()
SET(EIGEN3_ROOT_DIR "")
ENDIF()
SET(_eigen3_SEARCH_DIRS

View File

@ -12,9 +12,13 @@
# This can also be an environment variable.
# EMBREEFOUND, If false, do not try to use Embree.
# If EMBREE_ROOT_DIR was defined in the environment, use it.
IF(NOT EMBREE_ROOT_DIR AND NOT $ENV{EMBREE_ROOT_DIR} STREQUAL "")
# If `EMBREE_ROOT_DIR` was defined in the environment, use it.
IF(DEFINED EMBREE_ROOT_DIR)
# Pass.
ELSEIF(DEFINED ENV{EMBREE_ROOT_DIR})
SET(EMBREE_ROOT_DIR $ENV{EMBREE_ROOT_DIR})
ELSE()
SET(EMBREE_ROOT_DIR "")
ENDIF()
SET(_embree_SEARCH_DIRS

View File

@ -9,8 +9,13 @@
# This can also be an environment variable.
# Epoxy_FOUND, If false, do not try to use epoxy.
IF(NOT EPOXY_ROOT_DIR AND NOT $ENV{EPOXY_ROOT_DIR} STREQUAL "")
# If `EPOXY_ROOT_DIR` was defined in the environment, use it.
IF(DEFINED EPOXY_ROOT_DIR)
# Pass.
ELSEIF(DEFINED ENV{EPOXY_ROOT_DIR})
SET(EPOXY_ROOT_DIR $ENV{EPOXY_ROOT_DIR})
ELSE()
SET(EPOXY_ROOT_DIR "")
ENDIF()
FIND_PATH(Epoxy_INCLUDE_DIR

View File

@ -13,9 +13,13 @@
# FFMPEG_FOUND, If false, do not try to use FFmpeg.
# FFMPEG_<COMPONENT>_LIBRARY, the given individual component libraries.
# If FFMPEG_ROOT_DIR was defined in the environment, use it.
if(NOT FFMPEG_ROOT_DIR AND NOT $ENV{FFMPEG_ROOT_DIR} STREQUAL "")
# If `FFMPEG_ROOT_DIR` was defined in the environment, use it.
if(DEFINED FFMPEG_ROOT_DIR)
# Pass.
elseif(DEFINED ENV{FFMPEG_ROOT_DIR})
set(FFMPEG_ROOT_DIR $ENV{FFMPEG_ROOT_DIR})
else()
set(FFMPEG_ROOT_DIR "")
endif()
set(_ffmpeg_SEARCH_DIRS

View File

@ -15,9 +15,13 @@
# also defined, but not for general use are
# FFTW3_LIBRARY, where to find the Fftw3 library.
# If FFTW3_ROOT_DIR was defined in the environment, use it.
IF(NOT FFTW3_ROOT_DIR AND NOT $ENV{FFTW3_ROOT_DIR} STREQUAL "")
# If `FFTW3_ROOT_DIR` was defined in the environment, use it.
IF(DEFINED FFTW3_ROOT_DIR)
# Pass.
ELSEIF(DEFINED ENV{FFTW3_ROOT_DIR})
SET(FFTW3_ROOT_DIR $ENV{FFTW3_ROOT_DIR})
ELSE()
SET(FFTW3_ROOT_DIR "")
ENDIF()
SET(_fftw3_SEARCH_DIRS

View File

@ -15,9 +15,13 @@
# also defined, but not for general use are
# GMP_LIBRARY, where to find the GMP library.
# If GMP_ROOT_DIR was defined in the environment, use it.
IF(NOT GMP_ROOT_DIR AND NOT $ENV{GMP_ROOT_DIR} STREQUAL "")
# If `GMP_ROOT_DIR` was defined in the environment, use it.
IF(DEFINED GMP_ROOT_DIR)
# Pass.
ELSEIF(DEFINED ENV{GMP_ROOT_DIR})
SET(GMP_ROOT_DIR $ENV{GMP_ROOT_DIR})
ELSE()
SET(GMP_ROOT_DIR "")
ENDIF()
SET(_gmp_SEARCH_DIRS

View File

@ -60,9 +60,13 @@
# GFLAGS_LIBRARY: gflags library, not including the libraries of any
# dependencies.
# If GFLAGS_ROOT_DIR was defined in the environment, use it.
if(NOT GFLAGS_ROOT_DIR AND NOT $ENV{GFLAGS_ROOT_DIR} STREQUAL "")
# If `GFLAGS_ROOT_DIR` was defined in the environment, use it.
if(DEFINED GFLAGS_ROOT_DIR)
# Pass.
elseif(DEFINED ENV{GFLAGS_ROOT_DIR})
set(GFLAGS_ROOT_DIR $ENV{GFLAGS_ROOT_DIR})
else()
set(GFLAGS_ROOT_DIR "")
endif()
if(DEFINED GFLAGS_ROOT_DIR)

View File

@ -38,9 +38,13 @@
# GLOG_LIBRARY: glog library, not including the libraries of any
# dependencies.
# If GLOG_ROOT_DIR was defined in the environment, use it.
if(NOT GLOG_ROOT_DIR AND NOT $ENV{GLOG_ROOT_DIR} STREQUAL "")
# If `GLOG_ROOT_DIR` was defined in the environment, use it.
if(DEFINED GLOG_ROOT_DIR)
# Pass.
elseif(DEFINED ENV{GLOG_ROOT_DIR})
set(GLOG_ROOT_DIR $ENV{GLOG_ROOT_DIR})
else()
set(GLOG_ROOT_DIR "")
endif()
if(DEFINED GLOG_ROOT_DIR)

View File

@ -7,9 +7,13 @@
# HIP_VERSION, the HIP compiler version
# HIP_FOUND, if the HIP toolkit is found.
# If HIP_ROOT_DIR was defined in the environment, use it.
if(NOT HIP_ROOT_DIR AND NOT $ENV{HIP_ROOT_DIR} STREQUAL "")
# If `HIP_ROOT_DIR` was defined in the environment, use it.
if(DEFINED HIP_ROOT_DIR)
# Pass.
elseif(DEFINED ENV{HIP_ROOT_DIR})
set(HIP_ROOT_DIR $ENV{HIP_ROOT_DIR})
else()
set(HIP_ROOT_DIR "")
endif()
set(_hip_SEARCH_DIRS

View File

@ -7,9 +7,13 @@
# HIPRT_BITCODE, bitcode file with ray-tracing functionality
# HIPRT_FOUND, if SDK found
# If HIPRT_ROOT_DIR was defined in the environment, use it.
if(NOT HIPRT_ROOT_DIR AND NOT $ENV{HIPRT_ROOT_DIR} STREQUAL "")
# If `HIPRT_ROOT_DIR` was defined in the environment, use it.
if(DEFINED HIPRT_ROOT_DIR)
# Pass.
elseif(DEFINED ENV{HIPRT_ROOT_DIR})
set(HIPRT_ROOT_DIR $ENV{HIPRT_ROOT_DIR})
else()
set(HIPRT_ROOT_DIR "")
endif()
set(_hiprt_SEARCH_DIRS

View File

@ -15,9 +15,13 @@
# also defined, but not for general use are
# HARU_LIBRARY, where to find the Haru library.
# If HARU_ROOT_DIR was defined in the environment, use it.
if(NOT HARU_ROOT_DIR AND NOT $ENV{HARU_ROOT_DIR} STREQUAL "")
# If `HARU_ROOT_DIR` was defined in the environment, use it.
if(DEFINED HARU_ROOT_DIR)
# Pass.
elseif(DEFINED ENV{HARU_ROOT_DIR})
set(HARU_ROOT_DIR $ENV{HARU_ROOT_DIR})
else()
set(HARU_ROOT_DIR "")
endif()
set(_haru_SEARCH_DIRS

View File

@ -13,9 +13,13 @@
# also defined, but not for general use are
# ICU_LIBRARY_xxx, where to find the icu libraries.
# If ICU_ROOT_DIR was defined in the environment, use it.
IF(NOT ICU_ROOT_DIR AND NOT $ENV{ICU_ROOT_DIR} STREQUAL "")
# If `ICU_ROOT_DIR` was defined in the environment, use it.
IF(DEFINED ICU_ROOT_DIR)
# Pass.
ELSEIF(DEFINED ENV{ICU_ROOT_DIR})
SET(ICU_ROOT_DIR $ENV{ICU_ROOT_DIR})
ELSE()
SET(ICU_ROOT_DIR "")
ENDIF()
if(Boost_USE_STATIC_LIBS)

View File

@ -15,9 +15,13 @@
# also defined, but not for general use are
# JACK_LIBRARY, where to find the JACK library.
# If JACK_ROOT_DIR was defined in the environment, use it.
IF(NOT JACK_ROOT_DIR AND NOT $ENV{JACK_ROOT_DIR} STREQUAL "")
# If `JACK_ROOT_DIR` was defined in the environment, use it.
IF(DEFINED JACK_ROOT_DIR)
# Pass.
ELSEIF(DEFINED ENV{JACK_ROOT_DIR})
SET(JACK_ROOT_DIR $ENV{JACK_ROOT_DIR})
ELSE()
SET(JACK_ROOT_DIR "")
ENDIF()
SET(_jack_SEARCH_DIRS

View File

@ -15,9 +15,13 @@
# also defined, but not for general use are
# JEMALLOC_LIBRARY, where to find the JeMalloc library.
# If JEMALLOC_ROOT_DIR was defined in the environment, use it.
IF(NOT JEMALLOC_ROOT_DIR AND NOT $ENV{JEMALLOC_ROOT_DIR} STREQUAL "")
# If `JEMALLOC_ROOT_DIR` was defined in the environment, use it.
IF(DEFINED JEMALLOC_ROOT_DIR)
# Pass.
ELSEIF(DEFINED ENV{JEMALLOC_ROOT_DIR})
SET(JEMALLOC_ROOT_DIR $ENV{JEMALLOC_ROOT_DIR})
ELSE()
SET(JEMALLOC_ROOT_DIR "")
ENDIF()
SET(_jemalloc_SEARCH_DIRS

View File

@ -15,9 +15,13 @@
# also defined, but not for general use are
# LZO_LIBRARY, where to find the LZO library.
# If LZO_ROOT_DIR was defined in the environment, use it.
IF(NOT LZO_ROOT_DIR AND NOT $ENV{LZO_ROOT_DIR} STREQUAL "")
# If `LZO_ROOT_DIR` was defined in the environment, use it.
IF(DEFINED LZO_ROOT_DIR)
# Pass.
ELSEIF(DEFINED ENV{LZO_ROOT_DIR})
SET(LZO_ROOT_DIR $ENV{LZO_ROOT_DIR})
ELSE()
SET(LZO_ROOT_DIR "")
ENDIF()
SET(_lzo_SEARCH_DIRS

View File

@ -13,9 +13,13 @@
# MOLTENVK_FOUND, If false, do not try to use MoltenVK.
#
# If MOLTENVK_ROOT_DIR was defined in the environment, use it.
IF(NOT MOLTENVK_ROOT_DIR AND NOT $ENV{MOLTENVK_ROOT_DIR} STREQUAL "")
# If `MOLTENVK_ROOT_DIR` was defined in the environment, use it.
IF(DEFINED MOLTENVK_ROOT_DIR)
# Pass.
ELSEIF(DEFINED ENV{MOLTENVK_ROOT_DIR})
SET(MOLTENVK_ROOT_DIR $ENV{MOLTENVK_ROOT_DIR})
ELSE()
SET(MOLTENVK_ROOT_DIR "")
ENDIF()
SET(_moltenvk_SEARCH_DIRS

View File

@ -11,9 +11,13 @@
# This can also be an environment variable.
# NANOVDB_FOUND, If false, do not try to use NanoVDB.
# If NANOVDB_ROOT_DIR was defined in the environment, use it.
IF(NOT NANOVDB_ROOT_DIR AND NOT $ENV{NANOVDB_ROOT_DIR} STREQUAL "")
# If `NANOVDB_ROOT_DIR` was defined in the environment, use it.
IF(DEFINED NANOVDB_ROOT_DIR)
# Pass.
ELSEIF(DEFINED ENV{NANOVDB_ROOT_DIR})
SET(NANOVDB_ROOT_DIR $ENV{NANOVDB_ROOT_DIR})
ELSE()
SET(NANOVDB_ROOT_DIR "")
ENDIF()
SET(_nanovdb_SEARCH_DIRS

View File

@ -15,9 +15,13 @@
# OSL_LIBRARY_VERSION_MAJOR, OSL_LIBRARY_VERSION_MINOR, the major
# and minor versions of OSL library if found.
# If OSL_ROOT_DIR was defined in the environment, use it.
IF(NOT OSL_ROOT_DIR AND NOT $ENV{OSL_ROOT_DIR} STREQUAL "")
# If `OSL_ROOT_DIR` was defined in the environment, use it.
IF(DEFINED OSL_ROOT_DIR)
# Pass.
ELSEIF(DEFINED ENV{OSL_ROOT_DIR})
SET(OSL_ROOT_DIR $ENV{OSL_ROOT_DIR})
ELSE()
SET(OSL_ROOT_DIR "")
ENDIF()
SET(_osl_FIND_COMPONENTS
@ -100,10 +104,14 @@ IF(OSL_FOUND)
REGEX "^[ \t]*#define[ \t]+OSL_LIBRARY_VERSION_MAJOR[ \t]+[0-9]+.*$")
FILE(STRINGS "${OSL_INCLUDE_DIR}/OSL/oslversion.h" OSL_LIBRARY_VERSION_MINOR
REGEX "^[ \t]*#define[ \t]+OSL_LIBRARY_VERSION_MINOR[ \t]+[0-9]+.*$")
FILE(STRINGS "${OSL_INCLUDE_DIR}/OSL/oslversion.h" OSL_LIBRARY_VERSION_PATCH
REGEX "^[ \t]*#define[ \t]+OSL_LIBRARY_VERSION_PATCH[ \t]+[0-9]+.*$")
STRING(REGEX REPLACE ".*#define[ \t]+OSL_LIBRARY_VERSION_MAJOR[ \t]+([.0-9]+).*"
"\\1" OSL_LIBRARY_VERSION_MAJOR ${OSL_LIBRARY_VERSION_MAJOR})
STRING(REGEX REPLACE ".*#define[ \t]+OSL_LIBRARY_VERSION_MINOR[ \t]+([.0-9]+).*"
"\\1" OSL_LIBRARY_VERSION_MINOR ${OSL_LIBRARY_VERSION_MINOR})
STRING(REGEX REPLACE ".*#define[ \t]+OSL_LIBRARY_VERSION_PATCH[ \t]+([.0-9]+).*"
"\\1" OSL_LIBRARY_VERSION_PATCH ${OSL_LIBRARY_VERSION_PATCH})
ENDIF()
MARK_AS_ADVANCED(

View File

@ -20,9 +20,13 @@
# Where '/opt/opencollada' is the base dir:
# /opt/opencollada/COLLADABaseUtils/include/COLLADABUPlatform.h
# If OPENCOLLADA_ROOT_DIR was defined in the environment, use it.
IF(NOT OPENCOLLADA_ROOT_DIR AND NOT $ENV{OPENCOLLADA_ROOT_DIR} STREQUAL "")
# If `OPENCOLLADA_ROOT_DIR` was defined in the environment, use it.
IF(DEFINED OPENCOLLADA_ROOT_DIR)
# Pass.
ELSEIF(DEFINED ENV{OPENCOLLADA_ROOT_DIR})
SET(OPENCOLLADA_ROOT_DIR $ENV{OPENCOLLADA_ROOT_DIR})
ELSE()
SET(OPENCOLLADA_ROOT_DIR "")
ENDIF()
SET(_opencollada_FIND_INCLUDES

View File

@ -15,9 +15,13 @@
# also defined, but not for general use are
# OPENCOLORIO_LIBRARY, where to find the OpenColorIO library.
# If OPENCOLORIO_ROOT_DIR was defined in the environment, use it.
IF(NOT OPENCOLORIO_ROOT_DIR AND NOT $ENV{OPENCOLORIO_ROOT_DIR} STREQUAL "")
# If `OPENCOLORIO_ROOT_DIR` was defined in the environment, use it.
IF(DEFINED OPENCOLORIO_ROOT_DIR)
# Pass.
ELSEIF(DEFINED ENV{OPENCOLORIO_ROOT_DIR})
SET(OPENCOLORIO_ROOT_DIR $ENV{OPENCOLORIO_ROOT_DIR})
ELSE()
SET(OPENCOLORIO_ROOT_DIR "")
ENDIF()
SET(_opencolorio_FIND_COMPONENTS

View File

@ -22,9 +22,13 @@
# also defined, but not for general use are
# OPENEXR_LIBRARY, where to find the OpenEXR library.
# If OPENEXR_ROOT_DIR was defined in the environment, use it.
IF(NOT OPENEXR_ROOT_DIR AND NOT $ENV{OPENEXR_ROOT_DIR} STREQUAL "")
# If `OPENEXR_ROOT_DIR` was defined in the environment, use it.
IF(DEFINED OPENEXR_ROOT_DIR)
# Pass.
ELSEIF(DEFINED ENV{OPENEXR_ROOT_DIR})
SET(OPENEXR_ROOT_DIR $ENV{OPENEXR_ROOT_DIR})
ELSE()
SET(OPENEXR_ROOT_DIR "")
ENDIF()
# Old versions (before 2.0?) do not have any version string,

View File

@ -15,9 +15,13 @@
# also defined, but not for general use are
# OPENIMAGEDENOISE_LIBRARY, where to find the OpenImageDenoise library.
# If OPENIMAGEDENOISE_ROOT_DIR was defined in the environment, use it.
IF(NOT OPENIMAGEDENOISE_ROOT_DIR AND NOT $ENV{OPENIMAGEDENOISE_ROOT_DIR} STREQUAL "")
# If `OPENIMAGEDENOISE_ROOT_DIR` was defined in the environment, use it.
IF(DEFINED OPENIMAGEDENOISE_ROOT_DIR)
# Pass.
ELSEIF(DEFINED ENV{OPENIMAGEDENOISE_ROOT_DIR})
SET(OPENIMAGEDENOISE_ROOT_DIR $ENV{OPENIMAGEDENOISE_ROOT_DIR})
ELSE()
SET(OPENIMAGEDENOISE_ROOT_DIR "")
ENDIF()
SET(_openimagedenoise_SEARCH_DIRS

View File

@ -17,9 +17,13 @@
# also defined, but not for general use are
# OPENIMAGEIO_LIBRARY, where to find the OpenImageIO library.
# If OPENIMAGEIO_ROOT_DIR was defined in the environment, use it.
IF(NOT OPENIMAGEIO_ROOT_DIR AND NOT $ENV{OPENIMAGEIO_ROOT_DIR} STREQUAL "")
# If `OPENIMAGEIO_ROOT_DIR` was defined in the environment, use it.
IF(DEFINED OPENIMAGEIO_ROOT_DIR)
# Pass.
ELSEIF(DEFINED ENV{OPENIMAGEIO_ROOT_DIR})
SET(OPENIMAGEIO_ROOT_DIR $ENV{OPENIMAGEIO_ROOT_DIR})
ELSE()
SET(OPENIMAGEIO_ROOT_DIR "")
ENDIF()
SET(_openimageio_SEARCH_DIRS

View File

@ -15,9 +15,13 @@
# also defined, but not for general use are
# OPENJPEG_LIBRARY, where to find the OpenJPEG library.
# If OPENJPEG_ROOT_DIR was defined in the environment, use it.
IF(NOT OPENJPEG_ROOT_DIR AND NOT $ENV{OPENJPEG_ROOT_DIR} STREQUAL "")
# If `OPENJPEG_ROOT_DIR` was defined in the environment, use it.
IF(DEFINED OPENJPEG_ROOT_DIR)
# Pass.
ELSEIF(DEFINED ENV{OPENJPEG_ROOT_DIR})
SET(OPENJPEG_ROOT_DIR $ENV{OPENJPEG_ROOT_DIR})