forked from SUNET/pkcs11-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
45 lines (33 loc) · 1.39 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
cmake_minimum_required (VERSION 2.4)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
project (pkcs11 C)
set(PKCS11_PROXY_SRCS gck-rpc-module.c gck-rpc-message.c gck-rpc-util.c egg-buffer.c gck-rpc-tls-psk.c)
set(PKCS11_DAEMON_SRCS egg-buffer.c gck-rpc-daemon-standalone.c gck-rpc-dispatch.c gck-rpc-message.c gck-rpc-util.c syscall-reporter.c syscall-names.h gck-rpc-tls-psk.c)
add_definitions(-Wall)
add_library(pkcs11-proxy SHARED ${PKCS11_PROXY_SRCS})
# Disable console when building Win32 binary in release mode
if (WIN32)
if("${CMAKE_BUILD_TYPE}" MATCHES "^Rel.*")
set(GUI_TYPE WIN32)
endif()
endif()
add_executable (pkcs11-daemon ${GUI_TYPE} ${PKCS11_DAEMON_SRCS})
set_target_properties(pkcs11-proxy PROPERTIES VERSION 0.1 SOVERSION 0)
if (WIN32)
include_directories("ext/include")
add_library(dl STATIC IMPORTED)
set_property(TARGET dl PROPERTY
IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/ext/lib/libdl.a)
target_link_libraries (pkcs11-daemon ws2_32)
target_link_libraries (pkcs11-proxy ws2_32)
endif (WIN32)
target_link_libraries (pkcs11-proxy pthread ssl crypto)
target_link_libraries (pkcs11-daemon dl pthread ssl crypto seccomp)
install_targets (/lib pkcs11-proxy)
install_targets (/bin pkcs11-daemon)
add_custom_command(
OUTPUT syscall-names.h
COMMAND ${CMAKE_SOURCE_DIR}/mksyscalls.sh
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})