Files
whisper-com/Modules/compdb.cmake
Christina Sander e42ca53cee Squashed 'cmake/' content from commit 07b56b6
git-subtree-dir: cmake
git-subtree-split: 07b56b6a3dbe9f0c15160b3d11f11702db5e3999
2022-10-20 13:45:27 +02:00

24 lines
507 B
CMake

find_program(COMPDB_PATH
NAME compdb
PATHS ~/.local/bin/
/bin
/sbin
/usr/bin
/usr/sbin
/usr/local/bin
/usr/local/sbin
)
if (COMPDB_PATH)
IF(NOT TARGET COMPD)
add_custom_target(COMPD
ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${COMPDB_PATH} -p ${CMAKE_CURRENT_BINARY_DIR} list >compile_commands.json
)
endif()
endif()