summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJinkun Jang <jinkun.jang@samsung.com>2013-03-12 16:49:53 (GMT)
committerJinkun Jang <jinkun.jang@samsung.com>2013-03-12 16:49:53 (GMT)
commitb8ccdef0306cf19cde9511ec244fd43b4ae1d863 (patch)
treeedfb6fbb5a168525e60cbcf918d84217bd667586 /CMakeLists.txt
parent06e2dff413544d0e1465e0cb4897fe32e4de2c22 (diff)
downloadlibmedia-thumbnail-b8ccdef0306cf19cde9511ec244fd43b4ae1d863.zip
libmedia-thumbnail-b8ccdef0306cf19cde9511ec244fd43b4ae1d863.tar.gz
libmedia-thumbnail-b8ccdef0306cf19cde9511ec244fd43b4ae1d863.tar.bz2
Tizen 2.1 base
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt105
1 files changed, 105 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..a4883f7
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,105 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+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/media-thumb-internal.c
+ src/util/media-thumb-debug.c
+ src/util/media-thumb-util.c
+ src/util/media-thumb-db.c
+ src/codec/IfegDecodeAGIF.c
+ src/codec/img-codec.c
+ src/codec/img-codec-osal.c
+ src/codec/img-codec-parser.c
+ src/ipc/media-thumb-ipc.c
+ )
+SET(HASH_SRCS
+ md5/md5.c
+ md5/media-thumb-hash.c
+ )
+
+SET(THUMB-SERVER server/thumb-server.c server/thumb-server-internal.c)
+SET(TEST-THUMB test/test-thumb.c)
+
+SET(VENDOR "samsung")
+SET(PACKAGE ${PROJECT_NAME})
+SET(PKGNAME "com.${VENDOR}.${PACKAGE}")
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(BINDIR "${PREFIX}/bin")
+SET(LOCALBINDIR "${PREFIX}/local/bin")
+SET(DATADIR "${PREFIX}/share")
+SET(EXEC_PREFIX "\${prefix}")
+SET(LIBDIR "\${prefix}/lib")
+SET(INCLUDEDIR "\${prefix}/include")
+
+IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+ SET(CMAKE_BUILD_TYPE "Release")
+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(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED
+glib-2.0 gthread-2.0 dlog mm-fileinfo drm-client aul
+libexif ecore-evas evas mmutil-imgp mmutil-jpeg heynoti libmedia-utils)
+
+
+FOREACH(flag ${pkgs_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
+SET(CMAKE_C_FLAGS_RELEASE "-O2 -fPIC")
+
+FIND_PROGRAM(UNAME NAMES uname)
+EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
+IF("${ARCH}" STREQUAL "arm")
+ ADD_DEFINITIONS("-DTARGET")
+ MESSAGE("add -DTARGET")
+ENDIF("${ARCH}" STREQUAL "arm")
+
+ADD_DEFINITIONS("-DVENDOR=\"${VENDOR}\"")
+ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
+ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
+ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
+#ADD_DEFINITIONS("-D_PERFORMANCE_CHECK_")
+ADD_DEFINITIONS("-D_USE_NEW_MEDIA_DB_")
+ADD_DEFINITIONS("-D_USE_MEDIA_UTIL_")
+
+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/pkgconfig)
+
+LINK_DIRECTORIES(lib)
+
+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})
+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(TARGETS ${MEDIAHASH-LIB} LIBRARY DESTINATION lib)
+
+ADD_EXECUTABLE(media-thumbnail-server ${THUMB-SERVER})
+TARGET_LINK_LIBRARIES(media-thumbnail-server ${pkgs_LDFLAGS} ${MEDIATHUMB-LIB} )
+INSTALL(TARGETS media-thumbnail-server DESTINATION ${BINDIR})
+
+ADD_EXECUTABLE(test-thumb ${TEST-THUMB})
+TARGET_LINK_LIBRARIES(test-thumb ${pkgs_LDFLAGS} ${MEDIATHUMB-LIB} )
+INSTALL(TARGETS test-thumb DESTINATION ${LOCALBINDIR})
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/media-thumbnail.h DESTINATION include/${MEDIATHUMB-LIB})
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/media-thumbnail-private.h DESTINATION include/${MEDIATHUMB-LIB})
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/media-thumb-error.h DESTINATION include/${MEDIATHUMB-LIB})
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/media-thumb-types.h DESTINATION include/${MEDIATHUMB-LIB})
+#INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/thumbsvr DESTINATION /etc/init.d)
+