Skip to content

Commit

Permalink
Use CMake found binary path
Browse files Browse the repository at this point in the history
Actually use the binary that CMake found, rather than searching PATH again
  • Loading branch information
graeme-a-stewart committed Jan 26, 2024
1 parent 6ff5927 commit 02cdda5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmake/pythonFormat.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ find_program(BLACK_EXECUTABLE black)
if(BLACK_EXECUTABLE)
add_custom_target(
black
COMMAND black
COMMAND ${BLACK_EXECUTABLE}
${ALL_PYTHON_FILES}
)
set_target_properties(black PROPERTIES EXCLUDE_FROM_ALL TRUE)
Expand All @@ -23,12 +23,11 @@ find_program(FLAKE8_EXECUTABLE flake8)
if(FLAKE8_EXECUTABLE)
add_custom_target(
flake8
COMMAND flake8
COMMAND ${FLAKE8_EXECUTABLE}
--config=${CMAKE_CURRENT_SOURCE_DIR}/.flake8
${ALL_PYTHON_FILES}
)
set_target_properties(flake8 PROPERTIES EXCLUDE_FROM_ALL TRUE)
else()
message(STATUS "Failed to find flake8 executable - no target to run flake8 can be set")
endif()

0 comments on commit 02cdda5

Please sign in to comment.