Skip to content

CMakeLists.txt FetchContent compatibility#167

Open
afrind wants to merge 2 commits intofacebookincubator:mainfrom
afrind:export-D93366451
Open

CMakeLists.txt FetchContent compatibility#167
afrind wants to merge 2 commits intofacebookincubator:mainfrom
afrind:export-D93366451

Conversation

@afrind
Copy link
Contributor

@afrind afrind commented Feb 15, 2026

Summary:
When fizz is consumed via FetchContent, CMAKE_SOURCE_DIR points to the top-level project rather than fizz itself, and folly is built in-tree rather than installed. This diff makes three fixes:

  1. Set fizz_SOURCE_DIR as a cache variable so downstream FetchContent consumers can skip find_package(fizz)
  2. Guard find_package(folly) behind a check for folly_SOURCE_DIR, allowing folly to be built from source in the same CMake tree
  3. Use CMAKE_CURRENT_SOURCE_DIR instead of CMAKE_SOURCE_DIR for FIZZ_BASE_DIR so the path is correct when fizz is a subdirectory

Differential Revision: D93366451

Summary:
When fizz is consumed via FetchContent, CMAKE_SOURCE_DIR points to the top-level project rather than fizz itself, and folly is built in-tree rather than installed. This diff makes three fixes:

1. Set fizz_SOURCE_DIR as a cache variable so downstream FetchContent consumers can skip find_package(fizz)
2. Guard find_package(folly) behind a check for folly_SOURCE_DIR, allowing folly to be built from source in the same CMake tree
3. Use CMAKE_CURRENT_SOURCE_DIR instead of CMAKE_SOURCE_DIR for FIZZ_BASE_DIR so the path is correct when fizz is a subdirectory

Differential Revision: D93366451
@meta-cla meta-cla bot added the CLA Signed label Feb 15, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 15, 2026

@afrind has exported this pull request. If you are a Meta employee, you can view the originating Diff in D93366451.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant