From a95cedae4c65d759d55d5da2282de07de171e3aa Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Mon, 26 Jun 2017 09:39:34 +0200 Subject: [PATCH] Make gost-engine independent of OpenSSL SOURCE It really already was, this only removes artifacts in CMakeLists.txt --- CMakeLists.txt | 8 -------- CMake_ReadMe.md | 22 +++++++++++++--------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ee778f..76e51b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,12 +14,6 @@ else() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DL_ENDIAN") endif() -set(GOST_INCLUDE_DIRECTORIES "${OPENSSL_PATH}/include" "${OPENSSL_PATH}/crypto/include") - -set(GOST_LINK_DIRECTORIES "${OPENSSL_PATH}") - -include_directories("${GOST_INCLUDE_DIRECTORIES}") - set(BIN_DIRECTORY bin) set(OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/${BIN_DIRECTORY}) @@ -94,8 +88,6 @@ set(GOST_ENGINE_SOURCE_FILES gost_md2012.c gost_pmeth.c) -link_directories(${GOST_LINK_DIRECTORIES}) - add_library(gost STATIC ${GOST_LIB_SOURCE_FILES}) set_target_properties(gost PROPERTIES POSITION_INDEPENDENT_CODE ON) diff --git a/CMake_ReadMe.md b/CMake_ReadMe.md index b3bfca1..b708505 100644 --- a/CMake_ReadMe.md +++ b/CMake_ReadMe.md @@ -1,21 +1,25 @@ ## CMake Config -Required variables: -1. `OPENSSL_PATH` - full path to local [openssl](https://github.com/openssl/openssl) source tree +Configuring with `cmake` is can very simply be done like this: -For Example: +~~~ bash +cmake . +~~~ + +If you want to build against a specific OpenSSL installation (if you have +more than one, or your own private install, or...), you can use the `cmake` +variable `CMAKE_C_FLAGS`: -~~~bash -cmake -DOPENSSL_PATH=/home/user/openssl . +~~~ bash +cmake -DCMAKE_C_FLAGS='-I/PATH/TO/OPENSSL/include -L/PATH/TO/OPENSSL/lib' . ~~~ -Build Example: +Build example: -~~~bash -cd ~/gost-engine +~~~ bash mkdir build cd build -cmake -DOPENSSL_PATH=/home/user/openssl .. +cmake -DCMAKE_C_FLAGS='-I/PATH/TO/OPENSSL/include -L/PATH/TO/OPENSSL/lib' .. make -j 8 cd ../bin ~~~ -- 2.39.5