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

restrict includes for CMake #1518

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

KrisThielemans
Copy link
Collaborator

We had some remaining "global" include_directories. Using target_include_directories means it's more specific, and we don't need to explicitly export them anymore, and neither do they need to be added to the global include path in STIRConfig.cmake.

Similarly, the following line is not needed

include(${ITK_USE_FILE})

This PR reduces possible conflicts when importing STIR.

We had some remaining "global" include_directories. Using
target_include_directories means it's more specific, and we don't need
to explicitly export them anymore.

This reduces possible conflicts when importing STIR.
It turns out that we don't need `include(${ITK_USE_FILE})` in
STIRConfig.cmake. This therefore avoids adding the ITK include directory
to the global include path.

Effectively fixes UCL#432 as when building STIR, we don't mind (currently
anyway).
@KrisThielemans KrisThielemans force-pushed the CMake_restrict_includes branch from 42743e6 to 18d4b4e Compare October 1, 2024 17:19
@KrisThielemans
Copy link
Collaborator Author

KrisThielemans commented Nov 14, 2024

  2%] Building CXX object src/buildblock/CMakeFiles/buildblock.dir/ProjData.cxx.o
In file included from /home/runner/work/STIR/STIR/src/include/stir/ProjDataGEHDF5.h:29,
                 from /home/runner/work/STIR/STIR/src/buildblock/ProjData.cxx:45:
/home/runner/work/STIR/STIR/src/include/stir/IO/GEHDF5Wrapper.h:31:10: fatal error: H5Cpp.h: No such file or directory
   31 | #include "H5Cpp.h"

So, we currently need HDF5 as a dependency of buildblock as well.

@KrisThielemans
Copy link
Collaborator Author

In file included from /home/runner/work/STIR/STIR/src/recon_buildblock/recon_buildblock_registries.cxx:69:
In file included from /home/runner/work/STIR/STIR/src/include/stir/recon_buildblock/BinNormalisationFromGEHDF5.h:[34](https://github.com/UCL/STIR/actions/runs/13130646087/job/36634923721?pr=1518#step:11:35):
/home/runner/work/STIR/STIR/src/include/stir/IO/GEHDF5Wrapper.h:31:10: fatal error: 'H5Cpp.h' file not found
   31 | #include "H5Cpp.h"

@KrisThielemans KrisThielemans force-pushed the CMake_restrict_includes branch from 46a8d27 to 2872adb Compare February 4, 2025 09:13
@KrisThielemans KrisThielemans force-pushed the CMake_restrict_includes branch from 2872adb to ab3aa1c Compare February 4, 2025 14:13
As we currently do not depend on IO due to circular dependencies,
we need to add it explicitly.
@KrisThielemans KrisThielemans force-pushed the CMake_restrict_includes branch from ab3aa1c to e88bbf5 Compare February 4, 2025 14:37
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.

1 participant