CMakeLists.txt 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. set(CMAKE_SKIP_RPATH TRUE)
  19. # Flatten a list into a string.
  20. function(flatten_list INPUT SEPARATOR OUTPUT)
  21. string (REPLACE ";" "${SEPARATOR}" _TMPS "${INPUT}")
  22. set (${OUTPUT} "${_TMPS}" PARENT_SCOPE)
  23. endfunction()
  24. flatten_list("${FUSE_CFLAGS}" " " FUSE_CFLAGS)
  25. flatten_list("${FUSE_LDFLAGS}" " " FUSE_LDFLAGS)
  26. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FUSE_CFLAGS}")
  27. set(CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} ${FUSE_LDFLAGS}")
  28. message(STATUS "Building Linux FUSE client.")
  29. include_directories(
  30. ${CMAKE_CURRENT_SOURCE_DIR}
  31. ${CMAKE_BINARY_DIR}
  32. ${JNI_INCLUDE_DIRS}
  33. ${CMAKE_SOURCE_DIR}/main/native
  34. ${CMAKE_SOURCE_DIR}/main/native/libhdfs
  35. ${CMAKE_SOURCE_DIR}/main/native/libhdfs/include
  36. ${OS_DIR}
  37. ${FUSE_INCLUDE_DIRS})
  38. add_executable(fuse_dfs
  39. fuse_dfs.c
  40. fuse_options.c
  41. fuse_connect.c
  42. fuse_impls_access.c
  43. fuse_impls_chmod.c
  44. fuse_impls_chown.c
  45. fuse_impls_create.c
  46. fuse_impls_flush.c
  47. fuse_impls_getattr.c
  48. fuse_impls_mkdir.c
  49. fuse_impls_mknod.c
  50. fuse_impls_open.c
  51. fuse_impls_read.c
  52. fuse_impls_readdir.c
  53. fuse_impls_release.c
  54. fuse_impls_rename.c
  55. fuse_impls_rmdir.c
  56. fuse_impls_statfs.c
  57. fuse_impls_symlink.c
  58. fuse_impls_truncate.c
  59. fuse_impls_unlink.c
  60. fuse_impls_utimens.c
  61. fuse_impls_write.c
  62. fuse_init.c
  63. fuse_stat_struct.c
  64. fuse_trash.c
  65. fuse_users.c
  66. )
  67. target_link_libraries(fuse_dfs
  68. ${FUSE_LIBRARIES}
  69. ${JAVA_JVM_LIBRARY}
  70. hdfs
  71. m
  72. pthread
  73. rt
  74. )
  75. add_executable(test_fuse_dfs
  76. test/test_fuse_dfs.c
  77. test/fuse_workload.c
  78. util/posix_util.c
  79. )
  80. target_link_libraries(test_fuse_dfs
  81. ${FUSE_LIBRARIES}
  82. native_mini_dfs
  83. ${JAVA_JVM_LIBRARY}
  84. pthread
  85. )