Skip to content

Commit

Permalink
Add check for inotify.h and (optional) libinotify.so
Browse files Browse the repository at this point in the history
  • Loading branch information
sgolemon committed Aug 18, 2012
1 parent 7761a65 commit 7b3e14f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
23 changes: 23 additions & 0 deletions CMake/FindLibinotify.cmake
@@ -0,0 +1,23 @@
#
# $Id$
#
# - Find libinotify
# Find libinotify
#
# LIBINOTIFY_INCLUDE_DIR - where to find sys/inotify.h
# LIBINOTIFY_LIBRARY - List of libraries when using libinotify
# LIBINOTIFY_FOUND - True if libinotify found.


if(LIBINOTIFY_INCLUDE_DIR)
# Already in cache, be silent
SET(LIBINOTIFY_FIND_QUIETLY TRUE)
endif()

FIND_PATH(LIBINOTIFY_INCLUDE_DIR sys/inotify.h)
FIND_LIBRARY(LIBINOTIFY_LIBRARY inotify)

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBINOTIFY DEFAULT_MSG LIBINOTIFY_LIBRARY LIBINOTIFY_INCLUDE_DIR)

MARK_AS_ADVANCED(LIBINOTIFY_LIBRARY LIBINOTIFY_INCLUDE_DIR)
10 changes: 10 additions & 0 deletions CMake/HPHPFindLibs.cmake
Expand Up @@ -28,6 +28,12 @@ endif()
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})

# inotify checks
find_package(Libinotify)
if (LIBINOTIFY_INCLUDE_DIR)
include_directories(${LIBINOTIFY_INCLUDE_DIR})
endif()

# unwind checks
find_package(Libunwind REQUIRED)
include_directories(${LIBUNWIND_INCLUDE_DIR})
Expand Down Expand Up @@ -351,6 +357,10 @@ macro(hphp_link target)
target_link_libraries(${target} ${LIBEVENT_LIB})
target_link_libraries(${target} ${CURL_LIBRARIES})

if (LIBINOTIFY_LIBRARY)
target_link_libraries(${target} ${LIBINOTIFY_LIBRARY})
endif()

if (LINUX)
target_link_libraries(${target} ${CAP_LIB})
endif()
Expand Down

0 comments on commit 7b3e14f

Please sign in to comment.