From: Richard Levitte Date: Sun, 21 Feb 2021 16:32:47 +0000 (+0100) Subject: Modify installation instructions for gost-engine library and module X-Git-Tag: v3.0.0~35 X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=bc111014be6390ae8f3674d05b76eb205ab4c49b;p=openssl-gost%2Fengine.git Modify installation instructions for gost-engine library and module - Simplify the installation of libraries and programs to simply use defaults. - Install only the gost engine in module form into the OpenSSL engine directory. - Install the gostsum and gost12sum manuals in the normal man1 directory, as there's really no reason to install them among OpenSSL stuff specifically. - Install the cmake configuration file. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index ed2d44f..0fb7b6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -281,7 +281,7 @@ add_library(gost_engine MODULE ${GOST_ENGINE_SOURCE_FILES}) # module suffix should be set_target_properties(gost_engine PROPERTIES PREFIX "" OUTPUT_NAME "gost" SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}) -target_link_libraries(gost_engine gost_core ${OPENSSL_CRYPTO_LIBRARY}) +target_link_libraries(gost_engine PRIVATE gost_core ${OPENSSL_CRYPTO_LIBRARY}) # The GOST engine in library form add_library(lib_gost_engine SHARED ${GOST_ENGINE_SOURCE_FILES}) @@ -289,7 +289,7 @@ set_target_properties(lib_gost_engine PROPERTIES COMPILE_DEFINITIONS "BUILDING_ENGINE_AS_LIBRARY" PUBLIC_HEADER gost-engine.h OUTPUT_NAME "gost") -target_link_libraries(lib_gost_engine gost_core ${OPENSSL_CRYPTO_LIBRARY}) +target_link_libraries(lib_gost_engine PRIVATE gost_core ${OPENSSL_CRYPTO_LIBRARY}) set(GOST_SUM_SOURCE_FILES @@ -318,14 +318,21 @@ add_custom_target(tcl_tests add_executable(test_tlstree test_tlstree.c) target_link_libraries(test_tlstree PUBLIC ${OPENSSL_CRYPTO_LIBRARY}) -# install -set(OPENSSL_MAN_INSTALL_DIR ${CMAKE_INSTALL_MANDIR}/man1) +# install programs and manuals +install(TARGETS gostsum gost12sum) +install(FILES gostsum.1 gost12sum.1 DESTINATION ${CMAKE_INSTALL_DIR}/man1) -install(TARGETS gost_engine gostsum gost12sum EXPORT GostEngineConfig +# install engine in library and module form +install(TARGETS lib_gost_engine EXPORT GostEngineConfig) +install(TARGETS gost_engine EXPORT GostEngineConfig LIBRARY DESTINATION ${OPENSSL_ENGINES_DIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -install(FILES gostsum.1 gost12sum.1 DESTINATION ${OPENSSL_MAN_INSTALL_DIR}) + RUNTIME DESTINATION ${OPENSSL_ENGINES_DIR}) if (MSVC) - install(FILES $ DESTINATION ${OPENSSL_ENGINES_DIR} OPTIONAL) - install(FILES $ $ DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) + install(FILES $ + EXPORT GostEngineConfig DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) + install(FILES $ $ + EXPORT GostEngineConfig DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) + install(FILES $ + EXPORT GostEngineConfig DESTINATION ${OPENSSL_ENGINES_DIR} OPTIONAL) endif() +install(EXPORT GostEngineConfig DESTINATION GostEngine/share/cmake/GostEngine)