Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kaldi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
poppto72658
kaldi
Commits
4f7aa50a
Unverified
Commit
4f7aa50a
authored
Jun 1, 2020
by
Cloud Han
Committed by
GitHub
Jun 1, 2020
Browse files
Options
Downloads
Patches
Plain Diff
[build] relax python requirement in cmake build (#4090)
parent
a8fc99d0
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+2
-5
2 additions, 5 deletions
CMakeLists.txt
cmake/gen_cmake_skeleton.py
+6
-1
6 additions, 1 deletion
cmake/gen_cmake_skeleton.py
with
8 additions
and
6 deletions
CMakeLists.txt
+
2
−
5
View file @
4f7aa50a
...
...
@@ -6,12 +6,9 @@ include(GNUInstallDirs)
include
(
Utils
)
include
(
third_party/get_third_party
)
# Should update cmake to a more recent version which supports FindPython3.
find_package
(
PythonInterp
)
if
(
NOT PYTHON_EXECUTABLE OR PYTHON_VERSION_MAJOR LESS 3
)
message
(
WARNING
"Needs python3 to auto-generate most CMake files, but not found. "
"Will try `python3` directly..."
)
set
(
PYTHON_EXECUTABLE
"python3"
)
if
(
NOT PYTHON_EXECUTABLE
)
message
(
FATAL_ERROR
"Needs python to auto-generate most CMake files, but not found."
)
endif
()
message
(
STATUS
"Running gen_cmake_skeleton.py"
)
...
...
This diff is collapsed.
Click to expand it.
cmake/gen_cmake_skeleton.py
+
6
−
1
View file @
4f7aa50a
from
__future__
import
print_function
import
os
import
sys
import
re
import
fnmatch
import
argparse
# avoid Python>3 rewrite newline on different platforms
os
.
linesep
=
"
\n
"
# earily parse, will refernece args globally
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"
working_dir
"
)
...
...
@@ -308,7 +313,7 @@ class CMakeListsFile(object):
self
.
sections
.
append
(
section
)
def
write_file
(
self
):
with
open
(
self
.
path
,
"
w
"
,
newline
=
'
\n
'
)
as
f
:
# good luck for python2
with
open
(
self
.
path
,
"
w
"
)
as
f
:
f
.
write
(
CMakeListsFile
.
GEN_CMAKE_HEADER
)
for
s
in
self
.
sections
:
code
=
s
.
gen_code
()
...
...
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