Add pkg-config support

Closes #1032
This commit is contained in:
Martin Hořeňovský 2017-10-12 21:42:09 +02:00
parent 355ab78f4a
commit c7d9f02d5b
3 changed files with 38 additions and 0 deletions

View file

@ -15,6 +15,7 @@ versionPath = os.path.join( rootPath, "internal/catch_version.cpp" )
readmePath = os.path.join( catchPath, "README.md" )
conanPath = os.path.join(catchPath, 'conanfile.py')
conanTestPath = os.path.join(catchPath, 'test_package', 'conanfile.py')
cmakePath = os.path.join(catchPath, 'CMakeLists.txt')
class Version:
def __init__(self):
@ -126,6 +127,17 @@ def updateConanTestFile(version):
for line in lines:
f.write( line + "\n" )
def updateCmakeFile(version):
cmakeParser = re.compile(r'set(CATCH_VERSION_NUMBER \d+\.\d+\.\d+)')
with open(cmakePath, 'r') as file:
lines = file.readlines()
with open(cmakePath, 'w') as file:
for line in lines:
if 'set(CATCH_VERSION_NUMBER ' in line:
file.write('set(CATCH_VERSION_NUMBER {0})\n'.format(version.getVersionString()))
else:
file.write(line)
def performUpdates(version):
# First update version file, so we can regenerate single header and
# have it ready for upload to wandbox, when updating readme
@ -134,3 +146,4 @@ def performUpdates(version):
updateReadmeFile(version)
updateConanFile(version)
updateConanTestFile(version)
updateCmakeFile(version)