find_package(cpprest REQUIRED)
find_package(Boost 1.54.0 REQUIRED COMPONENTS system filesystem atomic chrono random regex)
find_package(OpenSSL REQUIRED)

include_directories(${CPPREST_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
set(LIBS ${LIBS} ${CPPREST_LIBRARIES} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${CMAKE_DL_LIBS})

set(SOURCE_FILES client.cpp REST/client.cpp REST/REST.cpp)

include_directories(../include ./include)

if(DISCCORD_BUILD_STATIC)
    message("Building disccord as a static library")
    add_library(disccord STATIC ${SOURCE_FILES})
else()
    message("Building disccord as a shared library")
    add_library(disccord SHARED ${SOURCE_FILES})
    
    set_target_properties(disccord PROPERTIES POSITION_INDEPENDENT_CODE ON)
endif()

target_include_directories(disccord PUBLIC ../include)
target_link_libraries(disccord ${LIBS})

install(TARGETS disccord DESTINATION /usr/local/lib)
find_package(cpprest REQUIRED)
find_package(Boost 1.54.0 REQUIRED COMPONENTS system filesystem atomic chrono random regex)
find_package(OpenSSL REQUIRED)

include_directories(${CPPREST_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
set(LIBS ${LIBS} ${CPPREST_LIBRARIES} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${CMAKE_DL_LIBS})

set(SOURCE_FILES client.cpp REST/client.cpp REST/REST.cpp)

include_directories(../include ./include)

if(DISCCORD_BUILD_STATIC)
    message("Building disccord as a static library")
    add_library(disccord STATIC ${SOURCE_FILES})
else()
    message("Building disccord as a shared library")
    add_library(disccord SHARED ${SOURCE_FILES})
    
    set_target_properties(disccord PROPERTIES POSITION_INDEPENDENT_CODE ON)
endif()

target_include_directories(disccord PUBLIC ../include)
target_link_libraries(disccord ${LIBS})

install(TARGETS disccord DESTINATION /usr/local/lib)
install(DIRECTORY ../include DESTINATION /usr/local/include/disccord)
Install header files as well as library files
Install header files as well as library files
