Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flexisip
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
6
Issues
6
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
flexisip
Commits
d62d5574
Commit
d62d5574
authored
Nov 23, 2017
by
Ghislain MARY
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rework search for hiredis library.
parent
934b8d84
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
16 deletions
+57
-16
CMakeLists.txt
CMakeLists.txt
+2
-16
FindHiredis.cmake
cmake/FindHiredis.cmake
+55
-0
No files found.
CMakeLists.txt
View file @
d62d5574
...
...
@@ -156,23 +156,9 @@ if(ENABLE_DATEHANDLER)
endif
()
if
(
ENABLE_REDIS
)
find_path
(
HIREDIS_INCLUDE_DIRS NAMES hiredis/hiredis.h
)
find_library
(
HIREDIS_LIBRARIES NAMES hiredis
)
if
(
NOT HIREDIS_INCLUDE_DIRS
)
message
(
FATAL_ERROR
"hiredis headers not found"
)
endif
()
if
(
NOT HIREDIS_LIBRARIES
)
message
(
FATAL_ERROR
"hiredis library not found"
)
endif
()
# check that the async mode is supported
cmake_push_check_state
(
RESET
)
list
(
APPEND CMAKE_REQUIRED_INCLUDES
${
HIREDIS_INCLUDE_DIRS
}
)
list
(
APPEND CMAKE_REQUIRED_LIBRARIES
${
HIREDIS_LIBRARIES
}
)
check_symbol_exists
(
"redisAsyncCommand"
"hiredis/async.h"
HIREDIS_ASYNC_ENABLED
)
cmake_pop_check_state
()
find_package
(
Hiredis REQUIRED
)
if
(
NOT HIREDIS_ASYNC_ENABLED
)
message
(
FATAL_ERROR
"Hiredis needs support for
Async commands.
"
)
message
(
FATAL_ERROR
"Hiredis needs support for
async commands
"
)
endif
()
endif
()
...
...
cmake/FindHiredis.cmake
0 → 100644
View file @
d62d5574
############################################################################
# FindHiredis.cmake
# Copyright (C) 2017 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
############################################################################
#
# - Find the libhiredis library
#
# HIREDIS_FOUND - system has libhiredis
# HIREDIS_INCLUDE_DIRS - the libhiredis include directory
# HIREDIS_LIBRARIES - The libraries needed to use libhiredis
# HIREDIS_ASYNC_ENABLED - The found libhiredis library supports async commands
find_path
(
HIREDIS_INCLUDE_DIRS
NAMES hiredis/hiredis.h
PATH_SUFFIXES include
)
find_library
(
HIREDIS_LIBRARIES
NAMES hiredis
)
if
(
HIREDIS_INCLUDE_DIRS AND HIREDIS_LIBRARIES
)
# check that the async mode is supported
cmake_push_check_state
(
RESET
)
list
(
APPEND CMAKE_REQUIRED_INCLUDES
${
HIREDIS_INCLUDE_DIRS
}
)
list
(
APPEND CMAKE_REQUIRED_LIBRARIES
${
HIREDIS_LIBRARIES
}
)
check_symbol_exists
(
"redisAsyncCommand"
"hiredis/async.h"
HIREDIS_ASYNC_ENABLED
)
cmake_pop_check_state
()
endif
()
include
(
FindPackageHandleStandardArgs
)
find_package_handle_standard_args
(
Hiredis
DEFAULT_MSG
HIREDIS_INCLUDE_DIRS HIREDIS_LIBRARIES
)
mark_as_advanced
(
HIREDIS_INCLUDE_DIRS HIREDIS_LIBRARIES HIREDIS_ASYNC_ENABLED
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment