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
712d8a01
Commit
712d8a01
authored
9 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Plain Diff
Merge pull request #35 from sim590/cmake_msgpack
Update FindMsgpack.cmake fixing "not found" error
parents
9fbe1173
8c2cc749
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmake/FindMsgpack.cmake
+23
-7
23 additions, 7 deletions
cmake/FindMsgpack.cmake
with
23 additions
and
7 deletions
cmake/FindMsgpack.cmake
+
23
−
7
View file @
712d8a01
...
...
@@ -7,7 +7,9 @@
if
(
NOT MSGPACK_USE_BUNDLED
)
find_package
(
PkgConfig
)
if
(
PKG_CONFIG_FOUND
)
pkg_check_modules
(
PC_MSGPACK QUIET msgpack
)
pkg_search_module
(
PC_MSGPACK QUIET
msgpackc>=
${
Msgpack_FIND_VERSION
}
msgpack>=
${
Msgpack_FIND_VERSION
}
)
endif
()
else
()
set
(
PC_MSGPACK_INCLUDEDIR
)
...
...
@@ -19,19 +21,33 @@ endif()
set
(
MSGPACK_DEFINITIONS
${
PC_MSGPACK_CFLAGS_OTHER
}
)
find_path
(
MSGPACK_INCLUDE_DIR msgpack.h
find_path
(
MSGPACK_INCLUDE_DIR msgpack
/version_master
.h
HINTS
${
PC_MSGPACK_INCLUDEDIR
}
${
PC_MSGPACK_INCLUDE_DIRS
}
${
LIMIT_SEARCH
}
)
# If we're asked to use static linkage, add libmsgpack.a as a preferred library name.
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 msgpack
)
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
}
)
...
...
@@ -43,6 +59,6 @@ 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
DEFAULT_MSG
MSGPACK_LIBRARY MSGPACK_INCLUDE_DIR
)
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