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

Add compound CMake targets for examples, tools, and apps #2673

Merged
merged 4 commits into from
Dec 5, 2018

Conversation

SergioRAgostinho
Copy link
Member

@SergioRAgostinho SergioRAgostinho commented Dec 1, 2018

With this PR three new compound targets were added to CMake, specifically: examples, tools and apps. The idea was to provide a target so that one could build all examples, tools and apps in a single invocation. So now if you want to build all examples you can simply call:

$ make examples

The same is valid for tools and apps. In case you're using an IDE, you should be able to see the newly added targets alongside other preexisting pcl targets.

Closes #2511

@SunBlack
Copy link
Contributor

SunBlack commented Dec 1, 2018

Maybe add sth. like this for each new target:

set_target_properties(${SUBSYS_NAME} PROPERTIES FOLDER "PCL_Compound_Targets")

@SergioRAgostinho
Copy link
Member Author

SergioRAgostinho commented Dec 1, 2018

👍 Sounds valuable. I'm not exactly using an IDE so it would be nice to get some visual input on how things get organized in the end. Are you using one @SunBlack? If positive, can you post a screenshot on how it looks on your IDE?

I'm have to say I'm not really fond of this particular string PCL_Compound_Targets but I need to have a sense of how things look in the different IDEs before having a good suggestion.

Windows people @UnaNancyOwen @claudiofantacci, can any of you also post a screenshot of how the PCL project structure looks in VS?

Edit: In the meantime I'm installing XCode. A part of me is dying...

@SunBlack
Copy link
Contributor

SunBlack commented Dec 1, 2018

I don't have all dependencies on my home PC, so I can't create a screenshot of your branch. But it looks like this after this.

I don't like PCL_Compound_Targets, too, but I have a better idea now:

foreach(target ${PCL_APPS_ALL_TARGETS})
    set_target_properties(target PROPERTIES FOLDER "Apps")
endforeach()
set_target_properties(${SUBSYS_NAME} PROPERTIES FOLDER "Apps")

Similar for both other groups.

@SergioRAgostinho
Copy link
Member Author

SergioRAgostinho commented Dec 1, 2018

Let me collect all variants here:

  • For the Sublime Text 2 (make) generator - doesn't make use of the folder property
  • For VS, seems like the folder names should be all upper case. target names are upper case. Uncertain what's the convention on folders.
  • XCode - doesn't make use of the folder property

apps/optronic_viewer/CMakeLists.txt Outdated Show resolved Hide resolved
@SunBlack
Copy link
Contributor

SunBlack commented Dec 1, 2018

  • For VS, seems like the folder names should be all upper case.

It doesn't matter. I prefer Examples, Apps and Tools as folder name.

The only thing: Custom targets are written in uppercase in CMake by default (ZERO_CHECK, INSTALL, ALL_BUILD), So I would prefer targets ALL_APPS, ALL_TOOLS and ALL_EXAMPLES (even if make apps looks better than make ALL_APPS), so it is more clear that this is a custom target and no library or executable only target.

@UnaNancyOwen
Copy link
Member

2018-12-02_23h37_54

@SunBlack
Copy link
Contributor

SunBlack commented Dec 3, 2018

Well I didn't knew there is already an option to enable folder: USE_PROJECT_FOLDERS. But it seems there is no folder for e.g. apps.

image

@SergioRAgostinho
Copy link
Member Author

I think I'll open a separate PR to beautify things and restrict this one to just adding the new targets.

@SergioRAgostinho SergioRAgostinho changed the title [WIP] Add compound CMake target for examples, tools, apps. Add compound CMake target for examples, tools, apps. Dec 3, 2018
@SergioRAgostinho
Copy link
Member Author

SergioRAgostinho commented Dec 3, 2018

That was a nasty rebase. :shipit:

Edit: Needs a fix. For another day...

@SergioRAgostinho SergioRAgostinho changed the title Add compound CMake target for examples, tools, apps. [WIP... again] Add compound CMake target for examples, tools, apps. Dec 3, 2018
@SergioRAgostinho SergioRAgostinho changed the title [WIP... again] Add compound CMake target for examples, tools, apps. Add compound CMake target for examples, tools, apps. Dec 4, 2018
@SergioRAgostinho
Copy link
Member Author

Seems to be working again. Good for review.

@taketwo
Copy link
Member

taketwo commented Dec 5, 2018

Thanks! Could you please add a brief summary in the PR description, so that clicking on the changelog item will give necessary information to those who are interested?

@taketwo taketwo merged commit 6a6aacc into PointCloudLibrary:master Dec 5, 2018
@SergioRAgostinho SergioRAgostinho deleted the compound-targets branch December 5, 2018 21:24
@taketwo taketwo changed the title Add compound CMake target for examples, tools, apps. Add compound CMake targets for examples, tools, and apps Jan 14, 2020
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.

Create high level CMake targets for examples, apps and tools
4 participants