Commit 0a36d34f authored by Adam Simpkins's avatar Adam Simpkins Committed by Facebook Github Bot

fbcode_builder: fix install_fb_python_library() to work with old CMake versions

Summary:
Update install_fb_python_library() to work with CMake versions older than 3.7.

Previously the code used a generator expression in the directory argument
supplied to `install(DIRECTORY)`.  Support for generators in this parameter
was only added in CMake 3.5, but it was buggy and did not correctly handle
absolute paths until 3.7.

This updates the code to avoid using a generator expression.  This does
require that the corresponding `add_fb_python_library()` statement appear
before the `install_fb_python_library()` statement, but this seems like a
pretty reasonable restriction.

Reviewed By: chadaustin

Differential Revision: D17103597

fbshipit-source-id: 54d6af93a3f530373cfe3137db99436d8484f308
parent 488fe98c
......@@ -369,10 +369,9 @@ function(install_fb_python_library LIB_NAME)
# Copy the intermediate install directory generated at build time into
# the desired install location.
set(dest_dir "$<TARGET_PROPERTY:${LIB_NAME}.py_lib_install,INSTALL_DIR>")
set(
build_install_dir
"$<TARGET_PROPERTY:${LIB_NAME}.py_lib_install,BUILD_INSTALL_DIR>"
get_target_property(dest_dir "${LIB_NAME}.py_lib_install" "INSTALL_DIR")
get_target_property(
build_install_dir "${LIB_NAME}.py_lib_install" "BUILD_INSTALL_DIR"
)
install(
DIRECTORY "${build_install_dir}/${LIB_NAME}"
......
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