Commit 0df1b49e authored by Ghislain MARY's avatar Ghislain MARY

Build console UI when building with CMake.

parent ef7677a8
......@@ -216,6 +216,9 @@ endif()
add_subdirectory(coreapi)
add_subdirectory(share)
if(ENABLE_CONSOLE_UI)
add_subdirectory(console)
endif()
if(ENABLE_GTK_UI)
add_subdirectory(gtk)
add_subdirectory(pixmaps)
......
############################################################################
# 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
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
set(LINPHONEC_SOURCE_FILES
linphonec.c
linphonec.h
commands.c
)
set(LINPHONECSH_SOURCE_FILES
shell.c
)
add_executable(linphonec ${LINPHONEC_SOURCE_FILES})
target_link_libraries(linphonec linphone)
if(WIN32)
add_executable(linphoned WIN32 ${LINPHONEC_SOURCE_FILES})
target_link_libraries(linphoned linphone)
endif()
add_executable(linphonecsh ${LINPHONECSH_SOURCE_FILES})
target_link_libraries(linphonecsh linphone)
set(INSTALL_TARGETS linphonec linphonecsh)
if(WIN32)
list(APPEND INSTALL_TARGETS linphoned)
endif()
install(TARGETS ${INSTALL_TARGETS}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
......@@ -28,7 +28,6 @@
#include <stdlib.h>
#ifndef _WIN32_WCE
#include <errno.h>
#include <unistd.h>
#endif /*_WIN32_WCE*/
#include <limits.h>
#include <ctype.h>
......@@ -38,6 +37,7 @@
#ifndef WIN32
#include <sys/wait.h>
#include <unistd.h>
#endif
#define AUDIO 0
......
......@@ -25,9 +25,7 @@
****************************************************************************/
#include <string.h>
#ifndef _WIN32_WCE
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include "private.h" /*coreapi/private.h, needed for LINPHONE_VERSION */
......@@ -48,17 +46,19 @@
#endif /*_WIN32_WCE*/
#else
#include <sys/socket.h>
#include <sys/time.h>
#include <netdb.h>
#include <sys/un.h>
#include <sys/stat.h>
#include <unistd.h>
#endif
#if defined(_WIN32_WCE)
#if !defined(PATH_MAX)
#define PATH_MAX 256
#endif /*PATH_MAX*/
#if defined(_WIN32_WCE)
#if !defined(strdup)
#define strdup _strdup
#endif /*strdup*/
......@@ -661,6 +661,12 @@ main (int argc, char *argv[]) {
exit(EXIT_SUCCESS); /* should never reach here */
}
#ifdef _MSC_VER
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
return main(__argc, __argv);
}
#endif
/*
* Initialize linphonec
*/
......@@ -1214,15 +1220,21 @@ linphonec_parse_cmdline(int argc, char **argv)
else if (strncmp ("-c", argv[arg_num], 2) == 0)
{
if ( ++arg_num >= argc ) print_usage(EXIT_FAILURE);
#ifdef _MSC_VER
if (strcmp(argv[arg_num], "NUL") != 0) {
#endif
#if !defined(_WIN32_WCE)
if (access(argv[arg_num],F_OK)!=0 )
{
fprintf (stderr,
"Cannot open config file %s.\n",
argv[arg_num]);
exit(EXIT_FAILURE);
}
if (access(argv[arg_num], F_OK) != 0)
{
fprintf(stderr,
"Cannot open config file %s.\n",
argv[arg_num]);
exit(EXIT_FAILURE);
}
#endif /*_WIN32_WCE*/
#ifdef _MSC_VER
}
#endif
snprintf(configfile_name, PATH_MAX, "%s", argv[arg_num]);
}
else if (strncmp ("-b", argv[arg_num], 2) == 0)
......
......@@ -183,7 +183,7 @@ typedef enum _LinphoneReason LinphoneReason;
* Converts a LinphoneReason enum to a string.
* @ingroup misc
**/
const char *linphone_reason_to_string(LinphoneReason err);
LINPHONE_PUBLIC const char *linphone_reason_to_string(LinphoneReason err);
/**
* Object representing full details about a signaling error or status.
......@@ -1623,7 +1623,7 @@ typedef enum _LinphoneGlobalState{
LinphoneGlobalConfiguring
}LinphoneGlobalState;
const char *linphone_global_state_to_string(LinphoneGlobalState gs);
LINPHONE_PUBLIC const char *linphone_global_state_to_string(LinphoneGlobalState gs);
/**
* LinphoneCoreLogCollectionUploadState is used to notify if log collection upload have been succesfully delivered or not.
......@@ -2770,10 +2770,10 @@ LINPHONE_PUBLIC void linphone_core_enable_mic(LinphoneCore *lc, bool_t enable);
**/
LINPHONE_PUBLIC bool_t linphone_core_mic_enabled(LinphoneCore *lc);
bool_t linphone_core_is_rtp_muted(LinphoneCore *lc);
LINPHONE_PUBLIC bool_t linphone_core_is_rtp_muted(LinphoneCore *lc);
bool_t linphone_core_get_rtp_no_xmit_on_audio_mute(const LinphoneCore *lc);
void linphone_core_set_rtp_no_xmit_on_audio_mute(LinphoneCore *lc, bool_t val);
LINPHONE_PUBLIC bool_t linphone_core_get_rtp_no_xmit_on_audio_mute(const LinphoneCore *lc);
LINPHONE_PUBLIC void linphone_core_set_rtp_no_xmit_on_audio_mute(LinphoneCore *lc, bool_t val);
/*******************************************************************************
......@@ -3129,7 +3129,7 @@ LINPHONE_PUBLIC int linphone_core_get_calls_nb(const LinphoneCore *lc);
LINPHONE_PUBLIC const MSList *linphone_core_get_calls(LinphoneCore *lc);
LinphoneGlobalState linphone_core_get_global_state(const LinphoneCore *lc);
LINPHONE_PUBLIC LinphoneGlobalState linphone_core_get_global_state(const LinphoneCore *lc);
/**
* force registration refresh to be initiated upon next iterate
* @ingroup proxies
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment