-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[dcmtk] How to use CONAN_LIBS to link libraries #5638
Comments
Hi, @akalali . The generators provided by Conan use a template that is common for all the references, so it is expected that custom variables are not available when using Conan, and they are when using the modules provided by the library itself. Conan implemented a feature called You can have a look at OpenSSL recipe, it is adding an extra I encourage you to create a PR contributing to DCMTK with these extra variables that are expected by consumers. |
Hi @jgsogo and thank you for you reply. I tried to test this with DCMTK and it gives me a I'm not sure if this is what I need: I somehow need to transfer the two mentioned variables from my initial post to the |
Those Yours would look like something like this: my_cmake_build_module = """\
set(DCMTK_LIBRARIES ...)
set(DCMTK_INCLUDE_DIRS ...)
"""
def package(self):
# Copy your file inside the package
...
def package_info(self):
self.cpp_info.build_modules['cmake'] = ['relative/path/to/your/file/inside/the/package', ]
self.cpp_info.build_modules['cmake_find_package'] = ['relative/path/to/your/file/inside/the/package', ]
self.cpp_info.build_modules['cmake_find_package_multi'] = ['relative/path/to/your/file/inside/the/package', ] With this scaffolding, you should be able to modify the DCMTK recipe, now when you run Now the problem is to assign the proper values to |
@akalali Those variables are defined in |
I have several ExternalProjects that I would like to use with the cci DCMTK recipe.
E.g. CTK requires
DCMTK_LIBRARIES
andDCMTK_INCLUDE_DIRS
to be set and they are defined inside theDCMTKConfig.cmake
-file of the classical built DCMTK, e.g.or
So using the classic CMake build approach for DCMTK and using
find_package
to find DCMTK provides these variables.However, with the DCMTK Conan recipe these variables are not defined inside the
DCMTKConfig.cmake
-file.Generating the
conanbuildinfo.cmake
-,DCMTKConfig.cmake
- andDCMTKTargets.cmake
-files (and some more) by using the conan cmake wrapper gives me some variables that I can use for my ExternalProjects, e.g.inside
conanbuildinfo.cmake
or
But I can not use the
CONAN_LIBS_DCMTK
forDCMTK_LIBRARIES
, I get the following error:Line 'DCMTK_LIBRARIES:=' does not match regex. Ignoring
when doinginside my custom
CTK.cmake
-file.I wonder how to replicate the original behavior and how to correctly use the DCMTK Conan recipe for other third parties. I also did not succeed using the DCMTK (or cci ITK packag) for DCMQI, see here or here.
There still seem to be a general misunderstanding on my side on how to replace a transitive dependency of an ExternalProject with a Conan package, ignoring the external project's way to find the required dependency and set the paths. So what can I do if a third party (e.g. CTK or DCMQI) require specific variables to be set (which is done in the original project) but the variables are not defined by Conan?
The text was updated successfully, but these errors were encountered: