From 292600cf54d5fd73278f67a4f98c2f955cbdaa10 Mon Sep 17 00:00:00 2001 From: Lukas Zaoral Date: Wed, 7 Apr 2021 21:33:36 +0200 Subject: cmake: Fix CMP0026 policy deprecation warning CMake 3.19+ started to issue warnings if this policy is set to OLD: CMake Deprecation Warning at test/CMakeLists.txt:143 (cmake_policy): The OLD behavior for policy CMP0026 will be removed from a future version of CMake. The cmake-policies(7) manual explains that the OLD behaviors of all policies are deprecated and that a policy should be set to OLD only under specific short-term circumstances. Projects should be ported to the NEW behavior and not rely on setting a policy to OLD. --- test/CMakeLists.txt | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'test') diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a5418a51..2ff9b0eb 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -135,23 +135,19 @@ add_subdirectory(Concrete) ############################################################################### # Find path to libkleeRuntest target for `lit.site.cfg`. -# FIXME: This is not the right way to get the location of the target we have to -# set CMP0026 to old. -# This will likely break if using a multi-configuration generator. -if (POLICY CMP0026) - # HACK: Allow reading `LOCATION` property. - cmake_policy(SET CMP0026 OLD) -endif() -get_property(LIB_KLEE_RUN_TEST_PATH - TARGET kleeRuntest - PROPERTY LOCATION -) +set(LIB_KLEE_RUN_TEST_PATH $) configure_file(lit.site.cfg.in - ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg + ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.imd @ONLY ) +# Evaluate all generator expressions inserted during the configure step. +file(GENERATE + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg + INPUT ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.imd +) + add_custom_target(systemtests COMMAND "${LIT_TOOL}" ${LIT_ARGS} "${CMAKE_CURRENT_BINARY_DIR}" DEPENDS klee kleaver klee-replay kleeRuntest gen-bout gen-random-bout -- cgit 1.4.1