22# SPDX-License-Identifier: Apache-2.0
33#
44
5- set (target_name ctcdecode_numpy_impl)
5+ set (TARGET_NAME ctcdecode_numpy_impl)
66
77file (GLOB_RECURSE HEADERS
88 "${CMAKE_CURRENT_SOURCE_DIR} /*.h" "${CMAKE_CURRENT_SOURCE_DIR} /*.hpp" )
@@ -11,31 +11,35 @@ file(GLOB_RECURSE SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
1111source_group ("include" FILES ${HEADERS} )
1212source_group ("src" FILES ${SOURCES} )
1313
14- add_library (${target_name } MODULE ${HEADERS} ${SOURCES} )
14+ add_library (${TARGET_NAME } MODULE ${HEADERS} ${SOURCES} )
1515
16- target_include_directories (${target_name} PRIVATE
16+ # check_code_style(NAME ${TARGET_NAME}
17+ # CLANG_FORMAT ${ENABLE_CLANG_FORMAT}
18+ # CPPLINT ${ENABLE_CPPLINT})
19+
20+ target_include_directories (${TARGET_NAME} PRIVATE
1721 ${PYTHON_INCLUDE_DIRS} ${NUMPY_INCLUDE_DIR} third_party/ThreadPool)
18- target_link_libraries (${target_name } ${PYTHON_LIBRARIES} )
22+ target_link_libraries (${TARGET_NAME } ${PYTHON_LIBRARIES} )
1923
20- set_target_properties (${target_name } PROPERTIES
24+ set_target_properties (${TARGET_NAME } PROPERTIES
2125 PREFIX ""
2226 OUTPUT_NAME _impl
2327)
2428
2529if (WIN32 )
26- set_target_properties (${target_name } PROPERTIES SUFFIX ".pyd" )
30+ set_target_properties (${TARGET_NAME } PROPERTIES SUFFIX ".pyd" )
2731endif ()
2832
2933foreach (artifact IN ITEMS ARCHIVE LIBRARY PDB RUNTIME)
30- set_property (TARGET ${target_name } APPEND_STRING
34+ set_property (TARGET ${TARGET_NAME } APPEND_STRING
3135 PROPERTY "${artifact} _OUTPUT_DIRECTORY" "/ctcdecode_numpy" )
3236endforeach ()
3337
3438# SWIG-generated code causes some warnings; disable them.
3539if (COMPILER_IS_GCC_LIKE)
36- target_compile_options (${target_name } PRIVATE -Wno-narrowing)
40+ target_compile_options (${TARGET_NAME } PRIVATE -Wno-narrowing)
3741elseif (MSVC )
38- target_compile_options (${target_name } PRIVATE
42+ target_compile_options (${TARGET_NAME } PRIVATE
3943 /wd4244 # Disable conversion warning =
4044 /wd4838 # Disable conversion warning in aggregate or list initialization
4145 )
@@ -52,8 +56,8 @@ add_custom_target(ctcdecode_numpy ALL
5256 COMMAND "${CMAKE_COMMAND} " -E copy_if_different
5357 "${CMAKE_CURRENT_SOURCE_DIR} /ctcdecode_numpy/__init__.py"
5458 "${CMAKE_CURRENT_SOURCE_DIR} /ctcdecode_numpy/impl.py"
55- "$<TARGET_FILE_DIR:${target_name } >"
59+ "$<TARGET_FILE_DIR:${TARGET_NAME } >"
5660 VERBATIM
5761)
5862
59- add_dependencies (ctcdecode_numpy ${target_name } )
63+ add_dependencies (ctcdecode_numpy ${TARGET_NAME } )
0 commit comments