CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(memo C) SET(SRCS extend/supplement.c extend/extended-elm.c src/memo.c src/memo-assist.c src/memo-genlist.c src/memo_list.c src/memo_edit.c src/memo_edit_list.c src/memo_list_viewer.c src/memo_list_editor.c src/memo_text_viewer.c src/memo_text_editor.c src/memo_doodle_viewer.c src/memo_doodle_editor.c src/memo_detail.c src/memo_ug.c) SET(VENDOR "tizen") SET(PKGPREFIX "org.${VENDOR}") SET(PACKAGE ${PROJECT_NAME}) SET(PKGNAME "${PKGPREFIX}.${PACKAGE}") SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(BINDIR "${PREFIX}/bin") SET(RESDIR "${PREFIX}/res") SET(DATADIR "${PREFIX}/data") SET(LOCALEDIR "${RESDIR}/locale") SET(ICONDIR "${RESDIR}/icons/default/small") SET(EDJDIR "${RESDIR}/edje") SET(DOODLEDIR "${DATADIR}/doodle") 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) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/extend) INCLUDE(FindPkgConfig) pkg_check_modules(pkgs REQUIRED appcore-efl elementary ecore ecore-x ecore-imf ecore-input eina evas edje memo iniparser ui-gadget dlog bundle appsvc heynoti) 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") 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_PREFIX=\"${PKGPREFIX}\"") ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"") ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"") ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"") ADD_DEFINITIONS("-DRESDIR=\"${RESDIR}\"") ADD_DEFINITIONS("-DDATADIR=\"${DATADIR}\"") ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"") ADD_DEFINITIONS("-DICONDIR=\"${ICONDIR}\"") ADD_DEFINITIONS("-DEDJ_DIR=\"${EDJDIR}\"") ADD_DEFINITIONS("-DEDJ_FILE=\"${EDJDIR}/${PACKAGE}.edj\"") ADD_DEFINITIONS("-DDOODLEDIR=\"${DOODLEDIR}\"") ADD_DEFINITIONS("-DMEMO_BUFFER_SIZE=256") ADD_DEFINITIONS("-DLOG_TAG=\"${PROJECT_NAME}\"") SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed") ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} "-pie" "-lm -L/usr/lib -licui18n -licuuc -licudata -lm") ADD_CUSTOM_TARGET(memo.edj COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/images ${CMAKE_SOURCE_DIR}/memo.edc ${CMAKE_BINARY_DIR}/memo.edj DEPENDS ${CMAKE_SOURCE_DIR}/memo.edc ) ADD_DEPENDENCIES(${PROJECT_NAME} memo.edj) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR}) INSTALL(FILES ${CMAKE_BINARY_DIR}/memo.edj DESTINATION ${EDJDIR}) INSTALL(DIRECTORY DESTINATION ${DOODLEDIR}) # install desktop file & icon CONFIGURE_FILE(${PKGNAME}.desktop.in ${CMAKE_BINARY_DIR}/${PKGNAME}.desktop) INSTALL(FILES ${CMAKE_BINARY_DIR}/${PKGNAME}.desktop DESTINATION /opt/share/applications) INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.memo.png DESTINATION ${ICONDIR}) INSTALL(FILES ${CMAKE_SOURCE_DIR}/images/01_header_icon_edit.png DESTINATION ${ICONDIR}) INSTALL(FILES ${CMAKE_SOURCE_DIR}/images/01_header_icon_add.png DESTINATION ${ICONDIR}) INSTALL(FILES ${CMAKE_SOURCE_DIR}/images/01_header_icon_others.png DESTINATION ${ICONDIR}) INSTALL(FILES ${CMAKE_SOURCE_DIR}/images/01_header_icon_cancel.png DESTINATION ${ICONDIR}) INSTALL(FILES ${CMAKE_SOURCE_DIR}/images/01_header_icon_done.png DESTINATION ${ICONDIR}) INSTALL(FILES ${CMAKE_SOURCE_DIR}/images/01_header_icon_delete.png DESTINATION ${ICONDIR}) # i18n ADD_SUBDIRECTORY(po) # theme ADD_SUBDIRECTORY(theme)