cmake_minimum_required(VERSION 3.14)
project(PishroSms CXX)

set(CMAKE_CXX_STANDARD 17)

find_package(CURL REQUIRED)
find_package(nlohmann_json 3.11.0 REQUIRED)

add_library(pishro_sms SmsClient.cpp)
target_include_directories(pishro_sms PUBLIC .)
target_link_libraries(pishro_sms PUBLIC CURL::libcurl nlohmann_json::nlohmann_json)

function(add_example NAME)
    add_executable(${NAME} examples/${NAME}.cpp)
    target_link_libraries(${NAME} pishro_sms)
endfunction()

add_example(send)
add_example(multi_send)
add_example(status)
add_example(select)
add_example(outbox)
add_example(latest)
add_example(latest_outbox)
add_example(count_outbox)
add_example(count_inbox)
add_example(inbox)
add_example(inbox_paged)
add_example(receive)
add_example(status_by_number)
add_example(user_credit)
add_example(user_details)
add_example(user_register)
add_example(phonebook_list)
add_example(phonebook_numbers)
add_example(phonebook_create)
add_example(phonebook_delete)
add_example(phonebook_add)
add_example(phonebook_remove)
add_example(blocked_list)
add_example(blocked_add)
add_example(blocked_remove)
add_example(blocked_exists)