[Pkg-owncloud-commits] [owncloud-client] 51/120: Fix linking with libinotify on OpenBSD.

Sandro Knauß hefee-guest at moszumanska.debian.org
Mon Aug 24 00:02:44 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 7786f1f9a9b64844098d98f9f09db97a8411aa14
Author: Kirill Bychkov <kirby at humppastara.linklevel.loc>
Date:   Thu Aug 13 09:44:55 2015 +0300

    Fix linking with libinotify on OpenBSD.
---
 cmake/modules/FindINotify.cmake | 11 +++++++++--
 src/libsync/CMakeLists.txt      | 13 +++++++++++--
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/cmake/modules/FindINotify.cmake b/cmake/modules/FindINotify.cmake
index ca9f388..19f43aa 100644
--- a/cmake/modules/FindINotify.cmake
+++ b/cmake/modules/FindINotify.cmake
@@ -4,20 +4,27 @@
 
 # This module defines
 #  INOTIFY_INCLUDE_DIR, where to find inotify.h, etc.
+#  INOTIFY_LIBRARY_DIR, the directory holding the inotify library.
 #  INOTIFY_FOUND, If false, do not try to use inotify.
 # also defined, but not for general use are
 #  INOTIFY_LIBRARY, where to find the inotify library.
 
 find_path(INOTIFY_INCLUDE_DIR sys/inotify.h 
-          HINTS /usr/include/${CMAKE_LIBRARY_ARCHITECTURE})
+          PATH_SUFFIXES inotify)
 mark_as_advanced(INOTIFY_INCLUDE_DIR)
 
+find_library(INOTIFY_LIBRARY inotify PATH_SUFFIXES lib/inotify)
+
+get_filename_component(INOTIFY_LIBRARY_DIR ${INOTIFY_LIBRARY} DIRECTORY)
+mark_as_advanced(INOTIFY_LIBRARY_DIR)
+
 # all listed variables are TRUE
 # handle the QUIETLY and REQUIRED arguments and set INOTIFY_FOUND to TRUE if
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(INOTIFY DEFAULT_MSG INOTIFY_INCLUDE_DIR)
+find_package_handle_standard_args(INOTIFY DEFAULT_MSG INOTIFY_INCLUDE_DIR INOTIFY_LIBRARY_DIR)
 
 IF(INOTIFY_FOUND)
   SET(INotify_INCLUDE_DIRS ${INOTIFY_INCLUDE_DIR})
+  SET(INotify_LIBRARY_DIRS ${INOTIFY_LIBRARY_DIR})
 ENDIF(INOTIFY_FOUND)
 
diff --git a/src/libsync/CMakeLists.txt b/src/libsync/CMakeLists.txt
index 509b482..26b012c 100644
--- a/src/libsync/CMakeLists.txt
+++ b/src/libsync/CMakeLists.txt
@@ -22,11 +22,11 @@ if ( APPLE )
     )
 endif()
 
-IF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
+IF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD|OpenBSD")
     list(APPEND OS_SPECIFIC_LINK_LIBRARIES
 	inotify
     )
-ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
+ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD|OpenBSD")
 
 if(SPARKLE_FOUND AND NOT BUILD_LIBRARIES_ONLY)
     list (APPEND OS_SPECIFIC_LINK_LIBRARIES ${SPARKLE_LIBRARY})
@@ -119,6 +119,11 @@ if(QTKEYCHAIN_FOUND OR QT5KEYCHAIN_FOUND)
     include_directories(${QTKEYCHAIN_INCLUDE_DIR})
 endif()
 
+if(INOTIFY_FOUND)
+    include_directories(${INOTIFY_INCLUDE_DIR})
+    link_directories(${INOTIFY_LIBRARY_DIR})
+endif()
+
 if(NEON_FOUND)
     list(APPEND libsync_LINK_TARGETS ${NEON_LIBRARIES} httpbf)
     include_directories(${NEON_INCLUDE_DIRS})
@@ -157,6 +162,10 @@ set_target_properties( ${synclib_NAME} PROPERTIES
 
 target_link_libraries(${synclib_NAME} ${libsync_LINK_TARGETS} )
 
+if(INOTIFY_FOUND)
+    target_link_libraries(${synclib_NAME} ${INOTIFY_LIBRARY} )
+endif()
+
 if(BUILD_LIBRARIES_ONLY)
     #add_library(${synclib_NAME}_static STATIC ${libsync_SRCS} ${syncMoc})
     #qt5_use_modules(${synclib_NAME}_static Widgets Network Xml Sql)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list