From: Mouse <mouse008@gmail.com>
Date: Tue, 27 Jun 2017 12:29:49 +0000 (-0400)
Subject: Make sure CMake does not pick stray directories for linking the engine
X-Git-Tag: v1.1.0.2~9^2~2
X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=b616bb8e764ca37c9e2c45e79e875ca55aab7d37;p=openssl-gost%2Fengine.git

Make sure CMake does not pick stray directories for linking the engine
---

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4ee778f..dfcd774 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,6 +18,17 @@ set(GOST_INCLUDE_DIRECTORIES "${OPENSSL_PATH}/include" "${OPENSSL_PATH}/crypto/i
 
 set(GOST_LINK_DIRECTORIES "${OPENSSL_PATH}")
 
+# module linker flags
+SET (CMAKE_MODULE_LINKER_FLAGS "-L${OPENSSL_PATH}" "-L${OPENSSL_PATH}/lib" $ENV{LDFLAGS}
+     CACHE STRING "Flags used by the linker during the creation of modules.")
+# exe linker flags
+SET (CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}
+     CACHE STRING "Flags used by the linker during the creation of executables.")
+# shared lib linker flags
+SET (CMAKE_SHARED_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}
+     CACHE STRING "Flags used by the linker during the creation of shared libraries.")
+
+
 include_directories("${GOST_INCLUDE_DIRECTORIES}")
 
 set(BIN_DIRECTORY bin)