Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize and beautify project generation for IDEs #2691

Merged
merged 2 commits into from
Apr 8, 2019

Conversation

SergioRAgostinho
Copy link
Member

It follows most of the recommendations mentioned in #2673 (comment) , creating a native look and feel for IDE users.

screen shot 2018-12-07 at 01 04 16

Closes #2680 .

Copy link
Member

@taketwo taketwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the idea to make target names consistent with the defaults of the generator, but on the other hand I don't like that the same target is named differently depending on the generator. What about keeping the old names and creating aliases? No strong opinion here, just throwing in an idea.

apps/CMakeLists.txt Outdated Show resolved Hide resolved
@SergioRAgostinho
Copy link
Member Author

What about keeping the old names and creating aliases? No strong opinion here, just throwing in an idea.

The code will look cleaner. Most of these folder are filled with so many targets that having one more makes no difference. The only questionable case is the uninstall target, it will look a little funky.

@taketwo
Copy link
Member

taketwo commented Dec 7, 2018

Hm, true. Well, forget about this idea then.

@taketwo
Copy link
Member

taketwo commented Dec 7, 2018

Looking at the screenshot you've just referenced, I wonder if names like EXAMPLES_BUILD are more consistent. ALL_BUILD builds everything, EXAMPLES_BUILD builds examples.

@SergioRAgostinho
Copy link
Member Author

SergioRAgostinho commented Dec 7, 2018

Looking at the screenshot you've just referenced, I wonder if names like EXAMPLES_BUILD are more consistent. ALL_BUILD builds everything, EXAMPLES_BUILD builds examples.

Valid point. I will adopt it. Summarizing everything

  • Make use of USE_FOLDERS (which exists by defaults) instead of USE_PROJECT_FOLDERS
  • Set USE_FOLDERS to on by default. It only has an effect on IDE generators anyway
  • Get rid of unnecessary USE_PROJECT_FOLDERS checks if possible
  • Rename compound targets to *_BUILD

@taketwo
Copy link
Member

taketwo commented Dec 7, 2018

Sounds good except to the first item.

USE_FOLDERS is not an option or variable, it's a property. As such, it can not be set through command line options and is not exposed in the ccmake interface. If we want to let the user decide whether he wants it or not, we have to create on option. If we do so, I'd propose to call it PCL_USE_FOLDERS. But maybe we don't want to make this configurable at all, don't know why someone would turn it off anyway.

@SergioRAgostinho
Copy link
Member Author

Let's be opinionated and use it by default. There's no disadvantage for adopting it.

cmake/pcl_utils.cmake Outdated Show resolved Hide resolved
@SergioRAgostinho
Copy link
Member Author

SergioRAgostinho commented Feb 23, 2019

I just completed the items from the last review. I need some help from windows users. I need an updated replacement for

https://github.com/PointCloudLibrary/pcl/raw/master/doc/tutorials/content/images/windows/pcl_solution_with_projects_folder.png

No need for the side-by-side image without project folders because it is unconditionally turned on now.

@UnaNancyOwen, @claudiofantacci or @SunBlack whenever one of you guys remembers it, would you mind sending me an updated version?

Edit:
After the review we can decide on the squash strategy.

@SergioRAgostinho SergioRAgostinho added needs: code review Specify why not closed/merged yet and removed needs: more work Specify why not closed/merged yet labels Feb 23, 2019
@claudiofantacci
Copy link
Contributor

I’ll test MSVS on Monday and send you a screen asap 👍🏻

@claudiofantacci
Copy link
Contributor

Ok, here we go!
Here follow 7 pictures of my MSVS 2017 solution view. I enabled all build options resulting in 303 projects.
pcl_1
pcl_2
pcl_3
pcl_4
pcl_5
pcl_6
pcl_7

@SergioRAgostinho
Copy link
Member Author

Thank you.

At first sight I'm confused that there's a target called pcl_apps under Libraries. But I'm not sure I want to address this on the current PR.

set(_ides
"Xcode"
"Visual Studio 14 2015"
"Visual Studio 15 2017"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to have specific versions here? I'd prefer a future-proof check if possible.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. It was a literal copy paste from the supported generators list. I'll change it to "Visual Studio*".

@taketwo
Copy link
Member

taketwo commented Feb 27, 2019

LGTM. Do you plan to add the image(s) from Claudio to the tutorial? (Maybe an edited/shortened version.)

@SergioRAgostinho
Copy link
Member Author

That's the idea. Hopefully some GIMP-fu to add some \vdots here and there.

@SergioRAgostinho SergioRAgostinho added needs: more work Specify why not closed/merged yet and removed needs: code review Specify why not closed/merged yet labels Feb 27, 2019
@SergioRAgostinho
Copy link
Member Author

I just noticed this

pcl/apps/CMakeLists.txt

Lines 215 to 221 in 356ea4f

set(LIB_NAME "pcl_${SUBSYS_NAME}")
PCL_ADD_LIBRARY("${LIB_NAME}" "${SUBSYS_NAME}" ${srcs} ${impl_incs} ${incs})
target_link_libraries("${LIB_NAME}" pcl_common pcl_io pcl_filters pcl_visualization pcl_segmentation pcl_surface pcl_features pcl_sample_consensus pcl_search)
PCL_MAKE_PKGCONFIG("${LIB_NAME}" "${SUBSYS_NAME}" "${SUBSYS_DESC}" "" "" "" "" "")
# Install include files
PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}" ${incs})
PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}/impl" ${impl_incs})

I'm inclined to replace it with regular executable targets. Currently it's compiling source files from apparently two different applications into a PCL Library "target" called pcl_apps. 😕

@taketwo
Copy link
Member

taketwo commented Mar 6, 2019

Disclaimer: this is a speculation.

Maybe the idea is that some of the apps include reusable components that e.g. combine functionality from several modules. Then a user can link with pcl_apps and reuse them.

@SergioRAgostinho
Copy link
Member Author

I'll keep that in mind. If that is indeed the case, I'll create the target without resorting to a PCL_ADD_LIBRARY call. That one should be limited to actual modules.

@SergioRAgostinho
Copy link
Member Author

ide-reduced

The end result.

@SergioRAgostinho
Copy link
Member Author

I'm not going to extend any more functionalities on this PR. In terms of squash strategy I believe the only important is to keep the tools relocation commit separate from the rest. I'm also open to keep the unconditional project folder activation as a separate commit.

@taketwo
Copy link
Member

taketwo commented Apr 7, 2019

I'd be fine with two commits, don't think unconditional project activation needs a separate one.

@SergioRAgostinho SergioRAgostinho removed the needs: more work Specify why not closed/merged yet label Apr 8, 2019
@SergioRAgostinho SergioRAgostinho merged commit b0d4f4a into PointCloudLibrary:master Apr 8, 2019
@claudiofantacci
Copy link
Contributor

Great! 🚀

@taketwo
Copy link
Member

taketwo commented Apr 8, 2019

Thanks!

@SergioRAgostinho SergioRAgostinho deleted the folders branch April 13, 2019 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants