Conversation
facebook@a6e835d added `find_dependency(Xxhash REQUIRED)`. It uses our `build/fbcode_builder/CMake/FindXxhash.cmake` but our `FindXxhash.cmake` isn't installed. So `find_dependency(Xxhash REQUIRED)` is failed when `xxHash/xxHashConfig.cmake` isn't installed by xxHash. For example, xxHash package in CentOS 9 stream doesn't install `xxHash/xxHashConfig.cmake`. See also: facebookincubator/velox#13153 We can fix this by install our `FindXxhash.cmake` and use it in `FBThriftConfig.cmake`.
| DESTINATION ${CMAKE_INSTALL_DIR} | ||
| ) | ||
| # This is used in FBThriftConfig.cmake. | ||
| install( |
There was a problem hiding this comment.
@kou will this work outside of fbcode_builder?
There was a problem hiding this comment.
Yes. Because https://github.com/facebook/fbthrift/blob/main/build/fbcode_builder/CMake/FindXxhash.cmake uses only built-in CMake features.
There was a problem hiding this comment.
But the path hardcodes fb specific infra path ../build/fbcode_builder?
There was a problem hiding this comment.
You refer ../build/fbcode_builder in https://github.com/facebook/fbthrift/pull/651/files#diff-72e4eecafeb87f57668ee019db6f11aa91d85647850c63e4bfb4d0ae2c38341eR43 , right?
We can use ../build/fbcode_builder in install(FILES) here because it's a static path that is only used in this project. It doesn't depend on installed system and projects that use this such as Velox. Because users including Velox use only DESTINATION path (${CMAKE_INSTALL_DIR}) via find_package(FBThrift).
a6e835d added
find_dependency(Xxhash REQUIRED). It uses ourbuild/fbcode_builder/CMake/FindXxhash.cmakebut ourFindXxhash.cmakeisn't installed. Sofind_dependency(Xxhash REQUIRED)is failed whenxxHash/xxHashConfig.cmakeisn't installed by xxHash.For example, xxHash package in CentOS 9 stream doesn't install
xxHash/xxHashConfig.cmake.See also: facebookincubator/velox#13153
We can fix this by install our
FindXxhash.cmakeand use it inFBThriftConfig.cmake.