ENH: Support install-tree use of RTK when built externally - #967
Conversation
SimonRit
left a comment
There was a problem hiding this comment.
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.
|
I don't know why it worked on my side, I maybe not tested it on a fresh environment, but you are right. |
- 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.
After some tests, it seems possible to install standalone modules, so I removed the error message.
Close #957