Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #25 from pmesnier/master
Browse files Browse the repository at this point in the history
Looks good to me. Doesn't break the build on my Linux box.
  • Loading branch information
nathanielhourt committed Jun 6, 2017
2 parents ef3c037 + f270eb4 commit 7072c6f
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 4 deletions.
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*.a
*.sw*

*.cmake
cmake*
CMakeCache.txt
CMakeFiles
Makefile
Expand All @@ -13,7 +13,11 @@ genesis.json
hardfork.hpp

libraries/utilities/git_revision.cpp

libraries/egenesis/egenesis_brief.cpp
libraries/egenesis/egenesis_full.cpp
libraries/egenesis/embed_genesis
libraries/types/type_generator
libraries/types/types_test
libraries/types/include/eos/types/generated.hpp

libraries/wallet/Doxyfile
Expand All @@ -23,6 +27,8 @@ libraries/wallet/doxygen
programs/cli_wallet/cli_wallet
programs/js_operation_serializer/js_operation_serializer
programs/witness_node/witness_node
programs/data-dir
programs/eosd/eosd

tests/app_test
tests/chain_bench
Expand Down
16 changes: 14 additions & 2 deletions libraries/fc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ SET( CMAKE_DEBUG_POSTFIX _debug )
SET( BUILD_SHARED_LIBS NO )
SET( ECC_IMPL secp256k1 CACHE STRING "secp256k1 or openssl or mixed" )


IF(NOT "$ENV{SECP256K1_ROOT_DIR}" STREQUAL "")
set(SECP256K1_ROOT_DIR $ENV{SECP256K1_ROOT_DIR} )
set(SECP256K1_INCLUDE_DIR ${SECP256K1_ROOT_DIR}/include)
ELSE()
SET( SECP256K1_INCLUDE_DIR /usr/local/include )
SET( SECP256K1_ROOT_DIR /usr/local )
ENDIF()

message(STATUS "Setting up SECP256K1 root and include vars to ${SECP256K1_ROOT_DIR}, ${SECP256K1_INCLUDE_DIR}")

set(platformBitness 32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(platformBitness 64)
Expand Down Expand Up @@ -46,6 +57,8 @@ ENDIF()

find_package(OpenSSL REQUIRED)

find_package(Secp256k1 REQUIRED)

set( CMAKE_FIND_LIBRARY_SUFFIXES ${ORIGINAL_LIB_SUFFIXES} )

set( fc_sources
Expand Down Expand Up @@ -145,6 +158,7 @@ target_include_directories(fc
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include
${Boost_INCLUDE_DIR}
${OPENSSL_INCLUDE_DIR}
${SECP256K1_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/vendor/websocketpp

PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
Expand All @@ -164,5 +178,3 @@ IF(DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY)
ELSE()
SET (OPENSSL_CONF_TARGET ${CMAKE_CURRENT_BINARY_DIR})
ENDIF()


49 changes: 49 additions & 0 deletions libraries/fc/CMakeModules/FindSecp256k1.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# - Try to find secp256k1 include dirs and libraries
#
# Usage of this module as follows:
#
# find_package(Secp256k1)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# Secp256k1_ROOT_DIR Set this variable to the root installation of
# secp256k1 if the module has problems finding the
# proper installation path.
#
# Variables defined by this module:
#
# SECP256K1_FOUND System has secp256k1, include and lib dirs found
# Secp256k1_INCLUDE_DIR The secp256k1 include directories.
# Secp256k1_LIBRARY The secp256k1 library.

find_path(Secp256k1_ROOT_DIR
NAMES include/secp256k1.h
)

find_path(Secp256k1_INCLUDE_DIR
NAMES secp256k1.h
HINTS ${Secp256k1_ROOT_DIR}/include
)

find_library(Secp256k1_LIBRARY
NAMES secp256k1
HINTS ${Secp256k1_ROOT_DIR}/lib
)

if(Secp256k1_INCLUDE_DIR AND Secp256k1_LIBRARY)
set(SECP256K1_FOUND TRUE)
else(Secp256k1_INCLUDE_DIR AND Secp256k1_LIBRARY)
FIND_LIBRARY(Secp256k1_LIBRARY NAMES secp256k1)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Secp256k1 DEFAULT_MSG Secp256k1_INCLUDE_DIR Secp256k1_LIBRARY )
MARK_AS_ADVANCED(Secp256k1_INCLUDE_DIR Secp256k1_LIBRARY)
endif(Secp256k1_INCLUDE_DIR AND Secp256k1_LIBRARY)

mark_as_advanced(
Secp256k1_ROOT_DIR
Secp256k1_INCLUDE_DIR
Secp256k1_LIBRARY
)

MESSAGE( STATUS "Found Secp256k1: ${Secp256k1_LIBRARY}" )

0 comments on commit 7072c6f

Please sign in to comment.