X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=CMakeLists.txt;h=1caf67db036ac7cfc2eb91d12e3b38dd5c1e5ad9;hb=21c7d90eb3034c1c82167e67d291a46a112a833b;hp=ba0cc715045372b379ed9d4862c66eef352070d4;hpb=2d2f10ed798cdc221ca63058768d4dcfdab901f8;p=openssl-gost%2Fengine.git diff --git a/CMakeLists.txt b/CMakeLists.txt index ba0cc71..1caf67d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,9 @@ project(gost-engine LANGUAGES C) include(GNUInstallDirs) -find_package(OpenSSL 1.1 REQUIRED) +enable_testing() + +find_package(OpenSSL 1.0.2 REQUIRED) include_directories(${OPENSSL_INCLUDE_DIR}) if (CMAKE_C_COMPILER_ID MATCHES "Clang") @@ -66,8 +68,6 @@ set(GOST_GRASSHOPPER_SOURCE_FILES gost_grasshopper_precompiled.c gost_grasshopper_cipher.h gost_grasshopper_cipher.c - gost_grasshopper_mac.h - gost_grasshopper_mac.c ) set(GOST_CORE_SOURCE_FILES @@ -80,6 +80,7 @@ set(GOST_CORE_SOURCE_FILES gost_keywrap.c gost_keywrap.h gost_lcl.h + compat.h gost_params.c ) @@ -90,6 +91,7 @@ set(GOST_EC_SOURCE_FILES set (GOST_OMAC_SOURCE_FILES gost_omac.c + gost_omac_acpkm.c ) set(GOST_LIB_SOURCE_FILES @@ -108,13 +110,23 @@ set(GOST_ENGINE_SOURCE_FILES gost_md2012.c gost_pmeth.c gost_omac.c + gost_omac_acpkm.c ) +add_executable(test_grasshopper test_grasshopper.c) +target_link_libraries(test_grasshopper gost_engine gost_core ${OPENSSL_CRYPTO_LIBRARY}) +add_test(NAME grasshopper + COMMAND test_grasshopper) + +add_test(NAME engine + COMMAND perl run_tests + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test) + add_library(gost_core STATIC ${GOST_LIB_SOURCE_FILES}) set_target_properties(gost_core PROPERTIES POSITION_INDEPENDENT_CODE ON) add_library(gost_engine MODULE ${GOST_ENGINE_SOURCE_FILES}) -set_target_properties(gost_engine PROPERTIES PREFIX "" OUTPUT_NAME "gost") +set_target_properties(gost_engine PROPERTIES PREFIX "" OUTPUT_NAME "libgost") target_link_libraries(gost_engine gost_core ${OPENSSL_CRYPTO_LIBRARY}) set(GOST_SUM_SOURCE_FILES @@ -137,7 +149,9 @@ add_custom_target(tags WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) # install -set(OPENSSL_ENGINES_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/engines-${OPENSSL_VERSION_MAJOR}_${OPENSSL_VERSION_MINOR}) +if (NOT OPENSSL_ENGINES_INSTALL_DIR) + set(OPENSSL_ENGINES_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/engines-${OPENSSL_VERSION_MAJOR}_${OPENSSL_VERSION_MINOR}) +endif() set(OPENSSL_MAN_INSTALL_DIR ${CMAKE_INSTALL_MANDIR}/man1) install(TARGETS gost_engine gostsum gost12sum EXPORT GostEngineConfig