Commit 3bd7d93d authored by Adam Simpkins's avatar Adam Simpkins Committed by Facebook Github Bot

cmake: always include files from the source directory first

Summary:
Add the current source and build directories to the very front of the include
directory list.  This ensures that folly finds its own local headers first,
even if the install directory already contains an older version of the folly
headers.

Even though the install directory was appended to the include list after the
current source directory in this statement, it could have ended up already in
the include list if other dependencies (e.g., glog or gmock) were found in
that directory.

Reviewed By: Orvid

Differential Revision: D10448692

fbshipit-source-id: 539613a055db41d6115f8d04c5f6fa90841a414f
parent b5df374b
...@@ -201,9 +201,13 @@ include(GenPkgConfig) ...@@ -201,9 +201,13 @@ include(GenPkgConfig)
gen_pkgconfig_vars(FOLLY_PKGCONFIG folly_deps) gen_pkgconfig_vars(FOLLY_PKGCONFIG folly_deps)
target_include_directories(folly_deps target_include_directories(folly_deps
BEFORE
INTERFACE INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
)
target_include_directories(folly_deps
INTERFACE
$<INSTALL_INTERFACE:include> $<INSTALL_INTERFACE:include>
) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment