增加安装动态库、头文件、二进制的功能

This commit is contained in:
Simon
2021-07-17 04:05:12 -07:00
parent 0af5775be3
commit 4159e6ddf5
5 changed files with 28 additions and 3 deletions

View File

@@ -1,12 +1,17 @@
cmake_minimum_required(VERSION 2.8.11) cmake_minimum_required(VERSION 2.8.11)
project(GmSSL) project(GmSSL)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
include_directories(include) include_directories(include)
add_library( add_library(
gmssl gmssl
SHARED
src/hex.c src/hex.c
src/debug.c src/debug.c
src/rand.c src/rand.c
@@ -64,8 +69,7 @@ add_library(
src/cms.c src/cms.c
) )
SET_TARGET_PROPERTIES(gmssl PROPERTIES VERSION 3.0 SOVERSION 3)
target_include_directories (gmssl PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
# tools # tools
add_executable (digest tools/digest.c) add_executable (digest tools/digest.c)
@@ -199,3 +203,19 @@ target_link_libraries (cmstest LINK_PUBLIC gmssl)
#add_executable(tlstest tests/tlstest.c) #add_executable(tlstest tests/tlstest.c)
#target_link_libraries (tlstest LINK_PUBLIC gmssl) #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
)

View File

@@ -49,6 +49,7 @@
#ifndef GMSSL_ASN1_H #ifndef GMSSL_ASN1_H
#define GMSSL_ASN1_H #define GMSSL_ASN1_H
#include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>

View File

@@ -54,6 +54,7 @@
extern "C" { extern "C" {
#endif #endif
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@@ -55,6 +55,8 @@ extern "C" {
#endif #endif
#include <stdint.h>
enum { enum {
OID_undef = 0, OID_undef = 0,
//OID_aes, //OID_aes,

View File

@@ -54,6 +54,7 @@
#define RC4_MIN_KEY_BITS 40 #define RC4_MIN_KEY_BITS 40
#define RC4_STATE_NUM_WORDS 256 #define RC4_STATE_NUM_WORDS 256
#include <stdint.h>
#include <string.h> #include <string.h>
#ifdef __cplusplus #ifdef __cplusplus