Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ar_sandbox_python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AR_Sandbox
ar_sandbox_python
Compare revisions
494cf1d847aae60abf42355a63722ee8071d841c to 3e390bb115a7f389596e08e91b510e422b0c35f7
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
ar_sandbox/ar_sandbox_python
Select target project
No results found
3e390bb115a7f389596e08e91b510e422b0c35f7
Select Git revision
Branches
QL-devel
main
2 results
Swap
Target
ar_sandbox/ar_sandbox_python
Select target project
ar_sandbox/ar_sandbox_python
1 result
494cf1d847aae60abf42355a63722ee8071d841c
Select Git revision
Branches
QL-devel
main
2 results
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
Update of install process
· f1415dc3
Quentin Leblanc
authored
1 month ago
and
Alexis Durgnat
committed
1 month ago
f1415dc3
Merge branch 'QL-devel' into 'main'
· 3e390bb1
Alexis Durgnat
authored
1 month ago
Update of install process See merge request
!1
3e390bb1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+81
-11
81 additions, 11 deletions
CMakeLists.txt
cpp/Makefile.valid
+24
-0
24 additions, 0 deletions
cpp/Makefile.valid
with
105 additions
and
11 deletions
CMakeLists.txt
View file @
3e390bb1
cmake_minimum_required
(
VERSION
2.8
.1
2
)
cmake_minimum_required
(
VERSION
3
.1
)
project
(
sandbox_wrapper
)
set
(
LIBNAME
"sandbox_wrapper"
)
set
(
LIB_MINOR_VERS
"0.0"
)
set
(
LIB_MAJOR_VERS
"1"
)
set
(
LIB_VERS
"
${
LIB_MAJOR_VERS
}
.
${
LIB_MINOR_VERS
}
"
)
set
(
LIB_FULL_NAME
"
${
LIBNAME
}
.so.
${
LIB_VERS
}
"
)
set
(
LIBSANDBOX_DIR
""
CACHE PATH
"Path to LIBSANDBOX Directory"
)
set
(
BUILD_DIR
""
CACHE PATH
"Path in the LIBSANDBOX Directory for the built .so file"
)
if
(
NOT LIBSANDBOX_DIR
)
message
(
FATAL_ERROR
"LIBSANDBOX Directory must be passed with -DLIBSANDBOX_DIR=..."
)
endif
()
if
(
NOT BUILD_DIR
)
message
(
FATAL_ERROR
"BUILD_DIR Directory must be passed with -DBUILD_DIR=..."
)
endif
()
set
(
BUILD_DIR
"
${
LIBSANDBOX_DIR
}${
BUILD_DIR
}
"
)
message
(
STATUS
"LIBSANDBOX located at:
${
LIBSANDBOX_DIR
}
"
)
message
(
STATUS
"Build of LIBSANDBOX located at
${
BUILD_DIR
}
"
)
find_package
(
OpenCV REQUIRED
)
include_directories
(
${
OpenCV_INCLUDE_DIRS
}
)
include_directories
(
/usr/include/x86_64-linux-gnu/python3.6m
)
include_directories
(
/usr/include/python3.6m
)
include_directories
(
/home/frog/Prog/Projects/Sandbox/lib/ar_sandbox_lib/inc
)
include_directories
(
inc
${
OpenCV_INCLUDE_DIRS
}
)
find_package
(
realsense2 REQUIRED
)
include_directories
(
inc
${
realsense_INCLUDE_DIR
}
)
find_package
(
yaml-cpp REQUIRED
)
include_directories
(
inc
${
YAML_CPP_INCLUDE_DIRS
}
)
find_package
(
Python3 REQUIRED COMPONENTS Interpreter Development
)
include_directories
(
inc
${
Python3_INCLUDE_DIRS
}
)
include_directories
(
inc
${
LIBSANDBOX_DIR
}
/inc
)
set
(
PYBIND11_FINDPYTHON ON
)
find_package
(
pybind11 CONFIG REQUIRED
)
include_directories
(
inc
${
pybind11_INCLUDE_DIR
}
)
# pybind11_add_module(sandbox_wrapper cpp/sandbox_wrapper.cpp)
file
(
GLOB_RECURSE SOURCES
cpp/*.cpp
)
add_library
(
${
LIBNAME
}
SHARED
${
SOURCES
}
)
set_target_properties
(
${
LIBNAME
}
PROPERTIES OUTPUT_NAME
${
LIBNAME
}
VERSION
${
LIB_VERS
}
SOVERSION
${
LIB_MAJOR_VERS
}
)
target_link_libraries
(
${
LIBNAME
}
${
OpenCV_LIBS
}
)
target_link_libraries
(
${
LIBNAME
}
${
realsense_LIBS
}
)
target_link_libraries
(
${
LIBNAME
}
-lrealsense2
)
target_link_libraries
(
${
LIBNAME
}
${
YAML_CPP_LIBRARIES
}
)
target_link_libraries
(
${
LIBNAME
}
-lyaml-cpp
)
include_directories
(
${
LIBNAME
}
${
BUILD_DIR
}
)
target_link_libraries
(
${
LIBNAME
}
"
${
BUILD_DIR
}
/libsandbox.so.1.0.0"
)
target_compile_options
(
${
LIBNAME
}
PRIVATE
-std=c++11
# Utilisation de C++11
-Wall
# Affichage des avertissements classiques
-Wextra
# Avertissements supplémentaires
-g
# Ajout des symboles de debug
-fPIC
# Position Indépendante du Code (obligatoire pour les bibliothèques partagées)
-Ilib
)
# Création des liens symboliques après la compilation
add_custom_command
(
TARGET
${
LIBNAME
}
POST_BUILD
WORKING_DIRECTORY
${
CMAKE_LIBRARY_OUTPUT_DIRECTORY
}
COMMENT
"Copie de
${
LIB_FULL_NAME
}
dans src/ar_sandbox/wrapper"
COMMAND
${
CMAKE_COMMAND
}
ARGS -E copy
"lib
${
LIB_FULL_NAME
}
"
../src/ar_sandbox/wrapper/
"
${
LIBNAME
}
.so"
)
include_directories
(
/usr/local/lib/python3.6/dist-packages/pybind11/share/cmake/pybind11
)
find_package
(
pybind11 REQUIRED
)
pybind11_add_module
(
sandbox_wrapper ./cpp/sandbox_wrapper.cpp
)
add_custom_command
(
TARGET
${
LIBNAME
}
POST_BUILD
WORKING_DIRECTORY
${
CMAKE_LIBRARY_OUTPUT_DIRECTORY
}
COMMENT
"Création du module Python dans le répertoire dist/"
COMMAND python -m build ..
# Création du module python en prenant en compte que cmake est exécuté dans un répertoir build situé à la racine du projet.
)
include_directories
(
/home/frog/Prog/Projects/Sandbox/lib/ar_sandbox_lib/build/
)
target_link_libraries
(
sandbox_wrapper PRIVATE
${
OpenCV_LIBS
}
)
target_link_libraries
(
sandbox_wrapper PRIVATE /home/frog/Prog/Projects/Sandbox/lib/ar_sandbox_lib/build/libsandbox.so.1.0.0 -lrealsense2 -lyaml-cpp
)
# Installation de la bibliothèque et des fichiers d'en-tête
install
(
TARGETS
${
LIBNAME
}
DESTINATION lib
)
install
(
DIRECTORY inc/ DESTINATION include
)
This diff is collapsed.
Click to expand it.
cpp/Makefile.valid
0 → 100644
View file @
3e390bb1
OPENCVFLAG
=
`
pkg-config
--libs
--cflags
opencv3
`
CAMERAFLAG
=
-lrealsense2
YAMLFLAG
=
-I
/usr/local/include
-L
/usr/local/lib
-lyaml-cpp
DEP_SANDBOX
=
$(
OPENCVFLAG
)
$(
CAMERAFLAG
)
$(
YAMLFLAG
)
SANDBOX
=
-I
/home/quentin/Documents/HEPIA/ar_sandbox_lib/inc
-L
/home/quentin/Documents/HEPIA/ar_sandbox_lib/build_test/lib
-lsandbox
CFLAGS
=
-std
=
c++11
-Wall
-Wextra
-g
-Ilib
-fPIC
WRAPPER_NAME
=
sandbox_wrapper.so
all
:
sandbox_wrapper.so
sandbox_wrapper
:
sandbox_wrapper.o
c++
-o
$@
$^
$(
shell python3-config
--libs
)
$(
CFLAGS
)
$(
SANDBOX
)
$(
DEP_SANDBOX
)
$(
LDFLAGS
)
sandbox_wrapper.so
:
sandbox_wrapper.o
c++
-O3
-shared
$(
CFLAGS
)
$(
shell python3
-m
pybind11
--includes
)
$^
-o
$(
WRAPPER_NAME
)$(
python3-config
--extension-suffix
)
$(
DEP_SANDBOX
)
$(
SANDBOX
)
sandbox_wrapper.o
:
sandbox_wrapper.cpp
c++
-c
$^
-o
$@
-I
/usr/include/python3.13
$(
python3
-m
pybind11
--includes
)
$(
CFLAGS
)
$(
SANDBOX
)
$(
DEP_SANDBOX
)
clean
:
rm
*
.so
*
.o
\ No newline at end of file
This diff is collapsed.
Click to expand it.