From a12b1389b87be97d2de572a7b9eb75709ac223df Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Thu, 13 Feb 2025 11:45:58 -0800 Subject: [PATCH] Support cmake versions without cmake_path (#474) Signed-off-by: Steve Peters --- cmake/GzInstallAllHeaders.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/GzInstallAllHeaders.cmake b/cmake/GzInstallAllHeaders.cmake index 1f0bf32d..d749a9af 100644 --- a/cmake/GzInstallAllHeaders.cmake +++ b/cmake/GzInstallAllHeaders.cmake @@ -206,7 +206,13 @@ function(gz_install_all_headers) endif() # Generate the install directory for the "meta" header one folder above the "config" header - cmake_path(SET meta_header_install_dir NORMALIZE ${config_header_install_dir}/..) + if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.20") + cmake_path(SET meta_header_install_dir NORMALIZE ${config_header_install_dir}/..) + else() + # cmake_path was added in cmake 3.20, so continue using a relative path with older versions + # Do not merge this forward to gz-cmake4 + set(meta_header_install_dir ${config_header_install_dir}/..) + endif() # Generate the "meta" header that includes all of the headers configure_file(${meta_header_in} ${meta_header_out})