Mlir-hlo repo cmake setup for dependent projects

This is a question related to projects that would like to depend on mlir-hlo and set it up as a submodule (while using a cmake setup).

As far as I could tell, mlir-hlo doesn’t include something equivalent to that would allow a user project to find it and see all its targets. As a result, one approach would be to set it up with proper target_link options to point to the submodule’s build dir. This creates issues with transitive dependencies and rebuilding after updates. I haven’t tried the approaches of cmake external projects ExternalProject — CMake 3.23.1 Documentation or simply an add_subdirectory.

Is there a recommended setup for projects that would like to depend on mlir-hlo via a submodule? Would a contribution of Config.cmake be acceptable in the repo or does one already exist somewhere? Thanks!

I don’t know about the solution here, but we’d take a patch :slight_smile:

Here it is:

I can raise a PR on the official tensorflow repo.