Adding a file/directory to build

Hello, extreme noob question:

I am trying to get my feet wet, in preparation of creating a new modifier in C++. I haven’t been successful in adding some skeleton code that does nothing to the build process.

I’ve added a directory under ~/blender-git/blender/source/blender/io:

~/blender-git/blender/source/blender/io/ds

I added a file that contains an obvious syntax error:

~/blender-git/blender/source/blender/io/ds/test.cpp

I modified ~/blender-git/blender/source/blender/io/CMakeLists.txt file to add that new directory with:

add_subdirectory(ds)

And finally, I made a new CMakeLists.txt file ~/blender-git/blender/source/blender/io/ds/CMakeLists.txt that contains:

set(SRC
test.cpp
)

But when I build, the build succeeds, when (if it were attempting to compile the new ds directory) it should fail.

I also did a “grep -i alembic” on the build output and found that the alembic directory, at the same level as the new ds directory is not getting build, either.

At this point, there is clearly something about how Blender builds that I am not appreciating. Can anyione enlighten me?

Thanks!

After a bit more research, I see that adding a directory for a custom modifier is not the correct approach, and have made some headway with a guide to making modifier that I found. Unfortunately, though, it is from 2019 and things have chaged.

I am currently stuck on how to populate the srna field of the ModifierTypeInfo class. I think I understand that it is autogenerated by makesrna, but I haven’t been able to figure out how to provoke it to do so for my new modifier class, based on an existing class.

Can anyone point me in the right direction?

Thanks!