qt5base-lts/cmake/FindSlog2.cmake
Tobias Hunger eb2ece3c59 CMake: Add FindSlog2
Add FindSlog2 and use it in src/corelib/configure.cmake.

Change-Id: I7e6a696a49df568a41ed1224228ab608db2dbb0e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-11-06 15:24:55 +00:00

20 lines
618 B
CMake

# Find the Slog2 library
# Will make the target Slog2::Slog2 available when found.
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 IMPORTED)
target_link_libraries(__Slog2 INTERFACE ${Slog2_LIBRARY})
target_include_directories(__Slog2 INTERFACE ${Slog2_INCLUDE_DIR})
add_library(Slog2::Slog2 ALIAS __Slog2)
endif()