From 2e933497ff3f98d8aedd405fccc8f3f8c338b71e Mon Sep 17 00:00:00 2001 From: albfan Date: Mon, 9 Mar 2015 00:06:19 +0100 Subject: [PATCH] cmake configuration --- CMakeLists.txt | 22 +++++++++ res/CMakeLists.txt | 11 +++++ src/CMakeLists.txt | 49 +++++++++++++++++++++ src/ctl/CMakeLists.txt | 68 ++++++++++++++++++++++++++++ src/dhcp/CMakeLists.txt | 51 +++++++++++++++++++++ src/shared/CMakeLists.txt | 55 +++++++++++++++++++++++ src/wifi/CMakeLists.txt | 41 +++++++++++++++++ test/CMakeLists.txt | 93 +++++++++++++++++++++++++++++++++++++++ 8 files changed, 390 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 res/CMakeLists.txt create mode 100644 src/CMakeLists.txt create mode 100644 src/ctl/CMakeLists.txt create mode 100644 src/dhcp/CMakeLists.txt create mode 100644 src/shared/CMakeLists.txt create mode 100644 src/wifi/CMakeLists.txt create mode 100644 test/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..d35863f --- /dev/null +++ b/CMakeLists.txt @@ -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 diff --git a/res/CMakeLists.txt b/res/CMakeLists.txt new file mode 100644 index 0000000..2065690 --- /dev/null +++ b/res/CMakeLists.txt @@ -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 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..4896a51 --- /dev/null +++ b/src/CMakeLists.txt @@ -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) +# diff --git a/src/ctl/CMakeLists.txt b/src/ctl/CMakeLists.txt new file mode 100644 index 0000000..f546e68 --- /dev/null +++ b/src/ctl/CMakeLists.txt @@ -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) +# +# diff --git a/src/dhcp/CMakeLists.txt b/src/dhcp/CMakeLists.txt new file mode 100644 index 0000000..8306f98 --- /dev/null +++ b/src/dhcp/CMakeLists.txt @@ -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) +# +# +# diff --git a/src/shared/CMakeLists.txt b/src/shared/CMakeLists.txt new file mode 100644 index 0000000..640c078 --- /dev/null +++ b/src/shared/CMakeLists.txt @@ -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 +# +# +# diff --git a/src/wifi/CMakeLists.txt b/src/wifi/CMakeLists.txt new file mode 100644 index 0000000..338af00 --- /dev/null +++ b/src/wifi/CMakeLists.txt @@ -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) +# diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..0eff8f6 --- /dev/null +++ b/test/CMakeLists.txt @@ -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