2023-11-02 06:27:10 +05:30
|
|
|
if(NOT CRYPTOPP_FOUND)
|
2023-11-20 17:37:41 +05:30
|
|
|
pkg_search_module(CRYPTOPP_TMP crypto++ cryptopp)
|
2023-11-02 06:27:10 +05:30
|
|
|
|
|
|
|
find_path(CRYPTOPP_INCLUDE_DIRS NAMES cryptlib.h
|
|
|
|
PATHS
|
|
|
|
${CRYPTOPP_TMP_INCLUDE_DIRS}
|
|
|
|
/usr/include
|
|
|
|
/usr/local/include
|
2023-11-20 17:37:41 +05:30
|
|
|
PATH_SUFFIXES crypto++ cryptopp
|
2023-11-02 06:27:10 +05:30
|
|
|
)
|
|
|
|
|
2023-11-20 17:37:41 +05:30
|
|
|
find_library(CRYPTOPP_LIBRARY_DIRS NAMES crypto++ cryptopp
|
2023-11-02 06:27:10 +05:30
|
|
|
PATHS
|
|
|
|
${CRYPTOPP_TMP_LIBRARY_DIRS}
|
|
|
|
/usr/lib
|
2023-11-20 17:37:41 +05:30
|
|
|
/usr/local/lib
|
2023-11-02 06:27:10 +05:30
|
|
|
)
|
|
|
|
|
|
|
|
if(CRYPTOPP_INCLUDE_DIRS AND CRYPTOPP_LIBRARY_DIRS)
|
|
|
|
set(CRYPTOPP_FOUND TRUE CACHE INTERNAL "Found cryptopp")
|
|
|
|
message(STATUS "Found cryptopp: ${CRYPTOPP_LIBRARY_DIRS}, ${CRYPTOPP_INCLUDE_DIRS}")
|
|
|
|
else()
|
|
|
|
set(CRYPTOPP_FOUND FALSE CACHE INTERNAL "Found cryptopp")
|
|
|
|
message(STATUS "Cryptopp not found.")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CRYPTOPP_FOUND AND NOT TARGET cryptopp::cryptopp)
|
|
|
|
add_library(cryptopp::cryptopp UNKNOWN IMPORTED)
|
|
|
|
set_target_properties(cryptopp::cryptopp PROPERTIES
|
|
|
|
INCLUDE_DIRECTORIES ${CRYPTOPP_INCLUDE_DIRS}
|
|
|
|
INTERFACE_LINK_LIBRARIES ${CRYPTOPP_LIBRARY_DIRS}
|
|
|
|
IMPORTED_LOCATION ${CRYPTOPP_LIBRARY_DIRS}
|
|
|
|
)
|
|
|
|
endif()
|