convert to lib
This commit is contained in:
@ -1,18 +1,29 @@
|
|||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.0)
|
||||||
|
|
||||||
project(unwrap)
|
project(uvosunwrap)
|
||||||
|
|
||||||
set(SRC_FILES src/main.cpp src/unwrap.cpp src/drawing.cpp src/matutils.cpp src/bgremoval.cpp src/charuco.cpp src/harris.cpp)
|
set(SRC_FILES_LIB src/unwrap.cpp src/drawing.cpp src/matutils.cpp src/bgremoval.cpp src/charuco.cpp src/harris.cpp)
|
||||||
|
|
||||||
|
set(SRC_FILES_APP src/main.cpp)
|
||||||
|
|
||||||
find_package( OpenCV REQUIRED )
|
find_package( OpenCV REQUIRED )
|
||||||
|
|
||||||
add_executable(${PROJECT_NAME} ${SRC_FILES})
|
add_library(${PROJECT_NAME} SHARED ${SRC_FILES_LIB})
|
||||||
|
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})
|
||||||
|
target_include_directories(${PROJECT_NAME} PRIVATE ${OpenCV_INCLUDE_DIRS})
|
||||||
|
target_compile_options(${PROJECT_NAME} PRIVATE "-std=c++17" "-Wall" "-O2" "-fno-strict-aliasing")
|
||||||
|
|
||||||
|
link_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
|
add_executable(${PROJECT_NAME}_cli ${SRC_FILES_APP})
|
||||||
|
target_link_libraries( ${PROJECT_NAME}_cli ${OpenCV_LIBS} -l${PROJECT_NAME})
|
||||||
|
target_include_directories(${PROJECT_NAME}_cli PRIVATE ${OpenCV_INCLUDE_DIRS} )
|
||||||
|
target_compile_options(${PROJECT_NAME}_cli PRIVATE "-std=c++17" "-Wall" "-O2" "-fno-strict-aliasing")
|
||||||
|
|
||||||
target_link_libraries( ${PROJECT_NAME} ${LIBS} -lopencv_core -lopencv_aruco -lopencv_imgcodecs -lopencv_highgui -lopencv_features2d -lopencv_imgcodecs -lopencv_imgproc -lopencv_video -lopencv_stitching)
|
|
||||||
target_include_directories(${PROJECT_NAME} PRIVATE "/usr/include/opencv4")
|
|
||||||
add_definitions(" -std=c++17 -Wall -O2 -fno-strict-aliasing")
|
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
|
||||||
|
|
||||||
|
|
||||||
set(CMAKE_INSTALL_PREFIX "/usr")
|
set(CMAKE_INSTALL_PREFIX "/usr")
|
||||||
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)
|
install(TARGETS ${PROJECT_NAME}_cli RUNTIME DESTINATION bin)
|
||||||
|
install(TARGETS ${PROJECT_NAME} DESTINATION lib)
|
||||||
|
install(DIRECTORY src/uvosunwrap/ DESTINATION include/${PROJECT_NAME} FILES_MATCHING PATTERN "*.h")
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
* Boston, MA 02110-1301, USA.
|
* Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "bgremoval.h"
|
#include "uvosunwrap/bgremoval.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <opencv2/highgui.hpp>
|
#include <opencv2/highgui.hpp>
|
||||||
#include <opencv2/imgproc.hpp>
|
#include <opencv2/imgproc.hpp>
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
* Boston, MA 02110-1301, USA.
|
* Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "charuco.h"
|
#include "uvosunwrap/charuco.h"
|
||||||
#include <opencv2/aruco/charuco.hpp>
|
#include <opencv2/aruco/charuco.hpp>
|
||||||
#include <opencv2/highgui.hpp>
|
#include <opencv2/highgui.hpp>
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include <opencv2/imgproc.hpp>
|
#include <opencv2/imgproc.hpp>
|
||||||
#include <opencv2/features2d.hpp>
|
#include <opencv2/features2d.hpp>
|
||||||
#include <opencv2/highgui.hpp>
|
#include <opencv2/highgui.hpp>
|
||||||
#include "harris.h"
|
#include "uvosunwrap/harris.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "matutils.h"
|
#include "matutils.h"
|
||||||
#include "drawing.h"
|
#include "drawing.h"
|
||||||
|
10
src/main.cpp
10
src/main.cpp
@ -26,12 +26,12 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "argpopt.h"
|
#include "argpopt.h"
|
||||||
#include "unwrap.h"
|
#include "uvosunwrap/unwrap.h"
|
||||||
#include "bgremoval.h"
|
#include "uvosunwrap/bgremoval.h"
|
||||||
#include "normalize.h"
|
#include "uvosunwrap/normalize.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "charuco.h"
|
#include "uvosunwrap/charuco.h"
|
||||||
#include "harris.h"
|
#include "uvosunwrap/harris.h"
|
||||||
|
|
||||||
#define IMREAD_SIZE pow(2, 20)
|
#define IMREAD_SIZE pow(2, 20)
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
* Boston, MA 02110-1301, USA.
|
* Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "unwrap.h"
|
#include "uvosunwrap/unwrap.h"
|
||||||
|
|
||||||
#include <opencv2/highgui.hpp>
|
#include <opencv2/highgui.hpp>
|
||||||
#include <opencv2/stitching/detail/seam_finders.hpp>
|
#include <opencv2/stitching/detail/seam_finders.hpp>
|
||||||
|
Reference in New Issue
Block a user