2019-07-27 05:35:44 +00:00
|
|
|
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)
|
2019-09-05 07:24:24 +00:00
|
|
|
include_directories(${FLTK_INCLUDE_DIR})
|
2019-08-03 00:31:48 +00:00
|
|
|
add_executable(fteapot WIN32 tpt_choose.cxx ${fteapot_FLTK_UI_SRCS})
|
2019-09-05 07:24:24 +00:00
|
|
|
target_compile_options(fteapot PRIVATE -Wno-shadow -Wno-conversion -Wno-sign-conversion)
|
2019-07-27 05:35:44 +00:00
|
|
|
set(fteapot_DEB_DEPENDS ", libstdc++6 (>= 4.1.1), libfltk1.3")
|
|
|
|
if (ENABLE_HELP)
|
2019-09-09 14:33:41 +00:00
|
|
|
find_package(JPEG)
|
2019-07-27 05:35:44 +00:00
|
|
|
set(fteapot_DEB_DEPENDS "${fteapot_DEB_DEPENDS}, libfltk-images1.3")
|
|
|
|
if (ENABLE_STATIC)
|
2019-09-09 14:33:41 +00:00
|
|
|
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 ()
|
2019-07-27 05:35:44 +00:00
|
|
|
else ()
|
2019-09-09 14:33:41 +00:00
|
|
|
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 ()
|
2019-07-27 05:35:44 +00:00
|
|
|
endif ()
|
|
|
|
else ()
|
|
|
|
if (ENABLE_STATIC)
|
2019-09-05 07:24:24 +00:00
|
|
|
target_link_libraries(fteapot teapotlib ${FLTK_LIBRARIES} ${LIB_PORTABLEXDR})
|
2019-07-27 05:35:44 +00:00
|
|
|
else ()
|
2019-09-05 07:24:24 +00:00
|
|
|
target_link_libraries(fteapot teapotlib ${FLTK_LIBRARIES} ${LIB_PORTABLEXDR})
|
2019-07-27 05:35:44 +00:00
|
|
|
endif ()
|
|
|
|
endif ()
|
|
|
|
install(TARGETS fteapot DESTINATION bin)
|
|
|
|
endif ()
|
2019-09-09 14:33:41 +00:00
|
|
|
|
|
|
|
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 ()
|