Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor 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
schwede
openstructure
Commits
7d03a05a
Commit
7d03a05a
authored
11 years ago
by
Andreas Schenk
Browse files
Options
Downloads
Patches
Plain Diff
fix for OSX rpath removal during package generation
parent
942231c3
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmake_support/CopyDependencies.cmake
+14
-32
14 additions, 32 deletions
cmake_support/CopyDependencies.cmake
with
14 additions
and
32 deletions
cmake_support/CopyDependencies.cmake
+
14
−
32
View file @
7d03a05a
...
...
@@ -419,37 +419,6 @@ function(append_unique list_var value)
endfunction
(
append_unique
)
#=============================================================================
# function copy_python
#=============================================================================
function
(
copy_python include_path version new_binary_path
)
get_filename_component
(
real_python_include_path
${
include_path
}
REALPATH
)
get_filename_component
(
python_root_dir
${
real_python_include_path
}
/../.. REALPATH
)
file
(
COPY
${
python_root_dir
}
/
${
LIB_DIR
}
/python
${
version
}
/ DESTINATION
${
CMAKE_INSTALL_PREFIX
}
/
${
LIB_DIR
}
/python
${
version
}
)
file
(
GLOB py_config_files
"
${
include_path
}
/pyconfig*.h"
)
file
(
COPY
${
py_config_files
}
DESTINATION
${
CMAKE_INSTALL_PREFIX
}
/include/python
${
version
}
)
file
(
GLOB_RECURSE python_so_files
"
${
CMAKE_INSTALL_PREFIX
}
/
${
LIB_DIR
}
/python
${
version
}
/*.so"
)
if
(
NOT APPLE
)
foreach
(
so_file
${
python_so_files
}
)
remove_rpath
(
"
${
so_file
}
"
)
endforeach
(
so_file
)
endif
(
NOT APPLE
)
read_config
(
ost_config
)
if
(
APPLE
)
file
(
COPY
${
python_root_dir
}
/Resources/Python.app/Contents/MacOS/Python DESTINATION
${
CMAKE_INSTALL_PREFIX
}
/bin
)
set
(
${
new_binary_path
}
"
${
CMAKE_INSTALL_PREFIX
}
/bin/Python"
PARENT_SCOPE
)
string
(
REGEX REPLACE
"pyexec=
\"
[^
\n\$
]*
\"
"
"pyexec=
\"\$
DNG_BINDIR/Python
\"\n
export PYTHONHOME=
\$
DNG_ROOT"
ost_config
"
${
ost_config
}
"
)
else
(
APPLE
)
file
(
GLOB python_libs
"
${
python_root_dir
}
/
${
LIB_DIR
}
/libpython
${
version
}
.so*"
)
file
(
COPY
${
python_libs
}
DESTINATION
${
CMAKE_INSTALL_PREFIX
}
/
${
LIB_DIR
}
)
file
(
COPY
${
python_root_dir
}
/bin/python
${
version
}
DESTINATION
${
CMAKE_INSTALL_PREFIX
}
/bin
)
set
(
${
new_binary_path
}
"
${
CMAKE_INSTALL_PREFIX
}
/bin/python
${
version
}
"
PARENT_SCOPE
)
string
(
REGEX REPLACE
"pyexec=
\"
[^
\n\$
]*
\"
"
"pyexec=
\"\$
DNG_BINDIR/python
${
version
}
\"\n
export PYTHONHOME=
\$
DNG_ROOT"
ost_config
"
${
ost_config
}
"
)
endif
(
APPLE
)
write_config
(
"
${
ost_config
}
"
)
endfunction
(
copy_python
)
#=============================================================================
# function read_config
...
...
@@ -681,7 +650,7 @@ function(copy_python include_path version new_binary_path)
file
(
COPY
${
py_config_files
}
DESTINATION
${
CMAKE_INSTALL_PREFIX
}
/include/python
${
version
}
)
file
(
GLOB_RECURSE python_so_files
"
${
CMAKE_INSTALL_PREFIX
}
/
${
LIB_DIR
}
/python
${
version
}
/*.so"
)
foreach
(
so_file
${
python_so_files
}
)
file
(
RPATH_REMOVE FILE
"
${
so_file
}
"
)
remove_rpath
(
"
${
so_file
}
"
)
endforeach
(
so_file
)
read_config
(
ost_config
)
file
(
COPY
${
python_root_dir
}
/Resources/Python.app/Contents/MacOS/Python DESTINATION
${
CMAKE_INSTALL_PREFIX
}
/bin
)
...
...
@@ -690,6 +659,19 @@ function(copy_python include_path version new_binary_path)
write_config
(
"
${
ost_config
}
"
)
endfunction
(
copy_python
)
#=============================================================================
# function remove_rpath (OSX)
#=============================================================================
function
(
remove_rpath file
)
get_rpath
(
${
file
}
rpath
)
if
(
${
rpath
}
)
execute_process
(
COMMAND stat -f %Mp%Lp
"
${
file
}
"
OUTPUT_VARIABLE permissions
)
execute_process
(
COMMAND chmod ugo+wx
"
${
file
}
"
)
string
(
SUBSTRING
${
permissions
}
0 3 permissions
)
file
(
RPATH_REMOVE FILE
"
${
file
}
"
)
execute_process
(
COMMAND chmod
${
permissions
}
"
${
file
}
"
)
endif
(
${
rpath
}
)
endfunction
(
remove_rpath
)
elseif
(
WIN32 AND NOT UNIX
)
...
...
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