Update the latest source
[framework/system/smartcard-plugin-uicc.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(smartcard-plugin-uicc CXX)
3
4 SET(CMAKE_VERBOSE_MAKEFILE OFF)
5
6 SET(VERSION_MAJOR 1)
7 SET(VERSION ${VERSION_MAJOR}.0.0)
8
9 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
10
11 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SRCS)
12
13 #IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
14 #        SET(CMAKE_BUILD_TYPE "Debug")
15 #ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
16 #MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
17
18 INCLUDE(FindPkgConfig)
19 pkg_check_modules(pkgs_common REQUIRED dlog smartcard-service-common tapi)
20
21 FOREACH(flag ${pkgs_common_CFLAGS})
22         SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} ${flag}")
23 ENDFOREACH(flag)
24
25 #SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -finstrument-functions")
26 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS}")
27 #SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
28 #SET(CMAKE_C_FLAGS_RELEASE "-O2")
29
30 FIND_PROGRAM(UNAME NAMES uname)
31 EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
32 IF("${ARCH}" STREQUAL "arm")
33         ADD_DEFINITIONS("-DTARGET")
34         MESSAGE("add -DTARGET")
35 ENDIF("${ARCH}" STREQUAL "arm")
36
37 MESSAGE("CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
38
39 MESSAGE("CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
40 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
41 ADD_DEFINITIONS("-DSLP_DEBUG")
42
43 ADD_DEFINITIONS("-DLOG_TAG=\"SCARD_SE_UICC\"")
44
45 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
46
47 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
48
49 #SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
50 #SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
51
52 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_common_LDFLAGS})
53
54 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib/se)