Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
8f0ff05b
Commit
8f0ff05b
authored
1 year ago
by
Ammar Nejati
Browse files
Options
Downloads
Plain Diff
[a.fixPythonWrappers] Minor fix to CMake scripts which produce the Python wrappers
Merging branch 'a.fixPythonWrappers' into 'main'. Related to issue
#223
See merge request
!2295
parents
a5428635
3293aa8a
No related branches found
No related tags found
1 merge request
!2295
Minor fix to CMake scripts which produce the Python wrappers
Pipeline
#126967
passed
1 year ago
Stage: build
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmake/multipython/MakePythonWheel.cmake
+2
-1
2 additions, 1 deletion
cmake/multipython/MakePythonWheel.cmake
cmake/multipython/SwigLib.cmake
+17
-9
17 additions, 9 deletions
cmake/multipython/SwigLib.cmake
with
19 additions
and
10 deletions
cmake/multipython/MakePythonWheel.cmake
+
2
−
1
View file @
8f0ff05b
...
@@ -145,7 +145,8 @@ function(add_library_to_wheel lib)
...
@@ -145,7 +145,8 @@ function(add_library_to_wheel lib)
if
(
lib_LIBRARY_PY
)
if
(
lib_LIBRARY_PY
)
add_custom_command
(
TARGET
${
lib
}
add_custom_command
(
TARGET
${
lib
}
POST_BUILD
POST_BUILD
COMMAND
${
CMAKE_COMMAND
}
-E copy
"$<TARGET_PROPERTY:
${
lib
}
,_LIBRARY_PY>"
${
_dst
}
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
lib_LIBRARY_PY
}
"
${
_dst
}
DEPENDS lib
${
lib
}
_py_wrappers
COMMENT
"Add Python wrapper-script of library
${
lib
}
to the Python wheel..."
COMMENT
"Add Python wrapper-script of library
${
lib
}
to the Python wheel..."
)
)
endif
()
endif
()
...
...
This diff is collapsed.
Click to expand it.
cmake/multipython/SwigLib.cmake
+
17
−
9
View file @
8f0ff05b
...
@@ -55,24 +55,32 @@ function(SwigLib name lib swigtmpdir)
...
@@ -55,24 +55,32 @@ function(SwigLib name lib swigtmpdir)
";-I
${
LibHeinz_INCLUDE_DIR
}
"
";-I
${
LibHeinz_INCLUDE_DIR
}
"
";-I
${
CMAKE_SOURCE_DIR
}
;-I
${
CMAKE_BINARY_DIR
}
/inc"
)
";-I
${
CMAKE_SOURCE_DIR
}
;-I
${
CMAKE_BINARY_DIR
}
/inc"
)
add_custom_command
(
add_custom_target
(
lib
${
lib
}
_py_wrappers ALL
OUTPUT
${
AUTO_WRAP_DIR
}
/lib
${
lib
}
.py
BYPRODUCTS
${
swigtmpdir
}
/lib
${
lib
}
.py
COMMAND
${
Python3_EXECUTABLE
}
${
SWIG_DIR
}
/tweaks.py
${
swigtmpdir
}
/lib
${
lib
}
.py
${
AUTO_WRAP_DIR
}
/lib
${
lib
}
.py
DEPENDS
${
swigtmpdir
}
/lib
${
lib
}
.py
)
add_custom_command
(
OUTPUT
${
swigtmpdir
}
/lib
${
lib
}
.py
${
AUTO_WRAP_DIR
}
/lib
${
lib
}
_wrap.h
${
AUTO_WRAP_DIR
}
/lib
${
lib
}
_wrap.h
${
AUTO_WRAP_DIR
}
/lib
${
lib
}
_wrap.cpp
${
AUTO_WRAP_DIR
}
/lib
${
lib
}
_wrap.cpp
${
AUTO_WRAP_DIR
}
/lib
${
lib
}
.py
# produce the Python wrapper
COMMAND
${
SWIG_EXECUTABLE
}
${
SWIG_FLAGS
}
${
SWIG_DIR
}
/lib
${
lib
}
.i
COMMAND
${
SWIG_EXECUTABLE
}
${
SWIG_FLAGS
}
${
SWIG_DIR
}
/lib
${
lib
}
.i
# amend the Python wrapper
COMMAND
${
Python3_EXECUTABLE
}
${
SWIG_DIR
}
/tweaks.py
${
swigtmpdir
}
/lib
${
lib
}
.py
${
AUTO_WRAP_DIR
}
/lib
${
lib
}
.py
DEPENDS
${
swig_dependencies
}
${
include_files
}
DEPENDS
${
swig_dependencies
}
${
include_files
}
COMMENT
"SWIG: build Python wrapper
${
AUTO_WRAP_DIR
}
/lib
${
lib
}
.py"
)
)
string
(
REPLACE
";"
" "
SWIG_FLAGS_STR
"
${
SWIG_FLAGS
}
"
)
string
(
REPLACE
";"
" "
SWIG_FLAGS_STR
"
${
SWIG_FLAGS
}
"
)
set
(
SWIG_FLAGS_STR
"
${
SWIG_FLAGS_STR
}
"
CACHE INTERNAL
""
)
set
(
SWIG_FLAGS_STR
"
${
SWIG_FLAGS_STR
}
"
CACHE INTERNAL
""
)
set
(
SWIG_DIR
"
${
SWIG_DIR
}
"
CACHE INTERNAL
""
)
set
(
SWIG_DIR
"
${
SWIG_DIR
}
"
CACHE INTERNAL
""
)
else
()
# assumes that lib${lib}_wrap.h, lib${lib}_wrap.cpp and lib${lib}.py
# are already present in ${AUTO_WRAP_DIR}
add_custom_target
(
lib
${
lib
}
_py_wrappers ALL
DEPENDS
${
AUTO_WRAP_DIR
}
/lib
${
lib
}
_wrap.h
${
AUTO_WRAP_DIR
}
/lib
${
lib
}
_wrap.cpp
${
AUTO_WRAP_DIR
}
/lib
${
lib
}
.py
)
endif
()
endif
()
# include Python and Numpy headers and link to Python shared library
# include Python and Numpy headers and link to Python shared library
...
...
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