source: verona/oRTP/CMakeLists.txt @ 227:7cf64dc0debb

Last change on this file since 227:7cf64dc0debb was 227:7cf64dc0debb, checked in by laurent@…, 2 years ago

add missing -DISL_DLLENTRY

File size: 3.2 KB
Line 
1project(ortp)
2
3cmake_minimum_required(VERSION 2.6)
4
5file(GLOB ORTP_SRC_ALL src/*.c)
6file(GLOB ORTP_SRC_WIN32 src/dll_entry.c)
7set(ORTP_SRC ${ORTP_SRC_ALL})
8
9if(NOT WIN32)
10  list(REMOVE_ITEM ORTP_SRC ${ORTP_SRC_WIN32})
11endif(NOT WIN32)
12
13if(CMAKE_UNDER_CE)
14  set(ORTP_SRC ${ORTP_SRC} build/wince/ortp.def)
15endif(CMAKE_UNDER_CE)
16
17if(WIN32 AND NOT CMAKE_UNDER_CE)
18  set(ORTP_SRC ${ORTP_SRC} build/win32native/ortp.def)
19endif(WIN32 AND NOT CMAKE_UNDER_CE)
20
21have_vars(dlfcn.h inttypes.h linux/soundcard.h memory.h
22   poll.h stdint.h strings.h string.h sys/audio.h stdlib.h fcntl.h sys/stat.h sys/uio.h unistd.h sys/time.h sys/types.h semaphore.h)
23
24if(ANDROID)
25  set(CMAKE_THREAD_LIBS_INIT "-lc")
26endif()
27include(FindThreads)
28include(FindOpenSSL)
29
30set(ORTP_MAJOR_VERSION __ZERO__)
31set(ORTP_MINOR_VERSION "16")
32set(ORTP_MICRO_VERSION __ZERO__)
33#set(ORTP_DEFAULT_THREAD_STACK_SIZE __ZERO__)
34set(ORTP_VERSION "0.${ORTP_MINOR_VERSION}.0")
35set(PACKAGE "ortp")
36set(PACKAGE_BUGREPORT "ortp")
37set(PACKAGE_NAME "ortp")
38set(PACKAGE_STRING "${PACKAGE} ${ORTP_VERSION}")
39set(POSIXTIMER_INTERVAL 10000)
40set(SO_REUSE_ADDR 1)
41set(VERSION ${ORTP_VERSION})
42
43if(ANDROID)
44  set(HAVE_DEV_RANDOM 1)
45endif(ANDROID)
46
47if(WIN32 AND NOT CMAKE_UNDER_CE)
48        set(CMAKE_REQUIRED_LIBRARIES WS2_32.Lib)
49        set(CMAKE_REQUIRED_FLAGS /FIwinsock2.h)
50endif(WIN32 AND NOT CMAKE_UNDER_CE)
51if(CMAKE_UNDER_CE)
52        set(CMAKE_REQUIRED_LIBRARIES WS2.Lib)
53        set(CMAKE_REQUIRED_FLAGS /FIwinsock2.h)
54endif(CMAKE_UNDER_CE)
55have_function(select socket)
56
57set(STDC_HEADERS true)
58
59configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ortp-config.h.cmake" "${CMAKE_CURRENT_BINARY_DIR}/ortp-config.h")
60add_definitions( -DHAVE_CONFIG_H )
61
62include_directories(include ${CMAKE_CURRENT_BINARY_DIR})
63
64add_library(ortp SHARED ${ORTP_SRC})
65
66
67set(ORTP_LINK_LIBRARIES)
68
69
70
71if(USE_CSL)
72  add_definitions( -DHAVE_CSL )
73  include_directories(${CSL_INCLUDE_DIRS} ${ACSLCORE_INCLUDE_DIRS})
74  set(ORTP_LINK_LIBRARIES ${ORTP_LINK_LIBRARIES} ${ACSLCORE_LIBRARIES})
75  if(WIN32)
76        add_definitions(-DISL_DLLENTRY=__declspec\(dllexport\))
77  else(WIN32)
78        add_definitions(-DISL_DLLENTRY=)
79  endif(WIN32)
80endif(USE_CSL)
81
82if(WIN32  AND NOT CMAKE_UNDER_CE)
83  set(ORTP_LINK_LIBRARIES ${ORTP_LINK_LIBRARIES} ws2_32 winmm)
84endif(WIN32  AND NOT CMAKE_UNDER_CE)
85if(CMAKE_UNDER_CE)
86  set(ORTP_LINK_LIBRARIES ${ORTP_LINK_LIBRARIES} ws2 mmTimer)
87endif(CMAKE_UNDER_CE)
88if(OPENSSL_FOUND)
89  set(ORTP_LINK_LIBRARIES ${ORTP_LINK_LIBRARIES} ssl crypto)
90endif(OPENSSL_FOUND)
91target_link_libraries(ortp ${ORTP_LINK_LIBRARIES})
92if(NOT ANDROID)
93  set_target_properties(ortp PROPERTIES VERSION ${ORTP_VERSION} SOVERSION ${ORTP_VERSION})
94endif()
95
96set(ORTP_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include" CACHE PATH "Include path for oRTP library")
97set(ORTP_LIB_DIR ${LIBRARY_OUTPUT_DIRECTORY} CACHE PATH "Output directory for oRTP library")
98set(ORTP_LIBRARIES ortp CACHE STRING "ortp libraries")
99#subdirs(src/tests)
100
101if (BUILD_ORTP_TEST)
102  file(GLOB ORTP_TEST_SRC  src/tests/*.c)
103  foreach(i ${ORTP_TEST_SRC})
104    string(REPLACE ".c" "" prog ${i})
105    string(REGEX REPLACE ".*/" "" prog ${prog})
106    message("Adding executable ${prog} ${i})")
107    add_executable(${prog} ${i})
108    target_link_libraries(${prog} ortp)
109  endforeach(i)
110endif (BUILD_ORTP_TEST)
111
112 
Note: See TracBrowser for help on using the repository browser.