option(BUILD_EXAMPLES "Create and install the HTML examples (requires Doxygen)" TRUE)

if(BUILD_EXAMPLES AND ${libhtmlpp_FOUND})
    include_directories(
        ${CMAKE_INCLUDE_DIRECTORIES}
        ${CMAKE_SOURCE_DIR}/src
        ${HTMLPP_INCLUDE_DIR}
    )
    if(WIN32)
        set(PLATFORM_LIBS ws2_32)
    else()
        set(PLATFORM_LIBS)
    endif()
    add_executable (httpcon httpcon.cpp)
    target_link_libraries(httpcon httppp-static htmlpp::htmlpp-static netplus::netplus-static cmdplus::cmdplus ${PLATFORM_LIBS})
    add_executable (httpform httpform.cpp)
    target_link_libraries(httpform httppp-static htmlpp::htmlpp-static netplus::netplus-static cmdplus::cmdplus ${PLATFORM_LIBS})
    add_executable (httpsysinfo httpsysinfo.cpp)
    target_link_libraries(httpsysinfo httppp-static htmlpp::htmlpp-static netplus::netplus-static cmdplus::cmdplus ${PLATFORM_LIBS})
    add_executable (httpcookie httpcookie.cpp)
    target_link_libraries(httpcookie httppp-static htmlpp::htmlpp-static netplus::netplus-static cmdplus::cmdplus ${PLATFORM_LIBS})
    add_executable (httpauth httpauth.cpp)
    target_link_libraries(httpauth httppp-static htmlpp::htmlpp-static netplus::netplus-static cmdplus::cmdplus ${PLATFORM_LIBS})
    add_executable (httpproxy httpproxy.cpp)
    target_link_libraries(httpproxy httppp-static htmlpp::htmlpp-static netplus::netplus-static cmdplus::cmdplus ${PLATFORM_LIBS})
    add_executable (httphello httphello.cpp)
    target_link_libraries(httphello httppp-static htmlpp::htmlpp-static netplus::netplus-static cmdplus::cmdplus ${PLATFORM_LIBS})
endif()

add_executable (httpclient httpclient.cpp)
if(WIN32)
    target_link_libraries(httpclient httppp-static netplus::netplus-static cmdplus::cmdplus ws2_32)
else()
    target_link_libraries(httpclient httppp-static netplus::netplus-static cmdplus::cmdplus)
endif()
