]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - CMakeLists.txt
MSVC: Disable deprecated declarations (C4996) warning
[openssl-gost/engine.git] / CMakeLists.txt
index c95e5ea49cf1593f7388ed8d1fd1337c22557ed8..a729a2041c42d894dd658246345eed2061f62a69 100644 (file)
@@ -18,6 +18,7 @@ find_program(OPENSSL_PROGRAM openssl
   PATHS ${OPENSSL_ROOT_DIR} PATH_SUFFIXES apps bin NO_DEFAULT_PATH)
 message(STATUS "Found OpenSSL application: ${OPENSSL_PROGRAM}")
 include_directories(${OPENSSL_INCLUDE_DIR})
+set(OPENSSL_MODULES_DIR ${CMAKE_INSTALL_LIBDIR}/ossl-modules)
 
 if (CMAKE_C_COMPILER_ID MATCHES "Clang")
   set(CMAKE_C_FLAGS_RELEASE -O2)
@@ -33,7 +34,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
   add_definitions(-D_CRT_SECURE_NO_WARNINGS)
   add_definitions(-D_CRT_DEPRECATED_NO_WARNINGS)
   add_definitions(-D_CRT_NONSTDC_NO_WARNINGS)
-  add_compile_options(/MP /WX /W4 /wd4100 /wd4267 /wd4206 /wd4706 /wd4244 /wd4115)
+  add_compile_options(/MP /WX /W4 /wd4100 /wd4267 /wd4206 /wd4706 /wd4244 /wd4115 /wd4996)
 endif()
 
 if (ASAN)
@@ -201,6 +202,7 @@ set(GOST_PROV_SOURCE_FILES
         gost_prov.c
         gost_prov_cipher.c
         gost_prov_digest.c
+        gost_prov_mac.c
         )
 
 set(TEST_ENVIRONMENT_COMMON
@@ -227,12 +229,18 @@ target_link_libraries(test_digest OpenSSL::Crypto)
 add_test(NAME digest-with-engine COMMAND test_digest)
 set_tests_properties(digest-with-engine
   PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_ENGINE}")
+add_test(NAME digest-with-provider COMMAND test_digest)
+set_tests_properties(digest-with-provider
+  PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_PROVIDER}")
 
 add_executable(test_ciphers test_ciphers.c)
 target_link_libraries(test_ciphers OpenSSL::Crypto)
 add_test(NAME ciphers-with-engine COMMAND test_ciphers)
 set_tests_properties(ciphers-with-engine
   PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_ENGINE}")
+add_test(NAME ciphers-with-provider COMMAND test_ciphers)
+set_tests_properties(ciphers-with-provider
+  PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_PROVIDER}")
 
 # test_curves is an internals testing program, it doesn't need a test env
 add_executable(test_curves test_curves.c)
@@ -268,6 +276,9 @@ target_link_libraries(test_context OpenSSL::Crypto)
 add_test(NAME context-with-engine COMMAND test_context)
 set_tests_properties(context-with-engine
   PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_ENGINE}")
+add_test(NAME context-with-provider COMMAND test_context)
+set_tests_properties(context-with-provider
+  PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_PROVIDER}")
 
 # test_keyexpimp is an internals testing program, it doesn't need a test env
 add_executable(test_keyexpimp test_keyexpimp.c)
@@ -400,6 +411,12 @@ install(TARGETS lib_gost_engine EXPORT GostEngineConfig LIBRARY DESTINATION ${CM
 install(TARGETS gost_engine EXPORT GostEngineConfig
         LIBRARY  DESTINATION ${OPENSSL_ENGINES_DIR}
         RUNTIME  DESTINATION ${OPENSSL_ENGINES_DIR})
+# install provider in library and module form
+install(TARGETS lib_gost_prov EXPORT GostProviderConfig
+        LIBRARY  DESTINATION ${CMAKE_INSTALL_LIBDIR})
+install(TARGETS gost_prov EXPORT GostProviderConfig
+        LIBRARY  DESTINATION ${OPENSSL_MODULES_DIR}
+        RUNTIME  DESTINATION ${OPENSSL_MODULES_DIR})
 if (MSVC)
   install(FILES $<TARGET_PDB_FILE:lib_gost_engine>
     EXPORT GostEngineConfig DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL)
@@ -407,5 +424,10 @@ if (MSVC)
     EXPORT GostEngineConfig DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL)
   install(FILES $<TARGET_PDB_FILE:gost_engine>
     EXPORT GostEngineConfig DESTINATION ${OPENSSL_ENGINES_DIR} OPTIONAL)
+  install(FILES $<TARGET_PDB_FILE:lib_gost_prov>
+    EXPORT GostProviderConfig DESTINATION ${CMAKE_INSTALL_LIBDIR} OPTIONAL)
+  install(FILES $<TARGET_PDB_FILE:gost_prov>
+    EXPORT GostProviderConfig DESTINATION ${OPENSSL_MODULES_DIR} OPTIONAL)
 endif()
 install(EXPORT GostEngineConfig DESTINATION GostEngine/share/cmake/GostEngine)
+install(EXPORT GostProviderConfig DESTINATION GostEngine/share/cmake/GostProvider)