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 )
22 if (MD5SUM_EXECUTABLE OR WIN32)
24 if ("${MD5SUM_EXECUTABLE}" MATCHES "md5sum")
25 set(CUT_ARG "-f 1") # for md5sum the sum is in the 1st column
26 else ("${MD5SUM_EXECUTABLE}" MATCHES "md5sum")
27 set(CUT_ARG "-f 4") # for md5 the sum is in the 4th column
28 endif ("${MD5SUM_EXECUTABLE}" MATCHES "md5sum")
31 set(FISH_GENERATOR "generate_fishcode.bat")
33 set(FISH_GENERATOR "generate_fishcode.sh")
35 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fishcode.h
36 COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${FISH_GENERATOR} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/fish.pl ${MD5SUM_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/fishcode.h "${CUT_ARG}"
37 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/fish.pl
38 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
40 set(kio_fish_PART_SRCS fish.cpp ${CMAKE_CURRENT_BINARY_DIR}/fishcode.h)
42 kde4_add_plugin(kio_fish ${kio_fish_PART_SRCS})
44 target_link_libraries(kio_fish ${KDE4_KIO_LIBS})
47 target_link_libraries(kio_fish ${UTIL_LIBRARIES})
48 endif (UTIL_LIBRARIES)
50 install(TARGETS kio_fish DESTINATION ${PLUGIN_INSTALL_DIR} )
53 ########### install files ###############
55 install( FILES fish.protocol DESTINATION ${SERVICES_INSTALL_DIR} )
57 endif (MD5SUM_EXECUTABLE OR WIN32)