Skip to content

Commit

Permalink
ENH: add the .exe executable extension to clang-format on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
dzenanz committed Apr 16, 2020
1 parent 716ddff commit 343cbf9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CMake/ITKClangFormatSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,16 @@ if ( ITK_USE_CLANGFORMAT AND NOT EXISTS "${CLANGFORMAT_EXECUTABLE}" )
message(FATAL_ERROR "UNKOWN SYSTEM: Set CLANGFORMAT_EXECUTABLE manually to the clang-format version 8.0 binary")
endif()
file(MAKE_DIRECTORY "${ITK_BINARY_DIR}/temp")
file(DOWNLOAD "${CLANGFORMAT_DOWNLOAD_URL}" "${ITK_BINARY_DIR}/temp/clang-format-${CMAKE_SYSTEM_NAME}")
file(COPY "${ITK_BINARY_DIR}/temp/clang-format-${CMAKE_SYSTEM_NAME}"
if(WIN32)
set(exe .exe)
endif()
set(CLANGFORMAT_EXECUTABLE_NAME "clang-format-${CMAKE_SYSTEM_NAME}${exe}")
file(DOWNLOAD "${CLANGFORMAT_DOWNLOAD_URL}" "${ITK_BINARY_DIR}/temp/${CLANGFORMAT_EXECUTABLE_NAME}")
file(COPY "${ITK_BINARY_DIR}/temp/${CLANGFORMAT_EXECUTABLE_NAME}"
DESTINATION "${ITK_BINARY_DIR}"
FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ)
unset( CLANGFORMAT_DOWNLOAD_URL )
set( CLANGFORMAT_EXECUTABLE "${ITK_BINARY_DIR}/clang-format-${CMAKE_SYSTEM_NAME}" CACHE FILEPATH "The binary for clang-format" FORCE)
set( CLANGFORMAT_EXECUTABLE "${ITK_BINARY_DIR}/${CLANGFORMAT_EXECUTABLE_NAME}" CACHE FILEPATH "The binary for clang-format" FORCE)
endif()
if(CLANGFORMAT_EXECUTABLE)
mark_as_advanced(CLANGFORMAT_EXECUTABLE)
Expand Down

0 comments on commit 343cbf9

Please sign in to comment.