Skip to content

Commit 4f77c1c

Browse files
authored
Merge pull request #1335 from ldorau/Set_FOUND_in_Find.cmake_files
Set *_FOUND in Find*.cmake files
2 parents 51f1429 + c417177 commit 4f77c1c

15 files changed

+28
-15
lines changed

CMakeLists.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,13 @@ else()
235235
jemalloc INTERFACE ${jemalloc_targ_BINARY_DIR}/lib/libjemalloc.a)
236236
add_dependencies(jemalloc jemalloc_prod)
237237

238+
set(JEMALLOC_FOUND TRUE)
238239
set(JEMALLOC_LIBRARY_DIRS ${jemalloc_targ_BINARY_DIR}/lib)
239240
set(JEMALLOC_INCLUDE_DIRS ${jemalloc_targ_BINARY_DIR}/include)
240241
set(JEMALLOC_LIBRARIES ${jemalloc_targ_BINARY_DIR}/lib/libjemalloc.a)
241242
endif()
242243

243-
if(JEMALLOC_FOUND OR JEMALLOC_LIBRARIES)
244+
if(JEMALLOC_FOUND)
244245
set(UMF_POOL_JEMALLOC_ENABLED TRUE)
245246
# add PATH to DLL on Windows
246247
set(DLL_PATH_LIST
@@ -263,12 +264,9 @@ if(NOT UMF_DISABLE_HWLOC AND (NOT UMF_LINK_HWLOC_STATICALLY))
263264
pkg_check_modules(LIBHWLOC hwloc>=2.3.0)
264265
if(NOT LIBHWLOC_FOUND)
265266
find_package(LIBHWLOC 2.3.0 COMPONENTS hwloc)
266-
if(LIBHWLOC_LIBRARIES)
267-
set(LIBHWLOC_AVAILABLE TRUE)
268-
endif()
269267
endif()
270268

271-
if(LIBHWLOC_AVAILABLE OR LIBHWLOC_FOUND)
269+
if(LIBHWLOC_FOUND)
272270
# add PATH to DLL on Windows
273271
set(DLL_PATH_LIST
274272
"${DLL_PATH_LIST};PATH=path_list_append:${LIBHWLOC_DLL_DIRS}")
@@ -327,6 +325,7 @@ else()
327325
DIRECTORY)
328326
set(LIBHWLOC_LIBRARIES ${HWLOC_LIB_PATH})
329327
set(LIBHWLOC_INCLUDE_DIRS ${hwloc_targ_BINARY_DIR}/include)
328+
set(LIBHWLOC_FOUND TRUE)
330329
else() # not Windows
331330
FetchContent_Declare(
332331
hwloc_targ
@@ -369,6 +368,7 @@ else()
369368
set(LIBHWLOC_LIBRARY_DIRS ${hwloc_targ_BINARY_DIR}/lib)
370369
set(LIBHWLOC_INCLUDE_DIRS ${hwloc_targ_BINARY_DIR}/include)
371370
set(LIBHWLOC_LIBRARIES ${hwloc_targ_BINARY_DIR}/lib/libhwloc.a)
371+
set(LIBHWLOC_FOUND TRUE)
372372
endif()
373373
endif() # UMF_LINK_HWLOC_STATICALLY
374374

@@ -444,7 +444,7 @@ if(UMF_BUILD_LEVEL_ZERO_PROVIDER)
444444
endif()
445445
message(STATUS "LEVEL_ZERO_INCLUDE_DIRS = ${LEVEL_ZERO_INCLUDE_DIRS}")
446446

447-
if(ZE_LOADER_LIBRARIES)
447+
if(ZE_LOADER_FOUND)
448448
set(UMF_LEVEL_ZERO_ENABLED TRUE)
449449
else()
450450
message(
@@ -500,7 +500,7 @@ if(UMF_BUILD_CUDA_PROVIDER)
500500
endif()
501501
message(STATUS "CUDA_INCLUDE_DIRS = ${CUDA_INCLUDE_DIRS}")
502502

503-
if(CUDA_LIBRARIES)
503+
if(CUDA_FOUND)
504504
set(UMF_CUDA_ENABLED TRUE)
505505
else()
506506
message(
@@ -722,7 +722,7 @@ pkg_check_modules(TBB tbb)
722722
if(NOT TBB_FOUND)
723723
find_package(TBB OPTIONAL_COMPONENTS tbb)
724724
endif()
725-
if(TBB_FOUND OR TBB_LIBRARY_DIRS)
725+
if(TBB_FOUND)
726726
# add PATH to DLL on Windows
727727
set(DLL_PATH_LIST "${DLL_PATH_LIST};PATH=path_list_append:${TBB_DLL_DIRS}")
728728
set(UMF_POOL_SCALABLE_ENABLED TRUE)

cmake/FindCUDA.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ if(WINDOWS)
2121
endif()
2222

2323
if(CUDA_LIBRARY)
24+
set(CUDA_FOUND TRUE)
2425
message(STATUS " Found cuda using find_library()")
2526
message(STATUS " CUDA_LIBRARIES = ${CUDA_LIBRARIES}")
2627
message(STATUS " CUDA_INCLUDE_DIRS = ${CUDA_INCLUDE_DIRS}")

cmake/FindJEMALLOC.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ if(WINDOWS)
3434
endif()
3535

3636
if(JEMALLOC_LIBRARY)
37+
set(JEMALLOC_FOUND TRUE)
3738
message(STATUS " Found jemalloc using find_library()")
3839
else()
3940
set(MSG_NOT_FOUND

cmake/FindLIBHWLOC.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ if(WINDOWS)
5555
endif()
5656

5757
if(LIBHWLOC_LIBRARY)
58+
set(LIBHWLOC_FOUND TRUE)
5859
message(STATUS " Found libhwloc: ${LIBHWLOC_LIBRARY}")
5960

6061
if(LIBHWLOC_FIND_VERSION)

cmake/FindLIBNUMA.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ find_library(LIBNUMA_LIBRARY NAMES libnuma numa)
88
set(LIBNUMA_LIBRARIES ${LIBNUMA_LIBRARY})
99

1010
if(LIBNUMA_LIBRARY)
11+
set(LIBNUMA_FOUND TRUE)
1112
message(STATUS " Found libnuma using find_library()")
1213
else()
1314
set(MSG_NOT_FOUND

cmake/FindTBB.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ if(WINDOWS)
3232
endif()
3333

3434
if(TBB_LIBRARY)
35+
set(TBB_FOUND TRUE)
3536
message(STATUS " Found tbb using find_library()")
3637
message(STATUS " TBB_LIBRARIES = ${TBB_LIBRARIES}")
3738
message(STATUS " TBB_INCLUDE_DIRS = ${TBB_INCLUDE_DIRS}")

cmake/FindZE_LOADER.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ if(WINDOWS)
2121
endif()
2222

2323
if(ZE_LOADER_LIBRARY)
24+
set(ZE_LOADER_FOUND TRUE)
2425
message(STATUS " Found ZE_LOADER using find_library()")
2526
message(STATUS " ZE_LOADER_LIBRARIES = ${ZE_LOADER_LIBRARIES}")
2627
message(STATUS " ZE_LOADER_INCLUDE_DIRS = ${ZE_LOADER_INCLUDE_DIRS}")

examples/cmake/FindCUDA.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2024 Intel Corporation
1+
# Copyright (C) 2024-2025 Intel Corporation
22
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

@@ -17,6 +17,7 @@ if(WINDOWS)
1717
endif()
1818

1919
if(CUDA_LIBRARY)
20+
set(CUDA_FOUND TRUE)
2021
message(STATUS " Found cuda using find_library()")
2122
message(STATUS " CUDA_LIBRARIES = ${CUDA_LIBRARIES}")
2223
message(STATUS " CUDA_INCLUDE_DIRS = ${CUDA_INCLUDE_DIRS}")

examples/cmake/FindJEMALLOC.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2024 Intel Corporation
1+
# Copyright (C) 2024-2025 Intel Corporation
22
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

@@ -36,6 +36,7 @@ if(WINDOWS)
3636
endif()
3737

3838
if(JEMALLOC_LIBRARY)
39+
set(JEMALLOC_FOUND TRUE)
3940
message(STATUS " Found jemalloc using find_library()")
4041
message(STATUS " JEMALLOC_LIBRARIES = ${JEMALLOC_LIBRARIES}")
4142
message(STATUS " JEMALLOC_INCLUDE_DIRS = ${JEMALLOC_INCLUDE_DIRS}")

examples/cmake/FindLIBHWLOC.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2024 Intel Corporation
1+
# Copyright (C) 2024-2025 Intel Corporation
22
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

@@ -45,6 +45,7 @@ if(WINDOWS)
4545
endif()
4646

4747
if(LIBHWLOC_LIBRARY)
48+
set(LIBHWLOC_FOUND TRUE)
4849
message(STATUS " Found libhwloc using find_library()")
4950
message(STATUS " LIBHWLOC_LIBRARIES = ${LIBHWLOC_LIBRARIES}")
5051
message(STATUS " LIBHWLOC_INCLUDE_DIRS = ${LIBHWLOC_INCLUDE_DIRS}")

0 commit comments

Comments
 (0)