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 have the following tool packages my-toolchain and some binary utilities tool-1, tool-2. Then I have a library my-lib that needs the toolchain in otder to build. my-lib is also containging some cmake files that is using these tools.
my-lib is having something similar to the following snippet in the package_info:
defpackage_info(self):
# ...# extra cmake modules to be included when using find_packagebuild_modules= [
os.path.join(self._cmake_install_base_path, "tool-1.cmake"),
os.path.join(self._cmake_install_base_path, "tool-2.cmake"),
os.path.join(self._cmake_install_base_path, "tool-3.cmake"),
]
self.cpp_info.set_property("cmake_build_modules", build_modules)
My issue is that is that these tools are not really required to build my-library but are more for who is linking agains the library. Ideally the client code should just do something like:
# the following line makes the tools visible in the PATH and pulls the tool-*.cmake files
find_package(my-library::my-library CONFIG REQUIRED)
I don't know how to achieve this with CMake. What I was trying is to expose from my-lib the tool requirements, which is not a good practice, but I don't know how to do this better.
As a workaround I put some error message in the cmake files that are added by my-lib to include the proper tool_requires and added this tool_requires in the profile. But I don't like this approach because the my-lib and the tool require connection is hidden and it's hard to make more explicit.
As alternative I could put self.tool_require("tool-1/version", visible=True) but this was not recomended. What are other options to accomplish this?
The text was updated successfully, but these errors were encountered:
What is your question?
I have the following tool packages
my-toolchain
and some binary utilitiestool-1
,tool-2
. Then I have a librarymy-lib
that needs the toolchain in otder to build.my-lib
is also containging some cmake files that is using these tools.my-lib
is having something similar to the following snippet in thepackage_info
:My issue is that is that these tools are not really required to build
my-library
but are more for who is linking agains the library. Ideally the client code should just do something like:And in the CMakeFiles:
I don't know how to achieve this with CMake. What I was trying is to expose from
my-lib
the tool requirements, which is not a good practice, but I don't know how to do this better.As a workaround I put some error message in the cmake files that are added by
my-lib
to include the proper tool_requires and added this tool_requires in the profile. But I don't like this approach because themy-lib
and the tool require connection is hidden and it's hard to make more explicit.As alternative I could put
self.tool_require("tool-1/version", visible=True)
but this was not recomended. What are other options to accomplish this?The text was updated successfully, but these errors were encountered: