Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opendht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
opendht
Commits
2bc8bf8e
Commit
2bc8bf8e
authored
3 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
build: use msgpack cmake
parent
c2415f38
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+4
-4
4 additions, 4 deletions
CMakeLists.txt
cmake/FindMsgpack.cmake
+0
-64
0 additions, 64 deletions
cmake/FindMsgpack.cmake
with
4 additions
and
68 deletions
CMakeLists.txt
+
4
−
4
View file @
2bc8bf8e
...
...
@@ -57,7 +57,7 @@ if (NOT MSVC)
find_package
(
PkgConfig REQUIRED
)
find_package
(
GnuTLS 3.3 REQUIRED
)
pkg_search_module
(
Nettle REQUIRED nettle
)
find_package
(
M
sgpack
1.2
REQUIRED
)
find_package
(
m
sgpack REQUIRED
)
if
(
OPENDHT_TOOLS
)
find_package
(
Readline 6 REQUIRED
)
endif
()
...
...
@@ -329,7 +329,7 @@ if (OPENDHT_STATIC)
PRIVATE
${
argon2_LIBRARIES
}
PUBLIC
${
CMAKE_THREAD_LIBS_INIT
}
${
GNUTLS_LIBRARIES
}
${
Nettle_STATIC_LIBRARIES
}
${
Jsoncpp_STATIC_LIBRARIES
}
${
FMT_LIBRARY
}
${
HTTP_PARSER_LIBRARY
}
${
OPENSSL_STATIC_LIBRARIES
}
)
${
OPENSSL_STATIC_LIBRARIES
}
msgpackc-cxx
)
else
()
if
(
OPENDHT_TOOLS
)
function
(
add_obj_lib name libfile
)
...
...
@@ -392,14 +392,14 @@ if (OPENDHT_SHARED)
target_include_directories
(
opendht SYSTEM PRIVATE
${
argon2_INCLUDE_DIRS
}
)
if
(
APPLE
)
target_link_libraries
(
opendht
PUBLIC
${
CMAKE_THREAD_LIBS_INIT
}
${
OPENSSL_LIBRARIES
}
PUBLIC
${
CMAKE_THREAD_LIBS_INIT
}
${
OPENSSL_LIBRARIES
}
msgpackc-cxx
PRIVATE
${
GNUTLS_LIBRARIES
}
${
Nettle_LIBRARIES
}
${
Jsoncpp_LIBRARIES
}
${
FMT_LIBRARY
}
${
HTTP_PARSER_LIBRARY
}
${
argon2_LIBRARIES
}
SYSTEM
"-framework CoreFoundation"
"-framework Security"
)
else
()
target_link_libraries
(
opendht
PUBLIC
${
CMAKE_THREAD_LIBS_INIT
}
${
OPENSSL_LIBRARIES
}
PUBLIC
${
CMAKE_THREAD_LIBS_INIT
}
${
OPENSSL_LIBRARIES
}
msgpackc-cxx
PRIVATE
${
GNUTLS_LIBRARIES
}
${
Nettle_LIBRARIES
}
${
Jsoncpp_LIBRARIES
}
${
FMT_LIBRARY
}
${
HTTP_PARSER_LIBRARY
}
${
argon2_LIBRARIES
}
)
...
...
This diff is collapsed.
Click to expand it.
cmake/FindMsgpack.cmake
deleted
100644 → 0
+
0
−
64
View file @
c2415f38
# - 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
if
(
NOT MSGPACK_USE_BUNDLED
)
find_package
(
PkgConfig
)
if
(
PKG_CONFIG_FOUND
)
pkg_search_module
(
PC_MSGPACK QUIET
msgpackc>=
${
Msgpack_FIND_VERSION
}
msgpack>=
${
Msgpack_FIND_VERSION
}
)
endif
()
else
()
set
(
PC_MSGPACK_INCLUDEDIR
)
set
(
PC_MSGPACK_INCLUDE_DIRS
)
set
(
PC_MSGPACK_LIBDIR
)
set
(
PC_MSGPACK_LIBRARY_DIRS
)
set
(
LIMIT_SEARCH NO_DEFAULT_PATH
)
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
}
${
LIMIT_SEARCH
}
)
if
(
MSGPACK_INCLUDE_DIR
)
file
(
READ
${
MSGPACK_INCLUDE_DIR
}
/msgpack/version_master.h msgpack_version_h
)
string
(
REGEX REPLACE
".*MSGPACK_VERSION_MAJOR +([0-9]+).*"
"
\\
1"
MSGPACK_VERSION_MAJOR
"
${
msgpack_version_h
}
"
)
string
(
REGEX REPLACE
".*MSGPACK_VERSION_MINOR +([0-9]+).*"
"
\\
1"
MSGPACK_VERSION_MINOR
"
${
msgpack_version_h
}
"
)
string
(
REGEX REPLACE
".*MSGPACK_VERSION_REVISION +([0-9]+).*"
"
\\
1"
MSGPACK_VERSION_REVISION
"
${
msgpack_version_h
}
"
)
set
(
MSGPACK_VERSION_STRING
"
${
MSGPACK_VERSION_MAJOR
}
.
${
MSGPACK_VERSION_MINOR
}
.
${
MSGPACK_VERSION_REVISION
}
"
)
else
()
set
(
MSGPACK_VERSION_STRING
)
endif
()
# If we're asked to use static linkage, add libmsgpack{,c}.a as a preferred library name.
if
(
MSGPACK_USE_STATIC
)
list
(
APPEND MSGPACK_NAMES
"
${
CMAKE_STATIC_LIBRARY_PREFIX
}
msgpackc
${
CMAKE_STATIC_LIBRARY_SUFFIX
}
"
"
${
CMAKE_STATIC_LIBRARY_PREFIX
}
msgpack
${
CMAKE_STATIC_LIBRARY_SUFFIX
}
"
)
endif
()
list
(
APPEND MSGPACK_NAMES msgpackc msgpack
)
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
}
${
LIMIT_SEARCH
}
)
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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment