mirror of
https://github.com/albfan/miraclecast.git
synced 2025-02-12 14:11:56 +00:00
parent
8b61f733da
commit
8484a126be
14 changed files with 131 additions and 21 deletions
|
@ -1,11 +1,37 @@
|
|||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake
|
||||
${CMAKE_MODULE_PATH})
|
||||
set(CMAKE_C_FLAGS "-std=gnu11")
|
||||
|
||||
add_definitions(-DBUILD_ENABLE_DEBUG)
|
||||
add_definitions(-DBUILD_BINDIR="$(bindir)")
|
||||
|
||||
#set(CMAKE_CPP_FLAGS "-include $(top_builddir)/config.h \
|
||||
#-I $(top_srcdir)/src \
|
||||
#-I $(top_srcdir)/src/shared \
|
||||
FILE(GLOB _ALL_FILES $(top_srcdir)/src $(top_srcdir)/src/shared)
|
||||
FOREACH(_FILE ${_ALL_FILES})
|
||||
IF(IS_DIRECTORY ${_FILE})
|
||||
INCLUDE_DIRECTORIES(${_FILE})
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
|
||||
|
||||
project(Miraclecast)
|
||||
set(CMAKE_C_FLAGS "-std=c99")
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(res)
|
||||
add_subdirectory(test)
|
||||
|
||||
OPTION( WITH_FOO "Enable FOO support" ON )
|
||||
OPTION( WITH_BAR "Enable BAR component" OFF )
|
||||
SET( BAZ 18 )
|
||||
SET(PACKAGE_NAME miraclecast)
|
||||
SET(PACKAGE_VERSION 1)
|
||||
SET(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
|
||||
CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
|
||||
########### install files ###############
|
||||
|
||||
|
|
29
cmake/FindReadline.cmake
Normal file
29
cmake/FindReadline.cmake
Normal file
|
@ -0,0 +1,29 @@
|
|||
# from http://websvn.kde.org/trunk/KDE/kdeedu/cmake/modules/FindReadline.cmake
|
||||
# http://websvn.kde.org/trunk/KDE/kdeedu/cmake/modules/COPYING-CMAKE-SCRIPTS
|
||||
# --> BSD licensed
|
||||
#
|
||||
# GNU Readline library finder
|
||||
if(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY)
|
||||
set(READLINE_FOUND TRUE)
|
||||
else(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY)
|
||||
FIND_PATH(READLINE_INCLUDE_DIR readline/readline.h
|
||||
/usr/include/readline
|
||||
)
|
||||
|
||||
# 2008-04-22 The next clause used to read like this:
|
||||
#
|
||||
# FIND_LIBRARY(READLINE_LIBRARY NAMES readline)
|
||||
# FIND_LIBRARY(NCURSES_LIBRARY NAMES ncurses )
|
||||
# include(FindPackageHandleStandardArgs)
|
||||
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG NCURSES_LIBRARY READLINE_INCLUDE_DIR READLINE_LIBRARY )
|
||||
#
|
||||
# I was advised to modify it such that it will find an ncurses library if
|
||||
# required, but not if one was explicitly given, that is, it allows the
|
||||
# default to be overridden. PH
|
||||
|
||||
FIND_LIBRARY(READLINE_LIBRARY NAMES readline)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG READLINE_INCLUDE_DIR READLINE_LIBRARY )
|
||||
|
||||
MARK_AS_ADVANCED(READLINE_INCLUDE_DIR READLINE_LIBRARY)
|
||||
endif(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY)
|
10
config.h.cmake
Normal file
10
config.h.cmake
Normal file
|
@ -0,0 +1,10 @@
|
|||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#cmakedefine WITH_FOO
|
||||
#cmakedefine WITH_BAR
|
||||
|
||||
#cmakedefine BAZ @BAZ@
|
||||
#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@"
|
||||
|
||||
#endif // CONFIG_H
|
|
@ -1,4 +1,5 @@
|
|||
./kill-wpa.sh
|
||||
|
||||
CONFIG_FILE=${1:-/run/network/wpa_supplicant_wlp3s0.conf}
|
||||
echo starting wpa_supplicant for normal connection
|
||||
sudo wpa_supplicant -B -P /run/wpa_supplicant_wlp3s0.pid -i wlp3s0 -D nl80211,wext -c/run/network/wpa_supplicant_wlp3s0.conf
|
||||
sudo wpa_supplicant -B -P /run/wpa_supplicant_wlp3s0.pid -i wlp3s0 -D nl80211,wext -c$CONFIG_FILE
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
set(CMAKE_C_FLAGS "-std=gnu11")
|
||||
add_definitions(-D__USE_GNU)
|
||||
add_definitions(-D_GNU_SOURCE)
|
||||
|
||||
add_subdirectory(shared)
|
||||
add_subdirectory(wifi)
|
||||
|
@ -8,21 +11,10 @@ add_subdirectory(ctl)
|
|||
########### next target ###############
|
||||
|
||||
set(miracled_SRCS miracled.h miracled.c)
|
||||
include_directories(shared)
|
||||
link_directories(shared)
|
||||
add_executable(miracled ${miracled_SRCS})
|
||||
target_link_libraries(miracled miracle-shared)
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules (GLIB2 REQUIRED glib-2.0)
|
||||
pkg_check_modules (UDEV REQUIRED glib-2.0)
|
||||
pkg_check_modules ( REQUIRED glib-2.0)
|
||||
if (GLIB2_FOUND)
|
||||
message("let's go $GLIB2_INCLUDE_DIRS $GLIB2_LIBRARIES")
|
||||
#include_directories(${BZIP_INCLUDE_DIRS})
|
||||
#target_link_libraries (miracled ${BZIP2_LIBRARIES})
|
||||
endif (GLIB2_FOUND)
|
||||
#target_link_libraries(miracled glib)
|
||||
install(TARGETS miracled DESTINATION bin)
|
||||
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/shared)
|
||||
|
||||
|
||||
########### install files ###############
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
|
||||
find_package(Readline)
|
||||
########### next target ###############
|
||||
|
||||
set(miracle-wifictl_SRCS ctl.h
|
||||
|
@ -8,25 +9,42 @@ set(miracle-wifictl_SRCS ctl.h
|
|||
|
||||
add_executable(miracle-wifictl ${miracle-wifictl_SRCS})
|
||||
|
||||
target_link_libraries(miracle-wifictl ${KDE4_KDECORE_LIBS})
|
||||
|
||||
install(TARGETS miracle-wifictl DESTINATION bin)
|
||||
|
||||
if(READLINE_FOUND)
|
||||
message(STATUS "Compiling with Readline support")
|
||||
set_property(TARGET miracle-wifictl
|
||||
APPEND
|
||||
PROPERTY COMPILE_DEFINITIONS HAVE_READLINE)
|
||||
target_link_libraries(miracle-wifictl ${READLINE_LIBRARY})
|
||||
endif(READLINE_FOUND)
|
||||
|
||||
target_link_libraries(miracle-wifictl miracle-shared)
|
||||
########### next target ###############
|
||||
|
||||
set(miracle-sinkctl_SRCS ctl.h
|
||||
ctl-cli.c
|
||||
ctl-sink.c
|
||||
ctl-wifi.c
|
||||
sinkctl.c)
|
||||
sinkctl.c
|
||||
wfd.c)
|
||||
|
||||
|
||||
add_executable(miracle-sinkctl ${miracle-sinkctl_SRCS})
|
||||
|
||||
target_link_libraries(miracle-sinkctl ${KDE4_KDECORE_LIBS})
|
||||
|
||||
install(TARGETS miracle-sinkctl DESTINATION bin)
|
||||
|
||||
if(READLINE_FOUND)
|
||||
message(STATUS "Compiling with Readline support")
|
||||
set_property(TARGET miracle-sinkctl
|
||||
APPEND
|
||||
PROPERTY COMPILE_DEFINITIONS HAVE_READLINE)
|
||||
target_link_libraries(miracle-sinkctl ${READLINE_LIBRARY})
|
||||
endif(READLINE_FOUND)
|
||||
|
||||
target_link_libraries(miracle-sinkctl miracle-shared)
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/shared)
|
||||
|
||||
########### install files ###############
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "wfd.h"
|
||||
#include "shl_macro.h"
|
||||
#include "shl_util.h"
|
||||
#include "config.h"
|
||||
|
||||
static sd_bus *bus;
|
||||
static struct ctl_wifi *wifi;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "ctl.h"
|
||||
#include "shl_macro.h"
|
||||
#include "shl_util.h"
|
||||
#include "config.h"
|
||||
|
||||
static sd_bus *bus;
|
||||
static struct ctl_wifi *wifi;
|
||||
|
|
|
@ -13,9 +13,20 @@ set(miracle-dhcp_SRCS dhcp.c
|
|||
|
||||
add_executable(miracle-dhcp ${miracle-dhcp_SRCS})
|
||||
|
||||
target_link_libraries(miracle-dhcp ${KDE4_KDECORE_LIBS})
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules (GLIB2 REQUIRED glib-2.0)
|
||||
pkg_check_modules (UDEV REQUIRED libudev)
|
||||
link_directories( ${UDEV_LIBRARY_DIRS})
|
||||
include_directories( ${UDEV_INCLUDE_DIRS})
|
||||
target_link_libraries(miracle-dhcp ${UDEV_LIBRARIES})
|
||||
link_directories( ${GLIB2_LIBRARY_DIRS})
|
||||
include_directories( ${GLIB2_INCLUDE_DIRS})
|
||||
target_link_libraries(miracle-dhcp ${GLIB2_LIBRARIES})
|
||||
|
||||
target_link_libraries(miracle-dhcp miracle-shared)
|
||||
|
||||
install(TARGETS miracle-dhcp DESTINATION bin)
|
||||
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/shared)
|
||||
|
||||
|
||||
########### install files ###############
|
||||
|
|
|
@ -65,6 +65,7 @@
|
|||
#include <unistd.h>
|
||||
#include "dhcp/gdhcp.h"
|
||||
#include "shl_log.h"
|
||||
#include "config.h"
|
||||
|
||||
static const char *arg_netdev;
|
||||
static const char *arg_ip_binary = "/bin/ip";
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "shl_macro.h"
|
||||
#include "shl_log.h"
|
||||
#include "shl_util.h"
|
||||
#include "config.h"
|
||||
|
||||
static void manager_free(struct manager *m)
|
||||
{
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
set(CMAKE_C_FLAGS "-std=gnu11")
|
||||
|
||||
########### next target ###############
|
||||
find_package(PkgConfig)
|
||||
|
|
|
@ -12,11 +12,28 @@ add_executable(miracle-wifid ${miracle-wifid_SRCS})
|
|||
|
||||
target_link_libraries(miracle-wifid ${KDE4_KDECORE_LIBS})
|
||||
|
||||
install(TARGETS miracle-wifid DESTINATION bin)
|
||||
include_directories(shared)
|
||||
link_directories(shared)
|
||||
target_link_libraries(miracle-wifid miracle-shared)
|
||||
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules (GLIB2 REQUIRED glib-2.0)
|
||||
pkg_check_modules (UDEV REQUIRED libudev)
|
||||
link_directories( ${UDEV_LIBRARY_DIRS})
|
||||
include_directories( ${UDEV_INCLUDE_DIRS})
|
||||
target_link_libraries(miracle-wifid ${UDEV_LIBRARIES})
|
||||
link_directories( ${GLIB2_LIBRARY_DIRS})
|
||||
include_directories( ${GLIB2_INCLUDE_DIRS})
|
||||
target_link_libraries(miracle-wifid ${GLIB2_LIBRARIES})
|
||||
|
||||
install(TARGETS miracle-wifid DESTINATION bin)
|
||||
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/shared)
|
||||
|
||||
########### install files ###############
|
||||
|
||||
#set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake-extensions/ )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "shl_util.h"
|
||||
#include "util.h"
|
||||
#include "wifid.h"
|
||||
#include "config.h"
|
||||
|
||||
#define DO_NOT_RELY_UDEV 0
|
||||
|
||||
|
|
Loading…
Reference in a new issue