CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(pwlock C) SET(SRCS ./src/pwlock.c ./src/tapi.c ./src/util.c ./src/ui.c ./src/ui-callback.c ./src/langs.c ) SET(VENDOR "org.tizen") SET(PACKAGE ${PROJECT_NAME}) SET(PKGNAME "${VENDOR}.${PACKAGE}") #SET(DEBPKGNAME "deb.${PKGNAME}") 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(IMAGEDIR "${RESDIR}/images") INSTALL(DIRECTORY DESTINATION ${DATADIR}) 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) INCLUDE(FindPkgConfig) pkg_check_modules(pkgs REQUIRED elementary appcore-efl vconf tapi utilX ui-gadget-1 bundle ecore-imf ecore-x eina evas ecore edje ecore-input glib-2.0 gio-2.0 openssl aul sysman ail accounts-svc appsvc iniparser capi-system-info ) FOREACH(flag ${pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") 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=\"${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("-DEDJDIR=\"${EDJDIR}\"") ADD_DEFINITIONS("-DIMAGEDIR=\"${IMAGEDIR}\"") #ADD_DEFINITIONS("-DPWLOCK_ENABLE_TUTORIAL") SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed") ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS}) # install desktop file & icon & bin #CONFIGURE_FILE(${PKGNAME}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/${PKGNAME}.desktop) #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PKGNAME}.desktop DESTINATION /opt/share/applications) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PKGNAME}.xml DESTINATION /opt/share/packages) #INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/images/* DESTINATION res/icons) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR}) # i18n ADD_SUBDIRECTORY(po) ADD_SUBDIRECTORY(res)