This repository has been archived by the owner on Nov 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCMakeLists.txt
111 lines (90 loc) · 2.27 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
cmake_minimum_required( VERSION 2.6 FATAL_ERROR )
project( wzmrtd C )
#Compute exact revision from git if possible
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmakemodules/")
include(GetGitRevisionDescription)
# rune git describe "--tags"
git_describe(VERSION_STRING "--tags" "--always")
#if not possible use version number we ship instead
IF(NOT VERSION_STRING)
set(VERSION_STRING "v0.81.3")
ENDIF(NOT VERSION_STRING)
include( FindPkgConfig )
pkg_search_module( LIBPCSCLITE REQUIRED libpcsclite )
# configure a header file to pass some of the CMake settings
# to the source code
configure_file (
"${PROJECT_SOURCE_DIR}/Config.h.in"
"${PROJECT_BINARY_DIR}/Config.h"
)
include_directories(
${CMAKE_SOURCE_DIR}/inc
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${LIBPCSCLITE_INCLUDE_DIRS}
)
link_directories (
${LIBPCSCLITE_LIBRARY_DIRS}
)
if ( ${CMAKE_BUILD_TYPE} MATCHES Debug )
pkg_search_module( CPPUNIT REQUIRED cppunit )
include_directories( ${CPPUNIT_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/tests )
link_directories ( ${CPPUNIT_LIBRARY_DIRS} )
endif ( ${CMAKE_BUILD_TYPE} MATCHES Debug )
if ( ${CMAKE_BUILD_TYPE} MATCHES Release )
add_definitions ( -DNDEBUG )
endif ( ${CMAKE_BUILD_TYPE} MATCHES Release )
set ( CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O2" )
set ( CMAKE_C_FLAGS_DEBUG "-g -O0" )
set ( CMAKE_C_FLAGS_RELEASE "-O2" )
set ( CMAKE_C_FLAGS "-Wall -W -Wno-unused-parameter" )
add_definitions ( -DDISABLE_SPROX )
add_library(
wzmrtd
SHARED
src/des.c
src/mrtd_bac.c
src/mrtd_cbeff.c
src/mrtd_core.c
src/mrtd_entries.c
src/mrtd_errors.c
src/mrtd_icc.c
src/mrtd_mrz.c
src/mrtd_out_raw.c
src/mrtd_out_xml.c
src/mrtd_parse.c
src/pcsc_reader.c
src/random.c
src/sha1.c
src/tlv.c
)
target_link_libraries (
wzmrtd
pcsclite
)
configure_file (
wzmrtd.pc.in
wzmrtd.pc
)
install(TARGETS wzmrtd LIBRARY DESTINATION lib)
install(FILES
inc/config.h
inc/ldstags.h
inc/springprox.h
inc/wzmrtd.h
DESTINATION include/wzmrtd
)
install(FILES
wzmrtd.pc
DESTINATION lib/pkgconfig
)
add_executable(
wzmrtd-tool
src/main.c
)
target_link_libraries (
wzmrtd-tool
wzmrtd
)
install(TARGETS wzmrtd-tool DESTINATION bin)