Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added CMakeLists.txt and more structure to source files
- Loading branch information
Showing
16 changed files
with
161 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
cmake_minimum_required(VERSION 3.8) | ||
|
||
project(GraphCut_RANSAC LANGUAGES CXX) | ||
|
||
# indicate if OPENMP should be enabled | ||
option(USE_OPENMP "Use OPENMP" ON) | ||
|
||
# ============================================================================== | ||
# Check C++17 support | ||
# ============================================================================== | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
# ============================================================================== | ||
# Find OpenCV | ||
# ============================================================================== | ||
find_package(OpenCV 3.3 REQUIRED) | ||
|
||
# ============================================================================== | ||
# Find OpenMP | ||
# ============================================================================== | ||
find_package(OpenMP) | ||
if (USE_OPENMP) | ||
if(NOT OPENMP_FOUND) | ||
message(FATAL_ERROR "OPENMP not found.") | ||
endif() | ||
add_definitions(-DUSE_OPENMP) | ||
set(TRGT_LNK_LBS_ADDITIONAL OpenMP::OpenMP_CXX) | ||
endif (USE_OPENMP) | ||
|
||
# ============================================================================== | ||
# Includes | ||
# ============================================================================== | ||
include_directories ( | ||
${PROJECT_SOURCE_DIR}/include/GraphCut_RANSAC | ||
) | ||
|
||
# ============================================================================== | ||
# Structure: Library | ||
# ============================================================================== | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) | ||
|
||
# Set header files for the library | ||
file(GLOB_RECURSE HDRS_GCRANSAC | ||
"include/GraphCut_RANSAC/*.h" | ||
"include/GraphCut_RANSAC/*.cpp" | ||
) | ||
|
||
# Set source files to be added to the library | ||
file(GLOB_RECURSE SRCS_GCRANSAC | ||
"src/GraphCut_RANSAC/*.cpp" | ||
) | ||
|
||
source_group(third_pary\\GCOptimization FILES | ||
src/GraphCut_RANSAC/GCoptimization.cpp | ||
include/GraphCut_RANSAC/graph.cpp | ||
src/GraphCut_RANSAC/LinkedBlockList.cpp | ||
include/GraphCut_RANSAC/maxflow.cpp | ||
include/GraphCut_RANSAC/block.h | ||
include/GraphCut_RANSAC/energy.h | ||
include/GraphCut_RANSAC/GCoptimization.h | ||
include/GraphCut_RANSAC/graph.h | ||
include/GraphCut_RANSAC/LinkedBlockList.h | ||
) | ||
|
||
source_group(third_pary\\Theia FILES | ||
include/GraphCut_RANSAC/prosac.h | ||
include/GraphCut_RANSAC/prosac_sampler.h | ||
include/GraphCut_RANSAC/quality_measurement.h | ||
include/GraphCut_RANSAC/sample_consensus_estimator.h | ||
include/GraphCut_RANSAC/sampler.h | ||
include/GraphCut_RANSAC/inline_support.h | ||
include/GraphCut_RANSAC/estimator.h | ||
) | ||
|
||
add_library(${PROJECT_NAME} STATIC | ||
${HDRS_GCRANSAC} | ||
${SRCS_GCRANSAC} | ||
) | ||
|
||
target_link_libraries(${PROJECT_NAME} | ||
${OpenCV_LIBS} | ||
) | ||
|
||
# ============================================================================== | ||
# Structure: Applications | ||
# ============================================================================== | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) | ||
|
||
|
||
# five_point | ||
file(GLOB_RECURSE HDRSSRCS_FIVE_POINT | ||
"src/Sample_FundamentalEstimator/five_point/*.*" | ||
) | ||
source_group(third_pary\\five_point FILES | ||
${HDRSSRCS_FIVE_POINT} | ||
) | ||
|
||
# estimators | ||
source_group("Estimators" FILES | ||
src/Sample_FundamentalEstimator/essential_estimator.h | ||
src/Sample_FundamentalEstimator/fundamental_estimator.h | ||
src/Sample_FundamentalEstimator/homography_estimator.h | ||
src/Sample_FundamentalEstimator/line_estimator.h | ||
) | ||
|
||
|
||
add_executable(Sample_FundamentalEstimator | ||
${HDRSSRCS_FIVE_POINT} | ||
src/Sample_FundamentalEstimator/essential_estimator.h | ||
src/Sample_FundamentalEstimator/fundamental_estimator.h | ||
src/Sample_FundamentalEstimator/homography_estimator.h | ||
src/Sample_FundamentalEstimator/line_estimator.h | ||
src/Sample_FundamentalEstimator/main.cpp) | ||
|
||
target_link_libraries(Sample_FundamentalEstimator | ||
${OpenCV_LIBS} | ||
${PROJECT_NAME} | ||
) | ||
add_dependencies(Sample_FundamentalEstimator ${PROJECT_NAME}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,6 @@ | |
#include <vector> | ||
|
||
#include "sampler.h" | ||
#include "random.h" | ||
|
||
namespace theia | ||
{ | ||
|
4 changes: 1 addition & 3 deletions
4
src/Sample/essential_estimator.h → ...undamentalEstimator/essential_estimator.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions
2
src/Sample/fundamental_estimator.h → ...damentalEstimator/fundamental_estimator.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
#include "stdafx.h" | ||
|
||
#include <iostream> | ||
#include <math.h> | ||
#include <chrono> | ||
|
4 changes: 2 additions & 2 deletions
4
src/Sample/homography_estimator.h → ...ndamentalEstimator/homography_estimator.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
src/Sample/line_estimator.h → ...ple_FundamentalEstimator/line_estimator.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
#include "stdafx.h" | ||
|
||
#include <iostream> | ||
#include <math.h> | ||
#include <chrono> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters