Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to installation #7

Merged
merged 3 commits into from
Mar 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions cmake/gen_cmake_skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,12 @@ def gen_code(self):
ret.append(" " + f)
ret.append(")\n")

ret.append('if (GENERATED_LIBS STREQUAL "")')
ret.append(' set(GENERATED_LIBS "{}" CACHE INTERNAL "GENERATED_LIBS")'.format(self.target_name))
ret.append('else()')
ret.append(' set(GENERATED_LIBS "${GENERATED_LIBS};' + '{}" CACHE INTERNAL "GENERATED_LIBS")'.format(self.target_name))
ret.append('endif()')
if self.target_name != 'kaldi-itf':
ret.append('if (GENERATED_LIBS STREQUAL "")')
ret.append(' set(GENERATED_LIBS "{}" CACHE INTERNAL "GENERATED_LIBS")'.format(self.target_name))
ret.append('else()')
ret.append(' set(GENERATED_LIBS "${GENERATED_LIBS};' + '{}" CACHE INTERNAL "GENERATED_LIBS")'.format(self.target_name))
ret.append('endif()')

ret.append("add_library(" + self.target_name + " INTERFACE)")
ret.append("target_include_directories(" + self.target_name + " INTERFACE ")
Expand Down Expand Up @@ -196,12 +197,12 @@ def gen_code(self):
ret.append(" )")
ret.append("endif()\n")

# ret.append('list(APPEND GENERATED_LIBS "{}")'.format(self.target_name))
ret.append('if (GENERATED_LIBS STREQUAL "")')
ret.append(' set(GENERATED_LIBS "{}" CACHE INTERNAL "GENERATED_LIBS")'.format(self.target_name))
ret.append('else()')
ret.append(' set(GENERATED_LIBS "${GENERATED_LIBS};' + '{}" CACHE INTERNAL "GENERATED_LIBS")'.format(self.target_name))
ret.append('endif()')
if self.target_name != 'kaldi-itf':
ret.append('if (GENERATED_LIBS STREQUAL "")')
ret.append(' set(GENERATED_LIBS "{}" CACHE INTERNAL "GENERATED_LIBS")'.format(self.target_name))
ret.append('else()')
ret.append(' set(GENERATED_LIBS "${GENERATED_LIBS};' + '{}" CACHE INTERNAL "GENERATED_LIBS")'.format(self.target_name))
ret.append('endif()')

ret.append("add_library(" + self.target_name)
for f in self.source_list:
Expand Down
13 changes: 12 additions & 1 deletion install.bash
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ _kaldi_build_src_cmake()
# Build src using CMake
cd $KALDI

# Remove existing STATUS file from previous build
if [ -f STATUS ]
then
rm STATUS
fi

# Remove existing build directory
if [ -d build ]
then
rm -rf build
Expand All @@ -144,7 +151,11 @@ _kaldi_build_src_cmake()
mkdir build
cd build
cmake -GNinja -DCMAKE_INSTALL_PREFIX=../dist -DKALDI_BUILD_EXE=OFF -DKALDI_BUILD_TEST=OFF -DBUILD_SHARED_LIBS=ON ..
cmake --build . --target install
cmake --build . --target install || { echo "CMake build failed" && return 1; }

# Create a STATUS file to monitor installation
cd $KALDI
echo "ALL OK" > STATUS
}

_kaldi_build_src_make()
Expand Down