summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt117
1 files changed, 117 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..9263e8e
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,117 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+SET(fw_name "maps-plugin-mapquest")
+PROJECT(${fw_name} C CXX)
+
+SET(CMAKE_INSTALL_PREFIX /usr)
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+
+# Dependencies
+SET(dependents "glib-2.0 gmodule-2.0 dlog libcurl capi-network-connection json-glib-1.0 capi-maps-service")
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED ${dependents})
+FOREACH(flag ${pkgs_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ SET(EXTRA_CXXFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+
+# Build
+SET(CMAKE_INSTALL_PREFIX /usr)
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fvisibility=hidden -fPIC -Wall -Werror")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpie ${EXTRA_CFLAGS} -Wall -g -fPIC -std=c++0x -fvisibility=hidden")
+
+IF("${ARCH}" STREQUAL "arm")
+ ADD_DEFINITIONS("-DTARGET")
+ENDIF("${ARCH}" STREQUAL "arm")
+
+ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
+ADD_DEFINITIONS("-DEXPORT_API=__attribute__((visibility(\"default\")))")
+ADD_DEFINITIONS("-DTIZEN_DEBUG")
+
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib")
+
+
+# Include files
+# Maps Service Includes
+SET(INC_DIR
+ include
+)
+
+# Maps Service Implementation
+SET(INTERNAL_INC_DIR
+ src
+)
+
+# Mapquest Engine Implementation
+SET(ENGINE_INC_DIR
+ src/mapquest
+)
+INCLUDE_DIRECTORIES(
+${INC_DIR} ${INTERNAL_INC_DIR} ${ENGINE_INC_DIR}
+)
+
+#This file must be corrected
+
+# Source Lists
+SET(SRCS
+ # Maps API
+ src/mapquest_plugin.c
+
+ # Mapquest Engine
+ src/mapquest/mapquest_api.c
+ src/mapquest/mapquest_geocode.c
+ src/mapquest/mapquest_revgeocode.c
+ src/mapquest/mapquest_route.c
+ src/mapquest/mapquest_place.c
+ src/mapquest/mapquest_restcurl.c
+ src/mapquest/mapquest_jsonparser.c
+ src/mapquest/mapquest_queue.c
+ src/mapquest/mapquest_util.c
+)
+
+ADD_LIBRARY(${fw_name} SHARED ${SRCS})
+
+SET_TARGET_PROPERTIES(${fw_name}
+ PROPERTIES
+ VERSION ${FULLVER}
+ SOVERSION ${MAJORVER}
+ CLEAN_DIRECT_OUTPUT 1
+)
+
+TARGET_LINK_LIBRARIES(${fw_name} ${pkgs_LDFLAGS})
+
+SET(PC_NAME ${fw_name})
+SET(PC_DESCRIPTION "Tizen mpaquest plugin Library")
+SET(PC_LDFLAGS -l${fw_name})
+SET(PC_INCLUDE /usr/include/maps)
+
+CONFIGURE_FILE(
+ ${fw_name}.pc.in
+ ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
+ @ONLY
+)
+
+# Install
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION lib/pkgconfig)
+INSTALL(TARGETS ${fw_name} DESTINATION lib/maps/plugins)
+
+#INCLUDE(FindPkgConfig)
+#pkg_check_modules(lib_pkgs REQUIRED
+# capi-maps-service
+#)
+
+SET(LIB_APP_ASSIST capi-maps-service)
+INSTALL(
+ DIRECTORY ${INC_DIR}/ DESTINATION include/mapquest-plugin
+ FILES_MATCHING
+ PATTERN "*_internal.h" EXCLUDE
+ PATTERN "${INC_DIR}/mapquest_*.h"
+)
+
+# Test Suite
+#IF("${BINTYPE}" STREQUAL "eng")
+#ENDIF("${BINTYPE}" STREQUAL "eng")