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.

89 lines
3.2 KiB

cmake_minimum_required (VERSION 2.6)
#include_directories("${PROJECT_SOURCE_DIR}/include")
#include_directories("${PROJECT_SOURCE_DIR}/lib/")
#include_directories("${PROJECT_SOURCE_DIR}/")
include_directories("include")
include_directories("lib/")
include (CheckSymbolExists)
include (CheckFunctionExists)
find_package(Doxygen)
option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" ${DOXYGEN_FOUND})
if(BUILD_DOCUMENTATION)
if(NOT DOXYGEN_FOUND)
message(FATAL_ERROR "Doxygen is needed to build the documentation.")
endif()
#doxygen_add_docs(targetName
#${CMAKE_CURRENT_SOURCE_DIR}
#)
message("Doxygen build started.")
add_custom_target(
doc ALL
#COMMAND $<$<CONFIG:Release>:${DOXYGEN_EXECUTABLE} ${doxyfile_in}>
COMMAND $<$<CONFIG:Release>:${DOXYGEN_EXECUTABLE}>
#WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doc
COMMENT "Generating API documentation with Doxygen"
VERBATIM
)
# install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc)
endif()
find_package(Boost 1.47 COMPONENTS filesystem REQUIRED)
message(status "** Boost Include: ${Boost_INCLUDE_DIR}")
message(status "** Boost Libraries: ${Boost_LIBRARY_DIRS}")
message(status "** Boost Libraries: ${Boost_LIBRARIES}")
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
find_package(OpenSSL REQUIRED)
message("OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}")
message("OpenSSL libraries: ${OPENSSL_LIBRARIES}")
include_directories(${OPENSSL_INCLUDE_DIR})
link_directories(${OPENSSL_LIBRARIES})
#find_package(Poco COMPONENTS net)
#message("POCO include dir: ${POCO_INCLUDE_DIR}")
#message("POCO libraries: ${POCO_LIBRARIES}")
#include_directories(${POCO_INCLUDE_DIR})
#link_directories(${POCO_LIBRARIES})
file( GLOB libcbag_SOURCES_LIB
"lib/*.cpp"
)
file( GLOB libcbag_HEADERS "include/*.hpp" )
find_package(CURL REQUIRED)
message("Curl include dir: ${CURL_INCLUDE_DIR}")
message("Curl libraries: ${CURL_LIBRARIES}")
include_directories(${CURL_INCLUDE_DIR})
link_directories(${CURL_LIBRARIES})
#file( GLOB libcbag_SOURCES_LIB
# "${PROJECT_SOURCE_DIR}/lib/*.cpp"
# )
add_library(cbag ${libcbag_SOURCES_LIB} )
target_include_directories(cbag PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
set_target_properties(cbag PROPERTIES PUBLIC_HEADER ${libcbag_HEADERS})
#add_executable(test_payload ${PROJECT_SOURCE_DIR}/examples/test_payload.cpp ${libcbag_SOURCES_lib})
add_executable(test_payload examples/test_payload.cpp ${libcbag_SOURCES_lib})
TARGET_LINK_LIBRARIES(test_payload ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${CURL_LIBRARIES} cbag)
#add_executable(test_bag ${PROJECT_SOURCE_DIR}/examples/test_bag.cpp ${libcbag_SOURCES_lib})
add_executable(validate_a_bag examples/validate_a_bag.cpp ${libcbag_SOURCES_lib})
#TARGET_LINK_LIBRARIES(test_bag ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${POCO_NET_LIBRARIES} cbag)
TARGET_LINK_LIBRARIES(validate_a_bag ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${CURL_LIBRARIES} cbag)
add_executable(create_a_bag examples/create_a_bag.cpp ${libcbag_SOURCES_lib})
#TARGET_LINK_LIBRARIES(test_bag ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${POCO_NET_LIBRARIES} cbag)
TARGET_LINK_LIBRARIES(create_a_bag ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${CURL_LIBRARIES} cbag)