-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
38 lines (28 loc) · 1016 Bytes
/
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
cmake_minimum_required (VERSION 3.9)
project (libhsm VERSION 1.0.1 DESCRIPTION "a wrapper around OASIS PKCS#11 API")
include(GNUInstallDirs)
SET(CPPFLAGS "-DOS_UNIX -g -O3")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CPPFLAGS}")
file(GLOB LIBHSM_SOURCES "src/*.cpp")
add_library(libhsm SHARED
${LIBHSM_SOURCES}
)
target_include_directories (libhsm PUBLIC include)
configure_file(libhsm.pc.in libhsm.pc @ONLY)
set_target_properties(libhsm PROPERTIES PREFIX "")
install(TARGETS libhsm
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/
)
install(DIRECTORY include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libhsm
)
install(FILES ${CMAKE_BINARY_DIR}/libhsm.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
if(NOT TARGET uninstall)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()