Commit 9deea8e7c07ff64f3b95fd7e51affe74439e6458
1 parent
0a1b5b2e
Only install brpy optionally
Showing
1 changed file
with
8 additions
and
3 deletions
CMakeLists.txt
| ... | ... | @@ -138,9 +138,14 @@ endif() |
| 138 | 138 | install(FILES CHANGELOG.md LICENSE.txt README.md DESTINATION .) |
| 139 | 139 | install(DIRECTORY share DESTINATION .) |
| 140 | 140 | install(DIRECTORY ${BR_THIRDPARTY_SHARE} DESTINATION share) |
| 141 | -# install C API Python wrapper | |
| 142 | -execute_process(COMMAND python -c "import site, sys; sys.stdout.write(site.getsitepackages()[-1])" OUTPUT_VARIABLE PYTHON_SITE_DIR) | |
| 143 | -install(DIRECTORY ${BR_SCRIPTS_DIR}/brpy DESTINATION ${PYTHON_SITE_DIR}) | |
| 141 | + | |
| 142 | +# install brpy | |
| 143 | +option(BR_INSTALL_BRPY "Install brpy, the Python wrapper to the C API (requires Python)") | |
| 144 | +if(${BR_INSTALL_BRPY}) | |
| 145 | + find_package(PythonInterp REQUIRED) | |
| 146 | + execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import site, sys; sys.stdout.write(site.getsitepackages()[-1])" OUTPUT_VARIABLE PYTHON_SITE_DIR) | |
| 147 | + install(DIRECTORY ${BR_SCRIPTS_DIR}/brpy DESTINATION ${PYTHON_SITE_DIR}) | |
| 148 | +endif() | |
| 144 | 149 | |
| 145 | 150 | # Package |
| 146 | 151 | set(CPACK_PACKAGE_EXECUTABLES "OpenBR" "OpenBR") | ... | ... |