From 9deea8e7c07ff64f3b95fd7e51affe74439e6458 Mon Sep 17 00:00:00 2001 From: Austin Blanton Date: Thu, 2 Jan 2014 14:48:50 -0500 Subject: [PATCH] Only install brpy optionally --- CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b0894d6..039c678 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,9 +138,14 @@ endif() install(FILES CHANGELOG.md LICENSE.txt README.md DESTINATION .) install(DIRECTORY share DESTINATION .) install(DIRECTORY ${BR_THIRDPARTY_SHARE} DESTINATION share) -# install C API Python wrapper -execute_process(COMMAND python -c "import site, sys; sys.stdout.write(site.getsitepackages()[-1])" OUTPUT_VARIABLE PYTHON_SITE_DIR) -install(DIRECTORY ${BR_SCRIPTS_DIR}/brpy DESTINATION ${PYTHON_SITE_DIR}) + +# install brpy +option(BR_INSTALL_BRPY "Install brpy, the Python wrapper to the C API (requires Python)") +if(${BR_INSTALL_BRPY}) + find_package(PythonInterp REQUIRED) + execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import site, sys; sys.stdout.write(site.getsitepackages()[-1])" OUTPUT_VARIABLE PYTHON_SITE_DIR) + install(DIRECTORY ${BR_SCRIPTS_DIR}/brpy DESTINATION ${PYTHON_SITE_DIR}) +endif() # Package set(CPACK_PACKAGE_EXECUTABLES "OpenBR" "OpenBR") -- libgit2 0.21.4