Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 1 | # Copyright (C) 2009 Werner Dittman |
| 2 | # |
| 3 | # This file is free software; as a special exception the author gives |
| 4 | # unlimited permission to copy and/or distribute it, with or without |
| 5 | # modifications, as long as this notice is preserved. |
| 6 | # |
| 7 | # This program is distributed in the hope that it will be useful, but |
| 8 | # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the |
| 9 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 10 | # |
| 11 | cmake_minimum_required(VERSION 2.6) |
| 12 | |
| 13 | PROJECT(libzrtpcpp) |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 14 | set (PACKAGE libzrtpcpp) |
| 15 | set (VERSION 3.0.0) |
| 16 | set (SOVERSION ${VERSION}) |
| 17 | STRING(REGEX REPLACE "[.].*$" "" SOVERSION ${SOVERSION}) |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 18 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 19 | SET(CPACK_PACKAGE_VERSION_MAJOR ${SOVERSION}) |
| 20 | SET(CPACK_PACKAGE_VERSION_MINOR ${VERSION}) |
| 21 | SET(CPACK_PACKAGE_VERSION_PATCH ${VERSION}) |
| 22 | STRING(REGEX REPLACE "[.][0-9]*$" "" CPACK_PACKAGE_VERSION_MINOR ${VERSION}) |
| 23 | STRING(REGEX REPLACE ".*[.]" "" CPACK_PACKAGE_VERSION_MINOR ${CPACK_PACKAGE_VERSION_MINOR}) |
| 24 | STRING(REGEX REPLACE ".*[.]" "" CPACK_PACKAGE_VERSION_PATCH ${VERSION}) |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 25 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 26 | include(cmake/Modules/AutoArgs.cmake) |
| 27 | include(cmake/Modules/FindGcryptConfig.cmake) |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 28 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 29 | # Define supported -Denable-* command line parameters. |
Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 30 | # |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 31 | # Example to build the tivi client: cmake -Denable-tivi=true .. |
Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 32 | # Without any options cmake generates libzrtpcpp for use with GNU ccRTP |
| 33 | # |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 34 | enable_arg(ccrtp false "Build library to use with GNU ccRTP.") |
| 35 | enable_arg(crypto_standalone false "Use embedded crypto and big number modules.") |
| 36 | enable_arg(tivi false "Build library for the tivi client, implies '-Denable-crypto_standalone=true'.") |
| 37 | enable_arg(sqlite false "Use SQLite DB as backend for ZRTP cache.") |
| 38 | args_help() |
Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 39 | |
| 40 | # **** Check what and how to build **** |
| 41 | # |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 42 | if (enable_ccrtp AND enable_tivi) |
Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 43 | MESSAGE(FATAL_ERROR "Cannot build more than one client at once. Use different build directories.") |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 44 | endif() |
| 45 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 46 | if (enable_ccrtp) |
| 47 | if (USES_CCRTP_INCLUDE_DIRS) |
| 48 | message(STATUS " Using local commoncpp dependency") |
| 49 | else() |
| 50 | find_package(PkgConfig) |
| 51 | pkg_check_modules(USES_CCRTP libccrtp>=2.0.0) |
| 52 | endif() |
| 53 | include_directories(${USES_CCRTP_INCLUDE_DIRS}) |
| 54 | link_directories(${USES_CRTP_LIBRARY_DIRS}) |
| 55 | add_definitions(${USES_CCRTP_CFLAGS}) |
| 56 | set (LIBS ${LIBS} ${USES_CCRTP_LDFLAGS} ${USES_CCRTP_LIBRARIES}) |
Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 57 | set (PACKAGE libzrtpcpp) |
| 58 | set(zrtplibName zrtpcpp) |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 59 | elseif (enable_tivi) |
Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 60 | set (PACKAGE libzrtptivi) |
| 61 | set(zrtplibName zrtptivi) |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 62 | set (enable_crypto_standalone true) |
Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 63 | else() |
| 64 | MESSAGE(WARNING "No client defined, building for GNU ccRTP.") |
| 65 | set (PACKAGE libzrtpcpp) |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 66 | set(enable_ccrtp true) |
Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 67 | set(zrtplibName zrtpcpp) |
| 68 | endif() |
| 69 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 70 | if (enable_crypto_standalone) |
| 71 | set(CRYPTO_STANDALONE TRUE) |
| 72 | endif() |
| 73 | |
| 74 | if(CMAKE_GENERATOR MATCHES "Unix Makefiles") |
| 75 | add_custom_target(cleandist |
| 76 | WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" |
| 77 | COMMAND rm -f "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}[-_]*.gz" |
| 78 | COMMAND rm -f "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}_*.dsc" |
| 79 | COMMAND rm -f "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}-*.rpm" |
| 80 | COMMAND rm -f "${CMAKE_CURRENT_BINARY_DIR}/*${PACKAGE}*[-_]*.deb" |
| 81 | COMMAND rm -f "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}-*.zip" |
| 82 | COMMAND rm -f "${CMAKE_CURRENT_BINARY_DIR}/*${PACKAGE}*.changes" |
| 83 | ) |
| 84 | |
| 85 | add_custom_target(dist |
| 86 | DEPENDS cleandist |
| 87 | WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" |
| 88 | COMMAND git archive --format tar --output="${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}-${VERSION}.tar" --prefix="${PACKAGE}-${VERSION}/" HEAD |
| 89 | COMMAND gzip "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}-${VERSION}.tar" |
| 90 | ) |
| 91 | endif() |
Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 92 | |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 93 | if(MSVC60) |
| 94 | set(BUILD_STATIC ON CACHE BOOL "static linking only" FORCE) |
| 95 | MARK_AS_ADVANCED(BUILD_STATIC) |
| 96 | else() |
| 97 | option(BUILD_STATIC "Set to OFF to build shared libraries" OFF) |
| 98 | endif() |
| 99 | |
| 100 | # set to true for debug and trace during CMakeLists development |
Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 101 | # set(CMAKE_VERBOSE_MAKEFILE TRUE) |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 102 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 103 | MESSAGE( STATUS "Configuring GNU ${PROJECT_NAME} ${VERSION} for ${PACKAGE}...") |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 104 | |
| 105 | # include most of the fine stuff we need |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 106 | include(FindPkgConfig) |
| 107 | include(CheckLibraryExists) |
| 108 | include(CheckIncludeFiles) |
Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 109 | include(CheckFunctionExists) |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 110 | |
| 111 | if (NOT LIB_SUFFIX) |
| 112 | set(LIBDIRNAME "lib") |
| 113 | # this caused problems in debian where it has to always be lib.... |
| 114 | if (NOT EXISTS /etc/debian_version) |
| 115 | if ( "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" ) |
| 116 | set(LIBDIRNAME "lib64") |
| 117 | endif() |
| 118 | endif() |
| 119 | else() |
| 120 | set(LIBDIRNAME "lib${LIB_SUFFIX}") |
| 121 | endif() |
| 122 | |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 123 | check_include_files(stdlib.h HAVE_STDLIB_H) |
| 124 | check_include_files(string.h HAVE_STRING_H) |
| 125 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 126 | if (NOT enable_crypto_standalone) |
Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 127 | pkg_check_modules(OPENSSL libcrypto>=0.9.8) |
| 128 | if (OPENSSL_FOUND) |
| 129 | set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${OPENSSL_INCLUDE_DIRS}) #update include files search directory |
| 130 | check_include_files(openssl/bn.h HAVE_OPENSSL_BN_H) |
| 131 | check_include_files(openssl/aes.h HAVE_OPENSSL_AES_H) |
| 132 | check_include_files(openssl/sha.h HAVE_OPENSSL_SHA_H) |
| 133 | check_library_exists(crypto EVP_CipherInit_ex "${OPENSSL_LIBDIR}" HAVE_SSL_CRYPT) #use search lib directory from pkg-config |
| 134 | set(LIBS ${LIBS} -lcrypto) |
| 135 | set(CRYPTOBACKEND "libcrypto >= 0.9.8") |
| 136 | set(BUILD_REQ "libopenssl-devel >= 0.9.8") |
| 137 | set(PACKAGE_REQ "libopenssl >= 0.9.8") |
| 138 | include_directories(${OPENSSL_INCLUDE_DIRS}) #update includes directory from pkg-config |
| 139 | else() |
| 140 | message(FATAL_ERROR "No crypto library found") |
| 141 | endif() |
| 142 | else() |
| 143 | # For crypto standalone mode we need to configure the bnlib. In a first step |
| 144 | # without the tests and demos. |
| 145 | check_include_files(stdint.h HAVE_STDINT_H) |
| 146 | check_include_files(stdint.h HAVE_ASSERT_H) |
| 147 | check_include_files(limits.h HAVE_LIMITS_H) |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 148 | |
Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 149 | check_function_exists(memmove HAVE_MEMMOVE) |
| 150 | check_function_exists(memcpy HAVE_MEMCPY) |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 151 | |
Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 152 | # TODO: check if we compile the tests for bnlib |
| 153 | # |
| 154 | # check_function_exists(clock_gettime HAVE_CLOCK_GETTIME) |
| 155 | # check_function_exists(getrusage HAVE_GETRUSAGE) |
| 156 | # check_function_exists(clock HAVE_CLOCK) |
| 157 | # check_function_exists(time HAVE_TIME) |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 158 | |
Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 159 | # Check if Solaris-style gethrvtime() is available |
| 160 | # check_function_exists(gethrvtime HAVE_GETHRVTIME) |
| 161 | # |
| 162 | # until here |
| 163 | |
| 164 | # necessary and required modules checked, ready to generate config.h |
| 165 | configure_file(${CMAKE_SOURCE_DIR}/bnlib/bnconfig.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/bnconfig.h) |
| 166 | endif() |
| 167 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 168 | if (enable_sqlite) |
Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 169 | pkg_check_modules(SQLITE3 sqlite3>=3.7) |
| 170 | if (SQLITE3_FOUND) |
| 171 | check_include_files(sqlite3.h HAVE_SQLITE_H) |
| 172 | set(LIBS ${LIBS} -lsqlite3) |
| 173 | else() |
| 174 | message(FATAL_ERROR "SQLite3 library not found") |
| 175 | endif() |
| 176 | endif() |
| 177 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 178 | # now get info about crypto libraries |
| 179 | gcr_check(GCRYPT gcrypt) |
| 180 | #if(GCRYPT_FOUND) |
| 181 | # check_include_files(gcrypt.h HAVE_GCRYPT_H) |
| 182 | # set(LIBS ${LIBS} ${GCRYPT_LIBRARIES}) |
| 183 | # set(BUILD_REQ "libgcrypt-devel") |
| 184 | # set(CRYPTOBACKEND="") |
| 185 | # set(PACKAGE_REQ "libgcrypt") |
| 186 | #else() |
| 187 | pkg_check_modules(OPENSSL libcrypto>=0.9.8) |
| 188 | if (OPENSSL_FOUND) |
| 189 | set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${OPENSSL_INCLUDE_DIRS}) #update include files search directory |
| 190 | check_include_files(openssl/bn.h HAVE_OPENSSL_BN_H) |
| 191 | check_include_files(openssl/aes.h HAVE_OPENSSL_AES_H) |
| 192 | check_include_files(openssl/sha.h HAVE_OPENSSL_SHA_H) |
| 193 | check_library_exists(crypto EVP_CipherInit_ex "${OPENSSL_LIBDIR}" HAVE_SSL_CRYPT) #use search lib directory from pkg-config |
| 194 | set(LIBS ${LIBS} -lcrypto) |
| 195 | set(CRYPTOBACKEND "libcrypto >= 0.9.8") |
| 196 | set(BUILD_REQ "libopenssl-devel >= 0.9.8") |
| 197 | set(PACKAGE_REQ "libopenssl >= 0.9.8") |
| 198 | include_directories(${OPENSSL_INCLUDE_DIRS}) #update includes directory from pkg-config |
| 199 | else() |
| 200 | message(FATAL_ERROR "No crypto library found") |
| 201 | endif() |
| 202 | #endif() |
| 203 | |
| 204 | check_include_files(stdlib.h HAVE_STDLIB_H) |
| 205 | check_include_files(string.h HAVE_STRING_H) |
| 206 | |
| 207 | # necessary and required modules checked, ready to generate config.h |
| 208 | configure_file(libzrtpcpp-config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/libzrtpcpp-config.h) |
| 209 | include_directories(${CMAKE_CURRENT_BINARY_DIR}) |
| 210 | |
| 211 | # the following set(...) commands are only to have backward |
| 212 | # compatibility with autoconf stuff to generate the pc file |
| 213 | set(prefix ${CMAKE_INSTALL_PREFIX}) |
| 214 | set(exec_prefix ${prefix}/bin) |
| 215 | set(libdir ${prefix}/${LIBDIRNAME}) |
| 216 | set(includedir ${prefix}/include) |
| 217 | set(PACKAGE pkgconfig) |
| 218 | configure_file(libzrtpcpp.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libzrtpcpp.pc @ONLY) |
| 219 | |
| 220 | configure_file(libzrtpcpp.spec.cmake ${CMAKE_CURRENT_BINARY_DIR}/libzrtpcpp.spec @ONLY) |
| 221 | |
| 222 | #to make sure includes are first taken from those directory |
| 223 | include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src) |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 224 | |
| 225 | add_definitions(-g -O2 -fno-strict-aliasing) |
| 226 | if(CMAKE_COMPILER_IS_GNUCXX) |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 227 | add_definitions(-Wno-long-long -Wno-char-subscripts) |
| 228 | add_definitions(-Wall -pedantic) |
| 229 | add_definitions(-DNEW_STDCPP) |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 230 | endif() |
| 231 | |
Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 232 | include_directories(BEFORE ${CMAKE_BINARY_DIR}) |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 233 | include_directories (${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/zrtp) |
| 234 | if(enable_standalone) |
| 235 | include_directories (${CMAKE_CURRENT_SOURCE_DIR}/bnlib) |
Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 236 | endif() |
| 237 | |
| 238 | # **** The following source files a common for all clients **** |
| 239 | # |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 240 | if (NOT enable_ccrtp) |
| 241 | set (sdes_src ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZrtpSdesStream.cpp) |
Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 242 | endif() |
| 243 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 244 | set(zrtp_src_no_cache |
| 245 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZrtpCallbackWrapper.cpp |
| 246 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZRtp.cpp |
| 247 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZrtpCrc32.cpp |
| 248 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZrtpPacketCommit.cpp |
| 249 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZrtpPacketConf2Ack.cpp |
| 250 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZrtpPacketConfirm.cpp |
| 251 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZrtpPacketDHPart.cpp |
| 252 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZrtpPacketGoClear.cpp |
| 253 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZrtpPacketClearAck.cpp |
| 254 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZrtpPacketHelloAck.cpp |
| 255 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZrtpPacketHello.cpp |
| 256 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZrtpPacketError.cpp |
| 257 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZrtpPacketErrorAck.cpp |
| 258 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZrtpPacketPingAck.cpp |
| 259 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZrtpPacketPing.cpp |
| 260 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZrtpPacketSASrelay.cpp |
| 261 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZrtpPacketRelayAck.cpp |
| 262 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZrtpStateClass.cpp |
| 263 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZrtpTextData.cpp |
| 264 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZrtpConfigure.cpp |
| 265 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZrtpCWrapper.cpp |
| 266 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/Base32.cpp |
| 267 | ${CMAKE_CURRENT_SOURCE_DIR}/common/osSpecifics.c ${sdes_src}) |
| 268 | |
| 269 | set(bnlib_src |
| 270 | ${CMAKE_CURRENT_SOURCE_DIR}/bnlib/bn00.c |
| 271 | ${CMAKE_CURRENT_SOURCE_DIR}/bnlib/lbn00.c |
| 272 | ${CMAKE_CURRENT_SOURCE_DIR}/bnlib/bn.c |
| 273 | ${CMAKE_CURRENT_SOURCE_DIR}/bnlib/lbnmem.c |
| 274 | ${CMAKE_CURRENT_SOURCE_DIR}/bnlib/sieve.c |
| 275 | ${CMAKE_CURRENT_SOURCE_DIR}/bnlib/prime.c |
| 276 | ${CMAKE_CURRENT_SOURCE_DIR}/bnlib/bnprint.c |
| 277 | ${CMAKE_CURRENT_SOURCE_DIR}/bnlib/jacobi.c |
| 278 | ${CMAKE_CURRENT_SOURCE_DIR}/bnlib/germain.c |
| 279 | ${CMAKE_CURRENT_SOURCE_DIR}/bnlib/ec/ec.c |
| 280 | ${CMAKE_CURRENT_SOURCE_DIR}/bnlib/ec/ecdh.c |
| 281 | ${CMAKE_CURRENT_SOURCE_DIR}/bnlib/bnprint.c) |
| 282 | |
| 283 | set(zrtp_crypto_src |
| 284 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/crypto/zrtpDH.cpp |
| 285 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/crypto/hmac256.cpp |
| 286 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/crypto/sha256.cpp |
| 287 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/crypto/hmac384.cpp |
| 288 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/crypto/sha384.cpp |
| 289 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/crypto/aesCFB.cpp |
| 290 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/crypto/twoCFB.cpp |
| 291 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/crypto/sha2.c) |
| 292 | |
| 293 | if (NOT enable_sqlite) |
| 294 | set(zrtp_src ${zrtp_src_no_cache} |
| 295 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZIDCacheFile.cpp |
| 296 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZIDRecordFile.cpp) |
| 297 | else() |
| 298 | set(zrtp_src ${zrtp_src_no_cache} |
| 299 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZIDCacheDb.cpp |
| 300 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/ZIDRecordDb.cpp |
| 301 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/zrtpB64Encode.c |
| 302 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/zrtpB64Decode.c |
| 303 | ${CMAKE_CURRENT_SOURCE_DIR}/zrtp/zrtpCacheSqliteBackend.c) |
| 304 | endif() |
| 305 | |
| 306 | if (enable_ccrtp) |
Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 307 | add_subdirectory(clients/ccrtp) |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 308 | add_subdirectory(demo) |
| 309 | endif() |
| 310 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 311 | if (enable_tivi) |
Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 312 | add_subdirectory(clients/tivi) |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 313 | endif() |
| 314 | |
Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 315 | ##very usefull for macosx, specially when using gtkosx bundler |
| 316 | if(APPLE) |
| 317 | if (NOT CMAKE_INSTALL_NAME_DIR) |
| 318 | set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE STRING "CMAKE_INSTALL_NAME_DIR set for macosx" ) |
| 319 | endif (NOT CMAKE_INSTALL_NAME_DIR) |
| 320 | endif(APPLE) |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 321 | |
| 322 | |