summaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindNFS.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/modules/FindNFS.cmake')
-rw-r--r--cmake/modules/FindNFS.cmake38
1 files changed, 38 insertions, 0 deletions
diff --git a/cmake/modules/FindNFS.cmake b/cmake/modules/FindNFS.cmake
index c2414a1..d62d4e6 100644
--- a/cmake/modules/FindNFS.cmake
+++ b/cmake/modules/FindNFS.cmake
@@ -36,6 +36,44 @@ if(NFS_FOUND)
36 set(NFS_INCLUDE_DIRS ${NFS_INCLUDE_DIR}) 36 set(NFS_INCLUDE_DIRS ${NFS_INCLUDE_DIR})
37 set(NFS_DEFINITIONS -DHAS_FILESYSTEM_NFS=1) 37 set(NFS_DEFINITIONS -DHAS_FILESYSTEM_NFS=1)
38 38
39 set(CMAKE_REQUIRED_INCLUDES "${NFS_INCLUDE_DIR}")
40 set(CMAKE_REQUIRED_LIBRARIES ${NFS_LIBRARY})
41 if(CMAKE_SYSTEM_NAME MATCHES "Windows")
42 set(NFS_CXX_INCLUDE "#include <Winsock2.h>")
43 set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} "ws2_32.lib")
44 endif()
45
46# Check for nfs_set_timeout
47 check_cxx_source_compiles("
48 ${NFS_CXX_INCLUDE}
49 #include <nfsc/libnfs.h>
50 int main()
51 {
52 nfs_set_timeout(NULL, 0);
53 }
54 " NFS_SET_TIMEOUT)
55
56 if(NFS_SET_TIMEOUT)
57 list(APPEND NFS_DEFINITIONS -DHAS_NFS_SET_TIMEOUT)
58 endif()
59
60# Check for mount_getexports_timeout
61 check_cxx_source_compiles("
62 ${NFS_CXX_INCLUDE}
63 #include <nfsc/libnfs.h>
64 int main()
65 {
66 mount_getexports_timeout(NULL, 0);
67 }
68 " NFS_MOUNT_GETEXPORTS_TIMEOUT)
69
70 if(NFS_MOUNT_GETEXPORTS_TIMEOUT)
71 list(APPEND NFS_DEFINITIONS -DHAS_NFS_MOUNT_GETEXPORTS_TIMEOUT)
72 endif()
73
74 unset(CMAKE_REQUIRED_INCLUDES)
75 unset(CMAKE_REQUIRED_LIBRARIES)
76
39 if(NOT TARGET NFS::NFS) 77 if(NOT TARGET NFS::NFS)
40 add_library(NFS::NFS UNKNOWN IMPORTED) 78 add_library(NFS::NFS UNKNOWN IMPORTED)
41 if(NFS_LIBRARY) 79 if(NFS_LIBRARY)