Skip to content

Remove global includes and use target include for all "common" modules. #6008

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

Merged
merged 2 commits into from
Apr 22, 2024

Conversation

larshg
Copy link
Contributor

@larshg larshg commented Apr 16, 2024

Surpasses #6006 - sorry @Clemoot - but I thought about writing what you could change additionally, but realized it became a pretty large task.
I have more incoming after this PR.

@@ -29,8 +29,6 @@ set(impl_incs
"include/pcl/${SUBSYS_NAME}/impl/morphology.hpp"
)

include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
Copy link
Member

Choose a reason for hiding this comment

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

This module does not use PCL_ADD_LIBRARY, neither does geometry. Can this line still be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It did work due to the include_directories from within PCL_SUBSYS_DEPEND - I have removed it now and changed to use interface libraries for the header only modules.

Copy link
Contributor Author

@larshg larshg Apr 18, 2024

Choose a reason for hiding this comment

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

I removed the last changes, as it seemlingly only work like this, with the GPU and CUDA submodules. I couldn't "fix" it by adding include_directories in their respective submodules, which was propergated correctly to the other dependencies.
So my reasoning is to keep the include_directories in PCL_SUBSYS_DEPEND, until the latest PR which removes these and fix the remaining issues that aren't present until they are actually removed.
Want me to split the PRs even further or can we merge these 4 step by step?

@larshg larshg force-pushed the updateincludes branch 4 times, most recently from 90e2b20 to abeac82 Compare April 18, 2024 16:02

add_library(${LIB_NAME} INTERFACE)
target_include_directories(${LIB_NAME} INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include")
Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to keep this line or replace it with target_include_directories(${LIB_NAME} INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:${INCLUDE_INSTALL_ROOT}>) (at least temporarily for the next release)? If I understand correctly, removing this line would create the problem for geometry that #6006 tries to fix for kdtree and surface.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could also add the support for interface/header libraries in this PR?
But still keep the include_directories in PCL_SUBSYS_DEPEND.

@larshg larshg requested a review from mvieth April 22, 2024 18:35
@larshg larshg added this to the pcl-1.14.1 milestone Apr 22, 2024
@larshg larshg merged commit fc54abc into PointCloudLibrary:master Apr 22, 2024
13 checks passed
@larshg larshg deleted the updateincludes branch April 29, 2024 09:53
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.

2 participants