Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / runtime / kioslave / fish / CMakeLists.txt
blob28718847f9f742261fdbc77be1d75c74326c76e5
1 check_include_files(termios.h HAVE_TERMIOS_H)
2 check_include_files(util.h HAVE_UTIL_H)
3 check_include_files(sys/ioctl.h HAVE_SYS_IOCTL_H)
4 check_include_files(pty.h HAVE_PTY_H)
5 check_include_files("sys/types.h;libutil.h" HAVE_LIBUTIL_H)
6 check_function_exists(getpt       HAVE_GETPT)
7 check_function_exists(grantpt     HAVE_GRANTPT)
8 check_library_exists(util  openpty "" HAVE_OPENPTY)
9 check_library_exists(util  isastream "" HAVE_ISASTREAM)
11 find_library(UTIL_LIBRARIES util)
12 mark_as_advanced(UTIL_LIBRARIES)
14 configure_file(config-fish.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-fish.h)
16 ########### next target ###############
18 # on Linux there is md5sum, on FreeBSD there is md5
19 find_program(MD5SUM_EXECUTABLE NAMES md5sum md5 )
21 if (MD5SUM_EXECUTABLE)
23    if ("${MD5SUM_EXECUTABLE}" MATCHES "md5sum")
24       set(CUT_ARG "-f 1")                            # for md5sum the sum is in the 1st column
25    else ("${MD5SUM_EXECUTABLE}" MATCHES "md5sum")
26       set(CUT_ARG "-f 4")                            # for md5 the sum is in the 4th column
27    endif ("${MD5SUM_EXECUTABLE}" MATCHES "md5sum")
29    add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fishcode.h 
30       COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/generate_fishcode.sh ARGS ${CMAKE_CURRENT_SOURCE_DIR}/fish.pl ${MD5SUM_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/fishcode.h "${CUT_ARG}"
31       DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/fish.pl )
33    set(kio_fish_PART_SRCS fish.cpp ${CMAKE_CURRENT_BINARY_DIR}/fishcode.h)
35    kde4_add_plugin(kio_fish ${kio_fish_PART_SRCS})
37    target_link_libraries(kio_fish ${KDE4_KIO_LIBS})
39    if (UTIL_LIBRARIES)
40       target_link_libraries(kio_fish ${UTIL_LIBRARIES})
41    endif (UTIL_LIBRARIES)
43    install(TARGETS kio_fish  DESTINATION ${PLUGIN_INSTALL_DIR} )
46    ########### install files ###############
48    install( FILES fish.protocol  DESTINATION  ${SERVICES_INSTALL_DIR} )
50 endif (MD5SUM_EXECUTABLE)