Files
libmetal/cmake/modules/FindLibSysFS.cmake
Arnaud Pouliquen f3cf921f0a cmake: fix HUGETLBFS and LIBSYSFS naming warning
Fix warnings spotted by cmake:

The package name passed to `find_package_handle_standard_args`(HUGETLBFS)
does not match the name of the calling package(HugeTLBFS). This can lead
to problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.

Tested with cmake 3.5 and 3.17.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
2020-07-08 11:18:08 +02:00

35 lines
961 B
CMake

# FindLibSysFS
# --------
#
# Find LibSysFS
#
# Find the native LibSysFS includes and library This module defines
#
# ::
#
# LIBSYSFS_INCLUDE_DIR, where to find libsysfs.h, etc.
# LIBSYSFS_LIBRARIES, the libraries needed to use LibSysFS.
# LIBSYSFS_FOUND, If false, do not try to use LibSysFS.
#
# also defined, but not for general use are
#
# ::
#
# LIBSYSFS_LIBRARY, where to find the LibSysFS library.
find_path (LIBSYSFS_INCLUDE_DIR sysfs/libsysfs.h)
set (LIBSYSFS_NAMES ${LIBSYSFS_NAMES} sysfs)
find_library (LIBSYSFS_LIBRARY NAMES ${LIBSYSFS_NAMES})
# handle the QUIETLY and REQUIRED arguments and set LIBSYSFS_FOUND to TRUE if
# all listed variables are TRUE
include (FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS (LibSysFS DEFAULT_MSG LIBSYSFS_LIBRARY LIBSYSFS_INCLUDE_DIR)
if (LIBSYSFS_FOUND)
set (LIBSYSFS_LIBRARIES ${LIBSYSFS_LIBRARY})
endif (LIBSYSFS_FOUND)
mark_as_advanced (LIBSYSFS_LIBRARY LIBSYSFS_INCLUDE_DIR)