CMakeLists.txt 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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)
  19. if (CURL_FOUND)
  20. include_directories(${CURL_INCLUDE_DIRS})
  21. else (CURL_FOUND)
  22. MESSAGE(STATUS "Failed to find CURL library.")
  23. endif (CURL_FOUND)
  24. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
  25. "${CMAKE_SOURCE_DIR}/contrib/libwebhdfs/resources/")
  26. MESSAGE("CMAKE_MODULE_PATH IS: " ${CMAKE_MODULE_PATH})
  27. find_package(Jansson)
  28. include_directories(${JANSSON_INCLUDE_DIR})
  29. add_dual_library(webhdfs
  30. src/exception.c
  31. src/hdfs_web.c
  32. src/hdfs_jni.c
  33. src/jni_helper.c
  34. src/hdfs_http_client.c
  35. src/hdfs_http_query.c
  36. src/hdfs_json_parser.c
  37. )
  38. target_link_dual_libraries(webhdfs
  39. ${JAVA_JVM_LIBRARY}
  40. ${CURL_LIBRARY}
  41. ${JANSSON_LIBRARY}
  42. pthread
  43. )
  44. dual_output_directory(webhdfs target)
  45. set(LIBWEBHDFS_VERSION "0.0.0")
  46. set_target_properties(webhdfs PROPERTIES
  47. SOVERSION ${LIBWEBHDFS_VERSION})
  48. add_executable(test_libwebhdfs_ops
  49. src/test_libwebhdfs_ops.c
  50. )
  51. target_link_libraries(test_libwebhdfs_ops
  52. webhdfs
  53. ${CURL_LIBRARY}
  54. ${JAVA_JVM_LIBRARY}
  55. ${JANSSON_LIBRARY}
  56. pthread
  57. )
  58. add_executable(test_libwebhdfs_read
  59. src/test_libwebhdfs_read.c
  60. )
  61. target_link_libraries(test_libwebhdfs_read
  62. webhdfs
  63. ${CURL_LIBRARY}
  64. ${JAVA_JVM_LIBRARY}
  65. ${JANSSON_LIBRARY}
  66. pthread
  67. )
  68. add_executable(test_libwebhdfs_write
  69. src/test_libwebhdfs_write.c
  70. )
  71. target_link_libraries(test_libwebhdfs_write
  72. webhdfs
  73. ${CURL_LIBRARY}
  74. ${JAVA_JVM_LIBRARY}
  75. ${JANSSON_LIBRARY}
  76. pthread
  77. )
  78. add_executable(test_libwebhdfs_threaded
  79. src/test_libwebhdfs_threaded.c
  80. )
  81. target_link_libraries(test_libwebhdfs_threaded
  82. webhdfs
  83. ${CURL_LIBRARY}
  84. ${JAVA_JVM_LIBRARY}
  85. ${JANSSON_LIBRARY}
  86. pthread
  87. )