File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -116,10 +116,16 @@ function(generate_type_stubs MODULE_NAME DEPENDS_TARGET MLIR_DEPENDS_TARGET OUTP
116116 ""
117117 "OUTPUTS"
118118 ${ARGN} )
119+ # for people doing find_package(nanobind)
119120 if (EXISTS ${nanobind_DIR} /../src/stubgen.py)
120121 set (NB_STUBGEN "${nanobind_DIR} /../src/stubgen.py" )
121122 elseif (EXISTS ${nanobind_DIR} /../stubgen.py)
122123 set (NB_STUBGEN "${nanobind_DIR} /../stubgen.py" )
124+ # for people using FetchContent_Declare and FetchContent_MakeAvailable
125+ elseif (EXISTS ${nanobind_SOURCE_DIR} /src/stubgen.py)
126+ set (NB_STUBGEN "${nanobind_SOURCE_DIR} /src/stubgen.py" )
127+ elseif (EXISTS ${nanobind_SOURCE_DIR} /stubgen.py)
128+ set (NB_STUBGEN "${nanobind_SOURCE_DIR} /stubgen.py" )
123129 else ()
124130 message (FATAL_ERROR "generate_type_stubs(): could not locate 'stubgen.py'!" )
125131 endif ()
You can’t perform that action at this time.
0 commit comments