1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(smartcard-service CXX)
4 SET(LIB_NAME "smartcard-service")
6 SET(VERSION ${VERSION_MAJOR}.0.0)
8 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../common/include)
9 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../server/include)
10 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
12 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SRCS)
14 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
15 SET(CMAKE_BUILD_TYPE "Release")
16 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
17 MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
19 INCLUDE(FindPkgConfig)
20 pkg_check_modules(pkgs_client REQUIRED gthread-2.0 dlog dbus-glib-1 security-server)
22 MESSAGE("${LIB_NAME} ld flag : ${pkgs_client_LDFLAGS}")
24 FOREACH(flag ${pkgs_client_CFLAGS})
25 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
26 SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} ${flag}")
29 #SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -finstrument-functions")
30 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
31 #SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
32 #SET(CMAKE_C_FLAGS_RELEASE "-O2")
34 #SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} -finstrument-functions -std=c++0x")
35 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS}")
36 #SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
37 #SET(CMAKE_CXX_FLAGS_RELEASE "-O2")
39 FIND_PROGRAM(UNAME NAMES uname)
40 EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
41 IF("${ARCH}" STREQUAL "arm")
42 ADD_DEFINITIONS("-DTARGET")
43 MESSAGE("add -DTARGET")
44 ENDIF("${ARCH}" STREQUAL "arm")
46 MESSAGE("CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
48 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
49 ADD_DEFINITIONS("-DSLP_DEBUG")
50 ADD_DEFINITIONS("-DLOG_TAG=\"SMARTCARD_SERVICE_CLIENT\"")
52 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
54 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
56 SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
57 SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES VERSION ${VERSION})
59 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_client_LDFLAGS})
62 ../common/include/smartcard-types.h
63 ../common/include/ByteArray.h
64 ../common/include/Debug.h
65 ../common/include/Exception.h
66 ../common/include/Synchronous.h
67 ../common/include/APDUHelper.h
68 ../common/include/Channel.h
69 ../common/include/Serializable.h
70 ../common/include/SEServiceHelper.h
71 ../common/include/ReaderHelper.h
72 ../common/include/SessionHelper.h
73 # ../common/include/FCI.h
75 include/SEServiceListener.h
79 include/ClientChannel.h
80 include/smartcard-service.h
84 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${LIB_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
85 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})
86 FOREACH(hfile ${EXPORT_HEADER})
87 INSTALL(FILES ${hfile} DESTINATION include/${LIB_NAME})