]> wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - CMakeLists.txt
Fixed sudden inability to find OpenSSL libraries by restoring manual specification of
[openssl-gost/engine.git] / CMakeLists.txt
index 4ee778fa35224cc39528f43da56bcb9ae9767b3b..239f259ff26bf5db41513cb0510f092fe354d84b 100644 (file)
@@ -14,11 +14,23 @@ else()
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DL_ENDIAN")
 endif()
 
-set(GOST_INCLUDE_DIRECTORIES "${OPENSSL_PATH}/include" "${OPENSSL_PATH}/crypto/include")
+# include and lib directories for OpenSSL
+set(GOST_INCLUDE_DIRECTORIES "${OPENSSL_PATH}/include")
+set(GOST_LINK_DIRECTORIES "${OPENSSL_PATH}/lib")
+
+# module linker flags
+SET (CMAKE_MODULE_LINKER_FLAGS "-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 "-L${OPENSSL_PATH}/lib" $ENV{LDFLAGS}
+     CACHE STRING "Flags used by the linker during the creation of executables.")
+# shared lib linker flags
+SET (CMAKE_SHARED_LINKER_FLAGS "-L${OPENSSL_PATH}/lib" $ENV{LDFLAGS}
+     CACHE STRING "Flags used by the linker during the creation of shared libraries.")
 
-set(GOST_LINK_DIRECTORIES "${OPENSSL_PATH}")
 
 include_directories("${GOST_INCLUDE_DIRECTORIES}")
+link_directories("${GOST_LINK_DIRECTORIES}")
 
 set(BIN_DIRECTORY bin)
 
@@ -94,8 +106,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)