CMakeLists.txt 2.74 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
############################################################################
# CMakeLists.txt
# Copyright (C) 2014  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
19
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 21 22 23 24 25 26 27 28 29 30 31
#
############################################################################

set(LINPHONEC_SOURCE_FILES
	linphonec.c
	linphonec.h
	commands.c
)
set(LINPHONECSH_SOURCE_FILES
	shell.c
)

32
bc_apply_compile_flags(LINPHONEC_SOURCE_FILES STRICT_OPTIONS_CPP STRICT_OPTIONS_C)
33 34 35 36 37 38
if(MSVC)
	get_source_file_property(COMMANDS_C_COMPILE_FLAGS commands.c COMPILE_FLAGS)
	set(COMMANDS_C_COMPILE_FLAGS "${COMMANDS_C_COMPILE_FLAGS} /wd4996") # Disable "was declared deprecated" warnings
	set_source_files_properties(commands.c PROPERTY COMPILE_FLAGS "${COMMANDS_C_COMPILE_FLAGS}")
endif()

39
add_executable(linphonec ${LINPHONEC_SOURCE_FILES})
40
target_link_libraries(linphonec ${LINPHONE_LIBS_FOR_TOOLS} ${BCTOOLBOX_CORE_LIBRARIES} ${ORTP_LIBRARIES} ${MEDIASTREAMER2_LIBRARIES} ${XSD_LIBRARIES})
jehan's avatar
jehan committed
41 42
set_target_properties(linphonec PROPERTIES LINK_FLAGS "${LINPHONE_LDFLAGS}")

43 44 45
if(INTL_FOUND)
	target_link_libraries(linphonec ${INTL_LIBRARIES})
endif()
46 47 48

if(WIN32)
	add_executable(linphoned WIN32 ${LINPHONEC_SOURCE_FILES})
49
	target_link_libraries(linphoned ${LINPHONE_LIBS_FOR_TOOLS} ${BCTOOLBOX_CORE_LIBRARIES} ${ORTP_LIBRARIES} ${MEDIASTREAMER2_LIBRARIES} ${XSD_LIBRARIES})
50 51 52
	if(INTL_FOUND)
		target_link_libraries(linphoned ${INTL_LIBRARIES})
	endif()
53 54 55
endif()

add_executable(linphonecsh ${LINPHONECSH_SOURCE_FILES})
56
target_link_libraries(linphonecsh ${LINPHONE_LIBS_FOR_TOOLS} ${BCTOOLBOX_CORE_LIBRARIES} ${ORTP_LIBRARIES})
jehan's avatar
jehan committed
57
set_target_properties(linphonecsh PROPERTIES LINK_FLAGS "${LINPHONE_LDFLAGS}")
58 59 60 61 62 63 64

set(INSTALL_TARGETS linphonec linphonecsh)
if(WIN32)
	list(APPEND INSTALL_TARGETS linphoned)
endif()

install(TARGETS ${INSTALL_TARGETS}
65 66 67
	RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
	LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
	ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
68 69
	PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)