From a8d818a6bc9f23c8685cb54ab0b426399de18eea Mon Sep 17 00:00:00 2001 From: Sean Keely Date: Wed, 18 Oct 2017 15:09:10 -0500 Subject: [PATCH] Improve build system handling of non-default directory layouts. Adds the thunk include and lib paths to the cache, removes paths to indicator files from the cache, uses the cached path directory (if any) as a search hint for indicator files. Change-Id: I0859faa8d229a97abfaacb408d2c831e317aed5f --- runtime/hsa-runtime/CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/runtime/hsa-runtime/CMakeLists.txt b/runtime/hsa-runtime/CMakeLists.txt index a1cdfc716d..5ca48bab8f 100644 --- a/runtime/hsa-runtime/CMakeLists.txt +++ b/runtime/hsa-runtime/CMakeLists.txt @@ -77,11 +77,13 @@ if ( DEFINED VERSION_BUILD ) endif () set ( BUILD_VERSION_STRING "${BUILD_VERSION_MAJOR}.${BUILD_VERSION_MINOR}.${BUILD_VERSION_PATCH}" ) -## Find the hsakmt library and include files -find_file ( HSAKMT_INC "libhsakmt/hsakmt.h" ) -find_library ( HSAKMT_LIB libhsakmt.so ) -get_filename_component ( HSAKMT_LIB_PATH ${HSAKMT_LIB} DIRECTORY ) -get_filename_component ( HSAKMT_INC_PATH ${HSAKMT_INC} DIRECTORY ) +## Find the hsakmt library and include files, use directory hint from cache +find_file ( HSAKMT_INC NAMES "hsakmt.h" "libhsakmt/hsakmt.h" PATHS ${HSAKMT_INC_PATH} ) +find_library ( HSAKMT_LIB "libhsakmt.so" ${HSAKMT_LIB_PATH} ) +get_filename_component ( HSAKMT_INC_PATH ${HSAKMT_INC} DIRECTORY CACHE ) +get_filename_component ( HSAKMT_LIB_PATH ${HSAKMT_LIB} DIRECTORY CACHE ) +unset( HSAKMT_INC CACHE ) +unset( HSAKMT_LIB CACHE ) ## Set include and link directories for libhsakmt include_directories ( ${HSAKMT_INC_PATH} )