aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/hmac_sha256/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/3rdparty/hmac_sha256/CMakeLists.txt')
-rw-r--r--src/libs/3rdparty/hmac_sha256/CMakeLists.txt36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/libs/3rdparty/hmac_sha256/CMakeLists.txt b/src/libs/3rdparty/hmac_sha256/CMakeLists.txt
new file mode 100644
index 0000000..8a50340
--- /dev/null
+++ b/src/libs/3rdparty/hmac_sha256/CMakeLists.txt
@@ -0,0 +1,36 @@
+cmake_minimum_required(VERSION 3.5)
+
+set(CMAKE_C_STANDARD 99)
+
+# For "CMAKE_INSTALL_<dir>" standard installation directories
+include(GNUInstallDirs)
+
+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
+ ${CMAKE_CURRENT_SOURCE_DIR}/sha256.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/hmac_sha256.c
+)
+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}"
+)
+
+if (HMAC_SHA256_TESTS)
+ enable_testing()
+ add_subdirectory(tests)
+endif ()
+
+if (HMAC_SHA256_EXAMPLES)
+ add_subdirectory(examples)
+endif ()