Skip to content

Commit 7a5eb60

Browse files
committed
fix setting LIBHWLOC_LIBRARIES on Windows
1 parent 37bffd9 commit 7a5eb60

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

CMakeLists.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,20 @@ else()
251251

252252
set(LIBHWLOC_INCLUDE_DIRS
253253
${hwloc_targ_SOURCE_DIR}/include;${hwloc_targ_BINARY_DIR}/include)
254-
set(LIBHWLOC_LIBRARY_DIRS
255-
${hwloc_targ_BINARY_DIR}/Release;${hwloc_targ_BINARY_DIR}/Debug)
254+
if(CMAKE_BUILD_TYPE STREQUAL "Release")
255+
set(LIBHWLOC_LIBRARY_DIRS ${hwloc_targ_BINARY_DIR}/Release)
256+
set(LIBHWLOC_LIBRARIES ${hwloc_targ_BINARY_DIR}/Release/hwloc.lib)
257+
elseif(CMAKE_BUILD_TYPE STREQUAL "Debug")
258+
set(LIBHWLOC_LIBRARY_DIRS ${hwloc_targ_BINARY_DIR}/Debug)
259+
set(LIBHWLOC_LIBRARIES ${hwloc_targ_BINARY_DIR}/Debug/hwloc.lib)
260+
else()
261+
message(
262+
WARNING
263+
"CMAKE_BUILD_TYPE is not set - UMF will be linked with the Release version of the HWLOC library by default"
264+
)
265+
set(LIBHWLOC_LIBRARY_DIRS ${hwloc_targ_BINARY_DIR}/Release)
266+
set(LIBHWLOC_LIBRARIES ${hwloc_targ_BINARY_DIR}/Release/hwloc.lib)
267+
endif()
256268
else()
257269
include(FetchContent)
258270
message(

0 commit comments

Comments
 (0)