mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 13:26:10 +01:00
Specify VERSION in modern CMake
This commit is contained in:
parent
15ad95c8db
commit
1e3ddbb496
@ -6,7 +6,7 @@ if(NOT DEFINED PROJECT_NAME)
|
|||||||
set(NOT_SUBPROJECT ON)
|
set(NOT_SUBPROJECT ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
project(Catch2)
|
project(Catch2 LANGUAGES CXX VERSION 2.1.0)
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
@ -22,7 +22,6 @@ set(CATCH_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
|||||||
set(SELF_TEST_DIR ${CATCH_DIR}/projects/SelfTest)
|
set(SELF_TEST_DIR ${CATCH_DIR}/projects/SelfTest)
|
||||||
set(BENCHMARK_DIR ${CATCH_DIR}/projects/Benchmark)
|
set(BENCHMARK_DIR ${CATCH_DIR}/projects/Benchmark)
|
||||||
set(HEADER_DIR ${CATCH_DIR}/include)
|
set(HEADER_DIR ${CATCH_DIR}/include)
|
||||||
set(CATCH_VERSION_NUMBER 2.1.0)
|
|
||||||
|
|
||||||
if(USE_WMAIN)
|
if(USE_WMAIN)
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ENTRY:wmainCRTStartup")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ENTRY:wmainCRTStartup")
|
||||||
|
@ -2,5 +2,5 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
|
|||||||
|
|
||||||
Name: Catch
|
Name: Catch
|
||||||
Description: Testing library for C++
|
Description: Testing library for C++
|
||||||
Version: @CATCH_VERSION_NUMBER@
|
Version: @Catch2_VERSION@
|
||||||
Cflags: -I${includedir}
|
Cflags: -I${includedir}
|
||||||
|
@ -128,13 +128,12 @@ def updateConanTestFile(version):
|
|||||||
f.write( line + "\n" )
|
f.write( line + "\n" )
|
||||||
|
|
||||||
def updateCmakeFile(version):
|
def updateCmakeFile(version):
|
||||||
cmakeParser = re.compile(r'set(CATCH_VERSION_NUMBER \d+\.\d+\.\d+)')
|
|
||||||
with open(cmakePath, 'r') as file:
|
with open(cmakePath, 'r') as file:
|
||||||
lines = file.readlines()
|
lines = file.readlines()
|
||||||
with open(cmakePath, 'w') as file:
|
with open(cmakePath, 'w') as file:
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if 'set(CATCH_VERSION_NUMBER ' in line:
|
if 'project(Catch2 LANGUAGES CXX VERSION ' in line:
|
||||||
file.write('set(CATCH_VERSION_NUMBER {0})\n'.format(version.getVersionString()))
|
file.write('project(Catch2 LANGUAGES CXX VERSION {0})\n'.format(version.getVersionString()))
|
||||||
else:
|
else:
|
||||||
file.write(line)
|
file.write(line)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user