Revert "Arrange CMakeLists.txt and spec file" 64/160964/1 accepted/tizen/4.0/unified/20171122.071136 submit/tizen_4.0/20171121.022718
authorMyungki Lee <mk5004.lee@samsung.com>
Tue, 21 Nov 2017 02:09:39 +0000 (11:09 +0900)
committerMyungki Lee <mk5004.lee@samsung.com>
Tue, 21 Nov 2017 02:09:39 +0000 (11:09 +0900)
Change-Id: I7442196d209535ca7b12a811b7033b5814c43ba7
Signed-off-by: Myungki Lee <mk5004.lee@samsung.com>
CMakeLists.txt
packaging/notification.spec

index c327f09..664f245 100755 (executable)
@@ -1,15 +1,56 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(notification C)
 
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(EXEC_PREFIX "\${prefix}")
+SET(LIBDIR ${LIB_INSTALL_DIR})
+SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}")
+
 #ADD_SUBDIRECTORY(test-app)
 
 SET(INIT-SRCS
        ./src/notification_init.c
 )
 
+SET(SRCS
+       ./src/notification.c
+       ./src/notification_noti.c
+       ./src/notification_ongoing.c
+       ./src/notification_group.c
+       ./src/notification_db.c
+       ./src/notification_db_query.h
+       ./src/notification_list.c
+       ./src/notification_status.c
+       ./src/notification_ipc.c
+       ./src/notification_setting.c
+       ./src/notification_setting_service.c
+       ./src/notification_internal.c
+       ./src/notification_viewer.c
+       ./src/notification_error.c
+       ./src/notification_shared_file.c
+       )
+SET(HEADERS-DEVEL
+       ./include/notification.h
+       ./include/notification_internal.h
+       ./include/notification_db.h
+       ./include/notification_error.h
+       ./include/notification_type.h
+       ./include/notification_list.h
+       ./include/notification_ongoing.h
+       ./include/notification_ongoing_flag.h
+       ./include/notification_text_domain.h
+       ./include/notification_status.h
+       ./include/notification_status_internal.h
+       ./include/notification_setting.h
+       ./include/notification_setting_internal.h
+       ./include/notification_ipc.h
+       ./include/notification_noti.h
+       ./include/notification_setting_service.h
+       ./include/notification_viewer.h
+       ./include/notification_shared_file.h
+   )
+
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
-AUX_SOURCE_DIRECTORY(src SRCS)
-LIST(REMOVE_ITEM SRCS ${INIT-SRCS})
 
 INCLUDE(FindPkgConfig)
 pkg_check_modules(pkgs REQUIRED
@@ -40,6 +81,14 @@ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE")
 
 SET(CMAKE_SKIP_BUILD_RPATH TRUE)
 
+IF (HAVE_X11)
+ADD_DEFINITIONS("-DHAVE_X11")
+ENDIF (HAVE_X11)
+
+IF (HAVE_WAYLAND)
+ADD_DEFINITIONS("-DHAVE_WAYLAND")
+ENDIF (HAVE_WAYLAND)
+
 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${MAJORVER})
 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${FULLVER})
@@ -51,13 +100,10 @@ TARGET_LINK_LIBRARIES(notification_init ${pkgs_LDFLAGS} notification "-pie")
 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
 INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
-INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/include/
-        DESTINATION include/notification
-        FILES_MATCHING
-               PATTERN "*_private.h" EXCLUDE
-               PATTERN "*_group.h" EXCLUDE
-               PATTERN "*_debug.h" EXCLUDE
-        PATTERN "*.h")
+
+FOREACH(hfile ${HEADERS-DEVEL})
+       INSTALL(FILES ${CMAKE_SOURCE_DIR}/${hfile} DESTINATION include/${PROJECT_NAME})
+ENDFOREACH(hfile)
 
 INSTALL(FILES ${CMAKE_BINARY_DIR}/11_notification-add.post DESTINATION ${SYSCONF_INSTALL_DIR}/gumd/useradd.d/)
 INSTALL(TARGETS notification_init DESTINATION bin)
index 02ee2f3..d913313 100755 (executable)
@@ -48,9 +48,15 @@ Development files needed to build software that needs to system a system notific
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 export LDFLAGS+="-Wl,--rpath=%{_prefix}/lib -Wl,--as-needed"
 LDFLAGS="$LDFLAGS"
+%if %{with wayland}
 %cmake . \
-       -DCMAKE_INSTALL_PREFIX=%{_prefix} \
+       -DCMAKE_INSTALL_PREFIX=%{_prefix} -DHAVE_WAYLAND=On \
        -DMAJORVER=${MAJORVER} -DFULLVER=%{version}
+%else
+%cmake . \
+       -DCMAKE_INSTALL_PREFIX=%{_prefix} -DHAVE_X11=On \
+       -DMAJORVER=${MAJORVER} -DFULLVER=%{version}
+%endif
 make %{?jobs:-j%jobs}
 
 %install