CMake Support

main
Xiao Song 3 years ago
parent 225f668539
commit 2914357f97

3
.gitignore vendored

@ -36,3 +36,6 @@ build/
# MacOS / Linux
.DS_Store
# Example
bin/demo

@ -4,9 +4,13 @@ cmake_minimum_required(VERSION 3.0)
project(hdrplus)
# set c++ standard
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -march=native -O3")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -march=native -O3")
# Default build with release
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
# Arm / X86 optimize flag
if(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "arm*")
@ -26,8 +30,27 @@ endif()
# dependency opencv
find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS})
include_directories( BEFORE ${OpenCV_INCLUDE_DIRS})
# library
include_directories(
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/include )
add_library(${PROJECT_NAME} SHARED
src/align.cpp
src/bayer_image.cpp
src/burst.cpp
src/finish.cpp
src/hdrplus_pipeline.cpp
src/merge.cpp )
target_link_libraries(${PROJECT_NAME}
${OpenCV_LIBS})
# example
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin )
# executable
add_executable( demo bin/demo.cpp )
target_link_libraries( demo ${OpenCV_LIBS} )
add_executable( demo
bin/demo.cpp )
target_link_libraries( demo ${PROJECT_NAME} )

@ -0,0 +1,4 @@
# Dependency
1. [OpenCV](git@github.com:opencv/opencv.git) v4.5.5 build from source through CMake

@ -1 +1,7 @@
#include "hdrplus/hdrplus.h"
#include "hdrplus/hdrplus_pipeline.h"
int main( int argc, char** argv )
{
hdrplus::hdrplus_pipeline pipeline;
pipeline.run_pipeline();
}

@ -5,4 +5,9 @@
namespace hdrplus
{
class align
{
};
} // namespace hdrplus

@ -5,4 +5,9 @@
namespace hdrplus
{
class bayer_image
{
};
} // namespace hdrplus

@ -1,8 +1,15 @@
#pragma once
#include <vector>
#include <opencv2/opencv.hpp> // all opencv header
#include <hdrplus/bayer_image.h>
namespace hdrplus
{
class burst
{
std::vector<hdrplus::bayer_image> bayer_images;
};
} // namespace hdrplus

@ -5,4 +5,9 @@
namespace hdrplus
{
class finish
{
};
} // namespace hdrplus

@ -1,8 +0,0 @@
#pragma once
#include <opencv2/opencv.hpp> // all opencv header
namespace hdrplus
{
} // namespace hdrplus

@ -0,0 +1,23 @@
#pragma once
#include <opencv2/opencv.hpp> // all opencv header
#include <hdrplus/burst.h>
#include <hdrplus/align.h>
#include <hdrplus/merge.h>
#include <hdrplus/finish.h>
namespace hdrplus
{
class hdrplus_pipeline
{
private:
hdrplus::align align;
hdrplus::merge merge;
hdrplus::finish finish;
public:
void run_pipeline();
};
} // namespace hdrplus

@ -5,4 +5,9 @@
namespace hdrplus
{
class merge
{
};
} // namespace hdrplus

@ -1,7 +0,0 @@
#include <opencv2/opencv.hpp> // all opencv header
#include "hdrplus/hdrplus.h"
namespace hdrplus
{
} // namespace hdrplus

@ -0,0 +1,13 @@
#include <cstdio>
#include <opencv2/opencv.hpp> // all opencv header
#include "hdrplus/hdrplus_pipeline.h"
namespace hdrplus
{
void hdrplus_pipeline::run_pipeline()
{
printf("Run pipeline\n");
}
} // namespace hdrplus
Loading…
Cancel
Save