Rewrite the FindCryptopp cmake module cleanly
This commit is contained in:
+1
-1
@@ -26,7 +26,7 @@ include_directories(${EXPAT_INCLUDE_DIRS})
|
|||||||
include_directories(${ICONV_INCLUDE_DIR})
|
include_directories(${ICONV_INCLUDE_DIR})
|
||||||
# the SYSTEM flag tells the compiler that we don't care about warnings
|
# the SYSTEM flag tells the compiler that we don't care about warnings
|
||||||
# coming from these headers.
|
# coming from these headers.
|
||||||
include_directories(SYSTEM ${CRYPTO++_INCLUDE_DIR})
|
include_directories(SYSTEM ${CRYPTO++_INCLUDE_DIRS})
|
||||||
|
|
||||||
set(POLLER "POLL" CACHE STRING
|
set(POLLER "POLL" CACHE STRING
|
||||||
"Choose the poller between POLL and EPOLL (Linux-only)")
|
"Choose the poller between POLL and EPOLL (Linux-only)")
|
||||||
|
|||||||
@@ -1,35 +1,53 @@
|
|||||||
# - Find Crypto++
|
# - Find Crypto++
|
||||||
|
# Find the Crypto++ library
|
||||||
|
#
|
||||||
|
# This module defines the following variables:
|
||||||
|
# CRYPTO++_FOUND - True if library and include directory are found
|
||||||
|
# If set to TRUE, the following are also defined:
|
||||||
|
# CRYPTO++_LIBRARIES - Where to find the library file
|
||||||
|
# CRYPTO++_INCLUDE_DIRS - The directory where to find the header files
|
||||||
|
#
|
||||||
|
# For conveniance, these variables are also set. They have the same values
|
||||||
|
# than the variables above. The user can thus choose his/her prefered way
|
||||||
|
# to way to write them.
|
||||||
|
#
|
||||||
|
# CRYPTOPP_FOUND
|
||||||
|
#
|
||||||
|
# CRYPTO++_LIBRARY
|
||||||
|
# CRYPTOPP_LIBRARY
|
||||||
|
# CRYPTOPP_LIBRARIES
|
||||||
|
#
|
||||||
|
# CRYPTO++_INCLUDE_DIR
|
||||||
|
# CRYPTOPP_INCLUDE_DIRS
|
||||||
|
# CRYPTOPP_INCLUDE_DIR
|
||||||
|
#
|
||||||
|
# This file is in the public domain.
|
||||||
|
|
||||||
if(CRYPTO++_INCLUDE_DIR AND CRYPTO++_LIBRARIES)
|
find_path(CRYPTO++_INCLUDE_DIRS NAMES cryptlib.h
|
||||||
set(CRYPTO++_FOUND TRUE)
|
PATH_SUFFIXES "crypto++" "cryptopp"
|
||||||
|
DOC "The Crypto++ include directory")
|
||||||
|
|
||||||
else(CRYPTO++_INCLUDE_DIR AND CRYPTO++_LIBRARIES)
|
find_library(CRYPTO++_LIBRARIES NAMES cryptopp
|
||||||
find_path(CRYPTO++_INCLUDE_DIR cryptlib.h
|
DOC "The Crypto++ library")
|
||||||
/usr/include/crypto++
|
|
||||||
/usr/include/cryptopp
|
|
||||||
/usr/local/include/crypto++
|
|
||||||
/usr/local/include/cryptopp
|
|
||||||
/opt/local/include/crypto++
|
|
||||||
/opt/local/include/cryptopp
|
|
||||||
$ENV{SystemDrive}/Crypto++/include
|
|
||||||
)
|
|
||||||
|
|
||||||
find_library(CRYPTO++_LIBRARIES NAMES cryptopp
|
# Use some standard module to handle the QUIETLY and REQUIRED arguments, and
|
||||||
PATHS
|
# set CRYPTO++_FOUND to TRUE if these two variables are set.
|
||||||
/usr/lib
|
include(FindPackageHandleStandardArgs)
|
||||||
/usr/local/lib
|
find_package_handle_standard_args(Crypto++ REQUIRED_VARS CRYPTO++_LIBRARIES CRYPTO++_INCLUDE_DIRS)
|
||||||
/opt/local/lib
|
|
||||||
$ENV{SystemDrive}/Crypto++/lib
|
|
||||||
)
|
|
||||||
|
|
||||||
if(CRYPTO++_INCLUDE_DIR AND CRYPTO++_LIBRARIES)
|
# Compatibility for all the ways of writing these variables
|
||||||
set(CRYPTO++_FOUND TRUE)
|
if(CRYPTO++_FOUND)
|
||||||
message(STATUS "Found Crypto++: ${CRYPTO++_INCLUDE_DIR}, ${CRYPTO++_LIBRARIES}")
|
set(CRYPTOPP_FOUND ${CRYPTO++_FOUND})
|
||||||
else(CRYPTO++_INCLUDE_DIR AND CRYPTO++_LIBRARIES)
|
|
||||||
set(CRYPTO++_FOUND FALSE)
|
set(CRYPTO++_LIBRARY ${CRYPTO++_LIBRARIES})
|
||||||
message(STATUS "Crypto++ not found.")
|
set(CRYPTOPP_LIBRARY ${CRYPTO++_LIBRARIES})
|
||||||
endif(CRYPTO++_INCLUDE_DIR AND CRYPTO++_LIBRARIES)
|
set(CRYPTOPP_LIBRARIES ${CRYPTO++_LIBRARIES})
|
||||||
|
|
||||||
|
set(CRYPTO++_INCLUDE_DIR ${CRYPTO++_INCLUDE_DIRS})
|
||||||
|
set(CRYPTOPP_INCLUDE_DIR ${CRYPTO++_INCLUDE_DIRS})
|
||||||
|
set(CRYPTOPP_INCLUDE_DIRS ${CRYPTO++_INCLUDE_DIRS})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
mark_as_advanced(CRYPTO++_INCLUDE_DIRS CRYPTO++_LIBRARIES)
|
||||||
|
|
||||||
mark_as_advanced(CRYPTO++_INCLUDE_DIR CRYPTO++_LIBRARIES)
|
|
||||||
|
|
||||||
endif(CRYPTO++_INCLUDE_DIR AND CRYPTO++_LIBRARIES)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user