@ -1,5 +1,5 @@
cmake_minimum_required ( VERSION 3.14 )
project ( notcurses VERSION 1.1. 1
project ( notcurses VERSION 1.1. 2
D E S C R I P T I O N " U I f o r m o d e r n t e r m i n a l e m u l a t o r s "
H O M E P A G E _ U R L " h t t p s : / / n i c k - b l a c k . c o m / d a n k w i k i / i n d e x . p h p / n o t c u r s e s "
L A N G U A G E S C C X X )
@ -13,6 +13,7 @@ include(GNUInstallDirs)
set ( NOTCURSES_SHARE ${ CMAKE_INSTALL_PREFIX } /share/notcurses )
option ( DISABLE_FFMPEG "Disable FFmpeg image/video support" OFF )
option ( BUILD_PYTHON "Build Python wrappers" OFF )
find_package ( PkgConfig REQUIRED )
find_package ( Threads REQUIRED )
@ -431,31 +432,32 @@ write_basic_package_version_file(
)
# P y t h o n b i n d i n g s
find_package ( Python3 COMPONENTS Development Interpreter REQUIRED )
file ( GLOB PYSRC CONFIGURE_DEPENDS python/src/notcurses/*.py )
set ( SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/python/setup.py.in" )
set ( SETUP_PY "${CMAKE_CURRENT_BINARY_DIR}/python/setup.py" )
set ( SETUP_CFG_IN "${CMAKE_CURRENT_SOURCE_DIR}/python/setup.cfg.in" )
set ( SETUP_CFG "${CMAKE_CURRENT_BINARY_DIR}/setup.cfg" )
configure_file ( ${ SETUP_PY_IN } ${ SETUP_PY } )
configure_file ( ${ SETUP_CFG_IN } ${ SETUP_CFG } )
add_custom_command (
O U T P U T
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / b u i l d / p y t i m e s t a m p "
C O M M A N D
" $ { P y t h o n 3 _ E X E C U T A B L E } " $ { S E T U P _ P Y } b u i l d & &
" $ { P y t h o n 3 _ E X E C U T A B L E } " $ { S E T U P _ P Y } b u i l d _ e x t & &
m k d i r - p " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / b u i l d " & &
$ { C M A K E _ C O M M A N D } - E t o u c h " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / b u i l d / p y t i m e s t a m p "
D E P E N D S
$ { P Y S R C } $ { S E T U P _ P Y } $ { S E T U P _ C F G } n o t c u r s e s
C O M M E N T " B u i l d i n g P y t h o n w r a p p e r s "
)
add_custom_target ( pymod
A L L
D E P E N D S " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / b u i l d / p y t i m e s t a m p "
)
install ( CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} install)" )
if ( ${ BUILD_PYTHON } )
find_package ( Python3 COMPONENTS Development Interpreter REQUIRED )
file ( GLOB PYSRC CONFIGURE_DEPENDS python/src/notcurses/*.py )
set ( SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/python/setup.py.in" )
set ( SETUP_PY "${CMAKE_CURRENT_BINARY_DIR}/python/setup.py" )
set ( SETUP_CFG_IN "${CMAKE_CURRENT_SOURCE_DIR}/python/setup.cfg.in" )
set ( SETUP_CFG "${CMAKE_CURRENT_BINARY_DIR}/setup.cfg" )
configure_file ( ${ SETUP_PY_IN } ${ SETUP_PY } )
configure_file ( ${ SETUP_CFG_IN } ${ SETUP_CFG } )
add_custom_command (
O U T P U T
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / b u i l d / p y t i m e s t a m p "
C O M M A N D
" $ { P y t h o n 3 _ E X E C U T A B L E } " $ { S E T U P _ P Y } b u i l d & &
" $ { P y t h o n 3 _ E X E C U T A B L E } " $ { S E T U P _ P Y } b u i l d _ e x t
D E P E N D S
$ { P Y S R C } $ { S E T U P _ P Y } $ { S E T U P _ C F G } n o t c u r s e s
C O M M E N T " B u i l d i n g P y t h o n w r a p p e r s "
)
# b u i l d / p y t i m e s t a m p i s n ' t a c t u a l l y g e n e r a t e d , a n d t h u s t h i s r u n s e a c h t i m e .
# p y t h o n d o e s i t s o w n d e p t r a c k i n g , s o i t " w o r k s " o u t l i k e r e c u r s i v e m a k e .
add_custom_target ( pymod
A L L
D E P E N D S " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / b u i l d / p y t i m e s t a m p "
)
endif ( )
# I n s t a l l a t i o n
install ( FILES
@ -499,6 +501,10 @@ install(TARGETS notcurses
D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ I N C L U D E D I R }
C O M P O N E N T D e v e l o p m e n t
)
install (
C O D E
" execute_process ( COMMAND ${ Python3_EXECUTABLE } ${ SETUP_PY } install --root= ${ CMAKE_SOURCE_DIR } /debian/python3-notcurses --install-layout=deb --prefix= ${ CMAKE_INSTALL_PREFIX } WORKING_DIRECTORY ../python ) " )
if ( ${ BUILD_PYTHON } )
if ( DEFINED $ENV{ DEB_VENDOR } )
install (
C O D E
" execute_process ( COMMAND ${ Python3_EXECUTABLE } ${ SETUP_PY } install --root= ${ CMAKE_SOURCE_DIR } /debian/python3-notcurses --install-layout=deb --prefix= ${ CMAKE_INSTALL_PREFIX } WORKING_DIRECTORY ../python ) " )
endif ( )
endif ( )