diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2018-11-06 14:58:26 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2018-11-06 15:24:55 +0000 |
commit | eb2ece3c59773f8948819349d6f86fc453967588 (patch) | |
tree | eca84796878409c2e844a68b3ed21b909344e0e2 /cmake | |
parent | 38f1a10b6f6deeee0871535fe7430ebd90f3a935 (diff) |
CMake: Add FindSlog2
Add FindSlog2 and use it in src/corelib/configure.cmake.
Change-Id: I7e6a696a49df568a41ed1224228ab608db2dbb0e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/FindSlog2.cmake | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/cmake/FindSlog2.cmake b/cmake/FindSlog2.cmake new file mode 100644 index 0000000000..8ff00e4157 --- /dev/null +++ b/cmake/FindSlog2.cmake @@ -0,0 +1,19 @@ +# 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() |