qt5base-lts/cmake/FindSlog2.cmake
Cristian Adam 7e10dcb1d4 CMake Build: Add include guards for FindPPS.cmake and FindSlog2.cmake
The CMake configure process fails without include guards for these
two find modules on QNX.

Task-number: QTBUG-83202
Change-Id: I3cc589f98bc3b6b22c401421927ee6dab2663fb7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-19 12:46:10 +02:00

22 lines
669 B
CMake

# Find the Slog2 library
# Will make the target Slog2::Slog2 available when found.
if(TARGET Slog2::Slog2)
set(Slog2_FOUND TRUE)
return()
endif()
find_library(Slog2_LIBRARY NAMES "slog2")
find_path(Slog2_INCLUDE_DIR NAMES "sys/slog2.h" DOC "The Slog2 Include path")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Slog2 DEFAULT_MSG Slog2_INCLUDE_DIR Slog2_LIBRARY)
mark_as_advanced(Slog2_INCLUDE_DIR Slog2_LIBRARY)
if(Slog2_FOUND)
add_library(Slog2::Slog2 INTERFACE IMPORTED)
target_link_libraries(Slog2::Slog2 INTERFACE ${Slog2_LIBRARY})
target_include_directories(Slog2::Slog2 INTERFACE ${Slog2_INCLUDE_DIR})
endif()