############################################# # # Step 1. Set Variable and Build Dependency # # set a name for the entire project PROJECT(oma-dm) # set variables SET(EXENAME "${PROJECT_NAME}-agent") SET(BINDIR "${PREFIX}/bin") SET(OMADM_SRC_DIR "${CMAKE_SOURCE_DIR}/src/agent") SET(OMADM_COMPONETS "common;common/dm-status;common/util;framework;framework/task;framework/ui-event-handler;framework/ui-event-handler/user-interaction;framework/platform-event-handler;framework/san-parser;dm-engine;dm-engine/fumo;dm-engine/lawmo;dm-engine/bootstrap;dm-engine/cp;dm-engine/dl-manager;mo-handler;serviceadapter;serviceadapter/dm-phase-handler;serviceadapter/protocolbinder;serviceadapter/networkbinder") # checks for build dependency modules : a pkg-config module for CMake INCLUDE(FindPkgConfig) pkg_check_modules(LPKGS REQUIRED glib-2.0 libsoup-2.4 sqlite3 sync-agent vconf libxml-2.0 aul libwbxml2 # oauth appsvc dlog dbus-glib-1 # appcore-efl ) ############################################# # # Step 2. Set Compile Environment # # set extra cflags from build dependency STRING(REPLACE ";" " " EXTRA_CFLAGS "${LPKGS_CFLAGS}") # find all source files in a directory. AUX_SOURCE_DIRECTORY(${OMADM_SRC_DIR} SRCS) FOREACH(OMADM_COMPONET ${OMADM_COMPONETS}) AUX_SOURCE_DIRECTORY(${OMADM_SRC_DIR}/${OMADM_COMPONET} SRCS) ENDFOREACH(OMADM_COMPONET) # add internal include directories to the build. INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/framework/ui-event-handler) # add define macros ADD_DEFINITIONS("-DGLIB_VERSION_MIN_REQUIRED=(2<<16|32<<8) ") ############################################# # # Step 3. Set Link Environment # # add an executable to the project using the specified source files. ADD_EXECUTABLE(${EXENAME} ${SRCS}) # link a target to given libraries. TARGET_LINK_LIBRARIES(${EXENAME} ${LPKGS_LIBRARIES}) # sets additional compiler flags used to build sources within the target. SET_TARGET_PROPERTIES(${EXENAME} PROPERTIES COMPILE_FLAGS ${EXTRA_CFLAGS}) ############################################# # # Step 4. Install packages # # install executable file INSTALL(TARGETS ${EXENAME} DESTINATION ${BINDIR}) # install dm configuration files INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/oma-dm-cfg DESTINATION /usr/share) # install oma ds dbus file INSTALL(FILES ${CMAKE_SOURCE_DIR}/com.samsung.omadmagent.service DESTINATION /usr/share/dbus-1/services) # install smack rule file Install(FILES ${CMAKE_SOURCE_DIR}/oma-dm-agent.rule DESTINATION /etc/smack/accesses2.d)