Skip to content

Commit

Permalink
Add CMake build file
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Johan 't Hart committed Jun 13, 2019
1 parent b0f48a7 commit 23a3ce1
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ old?
*.app

# srtp things
build
Debug
Makefile
Root
Expand Down
89 changes: 89 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -313,6 +314,26 @@ brew install automake pkgconfig
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>
Expand Down

0 comments on commit 23a3ce1

Please sign in to comment.