1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-10-06 09:17:07 +02:00

Format file with latest python 3.9

Apparently my python 3.6 install an old cmakelang
This commit is contained in:
Elias Steurer 2020-10-29 20:06:13 +01:00
parent f6db59f955
commit 2311cdaccb
2 changed files with 7 additions and 10 deletions

View File

@ -43,7 +43,8 @@ execute_process(
execute_process(
COMMAND "${GIT_EXECUTABLE}" describe --always
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_COMMIT_HASH ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
OUTPUT_VARIABLE GIT_COMMIT_HASH
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
add_compile_definitions(COMPILE_INFO="${BUILD_DATE} + ${GIT_COMMIT_HASH}")

View File

@ -3,19 +3,15 @@ import os
import sys
import subprocess
executable = "cmake-format"
if os.name == 'nt':
executable += ".exe"
for root, dirnames, filenames in os.walk('../'):
for root, dirnames, filenames in os.walk('..'):
for filename in fnmatch.filter(filenames, 'CMakeLists.txt'):
print(executable, root+"/"+filename)
os.system(" %s -c ../.cmake-format.py -i %s" % (executable, (root + "/" + filename)))
print("cmake-format -c ../.cmake-format.py -i " + root + "/" + filename)
os.system("cmake-format -c ../.cmake-format.py -i %s" % ((root + "/" + filename)))
# Check if all files are formatter
output = subprocess.check_output("git diff", shell=True)
if output:
print("Git diff is not empty. This means your CMakeLists.txt file was not formatted via %s!" % executable)
print(output)
print("Git diff is not empty. This means your CMakeLists.txt file was not formatted!")
#print(output)
sys.exit(1)