Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aidge_backend_opencv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eclipse Projects
aidge
aidge_backend_opencv
Commits
4f5b06bd
Commit
4f5b06bd
authored
9 months ago
by
Grégoire Kubler
Committed by
Maxence Naud
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
feat : added alternate build backend option + rm copying version.txt into pkg
parent
92bd3b96
No related branches found
No related tags found
1 merge request
!18
v0.1.3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
setup.py
+13
-12
13 additions, 12 deletions
setup.py
with
13 additions
and
12 deletions
setup.py
+
13
−
12
View file @
4f5b06bd
...
...
@@ -13,8 +13,9 @@ import toml
from
setuptools
import
setup
,
Extension
from
setuptools.command.build_ext
import
build_ext
def
get_project_name
()
->
str
:
with
open
(
pathlib
.
Path
().
absolute
()
/
"
pyproject.toml
"
,
"
r
"
)
as
file
:
with
open
(
pathlib
.
Path
().
absolute
()
/
"
pyproject.toml
"
,
"
r
"
)
as
file
:
project_toml
=
toml
.
load
(
file
)
return
project_toml
[
"
project
"
][
"
name
"
]
...
...
@@ -23,8 +24,8 @@ class CMakeExtension(Extension):
def
__init__
(
self
,
name
):
super
().
__init__
(
name
,
sources
=
[])
class
CMakeBuild
(
build_ext
):
class
CMakeBuild
(
build_ext
):
def
run
(
self
):
# This lists the number of processors available on the machine
# The compilation will use half of them
...
...
@@ -52,24 +53,29 @@ class CMakeBuild(build_ext):
else
os
.
environ
[
"
AIDGE_PYTHON_BUILD_TYPE
"
]
)
# Impose to use the executable of the python
# used to launch setup.py to setup PythonInterp
install_path
=
(
os
.
path
.
join
(
sys
.
prefix
,
"
lib
"
,
"
libAidge
"
)
if
"
AIDGE_INSTALL
"
not
in
os
.
environ
else
os
.
environ
[
"
AIDGE_INSTALL
"
]
)
build_gen
=
(
[
"
-G
"
,
os
.
environ
[
"
AIDGE_BUILD_GEN
"
]]
if
"
AIDGE_BUILD_GEN
"
in
os
.
environ
else
[]
)
self
.
spawn
(
[
"
cmake
"
,
*
build_gen
,
str
(
cwd
),
f
"
-DPYTHON_EXECUTABLE=
{
sys
.
executable
}
"
,
"
-DTEST=OFF
"
,
f
"
-DCMAKE_INSTALL_PREFIX:PATH=
{
install_path
}
"
,
f
"
-DCMAKE_BUILD_TYPE=
{
compile_type
}
"
,
"
-DPYBIND=ON
"
,
"
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
"
,
"
-DCOVERAGE=OFF
"
"
-DCOVERAGE=OFF
"
,
]
)
...
...
@@ -94,13 +100,8 @@ class CMakeBuild(build_ext):
currentFile
=
os
.
path
.
join
(
root
,
file
)
shutil
.
copy
(
currentFile
,
str
(
aidge_package
.
absolute
()))
# Copy version.txt in aidge_package
os
.
chdir
(
os
.
path
.
dirname
(
__file__
))
shutil
.
copy
(
"
version.txt
"
,
str
(
aidge_package
.
absolute
()))
if
__name__
==
'
__main__
'
:
if
__name__
==
"
__main__
"
:
setup
(
include_package_data
=
True
,
ext_modules
=
[
CMakeExtension
(
get_project_name
())],
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment