mirror of
https://github.com/albfan/miraclecast.git
synced 2025-03-09 23:38:56 +00:00
cmake configuration
This commit is contained in:
parent
f884dd858c
commit
2e933497ff
8 changed files with 390 additions and 0 deletions
22
CMakeLists.txt
Normal file
22
CMakeLists.txt
Normal file
|
@ -0,0 +1,22 @@
|
|||
project(Miraclecast)
|
||||
set(CMAKE_C_FLAGS "-std=c99")
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(res)
|
||||
add_subdirectory(test)
|
||||
|
||||
|
||||
########### install files ###############
|
||||
|
||||
|
||||
|
||||
|
||||
#original Makefile.am contents follow:
|
||||
|
||||
#SUBDIRS = src res test
|
||||
#EXTRA_DIST = README.md \
|
||||
# COPYING \
|
||||
# NEWS
|
||||
#
|
||||
#ACLOCAL_AMFLAGS = -I m4
|
11
res/CMakeLists.txt
Normal file
11
res/CMakeLists.txt
Normal file
|
@ -0,0 +1,11 @@
|
|||
|
||||
########### install files ###############
|
||||
|
||||
install(FILES miracle-gst.sh DESTINATION bin)
|
||||
|
||||
|
||||
|
||||
#original Makefile.am contents follow:
|
||||
|
||||
#bin_SCRIPTS = miracle-gst.sh
|
||||
#EXTRA_DIST = wpa.conf
|
49
src/CMakeLists.txt
Normal file
49
src/CMakeLists.txt
Normal file
|
@ -0,0 +1,49 @@
|
|||
|
||||
add_subdirectory(shared)
|
||||
add_subdirectory(wifi)
|
||||
add_subdirectory(dhcp)
|
||||
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)
|
||||
|
||||
|
||||
########### install files ###############
|
||||
|
||||
|
||||
|
||||
|
||||
#original Makefile.am contents follow:
|
||||
|
||||
#include $(top_srcdir)/common.am
|
||||
#SUBDIRS = shared wifi dhcp ctl
|
||||
#
|
||||
#bin_PROGRAMS = miracled
|
||||
#
|
||||
#miracled_SOURCES = \
|
||||
# miracled.h \
|
||||
# miracled.c
|
||||
#miracled_CPPFLAGS = \
|
||||
# $(AM_CPPFLAGS) \
|
||||
# $(DEPS_CFLAGS)
|
||||
#miracled_LDADD = \
|
||||
# shared/libmiracle-shared.la \
|
||||
# $(DEPS_LIBS)
|
||||
#
|
68
src/ctl/CMakeLists.txt
Normal file
68
src/ctl/CMakeLists.txt
Normal file
|
@ -0,0 +1,68 @@
|
|||
|
||||
########### next target ###############
|
||||
|
||||
set(miracle-wifictl_SRCS ${CMAKE_CURRENT_BINARY_DIR}/ctl.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ctl-cli.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ctl-wifi.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/wifictl.c)
|
||||
|
||||
add_executable(miracle-wifictl ${miracle-wifictl_SRCS})
|
||||
|
||||
target_link_libraries(miracle-wifictl ${KDE4_KDECORE_LIBS})
|
||||
|
||||
install(TARGETS miracle-wifictl DESTINATION bin)
|
||||
|
||||
|
||||
########### next target ###############
|
||||
|
||||
set(miracle-sinkctl_SRCS ${CMAKE_CURRENT_BINARY_DIR}/ctl.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ctl-cli.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ctl-sink.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ctl-wifi.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/sinkctl.c)
|
||||
|
||||
add_executable(miracle-sinkctl ${miracle-sinkctl_SRCS})
|
||||
|
||||
target_link_libraries(miracle-sinkctl ${KDE4_KDECORE_LIBS})
|
||||
|
||||
install(TARGETS miracle-sinkctl DESTINATION bin)
|
||||
|
||||
|
||||
########### install files ###############
|
||||
|
||||
|
||||
|
||||
|
||||
#original Makefile.am contents follow:
|
||||
|
||||
#include $(top_srcdir)/common.am
|
||||
#bin_PROGRAMS = miracle-wifictl miracle-sinkctl
|
||||
#
|
||||
#miracle_wifictl_SOURCES = \
|
||||
# ctl.h \
|
||||
# ctl-cli.c \
|
||||
# ctl-wifi.c \
|
||||
# wifictl.c
|
||||
#miracle_wifictl_CPPFLAGS = \
|
||||
# $(AM_CPPFLAGS) \
|
||||
# $(DEPS_CFLAGS)
|
||||
#miracle_wifictl_LDADD = \
|
||||
# ../shared/libmiracle-shared.la \
|
||||
# -lreadline \
|
||||
# $(DEPS_LIBS)
|
||||
#
|
||||
#miracle_sinkctl_SOURCES = \
|
||||
# ctl.h \
|
||||
# ctl-cli.c \
|
||||
# ctl-sink.c \
|
||||
# ctl-wifi.c \
|
||||
# sinkctl.c
|
||||
#miracle_sinkctl_CPPFLAGS = \
|
||||
# $(AM_CPPFLAGS) \
|
||||
# $(DEPS_CFLAGS)
|
||||
#miracle_sinkctl_LDADD = \
|
||||
# ../shared/libmiracle-shared.la \
|
||||
# -lreadline \
|
||||
# $(DEPS_LIBS)
|
||||
#
|
||||
#
|
51
src/dhcp/CMakeLists.txt
Normal file
51
src/dhcp/CMakeLists.txt
Normal file
|
@ -0,0 +1,51 @@
|
|||
|
||||
########### next target ###############
|
||||
|
||||
set(miracle-dhcp_SRCS ${CMAKE_CURRENT_BINARY_DIR}/dhcp.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/gdhcp.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/unaligned.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/common.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/common.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ipv4ll.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ipv4ll.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/client.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/server.c)
|
||||
|
||||
add_executable(miracle-dhcp ${miracle-dhcp_SRCS})
|
||||
|
||||
target_link_libraries(miracle-dhcp ${KDE4_KDECORE_LIBS})
|
||||
|
||||
install(TARGETS miracle-dhcp DESTINATION bin)
|
||||
|
||||
|
||||
########### install files ###############
|
||||
|
||||
|
||||
|
||||
|
||||
#original Makefile.am contents follow:
|
||||
|
||||
#include $(top_srcdir)/common.am
|
||||
#bin_PROGRAMS = miracle-dhcp
|
||||
#
|
||||
#miracle_dhcp_SOURCES = \
|
||||
# dhcp.c \
|
||||
# gdhcp.h \
|
||||
# unaligned.h \
|
||||
# common.h \
|
||||
# common.c \
|
||||
# ipv4ll.h \
|
||||
# ipv4ll.c \
|
||||
# client.c \
|
||||
# server.c
|
||||
#miracle_dhcp_CPPFLAGS = \
|
||||
# $(AM_CPPFLAGS) \
|
||||
# $(DEPS_CFLAGS) \
|
||||
# $(GDHCP_CFLAGS)
|
||||
#miracle_dhcp_LDADD = \
|
||||
# ../shared/libmiracle-shared.la \
|
||||
# $(DEPS_LIBS) \
|
||||
# $(GDHCP_LIBS)
|
||||
#
|
||||
#
|
||||
#
|
55
src/shared/CMakeLists.txt
Normal file
55
src/shared/CMakeLists.txt
Normal file
|
@ -0,0 +1,55 @@
|
|||
|
||||
########### next target ###############
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules (SYSTEMD REQUIRED systemd>=213)
|
||||
set(miracle-shared_SRCS rtsp.h
|
||||
rtsp.c
|
||||
shl_dlist.h
|
||||
shl_htable.h
|
||||
shl_htable.c
|
||||
shl_log.h
|
||||
shl_log.c
|
||||
shl_macro.h
|
||||
shl_ring.h
|
||||
shl_ring.c
|
||||
shl_util.h
|
||||
shl_util.c
|
||||
util.h
|
||||
wpas.h
|
||||
wpas.c)
|
||||
include_directories(/usr/include)
|
||||
link_directories(/usr/lib)
|
||||
add_library(miracle-shared STATIC ${miracle-shared_SRCS})
|
||||
target_link_libraries (miracle-shared systemd)
|
||||
|
||||
|
||||
########### install files ###############
|
||||
|
||||
|
||||
|
||||
|
||||
#original Makefile.am contents follow:
|
||||
|
||||
#include $(top_srcdir)/common.am
|
||||
#noinst_LTLIBRARIES = libmiracle-shared.la
|
||||
#
|
||||
#libmiracle_shared_la_SOURCES = \
|
||||
# rtsp.h \
|
||||
# rtsp.c \
|
||||
# shl_dlist.h \
|
||||
# shl_htable.h \
|
||||
# shl_htable.c \
|
||||
# shl_log.h \
|
||||
# shl_log.c \
|
||||
# shl_macro.h \
|
||||
# shl_ring.h \
|
||||
# shl_ring.c \
|
||||
# shl_util.h \
|
||||
# shl_util.c \
|
||||
# util.h \
|
||||
# wpas.h \
|
||||
# wpas.c
|
||||
#libmiracle_shared_la_LIBADD = -lsystemd
|
||||
#
|
||||
#
|
||||
#
|
41
src/wifi/CMakeLists.txt
Normal file
41
src/wifi/CMakeLists.txt
Normal file
|
@ -0,0 +1,41 @@
|
|||
|
||||
########### next target ###############
|
||||
|
||||
set(miracle-wifid_SRCS ${CMAKE_CURRENT_BINARY_DIR}/wifid.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/wifid.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/wifid-dbus.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/wifid-link.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/wifid-peer.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/wifid-supplicant.c)
|
||||
|
||||
add_executable(miracle-wifid ${miracle-wifid_SRCS})
|
||||
|
||||
target_link_libraries(miracle-wifid ${KDE4_KDECORE_LIBS})
|
||||
|
||||
install(TARGETS miracle-wifid DESTINATION bin)
|
||||
|
||||
|
||||
########### install files ###############
|
||||
|
||||
|
||||
|
||||
|
||||
#original Makefile.am contents follow:
|
||||
|
||||
#include $(top_srcdir)/common.am
|
||||
#bin_PROGRAMS = miracle-wifid
|
||||
#
|
||||
#miracle_wifid_SOURCES = \
|
||||
# wifid.h \
|
||||
# wifid.c \
|
||||
# wifid-dbus.c \
|
||||
# wifid-link.c \
|
||||
# wifid-peer.c \
|
||||
# wifid-supplicant.c
|
||||
#miracle_wifid_CPPFLAGS = \
|
||||
# $(AM_CPPFLAGS) \
|
||||
# $(DEPS_CFLAGS)
|
||||
#miracle_wifid_LDADD = \
|
||||
# ../shared/libmiracle-shared.la \
|
||||
# $(DEPS_LIBS)
|
||||
#
|
93
test/CMakeLists.txt
Normal file
93
test/CMakeLists.txt
Normal file
|
@ -0,0 +1,93 @@
|
|||
|
||||
include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
|
||||
|
||||
|
||||
########### next target ###############
|
||||
|
||||
set($(tests)_SRCS ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp)
|
||||
|
||||
if(KDE4_BUILD_TESTS)
|
||||
|
||||
kde4_add_executable($(tests) ${$(tests)_SRCS})
|
||||
|
||||
target_link_libraries($(tests) ${KDE4_KDECORE_LIBS})
|
||||
|
||||
endif(KDE4_BUILD_TESTS)
|
||||
|
||||
########### next target ###############
|
||||
|
||||
set(test_valgrind_SRCS test_valgrind.c $(test_sources))
|
||||
|
||||
if(KDE4_BUILD_TESTS)
|
||||
|
||||
kde4_add_executable(test_valgrind ${test_valgrind_SRCS})
|
||||
|
||||
target_link_libraries(test_valgrind ${KDE4_KDECORE_LIBS})
|
||||
|
||||
endif(KDE4_BUILD_TESTS)
|
||||
|
||||
########### install files ###############
|
||||
|
||||
|
||||
|
||||
|
||||
#original Makefile.am contents follow:
|
||||
|
||||
#include $(top_srcdir)/common.am
|
||||
#tests = \
|
||||
# test_rtsp \
|
||||
# test_wpas
|
||||
#
|
||||
#if BUILD_HAVE_CHECK
|
||||
#check_PROGRAMS = $(tests) test_valgrind
|
||||
#TESTS = $(tests) test_valgrind
|
||||
#MEMTESTS = $(tests)
|
||||
#endif
|
||||
#
|
||||
#test_sources = \
|
||||
# test_common.h
|
||||
#test_libs = \
|
||||
# ../src/shared/libmiracle-shared.la \
|
||||
# $(DEPS_LIBS) \
|
||||
# $(CHECK_LIBS)
|
||||
#test_cflags = \
|
||||
# $(AM_CPPFLAGS) \
|
||||
# $(DEPS_CFLAGS) \
|
||||
# $(CHECK_CFLAGS)
|
||||
#
|
||||
#test_rtsp_SOURCES = test_rtsp.c $(test_sources)
|
||||
#test_rtsp_CPPFLAGS = $(test_cflags)
|
||||
#test_rtsp_LDADD = $(test_libs)
|
||||
#
|
||||
#test_valgrind_SOURCES = test_valgrind.c $(test_sources)
|
||||
#test_valgrind_CPPFLAGS = $(test_cflags)
|
||||
#test_valgrind_LDADD = $(test_libs)
|
||||
#
|
||||
#test_wpas_SOURCES = test_wpas.c $(test_sources)
|
||||
#test_wpas_CPPFLAGS = $(test_cflags)
|
||||
#test_wpas_LDADD = $(test_libs)
|
||||
#
|
||||
### custom recipes
|
||||
#
|
||||
#VALGRIND = CK_FORK=no valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --leak-resolution=high --error-exitcode=1 --suppressions=$(top_builddir)/test.supp
|
||||
#
|
||||
## verify that test_valgrind actually leaks data
|
||||
#memcheck-verify: check
|
||||
# $(AM_V_GEN)$(VALGRIND) --log-file=/dev/null ./test_valgrind >/dev/null ; test 1 = $$?
|
||||
#
|
||||
## run memcheck tests via valgrind
|
||||
#memcheck: memcheck-verify
|
||||
# $(AM_V_GEN)for i in $(MEMTESTS) ; do \
|
||||
# $(VALGRIND) --log-file=$(top_builddir)/$$i.memlog \
|
||||
# $(top_builddir)/$$i >/dev/null || (echo "memcheck failed on: $$i" ; exit 1) ; \
|
||||
# done
|
||||
#
|
||||
#distcheck-hook: memcheck
|
||||
#AM_MAKEFLAGS = --no-print-directory
|
||||
#AUTOMAKE_OPTIONS = color-tests
|
||||
#
|
||||
##
|
||||
## Phony targets
|
||||
##
|
||||
#
|
||||
#.PHONY: memcheck-verify
|
Loading…
Add table
Add a link
Reference in a new issue