From 8503ec36ca4c4e01da7c708534f23df22657fb1d Mon Sep 17 00:00:00 2001 From: "Khatri, Shweta" Date: Fri, 14 Mar 2025 11:16:56 -0400 Subject: [PATCH] Use idomatic approach to extending CMAKE_MODULE_PATH. (#7) There are many reasons why there may already be a CMAKE_MODULE_PATH defined. The idiomatic way to extend it in a project is via list(APPEND). https://github.com/ROCm/rocminfo/pull/97 submitted by @stellaraccident Co-authored-by: Stella Laurenzo --- CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 212ca0e463..c8f0c6cd5c 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,9 +55,7 @@ endif() # Default to ON option(BUILD_SHARED_LIBS "Build using shared libraries" ON) ## Set default module path if not already set -if(NOT DEFINED CMAKE_MODULE_PATH) - set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/") -endif() +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/") ## Include common cmake modules include(utils)