Skip to content

Commit

Permalink
Use POLICY CMP0135
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed Dec 16, 2024
1 parent 7de3fb0 commit 809f493
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions suite/cstest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
cmake_minimum_required(VERSION 3.15)

# Enable DOWNLOAD_EXTRACT_TIMESTAMP
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()

include(ExternalProject)
find_library(libyaml
NAMES libyaml yaml
REQUIRED)
set(CMOCKA_LIB_FILE "${CMAKE_CURRENT_BINARY_DIR}/extern/src/cmocka_ext-build/src/libcmocka.a")

if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
set(DOWNLOAD_EXTRACT_TIMESTAMP "DOWNLOAD_EXTRACT_TIMESTAMP true")
endif()

ExternalProject_Add(cmocka_ext
PREFIX extern
URL "https://cmocka.org/files/1.1/cmocka-1.1.7.tar.xz"
URL_HASH SHA256=810570eb0b8d64804331f82b29ff47c790ce9cd6b163e98d47a4807047ecad82
${DOWNLOAD_EXTRACT_TIMESTAMP}
CONFIGURE_COMMAND cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ../cmocka_ext/
BUILD_COMMAND cmake --build . --config Release
BUILD_BYPRODUCTS "${CMOCKA_LIB_FILE}"
Expand All @@ -32,7 +32,6 @@ ExternalProject_Add(libcyaml_ext
PREFIX extern
URL "https://github.com/tlsa/libcyaml/archive/refs/tags/v1.4.2.tar.gz"
URL_HASH SHA256=3211b2a0589ebfe02c563c96adce9246c0787be2af30353becbbd362998d16dc
${DOWNLOAD_EXTRACT_TIMESTAMP}
CONFIGURE_COMMAND ""
BUILD_COMMAND make VARIANT=${LIBCYAML_VARIANT} PKG_CONFIG=pkg-config
BUILD_BYPRODUCTS "${LIBCYAML_LIB_FILE}"
Expand Down

0 comments on commit 809f493

Please sign in to comment.