CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(crash-worker-sdk C) SET(SRCS src/crash-worker-sdk.c src/_util_efl.c src/_logic.c ) SET(VENDOR "tizen") SET(PACKAGE "crash-worker") SET(PKGNAME "org.tizen.crash-worker") SET(EXENAME "crash-worker") SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(BINDIR "${PREFIX}/apps/${PKGNAME}/bin") SET(RESDIR "${PREFIX}/apps/${PKGNAME}/res") SET(DATADIR "${PREFIX}/data") SET(LOCALEDIR "${RESDIR}/locale") SET(ICONDIR "${PREFIX}/share/icons/default/small") SET(IMAGEDIR "${RESDIR}/images/crash-worker") SET(EDJDIR "${RESDIR}/edje") 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}/src) INCLUDE(FindPkgConfig) pkg_check_modules(pkgs REQUIRED appcore-efl ecore-file ecore-x ecore evas edje sqlite3 gthread-2.0 vconf utilX heynoti ) 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("-DIMAGEDIR=\"${IMAGEDIR}\"") ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"") #SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") ADD_EXECUTABLE(${EXENAME} ${SRCS}) TARGET_LINK_LIBRARIES(${EXENAME} ${pkgs_LDFLAGS}) INSTALL(TARGETS ${EXENAME} DESTINATION ${BINDIR}) # install xml file & icon INSTALL(FILES ${CMAKE_SOURCE_DIR}/${PKGNAME}.xml DESTINATION ${PREFIX}/share/packages) INSTALL(FILES ${CMAKE_SOURCE_DIR}/${PKGNAME}.png DESTINATION ${ICONDIR}) # data ADD_SUBDIRECTORY(data) # i18n ADD_SUBDIRECTORY(po)