2019-07-22 20:32:33 +00:00
cmake_minimum_required ( VERSION 2.6 )
project ( Teapot )
set ( Teapot_VERSION_MAJOR 2 )
set ( Teapot_VERSION_MINOR 3 )
2019-07-22 22:02:18 +00:00
set ( Teapot_VERSION_PATCH 0devel )
2019-07-22 20:32:33 +00:00
option ( ENABLE_HELP "Enable built-in documentation" ON )
option ( ENABLE_UTF8 "Enable UTF-8 support" ON )
option ( ENABLE_STATIC "Link FLTK statically" OFF )
2019-09-05 07:24:24 +00:00
add_compile_options ( -Wall -Wextra -Wshadow -Wconversion -Wno-unused-parameter )
2019-07-27 05:35:44 +00:00
include_directories ( "${Teapot_BINARY_DIR}/" )
add_subdirectory ( src )
2019-07-22 20:32:33 +00:00
if ( ENABLE_HELP )
add_custom_command (
O U T P U T t e a p o t . t e x t e a p o t . l y x
M A I N _ D E P E N D E N C Y $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / d o c / t e a p o t . l y x
V E R B A T I M
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / d o c / t e a p o t . l y x t e a p o t . l y x
C O M M A N D l y x - e p d f l a t e x - f m a i n t e a p o t . l y x
)
add_custom_command (
O U T P U T t e a p o t . p d f t e a p o t . a u x . o l d t e a p o t . l o g t e a p o t . t o c
M A I N _ D E P E N D E N C Y t e a p o t . t e x
V E R B A T I M
C O M M A N D p d f l a t e x t e a p o t . t e x ; d i f f - q t e a p o t . a u x . o l d t e a p o t . a u x & & c p t e a p o t . a u x t e a p o t . a u x . o l d
C O M M A N D p d f l a t e x t e a p o t . t e x ; d i f f - q t e a p o t . a u x . o l d t e a p o t . a u x & & c p t e a p o t . a u x t e a p o t . a u x . o l d
)
add_custom_command ( OUTPUT teapot.pdf teapot.out MAIN_DEPENDENCY teapot.tex teapot.aux.old VERBATIM COMMAND pdflatex teapot.tex; diff -q teapot.aux.old teapot.aux && cp teapot.aux teapot.aux.old )
add_custom_command (
O U T P U T h t m l / h t m l / i n d e x . h t m l . l a t e x 2 h t m l - i n i t
M A I N _ D E P E N D E N C Y t e a p o t . t e x
D E P E N D S t e a p o t . t e x t e a p o t . p d f $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / d o c / . l a t e x 2 h t m l - i n i t
V E R B A T I M
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / d o c / . l a t e x 2 h t m l - i n i t . l a t e x 2 h t m l - i n i t
C O M M A N D $ { C M A K E _ C O M M A N D } - E m a k e _ d i r e c t o r y h t m l
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / d o c / c o n t e n t s . p n g h t m l /
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / d o c / n e x t . p n g h t m l /
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / d o c / n e x t _ g . p n g h t m l /
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / d o c / p r e v . p n g h t m l /
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / d o c / p r e v _ g . p n g h t m l /
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / d o c / u p . p n g h t m l /
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / d o c / u p _ g . p n g h t m l /
C O M M A N D l a t e x 2 h t m l t e a p o t . t e x
)
add_custom_target ( pdf DEPENDS teapot.pdf )
add_custom_target ( html DEPENDS html/index.html )
add_custom_target ( doc ALL DEPENDS teapot.pdf html/index.html )
install ( DIRECTORY ${ CMAKE_CURRENT_BINARY_DIR } /html DESTINATION share/doc/teapot FILES_MATCHING PATTERN *.html PATTERN *.png )
install ( FILES ${ CMAKE_CURRENT_BINARY_DIR } /teapot.pdf DESTINATION share/doc/teapot )
set ( HELPFILE "${CMAKE_INSTALL_PREFIX}/share/doc/teapot/index.html" )
endif ( )
2019-07-22 22:02:18 +00:00
install ( FILES COPYING README.md DESTINATION share/doc/teapot )
2019-07-22 20:32:33 +00:00
install ( FILES teapot.1 DESTINATION share/man/man1 )
add_custom_target ( dist
C O M M A N D $ { C M A K E _ C O M M A N D } - E r e m o v e _ d i r e c t o r y t e a p o t - $ { T e a p o t _ V E R S I O N _ M A J O R } . $ { T e a p o t _ V E R S I O N _ M I N O R } . $ { T e a p o t _ V E R S I O N _ P A T C H }
C O M M A N D $ { C M A K E _ C O M M A N D } - E m a k e _ d i r e c t o r y t e a p o t - $ { T e a p o t _ V E R S I O N _ M A J O R } . $ { T e a p o t _ V E R S I O N _ M I N O R } . $ { T e a p o t _ V E R S I O N _ P A T C H }
C O M M A N D L A N G = C b a s h - c " c p - r $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / d o c $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / e x a m p l e s $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / [ A - Z ] * [ A - Z ] $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / * . * [ a - z 1 ] t e a p o t - $ { T e a p o t _ V E R S I O N _ M A J O R } . $ { T e a p o t _ V E R S I O N _ M I N O R } . $ { T e a p o t _ V E R S I O N _ P A T C H } "
C O M M A N D t a r c z f t e a p o t - $ { T e a p o t _ V E R S I O N _ M A J O R } . $ { T e a p o t _ V E R S I O N _ M I N O R } . $ { T e a p o t _ V E R S I O N _ P A T C H } . t a r . g z t e a p o t - $ { T e a p o t _ V E R S I O N _ M A J O R } . $ { T e a p o t _ V E R S I O N _ M I N O R } . $ { T e a p o t _ V E R S I O N _ P A T C H }
C O M M A N D s e t a r c h $ { C P A C K _ R P M _ P A C K A G E _ A R C H I T E C T U R E } c p a c k
C O M M A N D b a s h - c " [ ! - f f t e a p o t ] | | f o r i i n T e a p o t - * - L i n u x . * ; d o m v \ " \ $ i \ " \ " \ $ { i % - L i n u x . * } - L i n u x - $ { C P A C K _ R P M _ P A C K A G E _ A R C H I T E C T U R E } . \ $ { i ##*-Linux.}\"; done"
C O M M A N D b a s h - c " [ ! - f f t e a p o t . e x e - o $ { E N A B L E _ H E L P } ! = O F F ] | | { r m T e a p o t - * . z i p ; i 5 8 6 - m i n g w 3 2 m s v c - s t r i p f t e a p o t . e x e & & u p x - 9 - o T e a p o t - $ { T e a p o t _ V E R S I O N _ M A J O R } . $ { T e a p o t _ V E R S I O N _ M I N O R } . $ { T e a p o t _ V E R S I O N _ P A T C H } - w i n 3 2 - m i n i m a l . e x e f t e a p o t . e x e ; } "
V E R B A T I M
)
configure_file ( "${PROJECT_SOURCE_DIR}/config.h.in" "${PROJECT_BINARY_DIR}/config.h" )
include_directories ( "${PROJECT_BINARY_DIR}" )
include_directories ( "${PROJECT_SOURCE_DIR}" )
2019-09-09 14:33:41 +00:00
set ( CPACK_DEBIAN_PACKAGE_ARCHITECTURE ARCH-NOTFOUND CACHE STRING ".deb Architecture" )
set ( CPACK_RPM_PACKAGE_ARCHITECTURE ARCH-NOTFOUND CACHE STRING ".rpm Architecture" )
2019-07-22 20:32:33 +00:00
set ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "Table Editor And Planner, Or: Teapot!" )
set ( CPACK_PACKAGE_DESCRIPTION "A three-dimensional spreadsheet specialized in advanced calculations. Comes in GUI (FLTK) and console (curses) flavours." )
2019-07-22 22:02:18 +00:00
set ( CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md" )
2019-07-22 20:32:33 +00:00
set ( CPACK_PACKAGE_VENDOR "Jörg Walter, http://www.syntax-k.de/projekte/teapot" )
set ( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING" )
set ( CPACK_PACKAGE_VERSION_MAJOR "${Teapot_VERSION_MAJOR}" )
set ( CPACK_PACKAGE_VERSION_MINOR "${Teapot_VERSION_MINOR}" )
set ( CPACK_PACKAGE_VERSION_PATCH "${Teapot_VERSION_PATCH}" )
set ( CPACK_PACKAGE_CONTACT "Jörg Walter <info@syntax-k.de>" )
set ( CPACK_PACKAGE_EXECUTABLES "fteapot" "Teapot" )
set ( CPACK_STRIP_FILES TRUE )
set ( CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.11), libgcc1 (>= 1:4.1.1)${teapot_DEB_DEPENDS}${fteapot_DEB_DEPENDS}" )
include ( InstallRequiredSystemLibraries )
include ( CPack )
if ( NOT CMAKE_BUILD_TYPE )
set ( CMAKE_BUILD_TYPE MinSizeRel CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE )
endif ( )
2023-04-09 19:28:57 +00:00
add_custom_target (
p r i n t _ b u i l d _ t y p e
C O M M A N D $ { C M A K E _ C O M M A N D } - E e c h o $ < $ < C O N F I G : > : U n d e f i n e d > $ < $ < N O T : $ < C O N F I G : > > : $ < C O N F I G > >
)