CMakeLists.txt 3.84 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
Ronan's avatar
Ronan committed
24
	content/content.h
Ronan's avatar
Ronan committed
25
	core/core.h
26 27 28 29 30 31 32 33
	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
34 35 36
	db/abstract/abstract-db-p.h
	db/abstract/abstract-db.h
	db/events-db.h
37 38 39
	db/provider/db-session-p.h
	db/provider/db-session-provider.h
	db/provider/db-session.h
40
	enums.h
Ronan's avatar
Ronan committed
41
	event/call-event.h
42
	event/conference-event-p.h
Ronan's avatar
Ronan committed
43
	event/conference-event.h
44
	event/conference-participant-event.h
Ronan's avatar
Ronan committed
45 46
	event/event.h
	event/message-event.h
Ronan's avatar
Ronan committed
47
	logger/logger.h
48
	message/message.h
Ghislain MARY's avatar
Ghislain MARY committed
49
	object/clonable-object-p.h
Ronan's avatar
Ronan committed
50
	object/clonable-object.h
51
	object/object-p.h
Ronan's avatar
Ronan committed
52
	object/object.h
53 54 55 56 57 58
	object/singleton.h
	utils/general.h
	utils/utils.h
)

set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
Ronan's avatar
Ronan committed
59
	content/content.cpp
Ronan's avatar
Ronan committed
60
	core/core.cpp
61 62 63 64 65 66
	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
67 68
	db/abstract/abstract-db.cpp
	db/events-db.cpp
69 70
	db/provider/db-session-provider.cpp
	db/provider/db-session.cpp
Ronan's avatar
Ronan committed
71
	event/call-event.cpp
Ronan's avatar
Ronan committed
72
	event/conference-event.cpp
73
	event/conference-participant-event.cpp
Ronan's avatar
Ronan committed
74 75
	event/event.cpp
	event/message-event.cpp
Ronan's avatar
Ronan committed
76
	logger/logger.cpp
77
	message/message.cpp
Ghislain MARY's avatar
Ghislain MARY committed
78
	object/clonable-object.cpp
79
	object/object.cpp
80
	utils/general.cpp
81 82 83 84
	utils/utils.cpp
)

set(LINPHONE_CXX_OBJECTS_DEFINITIONS "-DLIBLINPHONE_EXPORTS")
85 86 87 88
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
89
	add_definitions(-DSOCI_ENABLED)
90
endif()
91 92 93 94 95 96 97 98 99 100 101 102

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})
103
	target_include_directories(linphone-cxx-objects-static SYSTEM PRIVATE ${LINPHONE_CXX_OBJECTS_INCLUDE_DIRS} ${LINPHONE_INCLUDE_DIRS})
104 105 106 107 108
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})
109
	target_include_directories(linphone-cxx-objects SYSTEM PRIVATE ${LINPHONE_CXX_OBJECTS_INCLUDE_DIRS} ${LINPHONE_INCLUDE_DIRS})
110 111
	target_compile_options(linphone-cxx-objects PRIVATE "-fPIC")
endif()