cmake_minimum_required(VERSION 3.20)
project(sha256_client_c LANGUAGES C)

if(NOT WIN32)
    message(FATAL_ERROR "This sample is intended for Win64 (DLL import).")
endif()

add_executable(sha256_client
    src/main.c
)

target_include_directories(sha256_client PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/include
)

target_link_libraries(sha256_client PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/dll/sha-256.lib
)

add_custom_command(TARGET sha256_client POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
            ${CMAKE_CURRENT_SOURCE_DIR}/dll/sha-256.dll
            $<TARGET_FILE_DIR:sha256_client>/sha-256.dll
)
