2016-02-12 15:24:56 +01:00
|
|
|
# EXTRA_DIST = cnghttp2.pxd nghttp2.pyx
|
|
|
|
|
|
|
|
if(ENABLE_PYTHON_BINDINGS)
|
2016-02-16 12:17:49 +01:00
|
|
|
add_custom_target(python ALL
|
|
|
|
COMMAND "${PYTHON_EXECUTABLE}" setup.py build
|
|
|
|
VERBATIM
|
2016-03-13 17:34:22 +01:00
|
|
|
DEPENDS nghttp2.c nghttp2
|
2016-02-12 15:24:56 +01:00
|
|
|
)
|
|
|
|
|
2016-02-16 12:17:49 +01:00
|
|
|
configure_file(install-python.cmake.in install-python.cmake ESCAPE_QUOTES @ONLY)
|
|
|
|
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/install-python.cmake")
|
2016-02-12 15:24:56 +01:00
|
|
|
|
|
|
|
add_custom_command(OUTPUT nghttp2.c
|
2016-02-16 12:17:49 +01:00
|
|
|
COMMAND "${CYTHON_EXECUTABLE}" -o nghttp2.c
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/nghttp2.pyx"
|
|
|
|
VERBATIM
|
2016-02-12 15:24:56 +01:00
|
|
|
DEPENDS nghttp2.pyx
|
|
|
|
)
|
2016-03-13 17:34:22 +01:00
|
|
|
|
|
|
|
# Instead of calling "setup.py clean --all", this should do...
|
|
|
|
set_directory_properties(PROPERTIES
|
|
|
|
ADDITIONAL_MAKE_CLEAN_FILES "build;python_nghttp2.egg-info"
|
|
|
|
)
|
|
|
|
|
2016-02-16 12:17:49 +01:00
|
|
|
## This works also, except that the installation target is missing...
|
|
|
|
# include(UseCython)
|
|
|
|
# cython_add_module(python_nghttp2 nghttp2.pyx)
|
|
|
|
# set_target_properties(python_nghttp2 PROPERTIES
|
|
|
|
# OUTPUT_NAME nghttp2
|
|
|
|
# )
|
|
|
|
# target_include_directories(python_nghttp2 PRIVATE
|
|
|
|
# "${CMAKE_SOURCE_DIR}/lib"
|
|
|
|
# "${CMAKE_SOURCE_DIR}/lib/includes"
|
|
|
|
# "${CMAKE_BINARY_DIR}/lib/includes"
|
|
|
|
# )
|
|
|
|
# target_link_libraries(python_nghttp2
|
|
|
|
# nghttp2
|
|
|
|
# )
|
2016-02-12 15:24:56 +01:00
|
|
|
endif()
|