@@ -20,9 +20,25 @@ if(CONDA_ROOT)
2020
2121endif ()
2222
23- include (third_party/get_third_party)
23+ option (BuildForFedora "Build for Fedora. Means that everything is build with Border tools" NO )
24+
25+ if (BuildForFedora)
26+
27+ # You also need to install sudo dnf install lapack-devel openfst-devel
28+ set (CMAKE_CXX_STANDARD 17)
29+ set (CMAKE_CXX_STANDARD_REQUIRED ON )
30+ set (CMAKE_CXX_EXTENSIONS OFF )
31+
32+ #find_package(PkgConfig REQUIRED)
33+
34+ #pkg_check_modules(FST REQUIRED fst)
35+
36+ else ()
37+ include (third_party/get_third_party)
38+
39+ include (cmake/third_party/openfst.cmake)
40+ endif ()
2441
25- include (cmake/third_party/openfst.cmake)
2642
2743find_package (PythonInterp)
2844if (NOT PYTHON_EXECUTABLE)
@@ -43,8 +59,11 @@ execute_process(COMMAND ${PYTHON_EXECUTABLE}
4359)
4460unset (IS_LIB_SHARE)
4561
46- set (CMAKE_CXX_STANDARD 14)
47- set (CMAKE_CXX_EXTENSIONS OFF )
62+ if (BuildForFedora)
63+ else ()
64+ set (CMAKE_CXX_STANDARD 14)
65+ set (CMAKE_CXX_EXTENSIONS OFF )
66+ endif ()
4867set (CMAKE_INSTALL_MESSAGE LAZY) # hide "-- Up-to-date: ..."
4968if (BUILD_SHARED_LIBS )
5069 set (CMAKE_POSITION_INDEPENDENT_CODE ON )
@@ -228,8 +247,19 @@ endif()
228247# PATHS "${CMAKE_CURRENT_SOURCE_DIR}/tools/openfst/include"
229248# REQUIRED)
230249
250+ if (BuildForFedora)
251+ # Version used used by Fedora 41 is 1.83
252+ # TODO: Detect the right version and put it here.
253+ add_definitions (-DOPENFST_VER=18300)
254+ # link_directories(/usr/lib64)
255+ # include_directories(/usr/include/fst)
256+ endif ()
257+
231258link_libraries (fst)
232259
260+
261+
262+
233263# add all native libraries
234264add_subdirectory (src/base) # NOTE, we need to patch the target with version from outside
235265set_property (TARGET kaldi-base PROPERTY COMPILE_DEFINITIONS "KALDI_VERSION=\" ${KALDI_VERSION} \" " )
0 commit comments