X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=CMakeLists.txt;h=684a93d6003f2ac7406c16eed28d733688e4c82d;hb=1ca11da3479fcc98ed8343c9d83684a87a0ee052;hp=60f33f5492b692e457150bfee858d0e9d1fb2844;hpb=c7c5c6387bdfabd1fb17860ca7432b277168798b;p=openssl-gost%2Fengine.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 60f33f5..684a93d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -42,11 +43,6 @@ if (ASAN) set(SKIP_PERL_TESTS 1) endif() -# DEPRECATEDIN_3_0 CMAC -set_source_files_properties(gost_omac.c PROPERTIES COMPILE_FLAGS -Wno-error=deprecated-declarations) -# DEPRECATEDIN_3_0 HMAC -set_source_files_properties(gost_keyexpimp.c PROPERTIES COMPILE_FLAGS -Wno-error=deprecated-declarations) - set(CMAKE_C_STANDARD 90) CHECK_FUNCTION_EXISTS(clock_gettime HAVE_CLOCK_GETTIME_C) CHECK_LIBRARY_EXISTS(rt clock_gettime "" HAVE_CLOCK_GETTIME_RT) @@ -264,17 +260,22 @@ add_test(NAME sign/verify-with-engine COMMAND test_sign) set_tests_properties(sign/verify-with-engine PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_ENGINE}") -add_executable(test_tls test_tls.c) -target_link_libraries(test_tls OpenSSL::SSL) -add_test(NAME TLS-with-engine COMMAND test_tls) -set_tests_properties(TLS-with-engine - PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_ENGINE}") +if(NOT MSVC) + add_executable(test_tls test_tls.c) + target_link_libraries(test_tls OpenSSL::SSL) + add_test(NAME TLS-with-engine COMMAND test_tls) + set_tests_properties(TLS-with-engine + PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_ENGINE}") +endif() add_executable(test_context test_context.c) 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) @@ -302,8 +303,10 @@ if(NOT SKIP_PERL_TESTS) endif() endif() -add_executable(sign benchmark/sign.c) -target_link_libraries(sign gost_core gost_err ${CLOCK_GETTIME_LIB}) +if(NOT MSVC) + add_executable(sign benchmark/sign.c) + target_link_libraries(sign gost_core gost_err ${CLOCK_GETTIME_LIB}) +endif() # All that may need to load just built engine will have path to it defined. set(BINARY_TESTS_TARGETS @@ -316,8 +319,10 @@ set(BINARY_TESTS_TARGETS test_context test_keyexpimp test_gost89 - test_tls ) +if(NOT MSVC) + list(APPEND BINARY_TESTS_TARGETS test_tls) +endif() set_property(TARGET ${BINARY_TESTS_TARGETS} APPEND PROPERTY COMPILE_DEFINITIONS ENGINE_DIR="${OUTPUT_DIRECTORY}") add_library(gost_core STATIC ${GOST_LIB_SOURCE_FILES}) @@ -407,6 +412,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 $ EXPORT GostEngineConfig DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) @@ -414,5 +425,10 @@ if (MSVC) EXPORT GostEngineConfig DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) install(FILES $ EXPORT GostEngineConfig DESTINATION ${OPENSSL_ENGINES_DIR} OPTIONAL) + install(FILES $ + EXPORT GostProviderConfig DESTINATION ${CMAKE_INSTALL_LIBDIR} OPTIONAL) + install(FILES $ + EXPORT GostProviderConfig DESTINATION ${OPENSSL_MODULES_DIR} OPTIONAL) endif() install(EXPORT GostEngineConfig DESTINATION GostEngine/share/cmake/GostEngine) +install(EXPORT GostProviderConfig DESTINATION GostEngine/share/cmake/GostProvider)