From 3e0161a20f93d4269ca8b51fcc4bd78e89b3004c Mon Sep 17 00:00:00 2001 From: HRN Date: Fri, 21 Feb 2025 22:42:11 +0330 Subject: [PATCH 1/2] version control for cmake_policy 0169 --- cmake/preReq.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/preReq.cmake b/cmake/preReq.cmake index 57690a91..d501521c 100644 --- a/cmake/preReq.cmake +++ b/cmake/preReq.cmake @@ -21,7 +21,10 @@ if(pFlow_STD_Parallel_Alg) endif() endif() -cmake_policy(SET CMP0169 OLD) +# Check CMake version and set policy CMP0169 if CMake version is 3.30 or higher +if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.30") + cmake_policy(SET CMP0169 OLD) +endif() # Kokkos folder creation set(Kokkos_Source_DIR $ENV{HOME}/Kokkos/kokkos) From fd45625ce68eefc709bd8e4b129004d92d5986ff Mon Sep 17 00:00:00 2001 From: HRN Date: Fri, 21 Feb 2025 22:46:31 +0330 Subject: [PATCH 2/2] cmake_policy --- cmake/preReq.cmake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmake/preReq.cmake b/cmake/preReq.cmake index d501521c..f2461064 100644 --- a/cmake/preReq.cmake +++ b/cmake/preReq.cmake @@ -21,16 +21,17 @@ if(pFlow_STD_Parallel_Alg) endif() endif() -# Check CMake version and set policy CMP0169 if CMake version is 3.30 or higher -if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.30") - cmake_policy(SET CMP0169 OLD) -endif() # Kokkos folder creation set(Kokkos_Source_DIR $ENV{HOME}/Kokkos/kokkos) if(NOT EXISTS "${Kokkos_Source_DIR}/CMakeLists.txt") + # Check CMake version and set policy CMP0169 if CMake version is 3.30 or higher + if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.30") + cmake_policy(SET CMP0169 OLD) + endif() + include(FetchContent) FetchContent_Declare( kokkos