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

Remove global includes and use target include for Apps #6009

Merged
merged 2 commits into from
May 30, 2024

Conversation

larshg
Copy link
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
@mvieth
Copy link
Member

mvieth commented May 17, 2024

Could you rebase this on master, please?

PCL_ADD_EXECUTABLE(pcl_test_search_speed COMPONENT ${SUBSYS_NAME} SOURCES src/test_search.cpp)
target_link_libraries(pcl_test_search_speed pcl_common pcl_io pcl_search pcl_kdtree pcl_visualization)

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
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
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
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
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
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
13 checks passed
@larshg larshg deleted the updateincludesapps branch May 30, 2024 06:11
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.

None yet

2 participants