Page MenuHome

[msvc] Use source folder structure for project file.
ClosedPublic

Authored by Ray Molenkamp (LazyDodo) on Sep 5 2017, 6:06 PM.

Details

Summary

When doing a release build, the visual studio solution will currently have 151 sub projects, all listed in a giant list, finding what you are looking for is getting kinda annoying.
this patch will enable the generation of subfolders, so the project structure in the solution explorer will follow the directory structure on disk .

Turning this:Into this:

There's a couple of problems though, cycles does not use blender_add_lib nor is there a macro's file I can hook into. So they all end up in the root folder.

There's a couple of places we can fix this

  1. just hardcode solution folder in each of cycles libs cmakelists.txt
  1. add a cycles_add_library macro and duplicate the code from macros.cmake there. Cycles standalone will not have the USE_FOLDERS global set, so nothing will change there.
  1. Just leave the cycles projects in root.

any opinions here?

Diff Detail

Repository
rB Blender

Event Timeline

Adding a cycles_add_lib seems like the best solution to me, ideally just calling blender_add_lib in case we're building from inside Blender? Not sure if there is some reason that wouldn't work.

CMakeLists.txt
544

I would not even have this as an option that you can disable, but up to you.

Campbell Barton (campbellbarton) added inline comments.
CMakeLists.txt
544

+1 - if people want this back an option can be added.

Update against latest master.

Cycles issues still have to be resolved.

sorted out the cycles libraries.

it would be nice to get the actual .osl files into cycles_osl_shaders but that's outside of the scope of this diff so i'll address that separately

build_files/cmake/macros.cmake
250

We don't bother with duplication w/ endif anymore.

remove duplication w/ endif

Ray Molenkamp (LazyDodo) marked an inline comment as done.Feb 1 2018, 11:11 PM

Actually doesn't look like including the osl files is too much of a stretch.

forgot to add cycles_kernel_cuda

Sergey Sharybin (sergey) added inline comments.
intern/cycles/cmake/macros.cmake
1 ↗(On Diff #9922)

Think this should be a function instead, so we don't pollute namespace with temp variables.

3 ↗(On Diff #9922)

Don't use camel case for variables.

macro->function.
removed camel-case.

Ray Molenkamp (LazyDodo) marked 2 inline comments as done.Feb 2 2018, 3:05 PM

After experiencing a little work in the blender code with this patch, I would not like to return to the previous scheme. Really very useful!

CMakeLists.txt
549

Except for reasons of maintenance and organization. I don't see why anyone would want this as an option.
+1 if devs want to prevent the list of advanced options from being too long.

intern/cycles/cmake/macros.cmake
1 ↗(On Diff #9924)

I don't know what convention is used in cmake, but I find it a bit strange a file called macros.cmake to have a function instead of macro.
But it seems the same happens elsewhere in blender, so it's not important.

This revision is now accepted and ready to land.Feb 3 2018, 6:28 PM

Thanks for committing the patch. This was the only issue that I had that avoiding to move my developer environment from QTCreator + MSVC compiler to MS Visual.
+1