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

Fix dependency load order to be able to use CMake targets in ITK #995

Open
Neumann-A opened this issue Jun 5, 2019 · 2 comments

Comments

Projects
None yet
3 participants
@Neumann-A
Copy link

commented Jun 5, 2019

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.

@dzenanz

This comment has been minimized.

Copy link
Member

commented Jun 5, 2019

use proper CMake targets instead of "hacks"

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.

@Neumann-A

This comment has been minimized.

Copy link
Author

commented Jun 5, 2019

Redoing the build system

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:

topological_sort(ITK_MODULES_ENABLED ITK_MODULE_ _DEPENDS)

foreach(itk-module ${ITK_MODULES_ENABLED})
if(NOT ${itk-module}_IS_TEST)
init_module_vars()
endif()
include("${${itk-module}_SOURCE_DIR}/itk-module-init.cmake" OPTIONAL)
add_subdirectory("${${itk-module}_SOURCE_DIR}" "${${itk-module}_BINARY_DIR}")
endforeach()

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 topological_sort seems to be not working correctly.

@thewtex thewtex removed their assignment Jun 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.