From 012756d6cc707df4cb823901e4b9788066671ce1 Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Sun, 18 May 2025 20:18:41 +0900 Subject: [PATCH] Updated cmake minimum required to 3.5-4.0 --- .github/workflows/coverage.yml | 2 +- .github/workflows/gha.yml | 6 +++--- CMakeLists.txt | 17 ++--------------- cmake/CodeCoverage.cmake | 2 +- 4 files changed, 7 insertions(+), 20 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 64eae7a71..6e457ead4 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: install depends run: | sudo apt-get update diff --git a/.github/workflows/gha.yml b/.github/workflows/gha.yml index c13a87296..fa9485644 100644 --- a/.github/workflows/gha.yml +++ b/.github/workflows/gha.yml @@ -17,7 +17,7 @@ jobs: matrix: pattern: [0, 1, 2, 3] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: install gtest run: | brew install --force googletest @@ -173,10 +173,10 @@ jobs: matrix: pattern: [0, 1, 2, 3] steps: - - uses: actions/checkout@v2.0.0 + - uses: actions/checkout@v3 - name: Cache vcpkg id: cache-vcpkg - uses: actions/cache@v1.1.2 + uses: actions/cache@v3 with: path: C:/vcpkg/installed key: windows-2019-vcpkg-v2 diff --git a/CMakeLists.txt b/CMakeLists.txt index c4d890544..26dfb15fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,17 +1,4 @@ -if(${CMAKE_VERSION} VERSION_GREATER "3.4") - CMAKE_MINIMUM_REQUIRED (VERSION 3.5) -else() - CMAKE_MINIMUM_REQUIRED (VERSION 2.8.12) - IF ((CMAKE_VERSION VERSION_GREATER 3.1) OR - (CMAKE_VERSION VERSION_EQUAL 3.1)) - CMAKE_POLICY(SET CMP0054 NEW) - ENDIF () -endif() - -IF ((CMAKE_VERSION VERSION_GREATER 3.27) OR - (CMAKE_VERSION VERSION_EQUAL 3.27)) - CMAKE_POLICY(SET CMP0145 OLD) -ENDIF () +CMAKE_MINIMUM_REQUIRED (VERSION 3.5...4.0) OPTION (MSGPACK_BUILD_TESTS "Build msgpack tests." OFF) OPTION (MSGPACK_GEN_COVERAGE "Enable running gcov to get a test coverage report." OFF) @@ -200,11 +187,11 @@ ENDIF () IF (MSGPACK_BUILD_TESTS) ENABLE_TESTING () + INCLUDE(CTest) list(APPEND CMAKE_CTEST_ARGUMENTS "--output-on-failure") # MEMORYCHECK_COMMAND_OPTIONS needs to place prior to CTEST_MEMORYCHECK_COMMAND SET (MEMORYCHECK_COMMAND_OPTIONS "--leak-check=full --show-leak-kinds=definite,possible --error-exitcode=1") FIND_PROGRAM(CTEST_MEMORYCHECK_COMMAND NAMES valgrind) - INCLUDE(Dart) ADD_SUBDIRECTORY (test) ENDIF () diff --git a/cmake/CodeCoverage.cmake b/cmake/CodeCoverage.cmake index f76b71747..e649b42ca 100644 --- a/cmake/CodeCoverage.cmake +++ b/cmake/CodeCoverage.cmake @@ -48,7 +48,7 @@ FUNCTION(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _outputname) # Show info where to find the report ADD_CUSTOM_COMMAND(TARGET ${_targetname} POST_BUILD - COMMAND ; + COMMAND ${CMAKE_COMMAND} -E echo "" COMMENT "Open ./${_outputname}/index.html in your browser to view the coverage report." )