Remove bundle insert
[platform/core/multimedia/libmedia-service.git] / CMakeLists.txt
old mode 100755 (executable)
new mode 100644 (file)
index 3a2b409..80d6670
@@ -1,31 +1,28 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(media-service C)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6...2.8.12)
+PROJECT(media-service C CXX)
 SET(VERSION_MAJOR 1)
 SET(VERSION "${VERSION_MAJOR}.0.0")
 
 SET(MEDIASERVICE-LIB "media-service")
-SET(MEDIASERVICE-HASH-LIB "media-svc-hash")
 SET(MEDIACONTENT-PLUGIN-LIB "media-content-plugin")
-SET(SRCS 
+SET(MEDIAEBOOK-PLUGIN-LIB "media-ebook-plugin")
+SET(SRCS
        src/common/media-svc.c
        src/common/media-svc-media.c
        src/common/media-svc-album.c
        src/common/media-svc-media-folder.c
        src/common/media-svc-db-utils.c
        src/common/media-svc-util.c
-       src/common/media-svc-debug.c
        src/common/media-svc-noti.c
        src/common/media-svc-storage.c
-       src/common/media-svc-localize_ch.c
        )
 
-SET(HASH_SRCS
-       md5/md5.c
-       md5/media-svc-hash.c
-       )
-
-SET(PLUGIN_SRCS
-       plugin/media-svc-plugin.c
+SET(EBOOKPLUGIN_SRCS
+       plugin/media-ebook-plugin.cpp
+       plugin/media-ebook-plugin-regmatch.cpp
+       plugin/media-ebook-plugin-dbinserter.cpp
+       plugin/media-ebook-plugin-pdf.cpp
+       plugin/media-ebook-plugin-epub.cpp
        )
 SET(CONTENTPLUGIN_SRCS
        plugin/media-content-plugin.c
@@ -46,20 +43,22 @@ IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
 MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
 
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src/include/common ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/uuid ${CMAKE_SOURCE_DIR}/md5)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src/include/common ${CMAKE_SOURCE_DIR})
 
 FIND_PROGRAM(UNAME NAMES uname)
 EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
 
 
 INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED glib-2.0 dlog sqlite3 db-util libexif mm-fileinfo media-thumbnail libmedia-utils aul uuid vconf capi-media-image-util)
+pkg_check_modules(pkgs REQUIRED glib-2.0 dlog sqlite3 libexif mm-fileinfo libmedia-utils aul uuid libxml-2.0 libzip media-thumbnail libpodofo iniparser)
 
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+       SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} ${flag}")
 ENDFOREACH(flag)
 
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Wno-deprecated-declarations")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror -D_FORTIFY_SOURCE=2")
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS} -fPIC -Wall -Werror -D_FORTIFY_SOURCE=2")
 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
 SET(CMAKE_C_FLAGS_RELEASE "-O2 -fPIC")
 
@@ -73,32 +72,26 @@ ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
 ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
 ADD_DEFINITIONS("-D_FILE_OFFSET_BITS=64")
-#ADD_DEFINITIONS("-D_PERFORMANCE_CHECK_")
 
 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--hash-style=both")
 CONFIGURE_FILE(libmedia-service.pc.in libmedia-service.pc @ONLY)
 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libmedia-service.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 
-#ADD_SUBDIRECTORY(test)
-
 LINK_DIRECTORIES(${LIB_INSTALL_DIR})
 
-ADD_LIBRARY(${MEDIASERVICE-HASH-LIB} SHARED ${HASH_SRCS})
-SET_TARGET_PROPERTIES(${MEDIASERVICE-HASH-LIB} PROPERTIES SOVERSION ${VERSION_MAJOR})
-SET_TARGET_PROPERTIES(${MEDIASERVICE-HASH-LIB} PROPERTIES VERSION ${VERSION})
-ADD_LIBRARY(${MEDIASERVICE-LIB} SHARED ${SRCS}) 
-TARGET_LINK_LIBRARIES(${MEDIASERVICE-LIB} ${pkgs_LDFLAGS} ${MEDIASERVICE-HASH-LIB})
+ADD_LIBRARY(${MEDIASERVICE-LIB} SHARED ${SRCS})
+TARGET_LINK_LIBRARIES(${MEDIASERVICE-LIB} ${pkgs_LDFLAGS})
 SET_TARGET_PROPERTIES(${MEDIASERVICE-LIB} PROPERTIES SOVERSION ${VERSION_MAJOR})
 SET_TARGET_PROPERTIES(${MEDIASERVICE-LIB} PROPERTIES VERSION ${VERSION})
 ADD_LIBRARY(${MEDIACONTENT-PLUGIN-LIB} SHARED ${CONTENTPLUGIN_SRCS})
 TARGET_LINK_LIBRARIES(${MEDIACONTENT-PLUGIN-LIB} ${MEDIASERVICE-LIB})
 SET_TARGET_PROPERTIES(${MEDIACONTENT-PLUGIN-LIB} PROPERTIES SOVERSION ${VERSION_MAJOR})
 SET_TARGET_PROPERTIES(${MEDIACONTENT-PLUGIN-LIB} PROPERTIES VERSION ${VERSION})
+ADD_LIBRARY(${MEDIAEBOOK-PLUGIN-LIB} SHARED ${EBOOKPLUGIN_SRCS})
+TARGET_LINK_LIBRARIES(${MEDIAEBOOK-PLUGIN-LIB} ${pkgs_LDFLAGS})
 
 INSTALL(TARGETS ${MEDIASERVICE-LIB} LIBRARY DESTINATION ${LIB_INSTALL_DIR})
-INSTALL(TARGETS ${MEDIASERVICE-HASH-LIB} LIBRARY DESTINATION ${LIB_INSTALL_DIR})
 INSTALL(TARGETS ${MEDIACONTENT-PLUGIN-LIB} LIBRARY DESTINATION ${LIB_INSTALL_DIR})
-#INSTALL(TARGETS ${MEDIACONTENT-PLUGIN-LIB} LIBRARY DESTINATION /usr/lib)
+INSTALL(TARGETS ${MEDIAEBOOK-PLUGIN-LIB} LIBRARY DESTINATION ${LIB_INSTALL_DIR})
 
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/media-svc.h DESTINATION include/media-service/)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/media-svc-types.h DESTINATION include/media-service/)