Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix dependency load order to be able to use CMake targets in ITK #995
related to behavior in: google/double-conversion#100 (comment)
related to behavior observed in VTK https://gitlab.kitware.com/vtk/vtk/issues/17616
I believe you use a similar module load mechanic like VTK. The reason why you are not simply able to use targets is because the module load order is not correctly setup. Please fix/sort the load order correctly and use proper CMake targets instead of "hacks" to archive library linkage.
ITK's current build system predates CMake targets. Redoing the build system is something we have been wishing for a while, but it is a huge task. ITK's and VTK's build systems are similar. As VTK has more resources, we are essentially waiting for its build system to be updated so we can apply that approach, possibly including some extra lessons learned during VTK's refactoring.
Note: CMake got started as a cross-platform build system for ITK.
you dont need to redo the build system just sort the module list by dependency before performing add_subdirectory(module_dir)
and from the source it should be doing this:
but it somehow seems to be not working correctly. Because if it would work correctly you could simply replace any imported LIBRARIES variable with a target. So