Add missing header
[platform/core/multimedia/libmedia-thumbnail.git] / CMakeLists.txt
old mode 100755 (executable)
new mode 100644 (file)
index bf9ba15..eeff3fb
@@ -1,19 +1,11 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6...2.8.12)
 PROJECT(media-thumbnail C)
 SET(VERSION_MAJOR 1)
 SET(VERSION "${VERSION_MAJOR}.0.0")
 
 SET(MEDIATHUMB-LIB "media-thumbnail")
-SET(MEDIAHASH-LIB "media-hash")
 SET(SRCS
        src/media-thumbnail.c
-       src/util/media-thumb-util.c
-       src/ipc/media-thumb-ipc.c
-       src/codec/img-codec-parser.c
-       )
-SET(HASH_SRCS
-       md5/md5.c
-       md5/media-thumb-hash.c
        )
 
 SET(VENDOR "samsung")
@@ -32,16 +24,21 @@ 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 ${CMAKE_SOURCE_DIR}/src/include/util ${CMAKE_SOURCE_DIR}/src/include/codec ${CMAKE_SOURCE_DIR}/src/include/util ${CMAKE_SOURCE_DIR}/src/include/ipc ${CMAKE_SOURCE_DIR}/server/include ${CMAKE_SOURCE_DIR}/md5)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
 
+IF(WITH_DA_PROFILE)
+INCLUDE(FindPkgConfig)
+       pkg_check_modules(pkgs REQUIRED dlog mm-fileinfo aul mmutil-common mmutil-magick mmutil-gif mmutil-jpeg libexif)
+ELSE(WITH_DA_PROFILE)
 INCLUDE(FindPkgConfig)
-       pkg_check_modules(pkgs REQUIRED glib-2.0 gthread-2.0 dlog sqlite3 mm-fileinfo aul libmedia-utils libtzplatform-config db-util mmutil-magick)
+       pkg_check_modules(pkgs REQUIRED dlog mm-fileinfo aul mmutil-common mmutil-magick)
+ENDIF(WITH_DA_PROFILE)
 
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
 
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror -Wno-deprecated-declarations")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror -Wno-deprecated-declarations -D_FORTIFY_SOURCE=2")
 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
 SET(CMAKE_C_FLAGS_RELEASE "-O2 -fPIC")
 
@@ -58,24 +55,25 @@ ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
 ADD_DEFINITIONS("-D_GNU_SOURCE")
 
+IF(WITH_DA_PROFILE)
+       ADD_DEFINITIONS("-DUSE_MEMORY_USAGE_REDUCTION")
+       ADD_DEFINITIONS("-DENABLE_IMAGE_SIZE_LIMITATION")
+ENDIF(WITH_DA_PROFILE)
+
 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--hash-style=both")
 CONFIGURE_FILE(media-thumbnail.pc.in media-thumbnail.pc @ONLY)
 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/media-thumbnail.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 
 LINK_DIRECTORIES(${LIB_INSTALL_DIR})
 
-ADD_LIBRARY(${MEDIAHASH-LIB} SHARED ${HASH_SRCS})
-SET_TARGET_PROPERTIES(${MEDIAHASH-LIB} PROPERTIES SOVERSION ${VERSION_MAJOR})
-SET_TARGET_PROPERTIES(${MEDIAHASH-LIB} PROPERTIES VERSION ${VERSION})
 ADD_LIBRARY(${MEDIATHUMB-LIB} SHARED ${SRCS})
-TARGET_LINK_LIBRARIES(${MEDIATHUMB-LIB} ${pkgs_LDFLAGS} ${MEDIAHASH-LIB})
+TARGET_LINK_LIBRARIES(${MEDIATHUMB-LIB} ${pkgs_LDFLAGS})
 SET_TARGET_PROPERTIES(${MEDIATHUMB-LIB} PROPERTIES SOVERSION ${VERSION_MAJOR})
 SET_TARGET_PROPERTIES(${MEDIATHUMB-LIB} PROPERTIES VERSION ${VERSION})
 
 INSTALL(TARGETS ${MEDIATHUMB-LIB} LIBRARY DESTINATION ${LIB_INSTALL_DIR})
-INSTALL(TARGETS ${MEDIAHASH-LIB} LIBRARY DESTINATION ${LIB_INSTALL_DIR})
-
-ADD_SUBDIRECTORY(server)
 
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/media-thumbnail.h DESTINATION include/${MEDIATHUMB-LIB})
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/include/codec/img-codec-parser.h DESTINATION include/${MEDIATHUMB-LIB})
+IF(BUILD_GTESTS)
+       ADD_SUBDIRECTORY(unittest)
+ENDIF(BUILD_GTESTS)