2022-04-26 02:22:27 +02:00
|
|
|
cmake_minimum_required(VERSION 3.5.1)
|
|
|
|
project(hash-library CXX)
|
|
|
|
|
|
|
|
set(HEADERS
|
|
|
|
crc32.h
|
|
|
|
hash.h
|
|
|
|
hmac.h
|
|
|
|
keccak.h
|
|
|
|
md5.h
|
|
|
|
sha1.h
|
|
|
|
sha256.h
|
|
|
|
sha3.h
|
|
|
|
)
|
|
|
|
|
|
|
|
set(SRCS
|
|
|
|
crc32.cpp
|
|
|
|
keccak.cpp
|
|
|
|
md5.cpp
|
|
|
|
sha1.cpp
|
|
|
|
sha256.cpp
|
|
|
|
sha3.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
add_library(hash-library ${SRCS})
|
|
|
|
|
2022-04-28 15:54:08 -07:00
|
|
|
target_include_directories(hash-library PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<INSTALL_INTERFACE:include/hash-library>)
|
2022-04-26 02:22:27 +02:00
|
|
|
|
|
|
|
if(NOT DISABLE_INSTALL_HEADERS)
|
2022-04-28 15:54:08 -07:00
|
|
|
install(FILES ${HEADERS} DESTINATION include/hash-library)
|
2022-04-26 02:22:27 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
install(
|
|
|
|
TARGETS hash-library
|
|
|
|
EXPORT unofficial-hash-library-targets
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
)
|
|
|
|
|
|
|
|
install(
|
|
|
|
EXPORT unofficial-hash-library-targets
|
|
|
|
FILE unofficial-hash-library-targets.cmake
|
|
|
|
NAMESPACE unofficial::
|
|
|
|
DESTINATION share/unofficial-hash-library
|
|
|
|
)
|
2022-08-01 23:33:12 +02:00
|
|
|
|
|
|
|
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/unofficial-hash-library-config.cmake" "include(\${CMAKE_CURRENT_LIST_DIR}/unofficial-hash-library-targets.cmake)\n")
|
|
|
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/unofficial-hash-library-config.cmake" DESTINATION share/unofficial-hash-library)
|