29 lines
595 B
CMake
29 lines
595 B
CMake
cmake_minimum_required(VERSION 3.31)
|
|
|
|
project(program)
|
|
|
|
set(PROGRAM_TARGETS
|
|
hash_task
|
|
sha1_test
|
|
sha256_test
|
|
)
|
|
|
|
foreach(target_name IN LISTS PROGRAM_TARGETS)
|
|
add_executable(${target_name} ${target_name}.c)
|
|
endforeach()
|
|
|
|
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/malloc.c)
|
|
add_executable(malloc malloc.c)
|
|
endif()
|
|
|
|
target_link_libraries(hash_task PRIVATE console_shim sha g)
|
|
target_link_libraries(sha1_test PRIVATE sha)
|
|
target_link_libraries(sha256_test PRIVATE sha)
|
|
|
|
install(TARGETS ${PROGRAM_TARGETS} DESTINATION program)
|
|
|
|
if(TARGET malloc)
|
|
install(TARGETS malloc DESTINATION program)
|
|
endif()
|
|
|