From 4159e6ddf5bc132d71fcad5e2dd5ea6a6f69339b Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 17 Jul 2021 04:05:12 -0700 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=89=E8=A3=85=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E5=BA=93=E3=80=81=E5=A4=B4=E6=96=87=E4=BB=B6=E3=80=81?= =?UTF-8?q?=E4=BA=8C=E8=BF=9B=E5=88=B6=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 26 +++++++++++++++++++++++--- include/gmssl/asn1.h | 1 + include/gmssl/hex.h | 1 + include/gmssl/oid.h | 2 ++ include/gmssl/rc4.h | 1 + 5 files changed, 28 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ef1cbc16..fe2fdf7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,12 +1,17 @@ - cmake_minimum_required(VERSION 2.8.11) project(GmSSL) +SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) +SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) + include_directories(include) + add_library( gmssl + SHARED + src/hex.c src/debug.c src/rand.c @@ -64,8 +69,7 @@ add_library( src/cms.c ) - -target_include_directories (gmssl PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) +SET_TARGET_PROPERTIES(gmssl PROPERTIES VERSION 3.0 SOVERSION 3) # tools add_executable (digest tools/digest.c) @@ -199,3 +203,19 @@ target_link_libraries (cmstest LINK_PUBLIC gmssl) #add_executable(tlstest tests/tlstest.c) #target_link_libraries (tlstest LINK_PUBLIC gmssl) +# 安装可执行文件 +INSTALL(TARGETS digest certview certgen certverify reqgen sm3sum sm2gen sm2sign sm2verify sm2encrypt sm2decrypt pkcs8gen sm2view pkcs8view tlcp_client tlcp_server tls12_client tls12_server + RUNTIME DESTINATION bin + ) +# 安装动态库 +INSTALL(TARGETS gmssl + LIBRARY DESTINATION lib + ) +#安装头文件 +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/include/gmssl + DESTINATION include + PATTERN "gmssl/*" + PERMISSIONS OWNER_WRITE OWNER_READ + GROUP_READ WORLD_READ + ) + diff --git a/include/gmssl/asn1.h b/include/gmssl/asn1.h index b01ea298..752ddb49 100644 --- a/include/gmssl/asn1.h +++ b/include/gmssl/asn1.h @@ -49,6 +49,7 @@ #ifndef GMSSL_ASN1_H #define GMSSL_ASN1_H +#include #include #include diff --git a/include/gmssl/hex.h b/include/gmssl/hex.h index 0011eac4..0a48bda9 100644 --- a/include/gmssl/hex.h +++ b/include/gmssl/hex.h @@ -54,6 +54,7 @@ extern "C" { #endif +#include #include #include #include diff --git a/include/gmssl/oid.h b/include/gmssl/oid.h index a6d9a44e..ebe70543 100644 --- a/include/gmssl/oid.h +++ b/include/gmssl/oid.h @@ -55,6 +55,8 @@ extern "C" { #endif +#include + enum { OID_undef = 0, //OID_aes, diff --git a/include/gmssl/rc4.h b/include/gmssl/rc4.h index e6a23817..d7f583c7 100644 --- a/include/gmssl/rc4.h +++ b/include/gmssl/rc4.h @@ -54,6 +54,7 @@ #define RC4_MIN_KEY_BITS 40 #define RC4_STATE_NUM_WORDS 256 +#include #include #ifdef __cplusplus