CMakeLists.txt 2.5 KB

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