| 1 | project(verona) |
|---|
| 2 | |
|---|
| 3 | cmake_minimum_required(VERSION 2.6) |
|---|
| 4 | |
|---|
| 5 | set(VERONA_VERSION_MAJOR 0) |
|---|
| 6 | set(VERONA_VERSION_MINOR 1) |
|---|
| 7 | set(VERONA_VERSION_MICRO 0) |
|---|
| 8 | set(VERONA_VERSION_STRING "0.1.0") |
|---|
| 9 | |
|---|
| 10 | set(CMAKE_MODULE_PATH |
|---|
| 11 | ${CMAKE_CURRENT_SOURCE_DIR} |
|---|
| 12 | ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules |
|---|
| 13 | ) |
|---|
| 14 | |
|---|
| 15 | include(DefineCompilerFlags) |
|---|
| 16 | #include(CPackConfig) |
|---|
| 17 | include(Macros) |
|---|
| 18 | include(FindMercurial) |
|---|
| 19 | include(CheckLibraryExists) |
|---|
| 20 | |
|---|
| 21 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) |
|---|
| 22 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/archive) |
|---|
| 23 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) |
|---|
| 24 | |
|---|
| 25 | message("Building for ${CMAKE_SYSTEM_NAME}") |
|---|
| 26 | if (CMAKE_SYSTEM_NAME MATCHES Linux) |
|---|
| 27 | set(LINUX True) |
|---|
| 28 | endif(CMAKE_SYSTEM_NAME MATCHES Linux) |
|---|
| 29 | |
|---|
| 30 | include(DefineVeronaOptions.cmake) |
|---|
| 31 | |
|---|
| 32 | if(CMAKE_UNDER_CE) |
|---|
| 33 | subdirs(wcecompat) |
|---|
| 34 | endif(CMAKE_UNDER_CE) |
|---|
| 35 | |
|---|
| 36 | if(WIN32) |
|---|
| 37 | subdirs(phapi/msdirent) |
|---|
| 38 | endif(WIN32) |
|---|
| 39 | if(NOT WIN32) |
|---|
| 40 | set(CMAKE_DEBUG_POSTFIX g) |
|---|
| 41 | endif(NOT WIN32) |
|---|
| 42 | |
|---|
| 43 | if(USE_PHTEST OR USE_CSL) |
|---|
| 44 | subdirs(libs/miniini) |
|---|
| 45 | endif(USE_PHTEST OR USE_CSL) |
|---|
| 46 | |
|---|
| 47 | if(USE_CSL) |
|---|
| 48 | if(CMAKE_UNDER_CE) |
|---|
| 49 | subdirs(openssl) |
|---|
| 50 | endif(CMAKE_UNDER_CE) |
|---|
| 51 | add_definitions(-D_FORTIFY_SOURCE=2) |
|---|
| 52 | |
|---|
| 53 | if(WIN32) |
|---|
| 54 | add_definitions(-DISL_DLLENTRY=__declspec\(dllimport\)) |
|---|
| 55 | else(WIN32) |
|---|
| 56 | add_definitions(-DISL_DLLENTRY=) |
|---|
| 57 | find_library(SRTP_SHARED_LIB libsrtp.so) |
|---|
| 58 | if (SRTP_SHARED_LIB) |
|---|
| 59 | CHECK_LIBRARY_EXISTS(libsrtp.so srtp_shutdown "" HAVE_SRTP_SHUTDOWN) |
|---|
| 60 | endif (SRTP_SHARED_LIB) |
|---|
| 61 | endif(WIN32) |
|---|
| 62 | |
|---|
| 63 | if(NOT DUMMYCSL AND (ANDROID OR IOS OR CMAKE_UNDER_CE OR NOT |
|---|
| 64 | SRTP_SHARED_LIB OR NOT HAVE_SRTP_SHUTDOWN)) |
|---|
| 65 | subdirs(libs/srtp) |
|---|
| 66 | endif() |
|---|
| 67 | |
|---|
| 68 | if(DUMMYCSL) |
|---|
| 69 | subdirs(libs/hlibpp) |
|---|
| 70 | endif() |
|---|
| 71 | |
|---|
| 72 | subdirs(csl) |
|---|
| 73 | ENDIF(USE_CSL) |
|---|
| 74 | |
|---|
| 75 | if (ANDROID) |
|---|
| 76 | subdirs(libs/cpufeatures) |
|---|
| 77 | endif() |
|---|
| 78 | |
|---|
| 79 | subdirs(libs/codecs/gsm libs/codecs/speex libosip2 libeXosip2 oRTP mediastreamer2 phapi) |
|---|
| 80 | |
|---|
| 81 | if(USE_TESTPHCPP OR USE_SWIG) |
|---|
| 82 | subdirs(phcpp) |
|---|
| 83 | endif(USE_TESTPHCPP OR USE_SWIG) |
|---|
| 84 | |
|---|
| 85 | if(USE_PHTEST) |
|---|
| 86 | subdirs(phtest) |
|---|
| 87 | endif(USE_PHTEST) |
|---|
| 88 | |
|---|
| 89 | if(USE_SWIG AND NOT IOS) |
|---|
| 90 | subdirs(swig) |
|---|
| 91 | endif(USE_SWIG AND NOT IOS) |
|---|
| 92 | |
|---|
| 93 | |
|---|
| 94 | if(CMAKE_UNDER_CE) |
|---|
| 95 | subdirs(csharp) |
|---|
| 96 | endif(CMAKE_UNDER_CE) |
|---|