-
Notifications
You must be signed in to change notification settings - Fork 61
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
Combining dcmqi with Conan ITK and DCMTK packages #429
Comments
@jcfr any chance you can comment on this? |
@akalali the purpose of this file appears to be documented here: https://github.com/InsightSoftwareConsortium/ITK/blob/master/CMake/UseITK.cmake#L13-L16 |
I'm wondering if there is another scenario where the source-directory and the |
@akalali I am afraid I do not know enough about cmake to answer your question, but I imagine in that scenario you mentioned, the steps performed in |
re: useITK In the context of ITK, the file To ensure, it is available in the ITK install tree (or SDK generated from it), there is also a corresponding install rule: Looking at conan index, ITK version 5.1.0 is downloaded: As a next step, I suggest to look how the conan package is created. |
Yes, and when I build ITK "the classic CMake" way, the
This is interesting: I created my own ITK 4.13.3 Conan recipe for another project (see here) and when I create the package from this recipe, I get the following directory structure:
Inside the lib-directory there is another directory structure
Here, the
but the lib-directory does neither contain a
I will try to build dmqi with my own ITK 4.13.3 Conan recipe and see if the |
So what I did was the following:
The result is a
Inside the
So basically I'm not able to automatically point my dcmqi-project to the correct ITK-build directory or to use the correct There is an option to use different CMake generators (e.g. cmake, cmake_find_package, cmake_find_package_multi) which leads to different Conan-configuration output files. I will investigate on that and see if I can get the project working. At least it is clear now that I might not be pointing to the right ITK-directory and thus the required ITK-files are not found. |
Wrong button clicked :D So while there is a problem with the ITK 5.1.0 Conan recipe from conan-center, the general problem of not considering the correct ITK-files still exists. |
If I understand correctly, you do have the Do you have the Does it point to the right location of the If the answer to both questions above is yes, perhaps you have multiple installations of ITK on your system, and a different one is being used? |
Ok, so to understand this maybe the principles of Conan need to be know: However, it points to the Conan-built ITK inside my So now there are two options, to make things work without the need to patch dcmqi (and I'm pretty sure that the idea of Conan is to integrate easily into existing CMake-projects):
I think a straight forward solution is 1. I already asked here what the recommended way of doing is. I would basically just say: "I don't need a new So basically - if you think that |
dcmqi CMakeLists.txt file was cross-checked by @jcfr from Kitware, who is one of the top experts in CMake on this planet (from what I know, anyway!). Based on that, I am pretty sure that it is the recommended way of including ITK. But if you want to confirm that, I suggest you ask on the ITK forum. |
To move forward, I suggest to address this. Thanks again for your help and patience 🙏 |
Hi again, so it seems as
is actually not an option. The conan-center documentation states that the config-files should not be packaged (see here). Now we are back at
I addressed this issue and a PR will cover this. The idea is to remove the config-files, as required by the documentation, but leave the I tried the recipe and now the error is gone.
I'm still investigating and maybe one needs to understand the Conan internals but maybe you have an idea why the config-mode does not correctly include the required header files. |
The difference in
Using Conan-generated
|
Ok, so I found out that everything is included and linked by using the variables However, these variables are not defined inside the Conan-generated Phew.. the only thing that is unclear is the
|
Thanks for the update. Great progress.
For simple project, this approach may work ... but for more complex project. This means that packages would have to be updated to work with conan. This could be done by maintaining a set of patches hard-coding values where needed.
This is set to the list of targets available in the current build of DCMTK. See https://github.com/DCMTK/dcmtk/blob/1d98cfd0fe0748a065b9b91bf957862868c63fd7/CMake/DCMTKConfig.cmake.in#L14 A conan specific patches could probably be applied to hardcode the list
There are around 90 tests total (see here) ... it looks like not all prerequisites are available. |
I'm currently in the process of migrating our code base using Conan for third-party dependency management.
As a test project I use the already existing Conan packages of ITK and DCMTK: I download them from ConanCenter using some Conan-calls inside my CMakeLists.txt and use them to point
ITK_DIR
andDCMTK_DIR
when building dcmqi with CMake's ExternalProject.However, I'm struggling with different things so I opened an issue here. One main point is that the
UseITK.cmake
-file is not found / used by the Conan ITK package so dcmqi fails here. I wonder what the use of this file is and why it is necessary.I would love to bring dcmqi to Conan, but in order to create a Conan recipe file for dcmqi I need to understand the process how dcmqi is built and for that I'm going one step back and try to built dcmqi as an external project, while using Conan packages for its dependencies.
The text was updated successfully, but these errors were encountered: