sastel commented on issue #12362:
URL: https://github.com/apache/nuttx/issues/12362#issuecomment-2135118932

   > How do you go about installing other Conan packages ? From what I can see 
you are building nuttx using Conan but what if your application needs other 
Conan packages like eigen which requires the nuttx toolchain otherwise your 
final nuttx application that requires nuttx and eigen won't really work. How do 
you inject the nuttx toolchain in the Conan profile on the fly?
   
   I tried including Eigen 3.4.0 from conancenter just now, and the answer is 
that you specify Eigen in the requires section of the recipe that needs it, and 
ensure that your host profile mentions nuttxpkg as a tool_require. The host 
profile gets applied to all of the dependencies including Eigen. Because of the 
following snippet in the nuttxpkg recipe, the toolchain.cmake file gets applied 
to any project that uses nuttxpkg as a tool require.
   
   ```python
       def package_info(self):
           # Later packages get access to the NuttX export not by 
find_package() in CMake,
           # but through the conan_toolchain.cmake file which includes the 
toolchain.cmake
           # from NuttX. This means that all builds which mark this package as a
           # tool_requires will include the NuttX headers and link against the 
NuttX libs.
           toolchain = os.path.join(self.package_folder, 
"nuttx-export-12.5.0/scripts/toolchain.cmake")
           self.conf_info.append("tools.cmake.cmaketoolchain:user_toolchain", 
toolchain)
   ```
   
   I didn't have to modify the Eigen package at all, and it is including the 
POSIX headers from nuttxpkg. See this graph from the `conan graph info` 
command. (Note that the dependency tree isn't quite complete, because nuttxpkg 
should be showing a dependency on my xpack compiler package, but isn't yet 
because I didn't form the xpack package correctly).
   
   
![image](https://github.com/apache/nuttx/assets/33885247/2b070be0-c0d0-461a-988d-e37136835e9f)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to