From c84d389aa253ecc2e290b6bf8affc6d0053709a6 Mon Sep 17 00:00:00 2001 From: Sean Keely Date: Fri, 19 Jun 2020 20:11:34 -0500 Subject: [PATCH] Add warning about incorrect package names when using CMake 3.5 Signed-off-by: Sean Keely Change-Id: Ie35b287224ec6b963bc317baf60853fbe223fc17 [ROCm/ROCR-Runtime commit: f101875de8bfcbe96964961442c94e8d73d594c0] --- projects/rocr-runtime/CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/projects/rocr-runtime/CMakeLists.txt b/projects/rocr-runtime/CMakeLists.txt index 56292ed135..9d99b40e57 100644 --- a/projects/rocr-runtime/CMakeLists.txt +++ b/projects/rocr-runtime/CMakeLists.txt @@ -25,6 +25,18 @@ cmake_minimum_required ( VERSION 3.5.0 ) +## Cosmetic Cmake version warnings. +if(NOT EXISTS VERSION_WARNED) + set (VERSION_WARNED FALSE CACHE BOOL "") +endif() +if(${CMAKE_VERSION} VERSION_LESS "3.6.0" AND NOT ${VERSION_WARNED}) + message("Your CMake version is too old for full functionality. +Generated package file names may be incorrect. +Please update to CMake 3.6 or newer to generate correct package file names") + set( VERSION_WARNED TRUE CACHE BOOL "Suppress cosmetic build errors due to CMake version after first warning." FORCE ) + mark_as_advanced( FORCE VERSION_WARNED ) +endif() + set ( HSAKMT "hsakmt" ) set ( HSAKMT_PACKAGE "hsakmt-roct" ) set ( HSAKMT_COMPONENT "lib${HSAKMT}" )