find_package(Boost COMPONENTS filesystem unit_test_framework REQUIRED)
message(status "** Boost Include: ${Boost_INCLUDE_DIRS}")
message(status "** Boost Libraries: ${Boost_LIBRARY_DIRS}")
message(status "** Boost Libraries: ${Boost_LIBRARIES}")
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
set (libcbag_dir ${PROJECT_SOURCE_DIR})
include_directories("${libcbag_dir}/src/include")
message(status "** libcbag Include: ${libcbag_dir}")
message(status "** libcbag Libraries: ${libcbag_BINARY_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})
add_definitions(-DBOOST_TEST_DYN_LINK)

#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})
#find_library(POCO PocoNet)
#find_path(POCO_NET_INCLUDE_DIR "Poco/URI.h")
#set(POCO_NET_INCLUDE_DIR "/usr/include")
#set(POCO_NET_LIBRARIES "libPocoNet.so")
#find_path(POCO_NET_LIBRARY "libPocoNet.so")
#message("POCO found: ${POCO_FOUND}")
#message("POCO include dir: ${POCO_INCLUDE_DIR}")
#message("POCO library: ${POCO_LIBRARY}")
#message("POCO libraries: ${POCO_LIBRARIES}")
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})

add_executable(TestBag testbag.cpp)
add_executable(TestPayload test_payload.cpp)
add_executable(TestPayloadManifest test_payloadmanifest.cpp)
add_executable(TestTagManifest test_tagmanifest.cpp)
add_executable(TestBagMetadata test_bagmetadata.cpp)
add_executable(TestFetchFile test_fetchfile.cpp)
target_link_libraries(TestBag             ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${CURL_LIBRARY} cbag)
target_link_libraries(TestPayload         ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} cbag)
target_link_libraries(TestPayloadManifest ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} cbag)
target_link_libraries(TestTagManifest     ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} cbag)
target_link_libraries(TestBagMetadata     ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} cbag)
#target_link_libraries(TestFetchFile       ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${POCO_NET_LIBRARY} cbag)
target_link_libraries(TestFetchFile       ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${CURL_LIBRARY} cbag)


