mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 03:10:02 +02:00
new regex for version
This commit is contained in:
parent
31ec3c8cf7
commit
c16411ba00
@ -25,14 +25,14 @@ mark_as_advanced(
|
|||||||
ClangFormat_BIN)
|
ClangFormat_BIN)
|
||||||
|
|
||||||
if(ClangFormat_FOUND)
|
if(ClangFormat_FOUND)
|
||||||
EXEC_PROGRAM(${ClangFormat_BIN} ${CMAKE_CURRENT_SOURCE_DIR} ARGS --version OUTPUT_VARIABLE CLANG_VERSION)
|
exec_program(${ClangFormat_BIN} ${CMAKE_CURRENT_SOURCE_DIR} ARGS --version OUTPUT_VARIABLE CLANG_VERSION_TEXT)
|
||||||
STRING(REGEX REPLACE ".*([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" CLANG_MAJOR_VERSION ${CLANG_VERSION})
|
string(REGEX MATCH "([0-9]+)\\.[0-9]+\\.[0-9]+" CLANG_VERSION ${CLANG_VERSION_TEXT})
|
||||||
if((${CLANG_MAJOR_VERSION} GREATER "9") OR (${CLANG_MAJOR_VERSION} EQUAL "9"))
|
if((${CLANG_VERSION} GREATER "9") OR (${CLANG_VERSION} EQUAL "9"))
|
||||||
# A CMake script to find all source files and setup clang-format targets for them
|
# A CMake script to find all source files and setup clang-format targets for them
|
||||||
message(STATUS "found clang-format ${CLANG_VERSION} adding formatting targets")
|
message(STATUS "found clang-format \"${CLANG_VERSION}\" adding formatting targets")
|
||||||
include(clang-format)
|
include(clang-format)
|
||||||
else()
|
else()
|
||||||
message(STATUS "clang-format version ${CLANG_VERSION} found but need at least 9. Not setting up format targets")
|
message(STATUS "clang-format version \"${CLANG_VERSION}\" found but need at least 9. Not setting up format targets")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
message(STATUS "clang-format not found. Not setting up format targets")
|
message(STATUS "clang-format not found. Not setting up format targets")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user