@ -23,63 +23,52 @@ else ()
message ( FATAL_ERROR "Your C++ compiler does not support C++11." )
endif ( )
# O v e r r i d e t h e c r y p t o p p s e a r c h u n t i l w e c a n g e t t h e q m a k e s t u f f s o r t e d .
# set ( CRYPTOPP_INCLUDE_DIR "../cryptopp562" CACHE FILEPATH "" FORCE )
# set ( CRYPTOPP_LIBRARIES "../cryptopp562" CACHE FILEPATH "" FORCE )
# L o o k f o r a v a i l a b l e C r y p t o + + v e r s i o n a n d i f i t i s > = 5 . 6 . 2
find_path ( ID cryptlib.h
/ u s r / i n c l u d e / c r y p t o p p
/ u s r / i n c l u d e / c r y p t o + +
/ u s r / l o c a l / i n c l u d e / c r y p t o p p
/ u s r / l o c a l / i n c l u d e / c r y p t o + +
/ o p t / l o c a l / i n c l u d e / c r y p t o p p
/ o p t / l o c a l / i n c l u d e / c r y p t o + +
)
find_library ( LS NAMES cryptoppeth cryptopp
P A T H S
/ u s r / l i b
/ u s r / l o c a l / l i b
/ o p t / l o c a l / l i b
)
set ( CRYPTOPP_INCLUDE_DIR CACHE FILEPATH "" FORCE )
set ( CRYPTOPP_LIBRARIES CACHE FILEPATH "" FORCE )
if ( ID AND LS )
set ( CRYPTOPP_FOUND TRUE )
message ( STATUS "Found Crypto++: ${ID}, ${LS}" )
set ( _CRYPTOPP_VERSION_HEADER ${ ID } /config.h )
if ( EXISTS ${ _CRYPTOPP_VERSION_HEADER } )
file ( STRINGS ${ _CRYPTOPP_VERSION_HEADER } _CRYPTOPP_VERSION REGEX "^#define CRYPTOPP_VERSION[ \t]+[0-9]+$" )
string ( REGEX REPLACE "^#define CRYPTOPP_VERSION[ \t]+([0-9]+)" "\\1" _CRYPTOPP_VERSION ${ _CRYPTOPP_VERSION } )
if ( ${ _CRYPTOPP_VERSION } LESS 562 )
message ( STATUS "System Crypto++ version found is smaller than 5.6.2." )
else ( )
set ( CRYPTOPP_INCLUDE_DIR ${ ID } CACHE FILEPATH "" FORCE )
set ( CRYPTOPP_LIBRARIES ${ LS } CACHE FILEPATH "" FORCE )
set ( CRYPTOPP_FOUND TRUE )
message ( STATUS "System Crypto++ found and version greater or equal to 5.6.2" )
endif ( )
endif ( )
endif ( )
# L o o k f o r a v a i l a b e C r y p t o + + v e r s i o n a n d i f i t i s > = 5 . 6 . 2
# if ( CRYPTOPP_INCLUDE_DIR AND CRYPTOPP_LIBRARIES )
# set ( CRYPTOPP_FOUND TRUE )
# message ( STATUS "Found Crypto++: ${CRYPTOPP_INCLUDE_DIR}, ${CRYPTOPP_LIBRARIES}" )
# else ( )
find_path ( ID cryptlib.h
/ u s r / i n c l u d e / c r y p t o p p
/ u s r / i n c l u d e / c r y p t o + +
/ u s r / l o c a l / i n c l u d e / c r y p t o p p
/ u s r / l o c a l / i n c l u d e / c r y p t o + +
/ o p t / l o c a l / i n c l u d e / c r y p t o p p
/ o p t / l o c a l / i n c l u d e / c r y p t o + +
)
find_library ( LS NAMES cryptoppeth cryptopp
P A T H S
/ u s r / l i b
/ u s r / l o c a l / l i b
/ o p t / l o c a l / l i b
)
if ( NOT CRYPTOPP_FOUND )
message ( STATUS "System Crypto++ not found, broken or too old. We use ../cryptopp562" )
set ( CRYPTOPP_INCLUDE_DIR "../cryptopp562" CACHE FILEPATH "" FORCE )
set ( CRYPTOPP_LIBRARIES "../cryptopp562" CACHE FILEPATH "" FORCE )
endif ( )
if ( ID AND LS )
set ( CRYPTOPP_FOUND TRUE )
message ( STATUS "Found Crypto++: ${ID}, ${LS}" )
set ( _CRYPTOPP_VERSION_HEADER ${ ID } /config.h )
if ( EXISTS ${ _CRYPTOPP_VERSION_HEADER } )
file ( STRINGS ${ _CRYPTOPP_VERSION_HEADER } _CRYPTOPP_VERSION REGEX "^#define CRYPTOPP_VERSION[ \t]+[0-9]+$" )
string ( REGEX REPLACE "^#define CRYPTOPP_VERSION[ \t]+([0-9]+)" "\\1" _CRYPTOPP_VERSION ${ _CRYPTOPP_VERSION } )
if ( ${ _CRYPTOPP_VERSION } LESS 562 )
message ( STATUS "Crypto++ version found is smaller than 5.6.2. We use ../cryptopp562" )
set ( CRYPTOPP_INCLUDE_DIR "../cryptopp562" CACHE FILEPATH "" FORCE )
set ( CRYPTOPP_LIBRARIES "../cryptopp562" CACHE FILEPATH "" FORCE )
else ( )
set ( CRYPTOPP_INCLUDE_DIR ${ ID } CACHE FILEPATH "" FORCE )
set ( CRYPTOPP_LIBRARIES ${ LS } CACHE FILEPATH "" FORCE )
message ( STATUS "Crypto++ found and version greater or equal to 5.6.2" )
endif ( )
endif ( )
else ( )
set ( CRYPTOPP_FOUND TRUE ) # U g l y
message ( STATUS "Crypto++ not found. We use ../cryptopp562" )
set ( CRYPTOPP_INCLUDE_DIR "../cryptopp562" CACHE FILEPATH "" FORCE )
set ( CRYPTOPP_LIBRARIES "../cryptopp562" CACHE FILEPATH "" FORCE )
endif ( )
mark_as_advanced ( CRYPTOPP_INCLUDE_DIR CRYPTOPP_LIBRARIES )
# endif ( )
# N o t r e a l l y w o r t h c a c h i n g . W e w a n t t o r e e v a l u a t e a n y w a y .
mark_as_advanced ( CRYPTOPP_INCLUDE_DIR CRYPTOPP_LIBRARIES )
if ( CRYPTOPP_FOUND )
include_directories ( ${ CRYPTOPP_INCLUDE_DIR } )
link_directories ( ${ CRYPTOPP_LIBRARIES } )
endif ( )
# A l w a y s " f o u n d " , g i v e n l a s t b l o c k .
include_directories ( ${ CRYPTOPP_INCLUDE_DIR } )
link_directories ( ${ CRYPTOPP_LIBRARIES } )
add_subdirectory ( secp256k1 )
add_subdirectory ( libethereum )