Skip to content

Commit f30c1d4

Browse files
committed
Updated per review comments
1 parent 7114386 commit f30c1d4

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

CMakeLists.txt

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,22 @@ option(DPNP_WITH_REDIST "Build DPNP assuming DPC++ redistributable is installed
4242
set(CMAKE_CXX_STANDARD 17)
4343
set(CMAKE_CXX_STANDARD_REQUIRED True)
4444
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
45-
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
46-
47-
48-
# find_package() search order:
49-
# 1. User-specified overrides (-DMKL_DIR=..., cache variables, package root variables like MKLROOT)
50-
# 2. Environment variables (ENV{MKLROOT}, CMAKE_PREFIX_PATH which is automatically set by conda)
51-
# 3. PATHS (if specified, but without NO_DEFAULT_PATH)
52-
# 4. HINTS
53-
# 5. System prefixes (/usr, /usr/local, etc.)
54-
# 6. CMake built-in modules
55-
find_package(IntelSYCL REQUIRED HINTS ${CMAKE_SOURCE_DIR}/dpnp/backend/cmake/Module)
56-
find_package(TBB REQUIRED HINTS ${CMAKE_SOURCE_DIR}/dpnp/backend/cmake/Module)
45+
set(CMAKE_MODULES_DIR BOTH)
46+
47+
48+
# find_package() search order in CONFIG mode:
49+
# 1. <PackageName>_ROOT variables (CMake variable / environment)
50+
# 2. CMake-specific cache variables (on the command line with -D<PackageName>_DIR=...)
51+
# 3. CMake-specific environment variables (<PackageName>_DIR, CMAKE_PREFIX_PATH, etc.)
52+
# 4. Paths specified by the HINTS option
53+
# 5. Standard system environment variables (PATH, etc.)
54+
# 6. Paths stored in the CMake User Package Registry
55+
# 7. CMake variables defined in the Platform files for the current system (like in /usr/local for Linux)
56+
# 8. Paths stored in the CMake System Package Registry
57+
# 9. Paths specified by the PATHS option (assumed hard-coded guesses)
58+
set(path_to_cmake_dir ${CMAKE_SOURCE_DIR}/dpnp/backend/cmake/Modules)
59+
find_package(IntelSYCL REQUIRED PATHS ${path_to_cmake_dir})
60+
find_package(TBB REQUIRED PATHS ${path_to_cmake_dir})
5761

5862
set(MKL_ARCH "intel64")
5963
set(MKL_LINK "dynamic")
@@ -63,10 +67,10 @@ find_package(MKL REQUIRED
6367
HINTS ${MKL_ROOT}/lib/cmake
6468
${MKL_ROOT}/lib/cmake/mkl
6569
$ENV{MKLROOT}
66-
${CMAKE_SOURCE_DIR}/dpnp/backend/cmake/Module)
70+
PATHS ${path_to_cmake_dir})
6771

6872
set(ONEDPL_PAR_BACKEND tbb)
69-
find_package(oneDPL REQUIRED HINTS ${CMAKE_SOURCE_DIR}/dpnp/backend/cmake/Module)
73+
find_package(oneDPL REQUIRED PATHS ${path_to_cmake_dir})
7074

7175
include(GNUInstallDirs)
7276

0 commit comments

Comments
 (0)