summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJinkun Jang <jinkun.jang@samsung.com>2013-03-16 01:03:05 +0900
committerJinkun Jang <jinkun.jang@samsung.com>2013-03-16 01:03:05 +0900
commitc1d7996554202de1e9f6d0fb47a5739bf2dae537 (patch)
tree93e62d3a16f460cf2094c042878cad67abbf03ee /CMakeLists.txt
parentfce1a668c6b85ead8992e2a14b67f9c4c952c513 (diff)
downloaddevice-manager-plugin-pinetrail-c1d7996554202de1e9f6d0fb47a5739bf2dae537.tar.gz
device-manager-plugin-pinetrail-c1d7996554202de1e9f6d0fb47a5739bf2dae537.tar.bz2
device-manager-plugin-pinetrail-c1d7996554202de1e9f6d0fb47a5739bf2dae537.zip
merge with master
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt61
1 files changed, 22 insertions, 39 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 42911bd..8ca0a82 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,54 +1,37 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(device-manager-plugin-pinetrail C)
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(rpkgs REQUIRED
- vconf
- dlog
- devman
- devman_plugin
- heynoti)
-ADD_DEFINITIONS(${rpkgs_CFLAGS})
-
-SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRAINTS true)
+PROJECT(slp_devman_plugin C)
SET(SRCS
- device_engine.c
- device-manager-plugin-pinetrail.c)
+ src/device_manager_io.c
+ src/device_manager_plugin_pinetrail.c)
-SET(HEADERS
- device-manager-plugin-pinetrail.h)
+IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+ SET(CMAKE_BUILD_TYPE "Release")
+ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
-SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-SET(EXEC_PREFIX "\${prefix}")
-SET(LIBDIR "\${prefix}/lib")
-SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}")
-SET(DATADIR ${CMAKE_DATADIR})
-SET(VERSION 0.2.4)
-
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
+SET(CMAKE_C_FLAGS_RELEASE "-O2")
-SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
-SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g")
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED devman devman_plugin svi)
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+FOREACH(flag ${pkgs_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
-ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
-ADD_DEFINITIONS("-DFACTORYFS=\"$ENV{FACTORYFS}\"")
-ADD_DEFINITIONS("-DENABLE_DLOG_OUT -DSLP_DEBUG")
-ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS} ${TARGET_SRCS})
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${rpkgs_LDFLAGS} "-ldl -rdynamic")
-SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION})
+ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
+ADD_EXECUTABLE(slp_plugin_test src/test/slp_plugin_test.c)
+TARGET_LINK_LIBRARIES(slp_plugin_test ${pkgs_LDFLAGS} ${PROJECT_NAME})
-CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib COMPONENT RuntimeLibraries)
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)
-
-FOREACH(hfile ${HEADERS})
- INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${hfile} DESTINATION include/${PROJECT_NAME})
-ENDFOREACH(hfile)
+INSTALL(TARGETS slp_plugin_test DESTINATION bin)