diff options
Diffstat (limited to 'src/agent/CMakeLists.txt')
-rwxr-xr-x | src/agent/CMakeLists.txt | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/src/agent/CMakeLists.txt b/src/agent/CMakeLists.txt new file mode 100755 index 0000000..64fb834 --- /dev/null +++ b/src/agent/CMakeLists.txt @@ -0,0 +1,80 @@ + +############################################# +# +# Step 1. Set Variable and Build Dependency +# + +# set a name for the entire project +PROJECT(oma-ds) + +# set variables +SET(EXENAME "${PROJECT_NAME}-agent") +SET(BINDIR "${PREFIX}/bin") +SET(OMADS_SRC_DIR "${CMAKE_SOURCE_DIR}/src/agent") +SET(OMADS_COMPONETS "main;common;framework/san-parser;framework/event;framework/task;service-adapter;service-adapter/network-binder;service-adapter/protocol-binder;service-engine") + +# 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 + libwbxml2 + dlog + aul + dbus-glib-1 + ) + +############################################# +# +# Step 2. Set Compile Environment +# + +# set extra cflags from build dependency +STRING(REPLACE ";" " " EXTRA_CFLAGS "${LPKGS_CFLAGS}") + +# find all source files in a directory. +FOREACH(OMADS_COMPONET ${OMADS_COMPONETS}) + AUX_SOURCE_DIRECTORY(${OMADS_SRC_DIR}/${OMADS_COMPONET} SRCS) +ENDFOREACH(OMADS_COMPONET) + +# add internal include directories to the build. +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/san-parser) + +# 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 oma ds configuration files +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/oma-ds-cfg DESTINATION /usr/share) + +# install oma ds dbus file +INSTALL(FILES ${CMAKE_SOURCE_DIR}/com.samsung.omadsagent.service DESTINATION /usr/share/dbus-1/services) + +# install booting script file +INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/${PROJECT_NAME} DESTINATION /etc/init.d/) + |