C++ Library to handle BagIt structures. BagIt is a standard format to create transfer packages for digital preservation purposes. See https://en.wikipedia.org/wiki/BagIt for details http://andreas-romeyke.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
3.2 KiB

  1. cmake_minimum_required (VERSION 2.6)
  2. #include_directories("${PROJECT_SOURCE_DIR}/include")
  3. #include_directories("${PROJECT_SOURCE_DIR}/lib/")
  4. #include_directories("${PROJECT_SOURCE_DIR}/")
  5. include_directories("include")
  6. include_directories("lib/")
  7. include (CheckSymbolExists)
  8. include (CheckFunctionExists)
  9. find_package(Doxygen)
  10. option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" ${DOXYGEN_FOUND})
  11. if(BUILD_DOCUMENTATION)
  12. if(NOT DOXYGEN_FOUND)
  13. message(FATAL_ERROR "Doxygen is needed to build the documentation.")
  14. endif()
  15. #doxygen_add_docs(targetName
  16. #${CMAKE_CURRENT_SOURCE_DIR}
  17. #)
  18. message("Doxygen build started.")
  19. add_custom_target(
  20. doc ALL
  21. #COMMAND $<$<CONFIG:Release>:${DOXYGEN_EXECUTABLE} ${doxyfile_in}>
  22. COMMAND $<$<CONFIG:Release>:${DOXYGEN_EXECUTABLE}>
  23. #WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doc
  24. COMMENT "Generating API documentation with Doxygen"
  25. VERBATIM
  26. )
  27. # install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc)
  28. endif()
  29. find_package(Boost 1.47 COMPONENTS filesystem REQUIRED)
  30. message(status "** Boost Include: ${Boost_INCLUDE_DIR}")
  31. message(status "** Boost Libraries: ${Boost_LIBRARY_DIRS}")
  32. message(status "** Boost Libraries: ${Boost_LIBRARIES}")
  33. INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
  34. LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
  35. find_package(OpenSSL REQUIRED)
  36. message("OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}")
  37. message("OpenSSL libraries: ${OPENSSL_LIBRARIES}")
  38. include_directories(${OPENSSL_INCLUDE_DIR})
  39. link_directories(${OPENSSL_LIBRARIES})
  40. #find_package(Poco COMPONENTS net)
  41. #message("POCO include dir: ${POCO_INCLUDE_DIR}")
  42. #message("POCO libraries: ${POCO_LIBRARIES}")
  43. #include_directories(${POCO_INCLUDE_DIR})
  44. #link_directories(${POCO_LIBRARIES})
  45. file( GLOB libcbag_SOURCES_LIB
  46. "lib/*.cpp"
  47. )
  48. file( GLOB libcbag_HEADERS "include/*.hpp" )
  49. find_package(CURL REQUIRED)
  50. message("Curl include dir: ${CURL_INCLUDE_DIR}")
  51. message("Curl libraries: ${CURL_LIBRARIES}")
  52. include_directories(${CURL_INCLUDE_DIR})
  53. link_directories(${CURL_LIBRARIES})
  54. #file( GLOB libcbag_SOURCES_LIB
  55. # "${PROJECT_SOURCE_DIR}/lib/*.cpp"
  56. # )
  57. add_library(cbag ${libcbag_SOURCES_LIB} )
  58. target_include_directories(cbag PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
  59. set_target_properties(cbag PROPERTIES PUBLIC_HEADER ${libcbag_HEADERS})
  60. #add_executable(test_payload ${PROJECT_SOURCE_DIR}/examples/test_payload.cpp ${libcbag_SOURCES_lib})
  61. add_executable(test_payload examples/test_payload.cpp ${libcbag_SOURCES_lib})
  62. TARGET_LINK_LIBRARIES(test_payload ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${CURL_LIBRARIES} cbag)
  63. #add_executable(test_bag ${PROJECT_SOURCE_DIR}/examples/test_bag.cpp ${libcbag_SOURCES_lib})
  64. add_executable(validate_a_bag examples/validate_a_bag.cpp ${libcbag_SOURCES_lib})
  65. #TARGET_LINK_LIBRARIES(test_bag ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${POCO_NET_LIBRARIES} cbag)
  66. TARGET_LINK_LIBRARIES(validate_a_bag ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${CURL_LIBRARIES} cbag)
  67. add_executable(create_a_bag examples/create_a_bag.cpp ${libcbag_SOURCES_lib})
  68. #TARGET_LINK_LIBRARIES(test_bag ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${POCO_NET_LIBRARIES} cbag)
  69. TARGET_LINK_LIBRARIES(create_a_bag ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${CURL_LIBRARIES} cbag)