CMakeLists.txt 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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(CURL REQUIRED)
  19. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
  20. "${CMAKE_SOURCE_DIR}/contrib/libwebhdfs/resources/")
  21. find_package(Jansson REQUIRED)
  22. include_directories(${JANSSON_INCLUDE_DIR})
  23. add_dual_library(webhdfs
  24. src/hdfs_web.c
  25. src/hdfs_http_client.c
  26. src/hdfs_http_query.c
  27. src/hdfs_json_parser.c
  28. ../../main/native/libhdfs/exception.c
  29. ../../main/native/libhdfs/jni_helper.c
  30. )
  31. target_link_dual_libraries(webhdfs
  32. ${JAVA_JVM_LIBRARY}
  33. ${CURL_LIBRARY}
  34. ${JANSSON_LIBRARY}
  35. pthread
  36. )
  37. dual_output_directory(webhdfs target)
  38. set(LIBWEBHDFS_VERSION "0.0.0")
  39. set_target_properties(webhdfs PROPERTIES
  40. SOVERSION ${LIBWEBHDFS_VERSION})
  41. add_executable(test_libwebhdfs_ops
  42. src/test_libwebhdfs_ops.c
  43. )
  44. target_link_libraries(test_libwebhdfs_ops
  45. webhdfs
  46. native_mini_dfs
  47. )
  48. add_executable(test_libwebhdfs_read
  49. src/test_libwebhdfs_read.c
  50. )
  51. target_link_libraries(test_libwebhdfs_read
  52. webhdfs
  53. )
  54. add_executable(test_libwebhdfs_write
  55. src/test_libwebhdfs_write.c
  56. )
  57. target_link_libraries(test_libwebhdfs_write
  58. webhdfs
  59. )
  60. add_executable(test_libwebhdfs_threaded
  61. src/test_libwebhdfs_threaded.c
  62. )
  63. target_link_libraries(test_libwebhdfs_threaded
  64. webhdfs
  65. native_mini_dfs
  66. pthread
  67. )