CMake packages can be found in build trees when setting CMAKE_PREFIX_PATH to the project directory of build directory of the project.
With the setup I had, CMake found the package since there was a cmake config file (span-lite-config.cmake) in the build directory, but tried to include span-lite-targets.cmake which was no longer generated.
This patch export the build tree (not globally). It simply enable CMake to use a build tree as a package as if it was installed when setting the path to find it.
There was also an unused option named SPAN_LITE_EXPORT_PACKAGE. I opted for removing the option instead of adding the global exportation back, since it's not considered a good practice anymore.
CMake packages can be found in build trees when setting
CMAKE_PREFIX_PATH
to the project directory of build directory of the project.With the setup I had, CMake found the package since there was a cmake config file (
span-lite-config.cmake
) in the build directory, but tried to includespan-lite-targets.cmake
which was no longer generated.This patch export the build tree (not globally). It simply enable CMake to use a build tree as a package as if it was installed when setting the path to find it.
There was also an unused option named
SPAN_LITE_EXPORT_PACKAGE
. I opted for removing the option instead of adding the global exportation back, since it's not considered a good practice anymore.