diff --git a/CMakeLists.txt b/CMakeLists.txt index ecec4ef957..9089a21392 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -207,13 +207,13 @@ endif() # process compile commands for IDE ################################################################################ -if (CMAKE_EXPORT_COMPILE_COMMANDS) +if (CMAKE_EXPORT_COMPILE_COMMANDS AND WITH_PYTHON) add_custom_command( - OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/compile_commands.json - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build/gen_compile_db.py - ARGS -b ${CMAKE_CURRENT_BINARY_DIR} -s ${CMAKE_CURRENT_SOURCE_DIR} -o ${CMAKE_CURRENT_SOURCE_DIR}/compile_commands.json ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/build/gen_compile_db.py ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json - COMMENT "Build compile commands for IDE" + OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/compile_commands.json + COMMAND $ ${CMAKE_CURRENT_SOURCE_DIR}/build/gen_compile_db.py + ARGS -b ${CMAKE_CURRENT_BINARY_DIR} -s ${CMAKE_CURRENT_SOURCE_DIR} -o ${CMAKE_CURRENT_SOURCE_DIR}/compile_commands.json ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/build/gen_compile_db.py ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json + COMMENT "Build compile commands for IDE" ) add_custom_target(processed_compile_commands ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/compile_commands.json ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json) endif()