Skip to content
Snippets Groups Projects
Commit 27a7faa0 authored by simon.fanetti's avatar simon.fanetti
Browse files

adjust to shared object lib

parent 56fb6a5d
No related branches found
No related tags found
No related merge requests found
include ./lib/common.mk
include src/common.mk
SRCS=$(wildcard ./*.cpp)
OBJS=$(SRCS:%.cpp=%.o)
OBJSALL=$(shell find . -name '*.o')
LIBNAME=libsandbox
LIB_MINOR_VERS=0.0
LIB_MAJOR_VERS=1
LIB_VERS=$(LIB_MAJOR_VERS).$(LIB_MINOR_VERS)
LIB_FULL_NAME=$(LIBNAME).so.$(LIB_VERS)
path=$(shell pwd)
ld_libs=$(shell echo $$LD_LIBRARY_PATH)
all:
$(MAKE) -C lib
$(MAKE) -C src
$(MAKE) build -C .
$(MAKE) pack -C .
# $(MAKE) link -C .
build: $(OBJS)
%.o: %.cpp
g++ -c $(CFLAGS) $(OPENCVFLAG) $< -o $@
$(CCP) -c $(CFLAGS) $< -o $@
# manque tout les autres fichiers .o
pack:
gcc -shared $(OBJSALL) $(CFLAGS) $(OPENCVFLAG) -lrealsense2 -o ./libsandbox.so
gcc -shared -Wl,-soname,$(LIB_FULL_NAME) $(OBJSALL) -o $(LIB_FULL_NAME)
link:
-ln -s $(LIB_FULL_NAME) $(LIBNAME).so.$(LIB_MAJOR_VERS)
-ln -s $(LIB_FULL_NAME) $(LIBNAME).so
clean:
-rm -f *.o *.so
$(MAKE) clean -C lib
-rm -f *.o *.so*
$(MAKE) clean -C src
#!/bin/bash
export LD_LIBRARY_PATH=$(pwd) && \
make link
......@@ -2,6 +2,7 @@
#define BEAMER_H
#include <opencv2/opencv.hpp>
#include "camera.h"
class Beamer
{
......
File moved
File moved
File moved
File moved
#ifndef CONTROLLER_H
#define CONTROLLER_H
#include "./components/camera.h"
#include "./components/calibrate.h"
#include "./components/beamer.h"
#include "./tools/borderedit.h"
#include "./tools/borderfinder.h"
#include <opencv2/opencv.hpp>
#include "camera.h"
#include "calibrate.h"
#include "beamer.h"
#include "borderedit.h"
#include "borderfinder.h"
class Controller{
class Controller
{
public:
Controller();
cv::Mat getRGBFrame();
......
File moved
#ifndef SANDBOX_H
#define SANDBOX_H
#include "./lib/controller.h"
#include <opencv2/opencv.hpp>
#include "controller.h"
class Sandbox{
class Sandbox
{
public:
Sandbox();
cv::Mat getRGBFrame();
......
File moved
#include "./sandbox.h"
#include "includes/sandbox.h"
Sandbox::Sandbox(){
//controller = Controller();
......
......@@ -11,7 +11,7 @@ all:
build: $(OBJS)
%.o: %.cpp
g++ $(CFLAGS) $(OPENCVFLAG) -c $< -o $@
g++ $(CFLAGS) -c $< -o $@
clean:
-rm -f *.o
......
CCP=g++
CFLAGS=-std=c++11 -Wall -Wextra -g -Ilib -fPIC
OPENCVFLAG=`pkg-config --libs --cflags opencv`
CAMERAFLAG=-lrealsense2
......@@ -6,7 +6,7 @@ CAMERAFLAG=-lrealsense2
build: $(OBJS)
camera.o: camera.cpp camera.h
camera.o: camera.cpp
g++ -c $(CFLAGS) $(OPENCVFLAG) $(CAMERAFLAG) $< -o $@
%.o: %.cpp
......
#include "beamer.h"
#include "../../includes/beamer.h"
using namespace cv;
using namespace std;
......
#include "calibrate.h"
#include "camera.h"
#include "../../includes/calibrate.h"
#include "../../includes/camera.h"
using namespace cv;
using namespace std;
......
#include "camera.h"
#include "../../includes/camera.h"
using namespace cv;
Camera::Camera() {}
......
#include "./controller.h"
#include "../includes/controller.h"
#include <numeric>
#include <fstream>
#include <string>
......
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment