0
0
mirror of https://github.com/monero-project/kovri synced 2025-10-06 00:32:51 +02:00

Build: implement cryptopp submodule. Fixes #210

* Also, adjust related cmake + make
* References #141
This commit is contained in:
anonimal
2016-07-27 12:31:45 +00:00
parent 853ad5dfe1
commit 609a4a3fe4
5 changed files with 36 additions and 18 deletions

4
.gitmodules vendored
View File

@@ -2,3 +2,7 @@
path = deps/cpp-netlib
url = https://github.com/cpp-netlib/cpp-netlib.git
branch = 0.13-release
[submodule "deps/cryptopp"]
path = deps/cryptopp
url = https://github.com/weidai11/cryptopp.git
branch = master

View File

@@ -113,9 +113,9 @@ endif()
if(WITH_CRYPTOPP)
find_package(CryptoPP REQUIRED)
if(NOT DEFINED CRYPTO++_INCLUDE_DIR)
message(SEND_ERROR "Could not find Crypto++. Please download and install it first!")
message(SEND_ERROR "Could not find Crypto++. See building instructions.")
endif()
include_directories(${CRYPTO++_INCLUDE_DIR})
include_directories(${CRYPTO++_INCLUDE_DIR}/../) # We back-track for <cryptopp/*>
endif()
if(APPLE)

View File

@@ -57,6 +57,7 @@ remove-build = rm -fR $(build)
# Dependencies
deps = deps
cpp-netlib = $(deps)/cpp-netlib
cryptopp = $(deps)/cryptopp
# Current off-by-default build options
cmake-upnp = -D WITH_UPNP=ON
@@ -75,6 +76,7 @@ cmake-data-path = -D KOVRI_DATA_PATH=$(data-path)
# Release types
# TODO(unassigned): put these to good use. We'll require rewrite of root recipe.
# TODO(unassigned): use release flag for dependencies when we release
cmake-debug = -D CMAKE_BUILD_TYPE=Debug
#cmake-release = -D CMAKE_BUILD_TYPE=Release
@@ -87,6 +89,8 @@ all: shared
dependencies:
mkdir -p $(cpp-netlib)/$(build)
cd $(cpp-netlib)/$(build) && $(cmake) $(cmake-debug) ../ && $(MAKE)
mkdir -p $(cryptopp)/$(build)
cd $(cryptopp)/$(build) && $(cmake) $(cmake-debug) ../ && $(MAKE)
shared:
mkdir -p $(build)

View File

@@ -34,22 +34,31 @@ if(CRYPTO++_INCLUDE_DIR AND CRYPTO++_LIBRARIES)
set(CRYPTO++_FOUND TRUE)
else(CRYPTO++_INCLUDE_DIR AND CRYPTO++_LIBRARIES)
find_path(CRYPTO++_INCLUDE_DIR cryptopp/cryptlib.h
/usr/include
/usr/local/include
$ENV{SystemDrive}/Crypto++/include
$ENV{CRYPTOPP}
$ENV{CRYPTOPP}/..
$ENV{CRYPTOPP}/include
${PROJECT_SOURCE_DIR}/../..)
find_path(CRYPTO++_INCLUDE_DIR cryptlib.h
${PROJECT_SOURCE_DIR}/deps/cryptopp)
find_library(CRYPTO++_LIBRARIES NAMES cryptopp
PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
$ENV{SystemDrive}/Crypto++/lib
$ENV{CRYPTOPP}/lib)
# Commented to prevent confusion if submodule was not built correctly.
# Uncomment when we stop using a submodule.
#find_path(CRYPTO++_INCLUDE_DIR cryptopp/cryptlib.h
#/usr/include
#/usr/local/include
#$ENV{SystemDrive}/Crypto++/include
#$ENV{CRYPTOPP}
#$ENV{CRYPTOPP}/..
#$ENV{CRYPTOPP}/include
#${PROJECT_SOURCE_DIR}/../..)
find_library(CRYPTO++_LIBRARIES NAMES cryptopp PATHS
${PROJECT_SOURCE_DIR}/deps/cryptopp)
# Commented to prevent confusion if submodule was not built correctly.
# Uncomment when we stop using a submodule.
#find_library(CRYPTO++_LIBRARIES NAMES cryptopp PATHS
#/usr/lib
#/usr/local/lib
#/opt/local/lib
#$ENV{SystemDrive}/Crypto++/lib
#$ENV{CRYPTOPP}/lib)
if(MSVC AND NOT CRYPTO++_LIBRARIES) # Give a chance for MSVC multiconfig
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
@@ -78,7 +87,7 @@ else(CRYPTO++_INCLUDE_DIR AND CRYPTO++_LIBRARIES)
message(STATUS "Found Crypto++: ${CRYPTO++_INCLUDE_DIR}, ${CRYPTO++_LIBRARIES}")
else(CRYPTO++_INCLUDE_DIR AND CRYPTO++_LIBRARIES)
set(CRYPTO++_FOUND FALSE)
message(STATUS "Crypto++ not found.")
message(SEND_ERROR "Crypto++ not found.")
endif(CRYPTO++_INCLUDE_DIR AND CRYPTO++_LIBRARIES)
mark_as_advanced(CRYPTO++_INCLUDE_DIR CRYPTO++_LIBRARIES)

1
deps/cryptopp vendored Submodule

Submodule deps/cryptopp added at 0b8cea5c51