Extend project call for Catch2

This provides some extra metadata for CPack and related tools.
This commit is contained in:
Martin Hořeňovský 2022-05-17 22:12:41 +02:00
parent dcafc605f3
commit abb669d4fd
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
2 changed files with 9 additions and 3 deletions

View File

@ -36,7 +36,13 @@ if(CMAKE_VERSION VERSION_GREATER 3.8)
endif() endif()
project(Catch2 LANGUAGES CXX VERSION 3.0.0) project(Catch2
VERSION 3.0.0 # CML version placeholder, don't delete
LANGUAGES CXX
HOMEPAGE_URL "https://github.com/catchorg/Catch2"
DESCRIPTION "A modern, C++-native, unit test framework."
)
# Provide path for scripts. We first add path to the scripts we don't use, # Provide path for scripts. We first add path to the scripts we don't use,
# but projects including us might, and set the path up to parent scope. # but projects including us might, and set the path up to parent scope.

View File

@ -82,8 +82,8 @@ class Version:
def updateCmakeFile(version): def updateCmakeFile(version):
with open(cmakePath, 'rb') as file: with open(cmakePath, 'rb') as file:
lines = file.readlines() lines = file.readlines()
replacementRegex = re.compile(b'project\\(Catch2 LANGUAGES CXX VERSION \\d+\\.\\d+\\.\\d+\\)') replacementRegex = re.compile(b'''VERSION (\\d+.\\d+.\\d+) # CML version placeholder, don't delete''')
replacement = 'project(Catch2 LANGUAGES CXX VERSION {0})'.format(version.getVersionString()).encode('ascii') replacement = '''VERSION {0} # CML version placeholder, don't delete'''.format(version.getVersionString()).encode('ascii')
with open(cmakePath, 'wb') as file: with open(cmakePath, 'wb') as file:
for line in lines: for line in lines:
file.write(replacementRegex.sub(replacement, line)) file.write(replacementRegex.sub(replacement, line))