Commit 7d9a4c55 authored by Adam Simpkins's avatar Adam Simpkins Committed by Facebook Github Bot

getdeps: add an install_fb_python_executable() function to the CMake utilities

Summary:
Add a `install_fb_python_executable()` function to `FBPythonBinary.cmake` for
helping to install python executables generated with
`add_fb_python_executable()`.  This primarily helps by automatically looking
up the correct output file to install from the generated targets.

Reviewed By: wez

Differential Revision: D18774539

fbshipit-source-id: 4b397580d72ac448f21d1db6d2cdd653cf3635df
parent f47108d3
...@@ -547,6 +547,30 @@ function(add_fb_python_library LIB_NAME) ...@@ -547,6 +547,30 @@ function(add_fb_python_library LIB_NAME)
) )
endfunction() endfunction()
#
# Install an FB-style packaged python binary.
#
# - DESTINATION <export-name>:
# Associate the installed target files with the given export-name.
#
function(install_fb_python_executable TARGET)
# Parse the arguments
set(one_value_args DESTINATION)
set(multi_value_args)
fb_cmake_parse_args(
ARG "" "${one_value_args}" "${multi_value_args}" "${ARGN}"
)
if(NOT DEFINED ARG_DESTINATION)
set(ARG_DESTINATION bin)
endif()
install(
PROGRAMS "$<TARGET_PROPERTY:${TARGET}.GEN_PY_EXE,EXECUTABLE>"
DESTINATION "${ARG_DESTINATION}"
)
endfunction()
# #
# Install a python library. # Install a python library.
# #
......
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