Generating New Schema Classes Unknown CMake command "pxr_plugin"

Hi everyone,

I’m currently experiencing an error in Generating New Schema Classes and haven’t been able to resolve it. Has anyone encountered a similar issue or knows what might be causing it?

Build the custom schema plugin using CMake: error

CMake Error at CMakeLists.txt:7 (include):
include could not find requested file:
pxrFunctions
CMake Error at CMakeLists.txt:10 (pxr_plugin):

Unknown CMake command “pxr_plugin”.

windows 10
cmake version 3.31.6-msvc6
OpenUSD 26.05
Python 3.10.10

For testing I used usdSchemaExamples from Open Usd

Generating New Schema Classes: Generating New Schema Classes — Universal Scene Description 26.11 documentation

step to reproduce

https://github.com/PixarAnimationStudios/OpenUSD/tree/dev/extras/usd/examples/usdSchemaExamples

copy usdSchemaExamples to a fresh working directory outside the main OpenUSD source repository:


set "USD_INSTALL_ROOT=D:/build/OpenUSD-26.05"

set "PATH=%USD_INSTALL_ROOT%/bin;%USD_INSTALL_ROOT%/lib;%PATH%"
set "PYTHONPATH=%USD_INSTALL_ROOT%/lib/python;%PYTHONPATH%"


cd /D D:\usd_builds\usd_my_schema

usdGenSchema schema.usda


# update CMakeLists.txt in my schema project directory

cmake_minimum_required(VERSION 3.14)
project(usdSchemaExamples)

find_package(pxr REQUIRED HINTS $ENV{USD_INSTALL_ROOT})

# Include USD CMake macro helpers
include(pxrFunctions)

# Build the plugin library
pxr_plugin(usdSchemaExamples
	LIBRARIES
		tf
		vt
		usd
		usdGeom
	PUBLIC_HEADERS
		api.h
		tokens.h
		simple.h
	CPPFILES
		tokens.cpp
		simple.cpp
		wrapTokens.cpp
		wrapSimple.cpp
	RESOURCE_FILES
		plugInfo.json
		generatedSchema.usda
)

# I did not change plugInfo.json file

plugInfo.json
# Portions of this file auto-generated by usdGenSchema.
# Edits will survive regeneration except for comments and
# changes to types with autoGenerated=true.
{
	"Plugins": [
		{
			"Info": {
				"Types": {
					"UsdSchemaExamplesComplex": {
						"alias": {
							"UsdSchemaBase": "ComplexPrim"
						}, 
						"autoGenerated": true, 
						"bases": [
							"UsdSchemaExamplesSimple"
						], 
						"schemaIdentifier": "ComplexPrim", 
						"schemaKind": "concreteTyped"
					}, 
					"UsdSchemaExamplesParamsAPI": {
						"alias": {
							"UsdSchemaBase": "ParamsAPI"
						}, 
						"autoGenerated": true, 
						"bases": [
							"UsdAPISchemaBase"
						], 
						"schemaIdentifier": "ParamsAPI", 
						"schemaKind": "singleApplyAPI"
					}, 
					"UsdSchemaExamplesSimple": {
						"alias": {
							"UsdSchemaBase": "SimplePrim"
						}, 
						"autoGenerated": true, 
						"bases": [
							"UsdTyped"
						], 
						"schemaIdentifier": "SimplePrim", 
						"schemaKind": "abstractTyped"
					}
				}
			}, 
			"LibraryPath": "@PLUG_INFO_LIBRARY_PATH@", 
			"Name": "usdSchemaExamples", 
			"ResourcePath": "@PLUG_INFO_RESOURCE_PATH@", 
			"Root": "@PLUG_INFO_ROOT@", 
			"Type": "library"
		}
	]
}

mkdir build
cd build

call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" amd64

cmake .. -DCMAKE_INSTALL_PREFIX=~/usd_my_schema/install


-- Found Python3: optimized;C:\Program Files\Python310\libs\python310.lib;debug;C:/Program Files/Python310/libs/python310_d.lib (found suitable exact version "3.10.10") found components: Development Development.Module Development.Embed

CMake Error at CMakeLists.txt:7 (include):
    include could not find requested file:
        pxrFunctions

CMake Error at CMakeLists.txt:10 (pxr_plugin):
Unknown CMake command "pxr_plugin".
-- Configuring incomplete, errors occurred!

Any help or suggestions would be greatly appreciated.

Thank you!

Subin

Hi @Subin , this sounds like a build configuration issue, so I’m moving your post into the “Build and Deployment” Category - hopefully someone there has an idea what may be going on.