CMakeLists.txt 4.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
Ronan's avatar
Ronan committed
26
	c-wrapper/c-tools.h
27
	call/call.h
28 29
	chat/chat-room-p.h
	chat/chat-room.h
30 31 32 33 34 35 36 37 38 39 40 41
	conference/conference.h
	conference/conference-listener.h
	conference/conference-p.h
	conference/local-conference.h
	conference/params/call-session-params.h
	conference/params/call-session-params-p.h
	conference/params/media-session-params.h
	conference/participant.h
	conference/remote-conference.h
	conference/session/call-session.h
	conference/session/call-session-p.h
	conference/session/media-session.h
Ronan's avatar
Ronan committed
42
	content/content.h
Ronan's avatar
Ronan committed
43
	core/core.h
44 45
	chat/imdn.h
	chat/is-composing.h
46 47 48 49 50 51 52 53
	cpim/cpim.h
	cpim/header/cpim-core-headers.h
	cpim/header/cpim-generic-header.h
	cpim/header/cpim-header-p.h
	cpim/header/cpim-header.h
	cpim/message/cpim-message.h
	cpim/parser/cpim-grammar.h
	cpim/parser/cpim-parser.h
Ronan's avatar
Ronan committed
54 55 56
	db/abstract/abstract-db-p.h
	db/abstract/abstract-db.h
	db/events-db.h
57 58 59
	db/provider/db-session-p.h
	db/provider/db-session-provider.h
	db/provider/db-session.h
Ronan's avatar
Ronan committed
60
	enums.h
Ronan's avatar
Ronan committed
61 62 63 64 65 66 67
	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
68
	logger/logger.h
69
	message/message.h
Ghislain MARY's avatar
Ghislain MARY committed
70
	object/clonable-object-p.h
Ronan's avatar
Ronan committed
71
	object/clonable-object.h
72
	object/object-p.h
Ronan's avatar
Ronan committed
73
	object/object.h
74
	object/singleton.h
Ghislain MARY's avatar
Ghislain MARY committed
75
	utils/content-type.h
76 77 78
)

set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
Ronan's avatar
Ronan committed
79
	address/address.cpp
80
	c-wrapper/api/c-address.cpp
Ronan's avatar
Ronan committed
81
	c-wrapper/api/c-event-log.cpp
82
	call/call.cpp
83
	chat/chat-room.cpp
Ronan's avatar
Ronan committed
84
	content/content.cpp
Ronan's avatar
Ronan committed
85
	core/core.cpp
86 87
	chat/imdn.cpp
	chat/is-composing.cpp
88 89 90 91 92 93 94 95
	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
96 97 98 99 100 101
	cpim/header/cpim-core-headers.cpp
	cpim/header/cpim-generic-header.cpp
	cpim/header/cpim-header.cpp
	cpim/message/cpim-message.cpp
	cpim/parser/cpim-grammar.cpp
	cpim/parser/cpim-parser.cpp
Ronan's avatar
Ronan committed
102 103
	db/abstract/abstract-db.cpp
	db/events-db.cpp
104 105
	db/provider/db-session-provider.cpp
	db/provider/db-session.cpp
Ronan's avatar
Ronan committed
106 107 108 109 110
	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
111
	logger/logger.cpp
112
	message/message.cpp
Ghislain MARY's avatar
Ghislain MARY committed
113
	object/clonable-object.cpp
114
	object/object.cpp
Ghislain MARY's avatar
Ghislain MARY committed
115
	utils/content-type.cpp
116
	utils/general.cpp
117 118 119 120
	utils/utils.cpp
)

set(LINPHONE_CXX_OBJECTS_DEFINITIONS "-DLIBLINPHONE_EXPORTS")
121 122 123 124
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
125
	add_definitions(-DSOCI_ENABLED)
126
endif()
127 128 129 130 131 132 133 134 135 136 137 138

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})
139
	target_include_directories(linphone-cxx-objects-static SYSTEM PRIVATE ${LINPHONE_CXX_OBJECTS_INCLUDE_DIRS} ${LINPHONE_INCLUDE_DIRS})
140 141 142 143 144
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})
145
	target_include_directories(linphone-cxx-objects SYSTEM PRIVATE ${LINPHONE_CXX_OBJECTS_INCLUDE_DIRS} ${LINPHONE_INCLUDE_DIRS})
146 147
	target_compile_options(linphone-cxx-objects PRIVATE "-fPIC")
endif()