@ -23,63 +23,52 @@ else ()
message ( FATAL_ERROR "Your C++ compiler does not support C++11." )
message ( FATAL_ERROR "Your C++ compiler does not support C++11." )
endif ( )
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 .
# 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
# set ( CRYPTOPP_INCLUDE_DIR "../cryptopp562" CACHE FILEPATH "" FORCE )
find_path ( ID cryptlib.h
# set ( CRYPTOPP_LIBRARIES "../cryptopp562" CACHE FILEPATH "" FORCE )
/ 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 )
if ( ID AND LS )
set ( CRYPTOPP_LIBRARIES CACHE FILEPATH "" FORCE )
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 ( NOT CRYPTOPP_FOUND )
# if ( CRYPTOPP_INCLUDE_DIR AND CRYPTOPP_LIBRARIES )
message ( STATUS "System Crypto++ not found, broken or too old. We use ../cryptopp562" )
# set ( CRYPTOPP_FOUND TRUE )
set ( CRYPTOPP_INCLUDE_DIR "../cryptopp562" CACHE FILEPATH "" FORCE )
# message ( STATUS "Found Crypto++: ${CRYPTOPP_INCLUDE_DIR}, ${CRYPTOPP_LIBRARIES}" )
set ( CRYPTOPP_LIBRARIES "../cryptopp562" CACHE FILEPATH "" FORCE )
# else ( )
endif ( )
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 ( ID AND LS )
# 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 .
set ( CRYPTOPP_FOUND TRUE )
mark_as_advanced ( CRYPTOPP_INCLUDE_DIR CRYPTOPP_LIBRARIES )
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 ( )
if ( CRYPTOPP_FOUND )
# 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 } )
include_directories ( ${ CRYPTOPP_INCLUDE_DIR } )
link_directories ( ${ CRYPTOPP_LIBRARIES } )
link_directories ( ${ CRYPTOPP_LIBRARIES } )
endif ( )
add_subdirectory ( secp256k1 )
add_subdirectory ( secp256k1 )
add_subdirectory ( libethereum )
add_subdirectory ( libethereum )