CMakeLists.txt 5.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
############################################################################
# CMakeLists.txt
# Copyright (C) 2017  Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
#
############################################################################

set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
24
	address/address-p.h
Ronan's avatar
Ronan committed
25
	address/address.h
26
	c-wrapper/c-private-types.h
Ronan's avatar
Ronan committed
27
	c-wrapper/c-tools.h
28 29
	call/call-listener.h
	call/call-p.h
30
	call/call.h
31
	chat/basic-chat-room-p.h
Ronan's avatar
Ronan committed
32
	chat/basic-chat-room.h
33
	chat/chat-message.h
34 35
	chat/chat-room-p.h
	chat/chat-room.h
36
	chat/client-group-chat-room-p.h
Ronan's avatar
Ronan committed
37
	chat/client-group-chat-room.h
Ronan's avatar
Ronan committed
38 39 40 41 42 43 44 45
	chat/cpim/cpim.h
	chat/cpim/header/cpim-core-headers.h
	chat/cpim/header/cpim-generic-header.h
	chat/cpim/header/cpim-header-p.h
	chat/cpim/header/cpim-header.h
	chat/cpim/message/cpim-message.h
	chat/cpim/parser/cpim-grammar.h
	chat/cpim/parser/cpim-parser.h
46 47
	chat/imdn.h
	chat/is-composing.h
48
	chat/real-time-text-chat-room-p.h
Ronan's avatar
Ronan committed
49
	chat/real-time-text-chat-room.h
50 51 52
	chat/modifier/chat-message-modifier.h
	chat/modifier/multipart-chat-message-modifier.h
	chat/modifier/cpim-chat-message-modifier.h
53 54
	conference/conference-listener.h
	conference/conference-p.h
55
	conference/conference.h
56 57
	conference/local-conference.h
	conference/params/call-session-params-p.h
58
	conference/params/call-session-params.h
59
	conference/params/media-session-params-p.h
60
	conference/params/media-session-params.h
61
	conference/participant-p.h
62
	conference/participant.h
63
	conference/remote-conference.h
64
	conference/session/call-session-listener.h
65
	conference/session/call-session-p.h
66
	conference/session/call-session.h
67
	conference/session/media-session.h
68
	conference/session/port-config.h
Ronan's avatar
Ronan committed
69 70
	content/content-type.h
	content/content.h
Ronan's avatar
Ronan committed
71
	content/content.h
Ronan's avatar
Ronan committed
72
	core/core.h
Ronan's avatar
Ronan committed
73 74 75
	db/abstract/abstract-db-p.h
	db/abstract/abstract-db.h
	db/events-db.h
76 77 78
	db/provider/db-session-p.h
	db/provider/db-session-provider.h
	db/provider/db-session.h
Ronan's avatar
Ronan committed
79
	enums.h
Ronan's avatar
Ronan committed
80 81 82 83 84 85 86
	event-log/call-event.h
	event-log/conference-event-p.h
	event-log/conference-event.h
	event-log/conference-participant-event.h
	event-log/event-log-p.h
	event-log/event-log.h
	event-log/message-event.h
Ronan's avatar
Ronan committed
87
	logger/logger.h
88 89
	nat/ice-agent.h
	nat/stun-client.h
Ghislain MARY's avatar
Ghislain MARY committed
90
	object/clonable-object-p.h
Ronan's avatar
Ronan committed
91
	object/clonable-object.h
92
	object/object-p.h
Ronan's avatar
Ronan committed
93
	object/object.h
94
	object/singleton.h
Ghislain MARY's avatar
Ghislain MARY committed
95
	utils/content-type.h
96
	utils/payload-type-handler.h
97 98 99
)

set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
Ronan's avatar
Ronan committed
100
	address/address.cpp
101
	c-wrapper/api/c-address.cpp
Ronan's avatar
Ronan committed
102
	c-wrapper/api/c-event-log.cpp
103
	call/call.cpp
104
	chat/basic-chat-room.cpp
105
	chat/chat-message.cpp
106
	chat/chat-room.cpp
107
	chat/client-group-chat-room.cpp
Ronan's avatar
Ronan committed
108 109 110 111 112 113
	chat/cpim/header/cpim-core-headers.cpp
	chat/cpim/header/cpim-generic-header.cpp
	chat/cpim/header/cpim-header.cpp
	chat/cpim/message/cpim-message.cpp
	chat/cpim/parser/cpim-grammar.cpp
	chat/cpim/parser/cpim-parser.cpp
114 115
	chat/imdn.cpp
	chat/is-composing.cpp
116
	chat/real-time-text-chat-room.cpp
117 118
	chat/modifier/multipart-chat-message-modifier.cpp
	chat/modifier/cpim-chat-message-modifier.cpp
119 120 121 122 123 124 125 126
	conference/conference.cpp
	conference/local-conference.cpp
	conference/params/call-session-params.cpp
	conference/params/media-session-params.cpp
	conference/participant.cpp
	conference/remote-conference.cpp
	conference/session/call-session.cpp
	conference/session/media-session.cpp
Ronan's avatar
Ronan committed
127 128
	content/content-type.cpp
	content/content.cpp
129 130
	content/content.cpp
	core/core.cpp
Ronan's avatar
Ronan committed
131 132
	db/abstract/abstract-db.cpp
	db/events-db.cpp
133 134
	db/provider/db-session-provider.cpp
	db/provider/db-session.cpp
Ronan's avatar
Ronan committed
135 136 137 138 139
	event-log/call-event.cpp
	event-log/conference-event.cpp
	event-log/conference-participant-event.cpp
	event-log/event-log.cpp
	event-log/message-event.cpp
Ronan's avatar
Ronan committed
140
	logger/logger.cpp
141 142
	nat/ice-agent.cpp
	nat/stun-client.cpp
Ghislain MARY's avatar
Ghislain MARY committed
143
	object/clonable-object.cpp
144
	object/object.cpp
Ghislain MARY's avatar
Ghislain MARY committed
145
	utils/content-type.cpp
146
	utils/general.cpp
147
	utils/payload-type-handler.cpp
148 149 150 151
	utils/utils.cpp
)

set(LINPHONE_CXX_OBJECTS_DEFINITIONS "-DLIBLINPHONE_EXPORTS")
152 153 154 155
set(LINPHONE_CXX_OBJECTS_INCLUDE_DIRS ${BELR_INCLUDE_DIRS})

if(SOCI_FOUND)
	list(APPEND LINPHONE_CXX_OBJECTS_INCLUDE_DIRS ${SOCI_INCLUDE_DIRS} ${SOCI_MYSQL_INCLUDES})
Ronan's avatar
Ronan committed
156
	add_definitions(-DSOCI_ENABLED)
157
endif()
158 159 160 161 162 163 164 165 166 167 168 169

set(LINPHONE_PRIVATE_HEADER_FILES)
foreach(header ${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES})
	list(APPEND LINPHONE_PRIVATE_HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${header}")
endforeach()
set(LINPHONE_PRIVATE_HEADER_FILES ${LINPHONE_PRIVATE_HEADER_FILES} PARENT_SCOPE)

bc_apply_compile_flags(LINPHONE_CXX_OBJECTS_SOURCE_FILES STRICT_OPTIONS_CPP STRICT_OPTIONS_CXX)

if(ENABLE_STATIC)
	add_library(linphone-cxx-objects-static OBJECT ${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES} ${LINPHONE_CXX_OBJECTS_SOURCE_FILES})
	target_compile_definitions(linphone-cxx-objects-static PRIVATE ${LINPHONE_CXX_OBJECTS_DEFINITIONS})
170
	target_include_directories(linphone-cxx-objects-static SYSTEM PRIVATE ${LINPHONE_CXX_OBJECTS_INCLUDE_DIRS} ${LINPHONE_INCLUDE_DIRS})
171 172 173 174 175
endif()

if(ENABLE_SHARED)
	add_library(linphone-cxx-objects OBJECT ${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES} ${LINPHONE_CXX_OBJECTS_SOURCE_FILES})
	target_compile_definitions(linphone-cxx-objects PRIVATE ${LINPHONE_CXX_OBJECTS_DEFINITIONS})
176
	target_include_directories(linphone-cxx-objects SYSTEM PRIVATE ${LINPHONE_CXX_OBJECTS_INCLUDE_DIRS} ${LINPHONE_INCLUDE_DIRS})
177 178
	target_compile_options(linphone-cxx-objects PRIVATE "-fPIC")
endif()