Skip to content

Commit 7f39e32

Browse files
authored
Merge pull request #2 from Abir-Tx/code-struct
Upgrade the project to use CMake build system
2 parents 3b491ea + 4cc215a commit 7f39e32

File tree

9 files changed

+62
-21
lines changed

9 files changed

+62
-21
lines changed

.github/workflows/c-cpp.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: C/C++ CI
1+
name: C/C++ Build CI
22

33
on:
44
push:
@@ -13,20 +13,24 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v2
1515
- name: make-dir
16-
run: make dir
16+
run: make -f Makefile.own dir
1717
- name: linux-build
18-
run: make build
18+
run: make -f Makefile.own build
1919
- name: make run
20-
run: make run
20+
run: make -f Makefile.own run
21+
- name: Linux CMake Build
22+
run: cmake . && make
2123

2224
build-windows:
2325
runs-on: windows-2019
2426

2527
steps:
2628
- uses: actions/checkout@v2
27-
- name: install-make
28-
run: choco install make
29+
# - name: install-make
30+
# run: choco install make cmake
2931
- name: make-directory
30-
run: make dir
32+
run: make -f Makefile.own dir
3133
- name: windows-build
32-
run: make winbuild
34+
run: make -f Makefile.own winbuild
35+
- name: Windows CMake Build
36+
run: cmake -G "MinGW Makefiles" && cmake . && make

.gitignore

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,22 @@
3737
bin/*
3838
passphrase.bin
3939
s_lockValue.bin
40-
release-configs/*
40+
release-configs/*
41+
42+
### CMake ###
43+
CMakeLists.txt.user
44+
CMakeCache.txt
45+
CMakeFiles
46+
CMakeScripts
47+
Testing
48+
Makefile
49+
cmake_install.cmake
50+
install_manifest.txt
51+
compile_commands.json
52+
CTestTestfile.cmake
53+
_deps
54+
CMakeUserPresets.json
55+
build/*
56+
### CMake Patch ###
57+
# External projects
58+
*-prefix/

.vscode/c_cpp_properties.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
"${workspaceFolder}/include/ffmpeg-coder/**",
2222
"${workspaceFolder}/include/**",
2323
"${workspaceFolder}/lib"
24-
2524
],
2625
"defines": [],
2726
"compilerPath": "C:\\MinGW\\bin\\gcc.exe",
2827
"cStandard": "${default}",
2928
"cppStandard": "c++14",
30-
"intelliSenseMode": "${default}"
29+
"intelliSenseMode": "${default}",
30+
"configurationProvider": "ms-vscode.cmake-tools"
3131
},
3232
{
3333
"name": "Surface",
@@ -36,7 +36,6 @@
3636
"${workspaceFolder}/include/ffmpeg-coder/**",
3737
"${workspaceFolder}/include/**",
3838
"${workspaceFolder}/lib"
39-
4039
],
4140
"defines": [],
4241
"compilerPath": "C:\\Program Files (x86)\\mingw-w64\\i686-8.1.0-posix-dwarf-rt_v6-rev0\\mingw32\\bin\\gcc.exe",

CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
cmake_minimum_required(VERSION 3.12)
2+
project(ffmpeg-coder VERSION 1.0.0)
3+
message("FFMPEG CODER BUILD PROCESS")
4+
message("--------------------------")
5+
6+
set(CMAKE_CXX_FLAGS "-Wall -v")
7+
include_directories(include/ffmpeg-coder lib)
8+
9+
# Placing the executable in the bin dir
10+
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
11+
12+
13+
14+
add_executable(ffmpeg-coder src/ffmpeg-coder.cpp)
15+

Makefile renamed to Makefile.own

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# make script for the ffmpeg-coder project to build the project from source code
22
# By Abir-Tx
3+
# Use make -f Makefile.own winbuild to use this file
34

45

56
# variables
@@ -33,6 +34,7 @@ run:
3334
dir:
3435
echo Creating directories.....
3536
mkdir bin
37+
mkdir build
3638

3739
.PHONY: debpackage
3840
debpackage: build

include/ffmpeg-coder/ffmpeg_coder.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#if !defined(FFMPEG_CODER_H)
2-
#define FFMPEG_CODER_H
1+
#if !defined(FFMPEG_CODER_HPP)
2+
#define FFMPEG_CODER_HPP
33

44
#include "utils.hpp"
55
#include <iostream>
@@ -330,6 +330,9 @@ class ffmpeg {
330330
}
331331
}
332332
}
333+
334+
// Quick convert function
335+
void quickConvert(){};
333336
};
334337

335338
ffmpeg::ffmpeg() {}

include/ffmpeg-coder/frontend_funcs.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#if !defined(FRONTEND_FUNC_H)
2-
#define FRONTEND_FUNC_H
1+
#if !defined(FRONTEND_FUNC_HPP)
2+
#define FRONTEND_FUNC_HPP
33

44
#include "rang.hpp"
55
#include <iostream>
@@ -108,7 +108,7 @@ void homepage()
108108
ffmpeg.selected_action();
109109
}
110110
else if (choice == 2){
111-
cout << "Work in progress !!" << endl;
111+
ffmpeg.quickConvert();
112112
}
113113
else if (choice == 3)
114114
{

include/ffmpeg-coder/s_lock.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#if !defined(S_LOCK_H)
2-
#define S_LOCK_H
1+
#if !defined(S_LOCK_HPP)
2+
#define S_LOCK_HPP
33

44
#include "rang.hpp"
55
#include <iostream>

include/ffmpeg-coder/utils.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#if !defined(UTILS_H)
2-
#define UTILS_H
1+
#if !defined(UTILS_HPP)
2+
#define UTILS_HPP
33

44
#include "rang.hpp"
55
#include <iostream>

0 commit comments

Comments
 (0)