CMakeLists.txt: Fix issue with rocrtst

Fix for issue where rocrtst could not be built if out directory 
was outside the src (WORK_ROOT) directory due to hard-coded 
relative path for OPENCL_INC_DIR.

Change-Id: Icb93de2266d568e9c2437166e34c88ec526fb45c
Tento commit je obsažen v:
Arun Sunil
2020-10-09 13:55:49 -07:00
rodič 0d1e5cbcb6
revize 8d00f1aa59
+5 -1
Zobrazit soubor
@@ -97,7 +97,11 @@ else()
endif()
if(NOT EXISTS "${OPENCL_INC_DIR}/opencl-c.h")
set(OPENCL_INC_DIR "${OPENCL_DIR}/../../../external/llvm-project/clang/lib/Headers/")
if(DEFINED ENV{WORK_ROOT})
set(OPENCL_INC_DIR "$ENV{WORK_ROOT}/external/llvm-project/clang/lib/Headers/")
else()
set(OPENCL_INC_DIR "${OPENCL_DIR}/../../../external/llvm-project/clang/lib/Headers/")
endif()
if(NOT EXISTS "${OPENCL_INC_DIR}/opencl-c.h")
message(WARNING "opencl-c.h not found.")
endif()