Skip to content

Remove global includes and use target include for Apps#6009

Merged
larshg merged 2 commits intoPointCloudLibrary:masterfrom
larshg:updateincludesapps
May 30, 2024
Merged

Remove global includes and use target include for Apps#6009
larshg merged 2 commits intoPointCloudLibrary:masterfrom
larshg:updateincludesapps

Conversation

@larshg
Copy link
Copy Markdown
Contributor

@larshg larshg commented Apr 16, 2024

follows after #6008

@larshg larshg changed the title Updateincludesapps URemove global includes and use target include for Apps Apr 16, 2024
@larshg larshg changed the title URemove global includes and use target include for Apps Remove global includes and use target include for Apps Apr 16, 2024
@larshg larshg force-pushed the updateincludesapps branch from 784a150 to 56499d3 Compare April 17, 2024 05:48
@mvieth
Copy link
Copy Markdown
Member

mvieth commented May 17, 2024

Could you rebase this on master, please?

@larshg larshg force-pushed the updateincludesapps branch from 56499d3 to 7d8a618 Compare May 21, 2024 15:48
@larshg larshg requested a review from mvieth May 22, 2024 08:29
Comment thread apps/CMakeLists.txt Outdated

PCL_ADD_EXECUTABLE(pcl_nn_classification_example COMPONENT ${SUBSYS_NAME} SOURCES src/nn_classification_example.cpp)
target_link_libraries(pcl_nn_classification_example pcl_common pcl_io pcl_features pcl_kdtree)
target_link_libraries(pcl_nn_classification_example pcl_apps pcl_common pcl_io pcl_features pcl_kdtree)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't understand why this has to link to pcl_apps when it didn't have to before? (same for some more executables below)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because it includes pcl/apps/vfh_nn_classifier.h - which resides in apps "library".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Line 21 the old include_directories made this available to all the executables afterwards.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

But vfh_nn_classifier.h seems to be a standalone header with every function fully defined, so no corresponding cpp file that would make linking to pcl_apps necessary. Wouldn't it be better to add target_include_directories(pcl_nn_classification_example ...) instead of unnecessarily adding pcl_apps as a dependency?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that should do it aswell of course. I'll change asap.

@larshg larshg merged commit fb100d9 into PointCloudLibrary:master May 30, 2024
@larshg larshg deleted the updateincludesapps branch May 30, 2024 06:11
@mvieth mvieth added the changelog: enhancement Meta-information for changelog generation label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: enhancement Meta-information for changelog generation module: cmake

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants