Source
15
15
include (LibFind)
16
16
17
17
# Define LIBZ package
18
18
define_package_component (LIBZ
19
19
INCLUDE_NAMES zlib.h
20
20
LIBRARY_NAMES z)
21
21
22
22
# SEARCH FOR PACKAGE
23
23
if (NOT LIBZ_FOUND)
24
24
25
-
# Manually add the MPI include and library dirs to search paths
25
+
# Manually add the MPI include and library dirs to search paths
26
+
# and search for the package component
26
27
if (MPI_C_FOUND)
27
-
set (LIBZ_PATHS ${MPI_C_INCLUDE_PATH})
28
-
foreach (lib IN LISTS MPI_C_LIBRARIES)
29
-
get_filename_component (libdir ${lib} PATH)
30
-
list (APPEND LIBZ_PATHS ${libdir})
31
-
unset (libdir)
32
-
endforeach ()
28
+
initialize_paths (LIBZ_PATHS
29
+
INCLUDE_DIRECTORIES ${MPI_C_INCLUDE_PATH}
30
+
LIBRARIES ${MPI_C_LIBRARIES})
31
+
find_package_component(LIBZ
32
+
PATHS ${LIBZ_PATHS})
33
+
else ()
34
+
find_package_component(LIBZ)
33
35
endif ()
34
-
35
-
# Search for the package
36
-
find_package_component(LIBZ
37
-
PATHS ${LIBZ_PATHS})
38
36
39
37
endif ()