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