Skip to content

ENH: Support install-tree use of RTK when built externally - #967

Open
axel-grc wants to merge 1 commit into
RTKConsortium:mainfrom
axel-grc:Install
Open

ENH: Support install-tree use of RTK when built externally#967
axel-grc wants to merge 1 commit into
RTKConsortium:mainfrom
axel-grc:Install

Conversation

@axel-grc

Copy link
Copy Markdown
Collaborator

After some tests, it seems possible to install standalone modules, so I removed the error message.

Close #957

@SimonRit SimonRit added this to the RTK 3.0 milestone Jul 16, 2026
@SimonRit
SimonRit self-requested a review July 16, 2026 08:55

@SimonRit SimonRit left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That doesn't work for me. If I compile and install ITK without RTK, then compile and install RTK, both with the same CMAKE_INSTALL_PREFIX, then try to compile the FirstReconstruction example againt this install directory, I get:

  Target "FirstReconstruction" links to:

    ITK::RTKModule

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.



CMake Error at CMakeLists.txt:34 (target_link_libraries):
  Target "FirstCudaReconstruction" links to:

    ITK::RTKModule

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

On Ubuntu with ITK main and CMake 3.29. Don't you have the same issue? This is precisely what motivated this check. BTW, I had to implement some fixes for lpsolve with other configurations, see #976.

@axel-grc axel-grc changed the title ENH: Remove installation check for ITK source directory in CMakeLists… ENH: Support install-tree use of RTK when built externally Jul 29, 2026
@axel-grc

Copy link
Copy Markdown
Collaborator Author

I don't know why it worked on my side, I maybe not tested it on a fresh environment, but you are right.
but now it should work.
The install(EXPORT ...) in ITKModuleExternal.cmake doesn't generate install code for externally-built modules. The fix adds an explicit install(EXPORT ...) to Modules/Targets/

- Remove the install-time FATAL_ERROR that prevented installing RTK
  when built outside the ITK source tree.
- Add install(EXPORT ...) to Modules/Targets/ so that the targets
  file is available for find_package(ITK COMPONENTS RTK).
- Remove outdated doc line claiming installation is unsupported.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix installation of wrapping when compilation is done separately from ITK

2 participants