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
586151ee
Commit
586151ee
authored
13 years ago
by
Ansgar Philippsen
Browse files
Options
Downloads
Patches
Plain Diff
Revert "extended _find_python_binary to make sure the binary matches the library version"
This reverts commit
77521f73
.
parent
153a3441
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/FindPython.cmake
+15
-37
15 additions, 37 deletions
cmake_support/FindPython.cmake
with
15 additions
and
37 deletions
cmake_support/FindPython.cmake
+
15
−
37
View file @
586151ee
...
...
@@ -70,44 +70,22 @@ endmacro()
macro
(
_find_python_bin PYTHON_ROOT VERSION
)
string
(
REPLACE
"."
""
_VERSION_NO_DOTS
${
VERSION
}
)
foreach
(
_NAME
"python"
"python
${
_VERSION_NO_DOTS
}
"
"python
${
VERSION
}
"
)
if
(
PYTHON_ROOT
)
find_program
(
PYTHON_BINARY
NAMES
${
_NAME
}
HINTS
"
${
PYTHON_ROOT
}
"
PATH_SUFFIXES bin
NO_SYSTEM_ENVIRONMENT_PATH NO_DEFAULT_PATH
)
if
(
PYTHON_BINARY
)
execute_process
(
COMMAND
${
PYTHON_BINARY
}
-V
OUTPUT_VARIABLE PY_VERSION
ERROR_VARIABLE PY_VERSION
)
if
(
PY_VERSION MATCHES
${
VERSION
}
)
break
()
else
()
unset
(
PYTHON_BINARY CACHE
)
endif
()
endif
()
else
()
find_program
(
PYTHON_BINARY
NAMES $_NAME
HINTS
"
${
CMAKE_PREFIX_PATH
}
"
PATH_SUFFIXES bin
)
if
(
PYTHON_BINARY
)
execute_process
(
COMMAND
${
PYTHON_BINARY
}
-V
OUTPUT_VARIABLE PY_VERSION
ERROR_VARIABLE PY_VERSION
)
if
(
${
PY_VERSION
}
matches
${
VERSION
}
)
break
()
else
()
unset
(
PYTHON_BINARY CACHE
)
endif
()
endif
()
endif
()
endforeach
()
if
(
PYTHON_ROOT
)
find_program
(
PYTHON_BINARY
NAMES
"python"
"python
${
_VERSION_NO_DOTS
}
"
"python
${
VERSION
}
"
HINTS
"
${
PYTHON_ROOT
}
"
PATH_SUFFIXES bin
NO_SYSTEM_ENVIRONMENT_PATH NO_DEFAULT_PATH
)
else
()
find_program
(
PYTHON_BINARY
NAMES
"python"
"python
${
_VERSION_NO_DOTS
}
"
"python
${
VERSION
}
"
HINTS
"
${
CMAKE_PREFIX_PATH
}
"
PATH_SUFFIXES bin
)
endif
()
endmacro
()
#-------------------------------------------------------------------------------
# check for python lib
#
...
...
@@ -136,7 +114,7 @@ macro(check_for_python_binary)
foreach
(
_VERSION
${
PYTHON_VERSIONS
}
)
if
(
${
PYTHON_MIN_VERSION
}
VERSION_LESS
${
_VERSION
}
)
_find_python_bin
(
"
${
PYTHON_ROOT
}
"
"
${
_VERSION
}
"
)
if
(
PYTHON_
BINARY
)
if
(
PYTHON_
LIBRARIES
)
set
(
PYTHON_VERSION
"
${
_VERSION
}
"
)
break
()
endif
()
...
...
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