Initialize Tizen 2.3
[framework/system/oma-dm-agent.git] / src / plugins / CMakeLists.sub
1
2
3 #############################################
4 #
5 # Step 1. Set Variable and Build Dependency
6 #
7
8 # set lib name
9 SET(LIBNAME "lib${PROJECT_NAME}")
10 #SET(LIBDIR "${PREFIX}/lib")
11
12 #############################################
13 #
14 # Step 2. Set Compile Environment
15 #
16
17 # set extra cflags from build dependency
18 STRING(REPLACE ";" " " EXTRA_CFLAGS "${PLUGIN_CFLAGS}")
19
20 # add include directories to the build.
21 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
22 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../../../include)
23
24 # find all source files in a directory.
25 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/src SRCS)
26
27 #############################################
28 #
29 # Step 3. Set Link Environment
30 #
31
32 # add a library to the project using the specified source files.
33 ADD_LIBRARY(${LIBNAME} SHARED ${SRCS})
34
35 # link a target to given libraries from pkg-config.
36 TARGET_LINK_LIBRARIES(${LIBNAME} ${PLUGIN_LDFLAGS})
37
38 # sets additional compiler flags used to build sources within the target.
39 SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES COMPILE_FLAGS "${EXTRA_CFLAGS}")
40
41 # override the default target name prefix (such as "lib")
42 SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES PREFIX "")
43
44 # specify the build version
45 SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES VERSION ${VERSION})
46
47 # specify the api version
48 SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
49
50 #############################################
51 #
52 # Step 4. Install packages
53 #
54
55 # install library files
56 INSTALL(TARGETS ${LIBNAME} DESTINATION ${LIBDIR})
57