teapot-spreadsheet/src/CMakeLists.txt

81 lines
2.9 KiB
CMake
Raw Normal View History

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 ()