From 33e3a51a433d042e845531e86afed1dde62e3fc0 Mon Sep 17 00:00:00 2001 From: Youngjae Cho Date: Mon, 17 Jul 2023 11:13:49 +0900 Subject: [PATCH] Add include directory to collect header file It is collected and installed automatically just by creating header file in include directory. Change-Id: Ia411edd7101afbb49097229986965eff5b175519 Signed-off-by: Youngjae Cho --- CMakeLists.txt | 19 ++----------------- {src/libcommon => include/libsyscommon}/bitmap.h | 0 {src/libcommon => include/libsyscommon}/common.h | 0 .../libsyscommon}/dbus-iface-system.h | 0 {src/libcommon => include/libsyscommon}/file.h | 0 {src/libcommon => include/libsyscommon}/ini-parser.h | 0 {src/libgdbus => include/libsyscommon}/libgdbus.h | 0 {src/libsystemd => include/libsyscommon}/libsystemd.h | 0 {src/libcommon => include/libsyscommon}/list.h | 0 .../libsyscommon}/resource-device.h | 0 .../libsyscommon}/resource-listener.h | 0 .../libsyscommon}/resource-manager.h | 0 .../libsyscommon}/resource-type.h | 0 src/libcommon/bitmap.c | 2 +- src/libcommon/common.c | 2 +- src/libcommon/file.c | 2 +- src/libcommon/ini-parser.c | 2 +- src/libgdbus/libgdbus.c | 2 +- src/libsystemd/libsystemd.c | 2 +- src/resource-manager/resource-device.c | 2 +- src/resource-manager/resource-listener-epoll.c | 4 ++-- src/resource-manager/resource-manager.c | 4 ++-- tests/libcommon/test-common.c | 8 ++++---- 23 files changed, 17 insertions(+), 32 deletions(-) rename {src/libcommon => include/libsyscommon}/bitmap.h (100%) rename {src/libcommon => include/libsyscommon}/common.h (100%) rename {src/libgdbus => include/libsyscommon}/dbus-iface-system.h (100%) rename {src/libcommon => include/libsyscommon}/file.h (100%) rename {src/libcommon => include/libsyscommon}/ini-parser.h (100%) rename {src/libgdbus => include/libsyscommon}/libgdbus.h (100%) rename {src/libsystemd => include/libsyscommon}/libsystemd.h (100%) rename {src/libcommon => include/libsyscommon}/list.h (100%) rename {src/resource-manager => include/libsyscommon}/resource-device.h (100%) rename {src/resource-manager => include/libsyscommon}/resource-listener.h (100%) rename {src/resource-manager => include/libsyscommon}/resource-manager.h (100%) rename {src/resource-manager => include/libsyscommon}/resource-type.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index a06a977..7d0a82d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,7 @@ PROJECT(libsyscommon C) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/src) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/src/shared) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) ADD_SUBDIRECTORY(src/plugin-api/common) ADD_SUBDIRECTORY(src/plugin-api/resourced) ADD_SUBDIRECTORY(src/plugin-api/deviced) @@ -25,20 +26,6 @@ SET(libsyscommon_SRCS src/resource-manager/resource-device.c src/resource-manager/resource-listener-epoll.c ) -SET(HEADERS - src/libgdbus/libgdbus.h - src/libgdbus/dbus-iface-system.h - src/libsystemd/libsystemd.h - src/libcommon/list.h - src/libcommon/ini-parser.h - src/libcommon/file.h - src/libcommon/bitmap.h - src/libcommon/common.h - src/resource-manager/resource-manager.h - src/resource-manager/resource-type.h - src/resource-manager/resource-device.h - src/resource-manager/resource-listener.h -) # CHECK PKG INCLUDE(FindPkgConfig) @@ -79,8 +66,6 @@ CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) # HEADER -FOREACH(hfile ${HEADERS}) - INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${hfile} DESTINATION include/${PROJECT_NAME}) -ENDFOREACH(hfile) +INSTALL(DIRECTORY include/libsyscommon DESTINATION include) ADD_SUBDIRECTORY(tests) diff --git a/src/libcommon/bitmap.h b/include/libsyscommon/bitmap.h similarity index 100% rename from src/libcommon/bitmap.h rename to include/libsyscommon/bitmap.h diff --git a/src/libcommon/common.h b/include/libsyscommon/common.h similarity index 100% rename from src/libcommon/common.h rename to include/libsyscommon/common.h diff --git a/src/libgdbus/dbus-iface-system.h b/include/libsyscommon/dbus-iface-system.h similarity index 100% rename from src/libgdbus/dbus-iface-system.h rename to include/libsyscommon/dbus-iface-system.h diff --git a/src/libcommon/file.h b/include/libsyscommon/file.h similarity index 100% rename from src/libcommon/file.h rename to include/libsyscommon/file.h diff --git a/src/libcommon/ini-parser.h b/include/libsyscommon/ini-parser.h similarity index 100% rename from src/libcommon/ini-parser.h rename to include/libsyscommon/ini-parser.h diff --git a/src/libgdbus/libgdbus.h b/include/libsyscommon/libgdbus.h similarity index 100% rename from src/libgdbus/libgdbus.h rename to include/libsyscommon/libgdbus.h diff --git a/src/libsystemd/libsystemd.h b/include/libsyscommon/libsystemd.h similarity index 100% rename from src/libsystemd/libsystemd.h rename to include/libsyscommon/libsystemd.h diff --git a/src/libcommon/list.h b/include/libsyscommon/list.h similarity index 100% rename from src/libcommon/list.h rename to include/libsyscommon/list.h diff --git a/src/resource-manager/resource-device.h b/include/libsyscommon/resource-device.h similarity index 100% rename from src/resource-manager/resource-device.h rename to include/libsyscommon/resource-device.h diff --git a/src/resource-manager/resource-listener.h b/include/libsyscommon/resource-listener.h similarity index 100% rename from src/resource-manager/resource-listener.h rename to include/libsyscommon/resource-listener.h diff --git a/src/resource-manager/resource-manager.h b/include/libsyscommon/resource-manager.h similarity index 100% rename from src/resource-manager/resource-manager.h rename to include/libsyscommon/resource-manager.h diff --git a/src/resource-manager/resource-type.h b/include/libsyscommon/resource-type.h similarity index 100% rename from src/resource-manager/resource-type.h rename to include/libsyscommon/resource-type.h diff --git a/src/libcommon/bitmap.c b/src/libcommon/bitmap.c index 07a7117..849ca15 100644 --- a/src/libcommon/bitmap.c +++ b/src/libcommon/bitmap.c @@ -24,7 +24,7 @@ #include #include -#include "bitmap.h" +#include "libsyscommon/bitmap.h" #include "shared/log.h" /** diff --git a/src/libcommon/common.c b/src/libcommon/common.c index 50cdee6..051f8bb 100644 --- a/src/libcommon/common.c +++ b/src/libcommon/common.c @@ -26,7 +26,7 @@ #include #include #include "shared/log.h" -#include "common.h" +#include "libsyscommon/common.h" #define FEATURE_MODEL_NAME "http://tizen.org/system/model_name" #define FEATURE_MODEL_NAME_EMULATOR "Emulator" diff --git a/src/libcommon/file.c b/src/libcommon/file.c index e0a3b29..c2f579d 100644 --- a/src/libcommon/file.c +++ b/src/libcommon/file.c @@ -27,7 +27,7 @@ #include #include -#include "file.h" +#include "libsyscommon/file.h" #define SHARED_H_BUF_MAX 255 diff --git a/src/libcommon/ini-parser.c b/src/libcommon/ini-parser.c index e8e2bce..19355d2 100644 --- a/src/libcommon/ini-parser.c +++ b/src/libcommon/ini-parser.c @@ -23,7 +23,7 @@ #include #include #include -#include "ini-parser.h" +#include "libsyscommon/ini-parser.h" #include "shared/log.h" diff --git a/src/libgdbus/libgdbus.c b/src/libgdbus/libgdbus.c index 248bb67..d206064 100644 --- a/src/libgdbus/libgdbus.c +++ b/src/libgdbus/libgdbus.c @@ -28,7 +28,7 @@ #include #include "shared/log.h" -#include "libgdbus.h" +#include "libsyscommon/libgdbus.h" /* 10 seconds */ #define DBUS_REPLY_TIMEOUT (10000) diff --git a/src/libsystemd/libsystemd.c b/src/libsystemd/libsystemd.c index 3d2fbc2..0e9725b 100644 --- a/src/libsystemd/libsystemd.c +++ b/src/libsystemd/libsystemd.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include "libsyscommon/libgdbus.h" #include "shared/log.h" diff --git a/src/resource-manager/resource-device.c b/src/resource-manager/resource-device.c index a716593..2520946 100644 --- a/src/resource-manager/resource-device.c +++ b/src/resource-manager/resource-device.c @@ -23,7 +23,7 @@ #include #include -#include "resource-device.h" +#include "libsyscommon/resource-device.h" static GList *g_resource_device_head; diff --git a/src/resource-manager/resource-listener-epoll.c b/src/resource-manager/resource-listener-epoll.c index 615c3de..ce74e8c 100644 --- a/src/resource-manager/resource-listener-epoll.c +++ b/src/resource-manager/resource-listener-epoll.c @@ -25,8 +25,8 @@ #include #include -#include "resource-manager.h" -#include "resource-listener.h" +#include "libsyscommon/resource-manager.h" +#include "libsyscommon/resource-listener.h" /* listener common */ struct listener_handle { diff --git a/src/resource-manager/resource-manager.c b/src/resource-manager/resource-manager.c index 6fd1f5e..25817ce 100644 --- a/src/resource-manager/resource-manager.c +++ b/src/resource-manager/resource-manager.c @@ -27,8 +27,8 @@ #include #include -#include "resource-manager.h" -#include "resource-type.h" +#include "libsyscommon/resource-manager.h" +#include "libsyscommon/resource-type.h" #define BIT64_INDEX(id) (63 - __builtin_clzll(id)) #define RESOURCE_ATTR_INDEX(id) BIT64_INDEX(id) diff --git a/tests/libcommon/test-common.c b/tests/libcommon/test-common.c index 3b988f9..9df8e61 100644 --- a/tests/libcommon/test-common.c +++ b/tests/libcommon/test-common.c @@ -6,10 +6,10 @@ #include #include -#include "libcommon/file.h" -#include "libcommon/list.h" -#include "libcommon/ini-parser.h" -#include "libcommon/bitmap.h" +#include "libsyscommon/file.h" +#include "libsyscommon/list.h" +#include "libsyscommon/ini-parser.h" +#include "libsyscommon/bitmap.h" #include "../test-main.h" #include "../test-mock.h" -- 2.7.4