Skip to content

Fix OpenFst CMake installation and document install options. - #428

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
copybara/1020359567
Open

copybara-service[bot] wants to merge 1 commit into
mainfrom
copybara/1020359567

Conversation

@copybara-service

Copy link
Copy Markdown

Fix OpenFst CMake installation and document install options.

Enabling OPENFST_ENABLE_INSTALL with default OPENFST_BUILD_TESTS=ON failed CMake export generation because test-only fststatus_matchers was added to OpenFstTargets while linking non-exported GTest::gtest and GTest::gmock. Building with BUILD_SHARED_LIBS=ON also compiled internal *-main CLI helper libraries as shared libraries without installing them, leaving installed executables with missing runtime library dependencies, while README.md omitted -DOPENFST_ENABLE_INSTALL=ON and -DOPENFST_USE_SYSTEM_ABSEIL=ON from its installation steps.

Exclude test-only fststatus_matchers and status_matchers.h from installation and OpenFstTargets, mark internal *-main helper libraries STATIC so they link directly into CLI executables regardless of BUILD_SHARED_LIBS, declare the missing OPENFST_ENABLE_CATEGORIAL option and fix FATAL_ERROR message spacing in CMakeLists.txt, and document the installation workflow and general CMake options in README.md.

Enabling `OPENFST_ENABLE_INSTALL` with default `OPENFST_BUILD_TESTS=ON` failed CMake export generation because test-only `fststatus_matchers` was added to `OpenFstTargets` while linking non-exported `GTest::gtest` and `GTest::gmock`. Building with `BUILD_SHARED_LIBS=ON` also compiled internal `*-main` CLI helper libraries as shared libraries without installing them, leaving installed executables with missing runtime library dependencies, while `README.md` omitted `-DOPENFST_ENABLE_INSTALL=ON` and `-DOPENFST_USE_SYSTEM_ABSEIL=ON` from its installation steps.

Exclude test-only `fststatus_matchers` and `status_matchers.h` from installation and `OpenFstTargets`, mark internal `*-main` helper libraries `STATIC` so they link directly into CLI executables regardless of `BUILD_SHARED_LIBS`, declare the missing `OPENFST_ENABLE_CATEGORIAL` option and fix `FATAL_ERROR` message spacing in `CMakeLists.txt`, and document the installation workflow and general CMake options in `README.md`.

PiperOrigin-RevId: 1020359567
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant