From 59e13a2b5fc0706ef72b12b99d9b72a47380137c Mon Sep 17 00:00:00 2001 From: johan Date: Sat, 17 Aug 2013 16:12:42 +0200 Subject: [PATCH] restructured project structure: move projects into sub-folders, split dispmanx-grabber from hyperion --- .../DispmanxWrapper.h | 0 libsrc/CMakeLists.txt | 1 + libsrc/dispmanx-grabber/CMakeLists.txt | 36 +++++++++++++++++++ .../DispmanxFrameGrabber.cpp | 0 .../DispmanxFrameGrabber.h | 0 .../DispmanxWrapper.cpp | 6 ++-- libsrc/hyperion/CMakeLists.txt | 13 +------ src/CMakeLists.txt | 31 +++------------- src/hyperiond/CMakeLists.txt | 8 +++++ .../hyperiond.cpp} | 4 ++- src/viewpng/CMakeLists.txt | 14 ++++++++ src/{ => viewpng}/FbWriter.h | 0 src/{ => viewpng}/ViewPng.cpp | 0 src/writeconfig/CMakeLists.txt | 2 ++ src/{ => writeconfig}/WriteConfig.cpp | 0 test/CMakeLists.txt | 20 +++++------ test/dispmanx2png/CMakeLists.txt | 2 +- test/dispmanx2png/dispmanx2png.cpp | 4 +-- 18 files changed, 85 insertions(+), 56 deletions(-) rename include/{hyperion => dispmanx-grabber}/DispmanxWrapper.h (100%) create mode 100644 libsrc/dispmanx-grabber/CMakeLists.txt rename libsrc/{hyperion => dispmanx-grabber}/DispmanxFrameGrabber.cpp (100%) rename libsrc/{hyperion => dispmanx-grabber}/DispmanxFrameGrabber.h (100%) rename libsrc/{hyperion => dispmanx-grabber}/DispmanxWrapper.cpp (95%) create mode 100644 src/hyperiond/CMakeLists.txt rename src/{hyperion-d.cpp => hyperiond/hyperiond.cpp} (94%) create mode 100644 src/viewpng/CMakeLists.txt rename src/{ => viewpng}/FbWriter.h (100%) rename src/{ => viewpng}/ViewPng.cpp (100%) create mode 100644 src/writeconfig/CMakeLists.txt rename src/{ => writeconfig}/WriteConfig.cpp (100%) diff --git a/include/hyperion/DispmanxWrapper.h b/include/dispmanx-grabber/DispmanxWrapper.h similarity index 100% rename from include/hyperion/DispmanxWrapper.h rename to include/dispmanx-grabber/DispmanxWrapper.h diff --git a/libsrc/CMakeLists.txt b/libsrc/CMakeLists.txt index 56455f7b..22f3987a 100644 --- a/libsrc/CMakeLists.txt +++ b/libsrc/CMakeLists.txt @@ -4,5 +4,6 @@ SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include) SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc) add_subdirectory(hyperion) +add_subdirectory(dispmanx-grabber) add_subdirectory(jsonserver) add_subdirectory(utils) diff --git a/libsrc/dispmanx-grabber/CMakeLists.txt b/libsrc/dispmanx-grabber/CMakeLists.txt new file mode 100644 index 00000000..f8bf6ad8 --- /dev/null +++ b/libsrc/dispmanx-grabber/CMakeLists.txt @@ -0,0 +1,36 @@ + +# Find the BCM-package (VC control) +find_package(BCM REQUIRED) +include_directories(${BCM_INCLUDE_DIRS}) + +# Define the current source locations +SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/dispmanx-grabber) +SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/dispmanx-grabber) + +# Group the headers that go through the MOC compiler +SET(DispmanxGrabberQT_HEADERS + ${CURRENT_HEADER_DIR}/DispmanxWrapper.h +) + +SET(DispmanxGrabberHEADERS + ${CURRENT_SOURCE_DIR}/DispmanxFrameGrabber.h +) + +SET(DispmanxGrabberSOURCES + ${CURRENT_SOURCE_DIR}/DispmanxWrapper.cpp + ${CURRENT_SOURCE_DIR}/DispmanxFrameGrabber.cpp +) + +QT4_WRAP_CPP(DispmanxGrabberHEADERS_MOC ${DispmanxGrabberQT_HEADERS}) + +add_library(dispmanx-grabber + ${DispmanxGrabberHEADERS} + ${DispmanxGrabberQT_HEADERS} + ${DispmanxGrabberHEADERS_MOC} + ${DispmanxGrabberSOURCES} +) + +target_link_libraries(dispmanx-grabber + hyperion + ${QT_LIBRARIES} + ${BCM_LIBRARIES}) diff --git a/libsrc/hyperion/DispmanxFrameGrabber.cpp b/libsrc/dispmanx-grabber/DispmanxFrameGrabber.cpp similarity index 100% rename from libsrc/hyperion/DispmanxFrameGrabber.cpp rename to libsrc/dispmanx-grabber/DispmanxFrameGrabber.cpp diff --git a/libsrc/hyperion/DispmanxFrameGrabber.h b/libsrc/dispmanx-grabber/DispmanxFrameGrabber.h similarity index 100% rename from libsrc/hyperion/DispmanxFrameGrabber.h rename to libsrc/dispmanx-grabber/DispmanxFrameGrabber.h diff --git a/libsrc/hyperion/DispmanxWrapper.cpp b/libsrc/dispmanx-grabber/DispmanxWrapper.cpp similarity index 95% rename from libsrc/hyperion/DispmanxWrapper.cpp rename to libsrc/dispmanx-grabber/DispmanxWrapper.cpp index 7f14a7f6..32de71a9 100644 --- a/libsrc/hyperion/DispmanxWrapper.cpp +++ b/libsrc/dispmanx-grabber/DispmanxWrapper.cpp @@ -3,15 +3,15 @@ #include // Hyperion includes -#include #include #include #include - -// Local-Hyperion includes +// Local-dispmanx includes +#include #include "DispmanxFrameGrabber.h" + DispmanxWrapper::DispmanxWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, Hyperion * hyperion) : _updateInterval_ms(1000/updateRate_Hz), _timeout_ms(2 * _updateInterval_ms), diff --git a/libsrc/hyperion/CMakeLists.txt b/libsrc/hyperion/CMakeLists.txt index e8b9cc82..ed76ce33 100644 --- a/libsrc/hyperion/CMakeLists.txt +++ b/libsrc/hyperion/CMakeLists.txt @@ -1,8 +1,4 @@ -# Find the BCM-package (VC control) -find_package(BCM REQUIRED) -include_directories(${BCM_INCLUDE_DIRS}) - # Define the current source locations SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/hyperion) SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/hyperion) @@ -10,7 +6,6 @@ SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/hyperion) # Group the headers that go through the MOC compiler SET(Hyperion_QT_HEADERS ${CURRENT_HEADER_DIR}/Hyperion.h - ${CURRENT_HEADER_DIR}/DispmanxWrapper.h ) SET(Hyperion_HEADERS @@ -20,8 +15,6 @@ SET(Hyperion_HEADERS ${CURRENT_HEADER_DIR}/ImageProcessorFactory.h ${CURRENT_HEADER_DIR}/PriorityMuxer.h - ${CURRENT_SOURCE_DIR}/DispmanxFrameGrabber.h - ${CURRENT_SOURCE_DIR}/LedDeviceWs2801.h ${CURRENT_SOURCE_DIR}/LedDeviceTest.h ${CURRENT_SOURCE_DIR}/ImageToLedsMap.h @@ -35,9 +28,6 @@ SET(Hyperion_SOURCES ${CURRENT_SOURCE_DIR}/ImageProcessorFactory.cpp ${CURRENT_SOURCE_DIR}/PriorityMuxer.cpp - ${CURRENT_SOURCE_DIR}/DispmanxWrapper.cpp - ${CURRENT_SOURCE_DIR}/DispmanxFrameGrabber.cpp - ${CURRENT_SOURCE_DIR}/LedDeviceWs2801.cpp ${CURRENT_SOURCE_DIR}/LedDeviceTest.cpp ${CURRENT_SOURCE_DIR}/ImageToLedsMap.cpp @@ -55,5 +45,4 @@ add_library(hyperion target_link_libraries(hyperion hyperion-utils - ${QT_LIBRARIES} - ${BCM_LIBRARIES}) + ${QT_LIBRARIES}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4f47cc50..400b7a8e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,27 +1,4 @@ - -add_executable(WriteConfig - WriteConfig.cpp) - -add_executable(hyperiond - hyperion-d.cpp) - -target_link_libraries(hyperiond - hyperion - jsonserver) - -# Find the libPNG -find_package(PNG QUIET) - -if(PNG_FOUND) - # Add additional includes dirs - include_directories(${PNG_INCLUDE_DIR}) - - add_executable(ViewPng - ViewPng.cpp) - - target_link_libraries(ViewPng - hyperion - ${PNG_LIBRARIES}) -endif(PNG_FOUND) - -add_subdirectory(hyperion-remote) +add_subdirectory(hyperiond) +add_subdirectory(hyperion-remote) +add_subdirectory(viewpng) +add_subdirectory(writeconfig) diff --git a/src/hyperiond/CMakeLists.txt b/src/hyperiond/CMakeLists.txt new file mode 100644 index 00000000..a3d4d27a --- /dev/null +++ b/src/hyperiond/CMakeLists.txt @@ -0,0 +1,8 @@ + +add_executable(hyperiond + hyperiond.cpp) + +target_link_libraries(hyperiond + hyperion + dispmanx-grabber + jsonserver) diff --git a/src/hyperion-d.cpp b/src/hyperiond/hyperiond.cpp similarity index 94% rename from src/hyperion-d.cpp rename to src/hyperiond/hyperiond.cpp index a657e319..9166f180 100644 --- a/src/hyperion-d.cpp +++ b/src/hyperiond/hyperiond.cpp @@ -6,9 +6,11 @@ #include // Hyperion includes -#include #include +// Dispmanx grabber includes +#include + // JsonServer includes #include diff --git a/src/viewpng/CMakeLists.txt b/src/viewpng/CMakeLists.txt new file mode 100644 index 00000000..8ad1defa --- /dev/null +++ b/src/viewpng/CMakeLists.txt @@ -0,0 +1,14 @@ +# Find the libPNG +find_package(PNG QUIET) + +if(PNG_FOUND) + # Add additional includes dirs + include_directories(${PNG_INCLUDE_DIR}) + + add_executable(viewpng + ViewPng.cpp) + + target_link_libraries(viewpng + hyperion + ${PNG_LIBRARIES}) +endif(PNG_FOUND) diff --git a/src/FbWriter.h b/src/viewpng/FbWriter.h similarity index 100% rename from src/FbWriter.h rename to src/viewpng/FbWriter.h diff --git a/src/ViewPng.cpp b/src/viewpng/ViewPng.cpp similarity index 100% rename from src/ViewPng.cpp rename to src/viewpng/ViewPng.cpp diff --git a/src/writeconfig/CMakeLists.txt b/src/writeconfig/CMakeLists.txt new file mode 100644 index 00000000..06ea507a --- /dev/null +++ b/src/writeconfig/CMakeLists.txt @@ -0,0 +1,2 @@ +add_executable(WriteConfig + WriteConfig.cpp) diff --git a/src/WriteConfig.cpp b/src/writeconfig/WriteConfig.cpp similarity index 100% rename from src/WriteConfig.cpp rename to src/writeconfig/WriteConfig.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index bf2807ea..18b38b82 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -2,30 +2,30 @@ include_directories(../libsrc) # Add the simple test executable 'TestSpi' -add_executable(TestSpi +add_executable(test_spi TestSpi.cpp) -target_link_libraries(TestSpi +target_link_libraries(test_spi hyperion) -add_executable(TestConfigFile +add_executable(test_configfile TestConfigFile.cpp) -target_link_libraries(TestConfigFile +target_link_libraries(test_configfile hyperion) -add_executable(TestRgbImage +add_executable(test_rgbimage TestRgbImage.cpp) -target_link_libraries(TestRgbImage +target_link_libraries(test_rgbimage hyperion-utils) -add_executable(TestColorTransform +add_executable(test_colortransform TestColorTransform.cpp) -target_link_libraries(TestColorTransform +target_link_libraries(test_colortransform hyperion) -add_executable(TestImage2LedsMap +add_executable(test_image2ledsmap TestImage2LedsMap.cpp) -target_link_libraries(TestImage2LedsMap +target_link_libraries(test_image2ledsmap hyperion) add_subdirectory(dispmanx2png) diff --git a/test/dispmanx2png/CMakeLists.txt b/test/dispmanx2png/CMakeLists.txt index bbffc142..5a2d32d4 100644 --- a/test/dispmanx2png/CMakeLists.txt +++ b/test/dispmanx2png/CMakeLists.txt @@ -14,5 +14,5 @@ add_executable(dispmanx2png dispmanx2png.cpp) target_link_libraries(dispmanx2png - hyperion + dispmanx-grabber ${QT_LIBRARIES}) diff --git a/test/dispmanx2png/dispmanx2png.cpp b/test/dispmanx2png/dispmanx2png.cpp index d3b48926..d7db03d7 100644 --- a/test/dispmanx2png/dispmanx2png.cpp +++ b/test/dispmanx2png/dispmanx2png.cpp @@ -6,8 +6,8 @@ #include #include -// Hyperion includes -#include +// Dispmanx grabber includes +#include static bool running = true;