Merge "- change cmake macro for packaging x86_64 ,solve DEVT-132." into tizen
[platform/framework/native/env-config.git] / appinfo / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2
3 SET(this_target appinfo)
4
5 SET(VERSION_MAJOR 0)
6 SET(VERSION "${VERSION_MAJOR}.1.2")
7
8 #INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/inc)
9
10 INCLUDE(FindPkgConfig)
11 pkg_check_modules(pkgs REQUIRED
12         dlog
13 )
14
15 FOREACH(flag ${pkgs_CFLAGS})
16         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
17 ENDFOREACH(flag)
18
19
20 SET (${this_target}_SOURCE_FILES
21         ${CMAKE_CURRENT_SOURCE_DIR}/appinfo.c
22 )
23
24 ADD_LIBRARY(${this_target} SHARED ${${this_target}_SOURCE_FILES})
25
26 SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")
27 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
28 SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")
29 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined -Wl,--as-needed")
30
31 SET_TARGET_PROPERTIES(${this_target}
32         PROPERTIES
33         VERSION ${FULLVER}
34         SOVERSION ${MAJORVER}
35         CLEAN_DIRECT_OUTPUT 1
36         )
37
38 TARGET_LINK_LIBRARIES(${this_target} ${pkgs_LDFLAGS})
39
40
41 SET(PC_NAME ${this_target})
42 SET(PC_REQUIRED ${pc_requires})
43 SET(PC_LDFLAGS -l${this_target})
44
45 CONFIGURE_FILE(appinfo.pc.in appinfo.pc @ONLY)
46
47 INSTALL(TARGETS ${this_target} DESTINATION ${LIB_INSTALL_DIR}/osp
48                                 PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
49                 GROUP_EXECUTE GROUP_READ
50                 WORLD_EXECUTE WORLD_READ)
51
52 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/appinfo.h DESTINATION include/osp)
53 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/appinfo.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
54