Skip to content

Commit 3e41a83

Browse files
committed
[vshampor] Add basic CMake project structure
1 parent 407ee72 commit 3e41a83

File tree

12 files changed

+159
-0
lines changed

12 files changed

+159
-0
lines changed

vshampor/deshuffler/.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/Debug/
2+
*.yuv
3+
CMakeFiles/*
4+
bin/*
5+
*/bin/*
6+
*/CMakeCache.txt
7+
CMakeCache.txt
8+
CMakeFiles
9+
CMakeScripts
10+
Testing
11+
Makefile
12+
cmake_install.cmake
13+
install_manifest.txt
14+
compile_commands.json
15+
CTestTestfile.cmake
16+
lib/*
17+
*.pc

vshampor/deshuffler/CMakeLists.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
cmake_minimum_required (VERSION 3.11)
2+
project (deshuffler)
3+
if (NOT CMAKE_BUILD_TYPE)
4+
message(STATUS "No build type selected, default to Debug")
5+
set(CMAKE_BUILD_TYPE "Release")
6+
endif()
7+
8+
set (CMAKE_CXX_STANDARD 11)
9+
10+
set(CMAKE_BINARY_DIR bin)
11+
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
12+
set(LIBRARY_OUTPUT_PATH lib)
13+
14+
include_directories(include)
15+
16+
add_subdirectory(unit_tests)
17+
18+
add_library(deshuffler STATIC
19+
src/deshuffler.cpp
20+
src/input_params.cpp
21+
src/permutation_data.cpp)
22+
add_executable(deshuffler_cl src/main.cpp)
23+
add_dependencies(deshuffler_cl deshuffler)
24+
target_link_libraries(deshuffler_cl deshuffler)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#ifndef DESHUFFLER_H_
2+
#define DESHUFFLER_H_
3+
4+
#include "permutation_data.h"
5+
#include "input_params.h"
6+
7+
class Deshuffler
8+
{
9+
public:
10+
Deshuffler() = default;
11+
Deshuffler(const InputParams& _params) : params(_params) {}
12+
void CalculatePermutation();
13+
void OutputPermutation();
14+
void ReconstructStream();
15+
void OutputStream();
16+
private:
17+
InputParams params;
18+
PermutationData permutation_data;
19+
20+
};
21+
22+
#endif /* DESHUFFLER_H_ */
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
#ifndef INPUT_PARAMS_H_
3+
#define INPUT_PARAMS_H_
4+
5+
6+
class InputParams
7+
{
8+
public:
9+
InputParams() = default;
10+
InputParams(int argc, char* argv[]);
11+
};
12+
13+
14+
#endif /* INPUT_PARAMS_H_ */
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#ifndef PERMUTATION_DATA_H_
2+
#define PERMUTATION_DATA_H_
3+
4+
class PermutationData
5+
{
6+
public:
7+
PermutationData();
8+
};
9+
10+
#endif /* PERMUTATION_DATA_H_ */
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include "deshuffler.h"
2+
3+
void Deshuffler::CalculatePermutation()
4+
{
5+
}
6+
7+
void Deshuffler::OutputPermutation()
8+
{
9+
}
10+
11+
void Deshuffler::ReconstructStream()
12+
{
13+
}
14+
15+
void Deshuffler::OutputStream()
16+
{
17+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#include "input_params.h"
2+
InputParams::InputParams(int argc, char* argv[])
3+
{
4+
5+
}

vshampor/deshuffler/src/main.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#include "deshuffler.h"
2+
#include <iostream>
3+
using namespace std;
4+
5+
int main(int argc, char* argv[]) {
6+
InputParams params(argc, argv);
7+
Deshuffler deshuffler(params);
8+
deshuffler.CalculatePermutation();
9+
deshuffler.OutputPermutation();
10+
deshuffler.ReconstructStream();
11+
deshuffler.OutputStream();
12+
return 0;
13+
}
14+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
#include "permutation_data.h"
3+
4+
PermutationData::PermutationData()
5+
{
6+
// TODO Auto-generated constructor stub
7+
8+
}
9+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
add_subdirectory(googletest)
2+
include_directories(googletest/googletest)
3+
include_directories(googletest/googletest/include)
4+
include_directories(googletest/googlemock)
5+
include_directories(googletest/googlemock/include)
6+
7+
add_executable(unit_tests
8+
deshuffler_test.cpp)
9+
add_dependencies(unit_tests deshuffler gtest_main)
10+
target_link_libraries(unit_tests deshuffler gtest_main)
11+
12+
add_custom_command(
13+
POST_BUILD
14+
TARGET unit_tests
15+
COMMAND unit_tests
16+
WORKING_DIRECTORY bin/
17+
COMMENT "Running unit tests..."
18+
)

0 commit comments

Comments
 (0)