teapot-spreadsheet/src/CMakeLists.txt
Glen Whitney d5fbc0ef07 Alleviate compile warnings on Linux and finalize programmable styles
This change gets teapot to compile without warnings on OpenSUSE Tumbleweed
  with the extended warnings flags that were recently added. It also represents
  a more thoroughly (but not exhaustively) tested and debugged version of the
  expression-controlled style settings from an earlier commit. The facility
  should be ready for use.

  It also adds a better pretty-printer for Token values in gdb and extensive
  edits to the documentation. It fixes a bug in max/min introduced by the
  addition of the Bool type and the switchover to comparisons returning Bool.
  It modifies the display of values too long to fit in their cells to show an
  initial segment of their contents with a continuation mark rather than
  obscuring the contents completely.

  Closes #54.
  Closes #55.
  Closes #44.
  Closes #22.
  Closes #13.
2019-09-09 10:33:41 -04:00

81 lines
2.9 KiB
CMake

add_subdirectory(common)
include_directories("${Teapot_SOURCE_DIR}/src")
include_directories("${Teapot_SOURCE_DIR}/src/common")
find_library(LIB_PORTABLEXDR portablexdr)
if (NOT LIB_PORTABLEXDR)
find_library(LIB_TIRPC tirpc)
if (LIB_TIRPC)
set(LIB_PORTABLEXDR ${LIB_TIRPC})
else ()
set(LIB_PORTABLEXDR "")
endif ()
endif ()
find_package(Curses)
if (CURSES_FOUND AND ENABLE_UTF8)
find_library(LIB_CURSESW ncursesw)
if (NOT LIB_CURSESW)
find_library(LIB_CURSESW ncursesw5)
endif ()
if (LIB_CURSESW)
set(teapot_DEB_DEPENDS ", libncursesw5 (>= 5.6+20071006-3)")
set(CURSES_CURSES_LIBRARY ${LIB_CURSESW})
else ()
set(ENABLE_UTF8 OFF)
set(teapot_DEB_DEPENDS ", libncurses5 (>= 5.6+20071006-3)")
endif ()
elseif (CURSES_FOUND)
set(teapot_DEB_DEPENDS ", libncurses5 (>= 5.6+20071006-3)")
endif ()
if (CURSES_FOUND)
include_directories("${CURSES_INCLUDE_DIR}")
add_executable(teapot display.c complete.c)
target_link_libraries(teapot teapotlib m ${CURSES_CURSES_LIBRARY} ${LIB_PORTABLEXDR})
install(TARGETS teapot DESTINATION bin)
endif ()
find_package(FLTK)
if (FLTK_FOUND)
fltk_wrap_ui(fteapot fteapot.fl)
include_directories(${FLTK_INCLUDE_DIR})
add_executable(fteapot WIN32 tpt_choose.cxx ${fteapot_FLTK_UI_SRCS})
target_compile_options(fteapot PRIVATE -Wno-shadow -Wno-conversion -Wno-sign-conversion)
set(fteapot_DEB_DEPENDS ", libstdc++6 (>= 4.1.1), libfltk1.3")
if (ENABLE_HELP)
find_package(JPEG)
set(fteapot_DEB_DEPENDS "${fteapot_DEB_DEPENDS}, libfltk-images1.3")
if (ENABLE_STATIC)
if (JPEG_FOUND)
target_link_libraries(fteapot teapotlib ${FLTK_LIBRARIES} ${JPEG_LIBRARIES} ${LIB_PORTABLEXDR})
else ()
target_link_libraries(fteapot teapotlib ${FLTK_LIBRARIES} ${LIB_PORTABLEXDR})
endif ()
else ()
if (JPEG_FOUND)
target_link_libraries(fteapot teapotlib ${FLTK_LIBRARIES} ${JPEG_LIBRARIES} ${LIB_PORTABLEXDR})
else ()
target_link_libraries(fteapot teapotlib ${FLTK_LIBRARIES} ${LIB_PORTABLEXDR})
endif ()
endif ()
else ()
if (ENABLE_STATIC)
target_link_libraries(fteapot teapotlib ${FLTK_LIBRARIES} ${LIB_PORTABLEXDR})
else ()
target_link_libraries(fteapot teapotlib ${FLTK_LIBRARIES} ${LIB_PORTABLEXDR})
endif ()
endif ()
install(TARGETS fteapot DESTINATION bin)
endif ()
if (CMAKE_BUILD_TYPE STREQUAL Debug)
message(STATUS "-----------------------------------------------")
message(STATUS "Add the line 'add-auto-load-safe-path ${CMAKE_CURRENT_BINARY_DIR}' to ~/.gdbinit for enhanced debugging.")
message(STATUS "-----------------------------------------------")
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/teapot-gdb.py DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/teapot-gdb.py ${CMAKE_CURRENT_BINARY_DIR}/fteapot-gdb.py)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/teapot-gdb.py DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
endif ()