You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed the link in one of the FAQs in the wiki does not work. I was hoping to use xreg as a dependency for other code, was having some issues, and thought that whatever may have been linked here in the past could have been helpful. I've replicated the portion on the wiki below:
How do I incorporate this library into my software?
The xReg library is most easily incorporated using standard CMake practices, such as add_subdirectory() and find_package(). See this page for more details.
I will briefly ask your opinion on what I am trying to do and see if you have a quick suggestion:
I have been using / expanding on some of Cong's 2d/3d CM registration work. I would prefer not to continue using an 'unofficial fork' of xreg as has been done to this point, but rather build xreg and then use it as a dependency for any custom code development. This development doesn't lend itself to living within xreg (e.g. specific applications for our robot and ROS wrappers for triggering image registration, etc.).
At the moment, the plan is as follows:
Build xreg e.g. at ~/xreg/ and then have a separate package e.g. at ~/cm_robot_regi/ that would find and use xreg as a dependency.
An excerpt from the CMakeLists for cm_robot_regi might be something like (where test.cpp has some xreg includes):
project(cm_robot_regi)
cmake_minimum_required(VERSION 3.13.0 FATAL_ERROR)
set (CMAKE_CXX_STANDARD "17" CACHE STRING "C++ Standard (needs at least 17)")
find_package(xreg REQUIRED HINTS ~/xreg/build)
add_executable(TEST_EXE test.cpp)
target_link_libraries(TEST_EXE xreg::xreg)
This doesn't work as I've written it, at the moment it seems like I may need to add additional find_package() for e.g. VTK, ITK, etc. (I get cmake errors expecting links to e.g. VTK::XYZ whenever I do the target_link_libraries()). I'm pursuing this avenue, but I feel I might be missing the big picture here.
I'm interested in your thoughts: 1) does this approach make sense? and 2) do you have a better suggested method for doing it if so?
Thanks!
The text was updated successfully, but these errors were encountered:
Thanks a lot for your comment, it's nice to hear from you.
I'm sorry that I have not written the wiki page yet for this question, but maybe by working on this we can have a good example to use.
I think your approach makes sense. You can see on this repository that I have a collection of other applications that link to a version of xreg that is built separate. In that CMakeLists.txt, the find_packages for ITK and VTK are done AFTER the find_package for xreg.
I would try the following (at least to get started):
Perform builds of dependencies (ITK/VTK/etc.) (see the example scripts for examples of how to do this) and install them in a local directory (I recommend trying static libraries).
Build xreg as a static library, do not install it,
For the new software, use CMAKE_PREFIX_PATH either as an environment variable or CMake variable to point to your dependencies and xreg build. This will avoid incompatible system versions being given preference.
If any of the libraries show up as not found during CMake manually set them (when using static libraries, specifying their build directories typically works well)
Hopefully, you do not have linker errors now.
I can see this having problems if your other software has the same dependencies, but conflicting versions. Is that the case here?
Hi Rob, hope you are well.
I noticed the link in one of the FAQs in the wiki does not work. I was hoping to use
xreg
as a dependency for other code, was having some issues, and thought that whatever may have been linked here in the past could have been helpful. I've replicated the portion on the wiki below:I will briefly ask your opinion on what I am trying to do and see if you have a quick suggestion:
I have been using / expanding on some of Cong's 2d/3d CM registration work. I would prefer not to continue using an 'unofficial fork' of xreg as has been done to this point, but rather build xreg and then use it as a dependency for any custom code development. This development doesn't lend itself to living within xreg (e.g. specific applications for our robot and ROS wrappers for triggering image registration, etc.).
At the moment, the plan is as follows:
Build xreg e.g. at
~/xreg/
and then have a separate package e.g. at~/cm_robot_regi/
that would find and use xreg as a dependency.An excerpt from the CMakeLists for
cm_robot_regi
might be something like (where test.cpp has some xreg includes):This doesn't work as I've written it, at the moment it seems like I may need to add additional
find_package()
for e.g. VTK, ITK, etc. (I get cmake errors expecting links to e.g. VTK::XYZ whenever I do thetarget_link_libraries()
). I'm pursuing this avenue, but I feel I might be missing the big picture here.I'm interested in your thoughts: 1) does this approach make sense? and 2) do you have a better suggested method for doing it if so?
Thanks!
The text was updated successfully, but these errors were encountered: