0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 04:02:15 +02:00
openvpn3/cmake/FindxxHash.cmake
Frank Lichtenheld d7b3419f8e CMake: clean up dependency handling
Always use find_package for all libraries.
Add missing Find*.cmake modules.
Always define an IMPORTED library in Find*

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-02-28 13:45:16 +01:00

16 lines
430 B
CMake

find_path(XXHASH_INCLUDE_DIR NAMES xxhash.h)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
xxHash DEFAULT_MSG
XXHASH_INCLUDE_DIR
)
if(XXHASH_INCLUDE_DIR AND NOT TARGET xxHash::xxhash)
add_library(xxHash::xxhash INTERFACE IMPORTED)
set_target_properties(xxHash::xxhash PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${XXHASH_INCLUDE_DIR}")
endif()
mark_as_advanced(XXHASH_INCLUDE_DIR)