From 2b035349c31fe64c31d2c050892b117a3a807179 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 15 Jan 2012 16:54:53 -0600 Subject: [PATCH] Add fam/gamin support to tdelibs CMake --- CMakeLists.txt | 18 ++++++++++++++++++ config.h.cmake | 2 +- kio/kio/CMakeLists.txt | 7 ++++++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ce186bda..a1a64292c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,6 +81,7 @@ OPTION( WITH_ELFICON "Enable ELF embedded icon support" ${WITH_ALL_OPTIONS} ) OPTION( WITH_PCRE "Enable pcre regex support for kjs" ON ) OPTION( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} ) OPTION( WITH_INOTIFY "Enable inotify support for kio" ON ) +OPTION( WITH_GAMIN "Enable FAM/GAMIN support" ${WITH_ALL_OPTIONS} ) OPTION( WITH_ASPELL "Enable aspell support" ${WITH_ALL_OPTIONS} ) OPTION( WITH_HSPELL "Enable hspell support" ${WITH_ALL_OPTIONS} ) @@ -786,6 +787,23 @@ if( WITH_INOTIFY ) endif( ) +##### check for FAM/GAMIN ########################## + +if( WITH_GAMIN ) + check_include_file( "fam.h" HAVE_FAM_H ) + if( HAVE_FAM_H ) + pkg_search_module( GAMIN gamin ) + if( GAMIN_FOUND ) + set( HAVE_FAM 1 ) + else( GAMIN_FOUND ) + message(FATAL_ERROR "\nfam/gamin support was requested, but gamin was not found on your system" ) + endif( GAMIN_FOUND ) + else( HAVE_FAM_H ) + message(FATAL_ERROR "\nfam/gamin support was requested, but fam was not found on your system" ) + endif( HAVE_FAM_H ) +endif( WITH_GAMIN ) + + ##### check for aspell ########################## # we need ASPELL_DATADIR too diff --git a/config.h.cmake b/config.h.cmake index d9b0ef552..4e4bd18b8 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -120,7 +120,7 @@ #undef HAVE_FADVISE /* Define if your system has libfam */ -#undef HAVE_FAM +#cmakedefine HAVE_FAM 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_FLOAT_H 1 diff --git a/kio/kio/CMakeLists.txt b/kio/kio/CMakeLists.txt index 9d8790f46..25d4fad83 100644 --- a/kio/kio/CMakeLists.txt +++ b/kio/kio/CMakeLists.txt @@ -25,8 +25,12 @@ include_directories( ${CMAKE_SOURCE_DIR}/kio/kssl ${CMAKE_SOURCE_DIR}/interfaces ${LIBR_INCLUDEDIR} + ${GAMIN_INCLUDEDIR} ) +link_directories( + ${GAMIN_LIBDIR} +) ##### headers ################################### @@ -113,6 +117,7 @@ set( ${target}_SRCS tde_add_library( ${target} STATIC_PIC AUTOMOC SOURCES ${${target}_SRCS} + LINK ${GAMIN_LIBRARIES} ) @@ -130,4 +135,4 @@ if( HAVE_ELFICON ) SOURCES ${${target}_SRCS} ) -endif( HAVE_ELFICON ) \ No newline at end of file +endif( HAVE_ELFICON )