aboutsummaryrefslogtreecommitdiff
path: root/cmake/FindMsgpack.cmake
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
commit1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch)
treecd08258054db80bb9a11b1061bb091c70b76926a /cmake/FindMsgpack.cmake
parenteaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-aucmd_textputpost.tar.gz
rneovim-aucmd_textputpost.tar.bz2
rneovim-aucmd_textputpost.zip
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'cmake/FindMsgpack.cmake')
-rw-r--r--cmake/FindMsgpack.cmake41
1 files changed, 6 insertions, 35 deletions
diff --git a/cmake/FindMsgpack.cmake b/cmake/FindMsgpack.cmake
index 26eb19d498..9ef18122ab 100644
--- a/cmake/FindMsgpack.cmake
+++ b/cmake/FindMsgpack.cmake
@@ -1,20 +1,4 @@
-# - Try to find msgpack
-# Once done this will define
-# MSGPACK_FOUND - System has msgpack
-# MSGPACK_INCLUDE_DIRS - The msgpack include directories
-# MSGPACK_LIBRARIES - The libraries needed to use msgpack
-
-find_package(PkgConfig)
-if (PKG_CONFIG_FOUND)
- pkg_search_module(PC_MSGPACK QUIET
- msgpackc>=${Msgpack_FIND_VERSION}
- msgpack>=${Msgpack_FIND_VERSION})
-endif()
-
-set(MSGPACK_DEFINITIONS ${PC_MSGPACK_CFLAGS_OTHER})
-
-find_path(MSGPACK_INCLUDE_DIR msgpack/version_master.h
- HINTS ${PC_MSGPACK_INCLUDEDIR} ${PC_MSGPACK_INCLUDE_DIRS})
+find_path2(MSGPACK_INCLUDE_DIR msgpack/version_master.h)
if(MSGPACK_INCLUDE_DIR)
file(READ ${MSGPACK_INCLUDE_DIR}/msgpack/version_master.h msgpack_version_h)
@@ -26,28 +10,15 @@ else()
set(MSGPACK_VERSION_STRING)
endif()
-if(MSVC)
- # The import library for the msgpack DLL has a different name
- list(APPEND MSGPACK_NAMES msgpackc_import)
-else()
- list(APPEND MSGPACK_NAMES msgpackc msgpack)
-endif()
-
-find_library(MSGPACK_LIBRARY NAMES ${MSGPACK_NAMES}
- # Check each directory for all names to avoid using headers/libraries from
- # different places.
- NAMES_PER_DIR
- HINTS ${PC_MSGPACK_LIBDIR} ${PC_MSGPACK_LIBRARY_DIRS})
+find_library2(MSGPACK_LIBRARY NAMES msgpackc msgpack msgpackc_import msgpack-c
+ NAMES_PER_DIR)
mark_as_advanced(MSGPACK_INCLUDE_DIR MSGPACK_LIBRARY)
-set(MSGPACK_LIBRARIES ${MSGPACK_LIBRARY})
-set(MSGPACK_INCLUDE_DIRS ${MSGPACK_INCLUDE_DIR})
-
-include(FindPackageHandleStandardArgs)
-# handle the QUIETLY and REQUIRED arguments and set MSGPACK_FOUND to TRUE
-# if all listed variables are TRUE
find_package_handle_standard_args(Msgpack
REQUIRED_VARS MSGPACK_LIBRARY MSGPACK_INCLUDE_DIR
VERSION_VAR MSGPACK_VERSION_STRING)
+add_library(msgpack INTERFACE)
+target_include_directories(msgpack SYSTEM BEFORE INTERFACE ${MSGPACK_INCLUDE_DIR})
+target_link_libraries(msgpack INTERFACE ${MSGPACK_LIBRARY})