From 363d14189051e9f0d9948eb64d3b6fe17051bc34 Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Mon, 27 Nov 2023 23:30:08 -0500 Subject: [PATCH] cmake >= 3.19 --- cmake/lapack.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmake/lapack.cmake b/cmake/lapack.cmake index 8f6f311..fa56e8a 100644 --- a/cmake/lapack.cmake +++ b/cmake/lapack.cmake @@ -1,6 +1,13 @@ include(GNUInstallDirs) include(ExternalProject) +if(CMAKE_VERSION VERSION_LESS 3.21) + get_property(not_top DIRECTORY PROPERTY PARENT_DIRECTORY) + if(NOT not_top) + set(PROJECT_IS_TOP_LEVEL true) + endif() +endif() + if(NOT PROJECT_IS_TOP_LEVEL) message(STATUS "${PROJECT_NAME} ${PROJECT_VERSION} deferring to ${CMAKE_PROJECT_NAME} for LAPACK") return()