Compare commits

...

1 Commits

Author SHA1 Message Date
h5p9sl d451541b41 Use CMake 3.23 FILE_SET install rules 2022-04-12 19:14:10 -06:00
1 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.14)
cmake_minimum_required(VERSION 3.23)
set(CMAKE_C_STANDARD 99)
@ -10,20 +10,20 @@ project(hmac_sha256 LANGUAGES C CXX)
option(HMAC_SHA256_TESTS "Build unit tests" FALSE)
option(HMAC_SHA256_EXAMPLES "Build the examples" FALSE)
add_library(hmac_sha256 STATIC
add_library(hmac_sha256 STATIC)
target_sources(hmac_sha256
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/sha256.c
${CMAKE_CURRENT_SOURCE_DIR}/hmac_sha256.c
PUBLIC FILE_SET HEADERS FILES
${CMAKE_CURRENT_SOURCE_DIR}/sha256.h
${CMAKE_CURRENT_SOURCE_DIR}/hmac_sha256.h
)
target_include_directories(hmac_sha256 INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
install(TARGETS hmac_sha256
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/hmac_sha256.h
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
FILE_SET HEADERS DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
if (HMAC_SHA256_TESTS)