CMake: remove python stuff; it'll be built externally

This commit is contained in:
nick black 2020-07-13 08:30:32 -04:00
parent fa343c92a4
commit 62f6896715
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
2 changed files with 4 additions and 40 deletions

View File

@ -17,7 +17,6 @@ option(DFSG_BUILD "DFSG build (no non-free media/code)" OFF)
option(USE_COVERAGE "Assess code coverage with llvm-cov/lcov" OFF)
option(USE_DOXYGEN "Build HTML cross reference with doxygen" OFF)
option(USE_PANDOC "Build man pages and HTML reference with pandoc" ON)
option(USE_PYTHON "Build Python wrappers" ON)
option(USE_QRCODEGEN "Disable libqrcodegen QR code support" ON)
option(USE_STATIC "Build static libraries (in addition to shared)" ON)
set(USE_MULTIMEDIA "ffmpeg" CACHE STRING "Multimedia engine, one of 'ffmpeg', 'oiio', or 'none'")
@ -599,43 +598,6 @@ write_basic_package_version_file(
COMPATIBILITY SameMajorVersion
)
# Python bindings. When we're building debs, we use pybuild to directly call
# into setup.py, so none of this applies---debian/rules sets USE_PYTHON=off.
# arch also doesn't use it. fedora does.
if(${USE_PYTHON})
find_package(Python3 COMPONENTS Development Interpreter REQUIRED)
file(GLOB PYSRC CONFIGURE_DEPENDS python/src/notcurses/*.py)
file(COPY python/src/ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/python/src)
file(COPY python/README.md DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/python)
set(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/tools/setup.py.in")
set(SETUP_PY "${CMAKE_CURRENT_BINARY_DIR}/python/setup.py")
set(SETUP_CFG_IN "${CMAKE_CURRENT_SOURCE_DIR}/tools/setup.cfg.in")
set(SETUP_CFG "${CMAKE_CURRENT_BINARY_DIR}/python/setup.cfg")
configure_file(${SETUP_PY_IN} ${SETUP_PY})
configure_file(${SETUP_CFG_IN} ${SETUP_CFG})
add_custom_command(
OUTPUT
"${CMAKE_CURRENT_BINARY_DIR}/build/pytimestamp"
COMMAND
env LDFLAGS=\"-Wl,-soname,_notcurses.abi3.so.1 -L${CMAKE_CURRENT_BINARY_DIR}\" "${Python3_EXECUTABLE}" ${SETUP_PY} build &&
"${Python3_EXECUTABLE}" ${SETUP_PY} egg_info
DEPENDS
${PYSRC} ${SETUP_PY} ${SETUP_CFG} notcurses
COMMENT "Building Python wrappers"
WORKING_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/python
)
# build/pytimestamp isn't actually generated, and thus this runs each time.
# python does its own dep tracking, so it "works" out like recursive make.
add_custom_target(pymod ALL
DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/build/pytimestamp"
WORKING_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/python
)
install(CODE "execute_process(COMMAND ${Python3_EXECUTABLE} setup.py install --prefix=${CMAKE_INSTALL_PREFIX} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/python)")
endif()
# Installation
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/notcursesConfig.cmake"

View File

@ -121,7 +121,7 @@ that fine library.
* (OPTIONAL) (documentation) [pandoc](https://pandoc.org/index.html) 1.19.2+
* (OPTIONAL) (python bindings): Python 3.7+, [CFFI](https://pypi.org/project/cffi/) 1.13.2+
* (OPTIONAL) (rust bindings): rust 1.40.0+, cargo 0.40.0+, [bindgen](https://crates.io/crates/bindgen) 0.53.0+
* (runtime) Linux 5.3+ or FreeBSD 12+
* (runtime) Linux 5.3+ or FreeBSD 11+
### Building
@ -129,6 +129,7 @@ that fine library.
* `cmake ..`. You might want to set e.g. `CMAKE_BUILD_TYPE`.
* `make`
* `make test`
* `make install`
The default multimedia engine is FFmpeg. You can select a different engine
using `USE_MULTIMEDIA`. Valid values are `ffmpeg`, `oiio` (for OpenImageIO),
@ -147,6 +148,8 @@ Install with `make install` following a successful build.
To watch the bitchin' demo, run `./notcurses-demo -p ../data`. More details can
be found on the `notcurses-demo(1)` man page.
This does not install the Python or Rust wrappers.
#### Build options
To set the C compiler, export `CC`. To set the C++ compiler, export `CXX`. The
@ -160,7 +163,6 @@ but must be `Debug` for use of `USE_COVERAGE`.
* `USE_QRCODEGEN`: build qrcode support via libqrcodegen
* `USE_PANDOC`: build man pages with pandoc
* `USE_DOXYGEN`: build interlinked HTML documentation with Doxygen
* `USE_PYTHON`: build the Python wrappers
* `USE_STATIC`: build static libraries (in addition to shared ones)
* `USE_COVERAGE`: build coverage support (for developers, requires use of Clang)