CMakeLists.txt 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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_package(Boost 1.72 COMPONENTS program_options REQUIRED)
  19. # Default LIBHDFSPP_DIR to the default install location. You can override
  20. # it by add -DLIBHDFSPP_DIR=... to your cmake invocation
  21. set(LIBHDFSPP_DIR CACHE STRING ${CMAKE_INSTALL_PREFIX})
  22. include_directories( ${LIBHDFSPP_DIR}/include )
  23. link_directories( ${LIBHDFSPP_DIR}/lib )
  24. add_library(tools_common_obj OBJECT tools_common.cc)
  25. add_library(tools_common $<TARGET_OBJECTS:tools_common_obj>)
  26. add_subdirectory(internal)
  27. add_library(hdfs_tool_obj OBJECT hdfs-tool.cc)
  28. target_include_directories(hdfs_tool_obj PRIVATE ../tools)
  29. add_subdirectory(hdfs-cat)
  30. add_subdirectory(hdfs-chgrp)
  31. add_subdirectory(hdfs-chown)
  32. add_subdirectory(hdfs-chmod)
  33. add_subdirectory(hdfs-find)
  34. add_subdirectory(hdfs-mkdir)
  35. add_subdirectory(hdfs-rm)
  36. add_subdirectory(hdfs-ls)
  37. add_executable(hdfs_stat hdfs_stat.cc)
  38. target_link_libraries(hdfs_stat tools_common hdfspp_static)
  39. add_subdirectory(hdfs-count)
  40. add_subdirectory(hdfs-df)
  41. add_subdirectory(hdfs-du)
  42. add_subdirectory(hdfs-get)
  43. add_subdirectory(hdfs-copy-to-local)
  44. add_subdirectory(hdfs-move-to-local)
  45. add_subdirectory(hdfs-setrep)
  46. add_subdirectory(hdfs-allow-snapshot)
  47. add_subdirectory(hdfs-disallow-snapshot)
  48. add_subdirectory(hdfs-create-snapshot)
  49. add_subdirectory(hdfs-rename-snapshot)
  50. add_subdirectory(hdfs-delete-snapshot)
  51. add_executable(hdfs_tail hdfs_tail.cc)
  52. target_link_libraries(hdfs_tail tools_common hdfspp_static)