Clean-up build scripts 59/64959/1
authorMu-Woong Lee <muwoong.lee@samsung.com>
Wed, 6 Apr 2016 09:58:21 +0000 (18:58 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Wed, 6 Apr 2016 09:58:21 +0000 (18:58 +0900)
Change-Id: Ie83e9cb07e2cb0c0c7a7c58715c39a561285e69f
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
CMakeLists.txt
packaging/motion.spec

index 21b3e92..c2049b8 100644 (file)
@@ -2,22 +2,14 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(motion)
 INCLUDE(GNUInstallDirs)
 
+# Target lib (for backward compatibility, the below old naming is used)
+SET(target "core-context-manager")
+
 # Source Lists
-SET(SRCS
-       src/shared/ctx_util_misc.cpp
-       src/shared/ctx_util_sensor.cpp
-# Gesture
-       src/gesture/gesture.cpp
-       src/gesture/motion_engine.cpp
-# Activity
-       src/activity/activity.cpp
-)
+FILE(GLOB_RECURSE SRCS src/*.cpp)
 
 SET(inc_subdir "context-service")
-SET(dependency "dlog glib-2.0 capi-base-common capi-system-info sensor")
-
-# Target lib (for backward compatibility, the below old naming is used)
-SET(target "core-context-manager")
+SET(dependency "glib-2.0 dlog capi-base-common capi-system-info sensor")
 
 # Options
 INCLUDE(FindPkgConfig)
@@ -26,7 +18,8 @@ INCLUDE_DIRECTORIES(
        ${CMAKE_CURRENT_SOURCE_DIR}/src/shared
 )
 
-ADD_DEFINITIONS(-O2 -Wall -fPIC -fvisibility=hidden -Wl,--as-needed)
+ADD_DEFINITIONS(-O2 -Wall -fPIC -fdata-sections -ffunction-sections -fvisibility=hidden)
+SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC -Wl,--as-needed -Wl,--gc-section -Wl,--print-gc-section")
 
 # Build
 pkg_check_modules(pkgs REQUIRED ${dependency})
@@ -43,7 +36,7 @@ SET_TARGET_PROPERTIES(${target} PROPERTIES SOVERSION ${MAJORVER})
 SET_TARGET_PROPERTIES(${target} PROPERTIES VERSION ${FULLVER})
 
 # Install
-INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR})
 INSTALL(
        DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${inc_subdir}
        FILES_MATCHING PATTERN "*.h"
@@ -51,7 +44,7 @@ INSTALL(
 
 SET(VERSION ${FULLVER})
 SET(PC_PREFIX ${CMAKE_INSTALL_PREFIX})
-SET(PC_NAME ${target})
+SET(PC_NAME ${PROJECT_NAME})
 SET(PC_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
 SET(PC_INCLUDE "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/${inc_subdir}")
 SET(PC_DESCRIPTION "Tizen Native Motion Recognition API")
index ebad3a4..d0eb8d8 100644 (file)
@@ -1,25 +1,21 @@
 Name:       motion
 Summary:    Tizen Native Motion Recognition API
-Version:    1.1.3
+Version:    1.1.4
 Release:    1
-Group:      Framework/context
+Group:      Service/Context
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
+
 BuildRequires:  cmake
-BuildRequires:  pkgconfig(capi-base-common)
-BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(glib-2.0)
+BuildRequires:  pkgconfig(dlog)
+BuildRequires:  pkgconfig(capi-base-common)
 BuildRequires:  pkgconfig(capi-system-info)
 BuildRequires:  pkgconfig(sensor)
+
 Requires(post):  /sbin/ldconfig
 Requires(postun):  /sbin/ldconfig
 
-%ifarch %{arm}
-%define ARCH arm
-%else
-%define ARCH i586
-%endif
-
 %description
 Tizen Native Motion Recognition API
 
@@ -29,21 +25,27 @@ Tizen Native Motion Recognition API
 %build
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 
-export   CFLAGS+=" -Werror -Wextra -Wcast-align -Wcast-qual -Wshadow -Wwrite-strings -Wswitch-default"
-export CXXFLAGS+=" -Werror -Wextra -Wcast-align -Wcast-qual -Wshadow -Wwrite-strings -Wswitch-default -Wnon-virtual-dtor -Wno-c++0x-compat"
+export   CFLAGS+=" -Wextra -Wcast-align -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-parameter"
+export CXXFLAGS+=" -Wextra -Wcast-align -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-parameter"
 
-#export  CFLAGS+=" -Wno-array-bounds -Wno-ignored-qualifiers"
-export   CFLAGS+=" -Wno-unused-parameter -Wno-empty-body"
-export CXXFLAGS+=" -Wno-unused-parameter -Wno-empty-body"
+export   CFLAGS+=" -Wno-empty-body -fomit-frame-pointer -fno-optimize-sibling-calls"
+export CXXFLAGS+=" -Wno-empty-body -fomit-frame-pointer -fno-optimize-sibling-calls"
 
-export   CFLAGS+=" -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-strict-aliasing -fno-unroll-loops -fsigned-char -fstrict-overflow -fno-common"
-export CXXFLAGS+=" -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-strict-aliasing -fno-unroll-loops -fsigned-char -fstrict-overflow"
+export   CFLAGS+=" -fno-strict-aliasing -fno-unroll-loops -fsigned-char -fstrict-overflow"
+export CXXFLAGS+=" -fno-strict-aliasing -fno-unroll-loops -fsigned-char -fstrict-overflow"
 
-export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
-export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
-export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
+export   CFLAGS+=" -fno-common"
+export CXXFLAGS+=" -Wnon-virtual-dtor"
+export CXXFLAGS+=" -std=c++11 -Wno-c++11-compat"
 
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCH=%{ARCH} -DMAJORVER=${MAJORVER} -DFULLVER=%{version} -DPROFILE=%{PROFILE}
+#export   CFLAGS+=" -Wcast-qual"
+#export CXXFLAGS+=" -Wcast-qual"
+
+#export   CFLAGS+=" -DTIZEN_ENGINEER_MODE"
+#export CXXFLAGS+=" -DTIZEN_ENGINEER_MODE"
+#export   FFLAGS+=" -DTIZEN_ENGINEER_MODE"
+
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DMAJORVER=${MAJORVER} -DFULLVER=%{version}
 make %{?jobs:-j%jobs}
 
 %install
@@ -75,12 +77,6 @@ Requires:    %{name} = %{version}-%{release}
 %description devel
 Tizen Native Motion Recognition API (Development)
 
-%post devel
-/sbin/ldconfig
-
-%postun devel
-/sbin/ldconfig
-
 %files devel
 %defattr(-,root,root,-)
 %{_includedir}/*/*.h