CMakeLists.txt 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #
  2. # Licensed to the Apache Software Foundation (ASF) under one
  3. # or more contributor license agreements. See the NOTICE file
  4. # distributed with this work for additional information
  5. # regarding copyright ownership. The ASF licenses this file
  6. # to you under the Apache License, Version 2.0 (the
  7. # "License"); you may not use this file except in compliance
  8. # with the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. #
  18. # Find Linux FUSE
  19. IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
  20. find_package(PkgConfig REQUIRED)
  21. pkg_check_modules(FUSE fuse)
  22. IF(FUSE_FOUND)
  23. FLATTEN_LIST("${FUSE_CFLAGS}" " " FUSE_CFLAGS)
  24. FLATTEN_LIST("${FUSE_LDFLAGS}" " " FUSE_LDFLAGS)
  25. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FUSE_CFLAGS}")
  26. set(CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} ${FUSE_LDFLAGS}")
  27. MESSAGE(STATUS "Building Linux FUSE client.")
  28. include_directories(${FUSE_INCLUDE_DIRS})
  29. ELSE(FUSE_FOUND)
  30. MESSAGE(STATUS "Failed to find Linux FUSE libraries or include files. Will not build FUSE client.")
  31. ENDIF(FUSE_FOUND)
  32. ELSE (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
  33. MESSAGE(STATUS "Non-Linux system detected. Will not build FUSE client.")
  34. ENDIF (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
  35. IF(FUSE_FOUND)
  36. add_executable(fuse_dfs
  37. fuse_dfs.c
  38. fuse_options.c
  39. fuse_connect.c
  40. fuse_impls_access.c
  41. fuse_impls_chmod.c
  42. fuse_impls_chown.c
  43. fuse_impls_create.c
  44. fuse_impls_flush.c
  45. fuse_impls_getattr.c
  46. fuse_impls_mkdir.c
  47. fuse_impls_mknod.c
  48. fuse_impls_open.c
  49. fuse_impls_read.c
  50. fuse_impls_readdir.c
  51. fuse_impls_release.c
  52. fuse_impls_rename.c
  53. fuse_impls_rmdir.c
  54. fuse_impls_statfs.c
  55. fuse_impls_symlink.c
  56. fuse_impls_truncate.c
  57. fuse_impls_unlink.c
  58. fuse_impls_utimens.c
  59. fuse_impls_write.c
  60. fuse_init.c
  61. fuse_stat_struct.c
  62. fuse_trash.c
  63. fuse_users.c
  64. )
  65. target_link_libraries(fuse_dfs
  66. ${FUSE_LIBRARIES}
  67. ${JAVA_JVM_LIBRARY}
  68. hdfs
  69. m
  70. )
  71. ENDIF(FUSE_FOUND)