Author SHA1 Message Date
jfmcarreira e064e4e62d Add GitHub action to build code using cmake 2021-04-16 22:35:41 +01:00
19 changed files with 44 additions and 129 deletions

No files matched your search

+7 -8
View File
@@ -5,16 +5,16 @@ platform:
environment:
access_token:
secure: SMxOWNKN0RkPvICWhIet2FJM5g/zx5mguM/XAPjM2OrC3U2/LAqcBZw0veS9peS4
clone_folder: C:\Projects\calyp
init:
- ps: Add-Content "$HOME\.git-credentials" "https://$($env:access_token):x-oauth-basic@github.com`n"
- git config --global credential.helper store
- git config --global user.email "jfmcarreira@gmail.com"
- git config --global user.name "AppVeyor"
- git config --global user.name "AppVeyor"
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
install:
- '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64'
- choco install nsis
@@ -25,14 +25,13 @@ install:
- 7z x ffmpeg.7z -y -offmpeg
- git clone https://github.com/pixlra/calyp-deployment.git
- CALL calyp-deployment/scripts/extract_ffmpeg.bat
- ps: rm C:\Projects\ffmpeg_libraries\bin\*.exe
build_script:
- mv C:\Projects\calyp C:\Projects\calyp-deployment\cmake-helper\
- mkdir C:\Projects\calyp-build
- cd C:\Projects\calyp-build
- cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DUSE_DYNLOAD=OFF -DOpenCV_DIR="C:/Tools/opencv/build" -DOpenCV_DLL_DIR="C:/Tools/opencv/build/x64/vc15/bin" -DOpenCV_INSTALL_MODULES="world" -DQT_DIR="C:\Qt\latest\msvc2017_64" -DQt5_DIR="C:\Qt\latest\msvc2017_64\lib\cmake\Qt5" -DUSE_QTDBUS=OFF -DAVFORMAT_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/avformat.lib -DAVFORMAT_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DAVCODEC_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/avcodec.lib -DAVCODEC_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DAVUTIL_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/avutil.lib -DAVUTIL_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DSWSCALE_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/swscale.lib -DSWSCALE_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DAVDEVICE_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/avdevice.lib -DAVDEVICE_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DPOSTPROC_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/postproc.lib -DPOSTPROC_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DFFMPEG_DIR=C:\Projects\ffmpeg_libraries -DSWRESAMPLE_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/swresample.lib -DSWRESAMPLE_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -G "Visual Studio 15 2017 Win64" C:\Projects\calyp-deployment\cmake-helper
- cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DUSE_DYNLOAD=OFF -DOpenCV_DIR="C:/Tools/opencv/build" -DOpenCV_DLL_DIR="C:/Tools/opencv/build/x64/vc15/bin" -DOpenCV_INSTALL_MODULES="world" -DQT_DIR="C:\Qt\latest\msvc2017_64" -DQt5_DIR="C:\Qt\latest\msvc2017_64\lib\cmake\Qt5" -DUSE_QTDBUS=OFF -DAVFORMAT_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/avformat.lib -DAVFORMAT_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DAVCODEC_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/avcodec.lib -DAVCODEC_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DAVUTIL_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/avutil.lib -DAVUTIL_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DSWSCALE_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/swscale.lib -DSWSCALE_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -G "Visual Studio 15 2017 Win64" C:\Projects\calyp-deployment\cmake-helper
- cmake --build . --target ALL_BUILD -- /p:Configuration=Release > log_build
- cmake --build . --target INSTALL -- /p:Configuration=Release > log_install
- cmake --build . --target PACKAGE -- /p:Configuration=Release > log_pkg
@@ -40,7 +39,7 @@ build_script:
after_build:
- IF "%APPVEYOR_REPO_BRANCH%" == "master" (CALL ..\calyp-deployment\scripts\deploy-to-github.bat)
on_failure:
- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
+1 -2
View File
@@ -76,7 +76,6 @@
# CMake
bin/
build/
build-*
cmake-build-*/
# Mongo Explorer plugin
@@ -143,4 +142,4 @@ fabric.properties
doc/
# CLang
compile_commands.json
compile_commands.json
+1 -1
View File
@@ -4,4 +4,4 @@ before_install:
- sudo apt-get -qq update
- sudo apt-get install build-essential cmake qtbase5-dev libavcodec-dev libavformat-dev libavutil-dev libopencv-dev libopencv-video-dev libopencv-contrib-dev libgtest-dev
script:
- mkdir -p build && cd build && cmake .. && make && cd ..
- mkdir -p build && cd build && cmake -DBUILD_TESTS=ON .. && make && cd ..
+15 -28
View File
@@ -2,7 +2,15 @@
# CMakeLists for calyp
#
CMAKE_MINIMUM_REQUIRED(VERSION 3.5.0)
CMAKE_MINIMUM_REQUIRED(VERSION 3.2.0)
# ####################################################################################################################################################
# CMake functions
# ####################################################################################################################################################
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
INCLUDE(cmake/ModulesFct.cmake)
INCLUDE(FeatureSummary)
INCLUDE(GNUInstallDirs)
# ####################################################################################################################################################
# Project Definition
@@ -17,28 +25,15 @@ SET(PROJECT_LIBRARY
CACHE INTERNAL "" FORCE
)
PROJECT(${PROJECT_NAME})
SET(CALYP_VERSION_MAJOR "1")
SET(CALYP_VERSION_MINOR "2")
SET(CALYP_VERSION_MINOR "1")
SET(CALYP_VERSION_PATCH "0")
SET(CALYP_VERSION
"${CALYP_VERSION_MAJOR}.${CALYP_VERSION_MINOR}.${CALYP_VERSION_PATCH}"
CACHE INTERNAL "" FORCE
)
PROJECT(
${PROJECT_NAME}
VERSION ${CALYP_VERSION}
LANGUAGES "CXX"
)
# ####################################################################################################################################################
# CMake functions
# ####################################################################################################################################################
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
INCLUDE(cmake/ModulesFct.cmake)
INCLUDE(FeatureSummary)
INCLUDE(GNUInstallDirs)
# ####################################################################################################################################################
# Variables
# ####################################################################################################################################################
@@ -48,7 +43,6 @@ OPTION(BUILD_TOOLS "Build Command Line Application" ON)
OPTION(BUILD_EXAMPLES "Build Examples" OFF)
OPTION(BUILD_DOC "Build Documentation" OFF)
OPTION(BUILD_TESTS "Build Google Tests" OFF)
OPTION(BUILD_TESTS_CATCH2 "Build Catch2 Tests" OFF)
OPTION(USE_FERVOR "Add Fervor support" OFF)
@@ -125,17 +119,6 @@ IF(BUILD_TESTS)
)
ENDIF()
IF(BUILD_TESTS_CATCH2)
FIND_PACKAGE(Catch2 REQUIRED)
ENABLE_TESTING()
SET_PACKAGE_PROPERTIES(
Catch2 PROPERTIES
URL "https://github.com/catchorg/Catch2"
DESCRIPTION "Catch2 unit tests"
TYPE OPTIONAL
)
ENDIF()
OPTION(USE_OPENCV "Add OpenCV support" ON)
IF(USE_OPENCV)
@@ -164,6 +147,10 @@ SET_PACKAGE_PROPERTIES(
OPTION(USE_FFMPEG "Add FFMPEG support" ON)
IF(USE_FFMPEG)
FIND_PACKAGE(FFmpeg COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE)
IF("${AVCODEC_VERSION}" VERSION_LESS "56.0.0")
SET(FFMPEG_FOUND FALSE)
SET(FFmpeg_FOUND FALSE)
ENDIF()
SET(USE_FFMPEG ${FFMPEG_FOUND})
ENDIF()
SET_PACKAGE_PROPERTIES(
+1 -5
View File
@@ -24,10 +24,6 @@
#include "PlotSubWindow.h"
#include <QGuiApplication>
#include <QScreen>
#include <QSize>
#include "qcustomplot.h"
//#include "external/qcustomplot/qcustomplot.h"
@@ -178,7 +174,7 @@ QSize PlotSubWindow::sizeHint() const
}
else
{
maxSize = QGuiApplication::screens()[0]->availableGeometry().size();
maxSize = QApplication::desktop()->availableGeometry().size();
}
return sizeHint( maxSize );
}
+5 -9
View File
@@ -29,12 +29,10 @@
#include <QActionGroup>
#include <QApplication>
#include <QDesktopWidget>
#include <QGuiApplication>
#include <QHBoxLayout>
#include <QMdiArea>
#include <QMenu>
#include <QPainter>
#include <QScreen>
#include <QSettings>
#include <QSignalMapper>
#include <QStyle>
@@ -156,7 +154,7 @@ void SubWindowHandle::setWindowMode( int iWindowMode )
parentWidget()->update();
m_pcApp->showNormal();
qApp->processEvents();
QSize screenSize = QGuiApplication::screens()[0]->availableGeometry().size();
QSize screenSize = QApplication::desktop()->availableGeometry().size();
m_pcApp->move( 0, 0 );
m_pcApp->resize( screenSize.width(), 5 );
m_pcApp->setWindowTitle( QApplication::applicationName() );
@@ -232,14 +230,12 @@ void SubWindowHandle::addMdiSubWindow( SubWindowAbstract* window )
SLOT( removeMdiSubWindow( MdiSubWindow* ) ) );
}
void SubWindowHandle::addSubWindow( SubWindowAbstract* window )
void SubWindowHandle::addSubWindow( SubWindowAbstract* window, Qt::WindowFlags flags )
{
if( window )
{
connect( window, SIGNAL( updateStatusBar( const QString& ) ), m_pcApp,
SLOT( printMessage( const QString& ) ) );
connect( window, SIGNAL( zoomFactorChanged( const double, const QPoint ) ), m_pcApp,
SLOT( updateZoomFactorSBox() ) );
connect( window, SIGNAL( updateStatusBar( const QString& ) ), m_pcApp, SLOT( printMessage( const QString& ) ) );
connect( window, SIGNAL( zoomFactorChanged( const double, const QPoint ) ), m_pcApp, SLOT( updateZoomFactorSBox() ) );
if( m_iWindowMode == DETACHEDSUBWINDOWMODE )
{
connect( window, SIGNAL( aboutToActivate( SubWindowAbstract* ) ), this,
@@ -382,7 +378,7 @@ void SubWindowHandle::tileSubWindows()
if( m_iWindowMode == DETACHEDSUBWINDOWMODE )
{
QSize screenSize = QGuiApplication::screens()[0]->availableGeometry().size();
QSize screenSize = QApplication::desktop()->availableGeometry().size();
unsigned int minWindowsInRow = 1;
while( ( screenSize.width() / minWindowsInRow ) > 500 )
{
+1 -1
View File
@@ -51,7 +51,7 @@ public:
void processLogMsg( const QString& msg );
void addSubWindow( SubWindowAbstract* widget );
void addSubWindow( SubWindowAbstract* widget, Qt::WindowFlags flags = 0 );
SubWindowAbstract* activeSubWindow() const;
+1 -1
View File
@@ -259,7 +259,7 @@ QSize VideoSubWindow::sizeHint() const
}
else
{
maxSize = QGuiApplication::screens()[0]->availableGeometry().size();
maxSize = QApplication::desktop()->availableGeometry().size();
}
return sizeHint( maxSize );
}
+1
View File
@@ -182,6 +182,7 @@ public:
QSize sizeHint( const QSize& ) const;
QString getCurrentFileName() { return m_cFilename; }
bool getIsModule() { return getCategory() | SubWindowAbstract::MODULE_SUBWINDOW; }
void clearWindowBusy() { m_bWindowBusy = false; }
void setFillWindow( bool bFlag );
+1 -1
View File
@@ -730,7 +730,7 @@ void ViewArea::wheelEvent( QWheelEvent* event )
if( event->modifiers() & Qt::ControlModifier )
{
scale = 0.001 * event->angleDelta().y();
scale = 0.001 * event->delta();
if( scale > 0 )
scale = 1.25;
else
+3 -10
View File
@@ -49,7 +49,7 @@ AboutDialog::AboutDialog( QWidget* parent )
.arg( QApplication::applicationVersion() ) );
label->setWordWrap( false );
QString featuresList = QStringLiteral( "<p><h4><b>Features:</b></h4><ul>" );
QString featuresList = QStringLiteral( "<p><h3><b>Features:</b></h3><ul>" );
#ifdef USE_QTDBUS
featuresList.append( QStringLiteral( "<li>Support for Qt DBus messages" ) );
@@ -63,21 +63,14 @@ AboutDialog::AboutDialog( QWidget* parent )
featuresList.append( QStringLiteral( "</ul></p>" ) );
QLabel* labelFeatures = new QLabel( featuresList );
QString thanksList = QStringLiteral( "<p><h4><b>Thanks to:</b></h4><ul>" );
thanksList.append( QStringLiteral( "<li>Joao Santos" ) );
thanksList.append( QStringLiteral( "<li>Jose Filipe" ) );
thanksList.append( QStringLiteral( "</ul></p>" ) );
QLabel* labelContributors = new QLabel( thanksList );
QLabel* labelCopyright = new QLabel( QStringLiteral( "Copyright 2014–2021 Joao Carreira and Luis Lucas" ) );
QLabel* labelCopyright = new QLabel( QStringLiteral( "Copyright © 2014–2018 Joao Carreira and Luis Lucas" ) );
QWidget* topWidget = new QWidget;
QVBoxLayout* topLayout = new QVBoxLayout;
topLayout->addWidget( pixmapLabel, 0, Qt::AlignHCenter );
topLayout->addWidget( label );
topLayout->addWidget( labelCopyright );
topLayout->addWidget( labelFeatures );
topLayout->addWidget( labelContributors );
topLayout->addWidget( labelCopyright );
topWidget->setLayout( topLayout );
// QTextEdit *textEdit = new QTextEdit(tr("<p>This program is free "
-4
View File
@@ -51,10 +51,6 @@ int main( int argc, char* argv[] )
QApplication::setApplicationVersion( QStringLiteral( CALYP_VERSION_STRING ) );
QApplication::setOrganizationName( QStringLiteral( "PixLRA" ) );
#if _WIN32
application.setStyle( QStyleFactory::create( "Fusion" ) );
#endif
#ifdef USE_QTDBUS
/**
* use dbus, if available
-1
View File
@@ -86,7 +86,6 @@ IF(NOT FFMPEG_LIBRARIES)
FIND_COMPONENT(AVDEVICE libavdevice avdevice libavdevice/avdevice.h)
FIND_COMPONENT(AVUTIL libavutil avutil libavutil/avutil.h)
FIND_COMPONENT(SWSCALE libswscale swscale libswscale/swscale.h)
FIND_COMPONENT(SWRESAMPLE libswresample swresample libswresample/swresample.h)
FIND_COMPONENT(POSTPROC libpostproc postproc libpostproc/postprocess.h)
# Check if the required components were found and add their stuff to the FFMPEG_* vars.
+1 -1
View File
@@ -4,7 +4,7 @@ MACRO(ADD_MODULE name file)
OPTION(MODULE_${name} "Use module ${name}" ON)
ADD_FEATURE_INFO(${name} MODULE_${name} "Module ${name}")
IF(MODULE_${name})
LIST(APPEND Calyp_Mod_SRCS ${MODULE_LOCATION}${file}.cpp)
LIST(APPEND Calyp_Mod_SRCS ${MODULE_LOCATION}${file})
LIST(APPEND MODULES_LIST_NAME ${name})
LIST(APPEND MODULES_LIST_FILES ${file})
SET(Calyp_Mod_SRCS
+5 -1
View File
@@ -77,5 +77,9 @@ IF(USE_FFMPEG)
"FFmpeg-Dir"
CACHE PATH "Where to find FFmpeg Lib on Windows"
)
INSTALL(DIRECTORY ${FFMPEG_DIR}/bin/ DESTINATION bin)
INSTALL(FILES ${FFMPEG_DIR}/bin/avcodec-${AVCODEC_VERSION}.dll DESTINATION bin)
INSTALL(FILES ${FFMPEG_DIR}/bin/avformat-${AVFORMAT_VERSION}.dll DESTINATION bin)
INSTALL(FILES ${FFMPEG_DIR}/bin/avutil-${AVUTIL_VERSION}.dll DESTINATION bin)
INSTALL(FILES ${FFMPEG_DIR}/bin/swscale-${SWSCALE_VERSION}.dll DESTINATION bin)
INSTALL(FILES ${FFMPEG_DIR}/bin/swresample-${SWRESAMPLE_VERSION}.dll DESTINATION bin)
ENDIF()
-4
View File
@@ -85,7 +85,3 @@ ENDIF()
IF(BUILD_TESTS)
ADD_SUBDIRECTORY(tests)
ENDIF()
IF(BUILD_TESTS_CATCH2)
ADD_SUBDIRECTORY(catch2)
ENDIF()
+1 -1
View File
@@ -91,7 +91,7 @@ bool StreamHandlerLibav::openHandler( ClpString strFilename, bool bInput )
// }
// Register all components of FFmpeg
//av_register_all();
av_register_all();
/* open input file, and allocate format context */
if( avformat_open_input( &m_cFmtCtx, filename, NULL, NULL ) < 0 )
-12
View File
@@ -1,12 +0,0 @@
#
# CMakeLists for Calyp lis tests using catch2
#
# ADD_DEFINITIONS(-DCALYP_TEST_DATA_DIR=\"${CALYP_TEST_DATA_DIR}\")
SET(Calyp_Lib_Catch2_Tests_SRCS CalypFrameTests.cpp)
ADD_EXECUTABLE(CalypLibCatch2Tests ${Calyp_Lib_Catch2_Tests_SRCS})
TARGET_LINK_LIBRARIES(CalypLibCatch2Tests ${PROJECT_LIBRARY} Catch2::Catch2)
INCLUDE(CTest)
-39
View File
@@ -1,39 +0,0 @@
/* This file is a part of plaYUVer project
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
* Luis Lucas (luisfrlucas@gmail.com)
*
* 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.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/**
* \file CalypFrameTests.cpp
* \brief CalypFrame general tests
*/
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
#include "CalypFrame.h"
TEST_CASE( "create a 256x128 frame in YUV420 format", "CalypFrame" )
{
// Constructor: CalypFrame( unsigned int width, unsigned int height, int pelFormat, unsigned bitsPixel = 8 );
CalypFrame testFrame( 256, 128, CLP_YUV420P, 8 );
REQUIRE( testFrame.getWidth() == 256 );
REQUIRE( testFrame.getHeight() == 128 );
REQUIRE( testFrame.getPelFormat() == CLP_YUV420P );
REQUIRE( testFrame.getBitsPel() == 8 );
}