aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan 't Hart <johan.thart@peterconnects.com>2019-06-13 10:18:49 +0200
committerJohan 't Hart <johan.thart@peterconnects.com>2019-06-13 15:24:43 +0200
commit23a3ce1b5b0391368df110610398f5489652652d (patch)
tree22f010c3332ba8afbcf8b1ad7773cb18f5472603
parentb0f48a71abdfc1cbfdc367d7c57c1107355a50a2 (diff)
downloadlibsrtp2-23a3ce1b5b0391368df110610398f5489652652d.tar.gz
Add CMake build file
This can potentially replace the visual studio build files. These can now be generated with e.g.: cmake . -G "Visual Studio 15" Or for 64 bit: cmake . -G "Visual Studio 15 2017 Win64" Also updated readme to reflect this.
-rw-r--r--.gitignore1
-rw-r--r--CMakeLists.txt89
-rw-r--r--README.md25
3 files changed, 113 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 4f578f9..c8b1235 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,6 +23,7 @@ old?
*.app
# srtp things
+build
Debug
Makefile
Root
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..e433b43
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,89 @@
+cmake_minimum_required (VERSION 2.8)
+
+project(srtp2)
+
+set(SOURCES_C
+ srtp/ekt.c
+ srtp/srtp.c
+)
+
+set(CIPHERS_SOURCES_C
+ crypto/cipher/aes.c
+ crypto/cipher/aes_icm.c
+ crypto/cipher/cipher.c
+ crypto/cipher/null_cipher.c
+)
+
+set(HASHES_SOURCES_C
+ crypto/hash/auth.c
+ crypto/hash/hmac.c
+ crypto/hash/null_auth.c
+ crypto/hash/sha1.c
+)
+
+set(KERNEL_SOURCES_C
+ crypto/kernel/alloc.c
+ crypto/kernel/crypto_kernel.c
+ crypto/kernel/err.c
+ crypto/kernel/key.c
+)
+
+set(MATH_SOURCES_C
+ crypto/math/datatypes.c
+ crypto/math/stat.c
+)
+
+set(REPLAY_SOURCES_C
+ crypto/replay/rdb.c
+ crypto/replay/rdbx.c
+ crypto/replay/ut_sim.c
+)
+
+set(SOURCES_H
+ crypto/include/aes.h
+ crypto/include/aes_icm.h
+ crypto/include/alloc.h
+ crypto/include/auth.h
+ crypto/include/cipher.h
+ crypto/include/cipher_types.h
+ crypto/include/config.h
+ crypto/include/crypto_kernel.h
+ crypto/include/crypto_types.h
+ crypto/include/datatypes.h
+ crypto/include/err.h
+ crypto/include/hmac.h
+ crypto/include/integers.h
+ crypto/include/key.h
+ crypto/include/null_auth.h
+ crypto/include/null_cipher.h
+ crypto/include/rdb.h
+ crypto/include/rdbx.h
+ crypto/include/sha1.h
+ crypto/include/stat.h
+ include/ekt.h
+ include/srtp.h
+ include/srtp_priv.h
+ include/ut_sim.h
+)
+
+source_group("src" FILES ${SOURCES_C})
+source_group("src\\Ciphers" FILES ${CIPHERS_SOURCES_C})
+source_group("src\\Hashes" FILES ${HASHES_SOURCES_C})
+source_group("src\\Kernel" FILES ${KERNEL_SOURCES_C})
+source_group("src\\Math" FILES ${MATH_SOURCES_C})
+source_group("src\\Replay" FILES ${REPLAY_SOURCES_C})
+source_group("include" FILES ${SOURCES_H})
+
+add_library(srtp2 STATIC
+ ${SOURCES_C}
+ ${CIPHERS_SOURCES_C}
+ ${HASHES_SOURCES_C}
+ ${KERNEL_SOURCES_C}
+ ${MATH_SOURCES_C}
+ ${REPLAY_SOURCES_C}
+ ${SOURCES_H}
+)
+
+target_include_directories(srtp2 PUBLIC crypto/include include)
+configure_file(config.hw ${CMAKE_CURRENT_SOURCE_DIR}/crypto/include/config.h COPYONLY)
+add_definitions(-D_LIB -DHAVE_CONFIG_H)
diff --git a/README.md b/README.md
index 3f1e5bb..b8732f1 100644
--- a/README.md
+++ b/README.md
@@ -31,7 +31,7 @@ because it does its work behind the scenes.
--------------------------------------------------------------------------------
-<a name="contact"></a>
+<a name="contact-us"></a>
# Contact Us
- [libsrtp@lists.packetizer.com](mailto:libsrtp@lists.packetizer.com) general mailing list for news / announcements / discussions. This is an open list, see
@@ -46,7 +46,7 @@ because it does its work behind the scenes.
## Contents
- [Introduction to libSRTP](#introduction-to-libsrtp)
- - [Contact Us](#contact)
+- [Contact Us](#contact-us)
- [Contents](#contents)
- [License and Disclaimer](#license-and-disclaimer)
- [libSRTP Overview](#libsrtp-overview)
@@ -55,6 +55,7 @@ because it does its work behind the scenes.
- [Implementation Notes](#implementation-notes)
- [Installing and Building libSRTP](#installing-and-building-libsrtp)
- [Changing Build Configuration](#changing-build-configuration)
+ - [Using Visual Studio](#using-visual-studio)
- [Applications](#applications)
- [Example Code](#example-code)
- [Credits](#credits)
@@ -314,6 +315,26 @@ autoremake -ivf
```
--------------------------------------------------------------------------------
+<a name="using-visual-studio"></a>
+## Using Visual Studio
+
+On Windows one can use Visual Studio via CMake. CMake can be downloaded here:
+https://cmake.org/ . To create Visual Studio build files, for example run the
+following commands:
+
+```
+# Create build subdirectory
+mkdir build
+cd build
+
+# Make project files
+cmake .. -G "Visual Studio 15 2017"
+
+# Or for 64 bit project files
+cmake .. -G "Visual Studio 15 2017 Win64"
+```
+
+--------------------------------------------------------------------------------
<a name="applications"></a>
# Applications