-PROJECT("singleo_log")
-CMAKE_MINIMUM_REQUIRED(VERSION 3.13)
+SET(LOG_DIRECTORY ${ROOT_DIRECTORY}/log)
if (${PLATFORM_IS_TIZEN})
- FILE(GLOB SINGLEO_SERVICE_OD_SOURCE_FILES "${PROJECT_SOURCE_DIR}/tizen/*.cpp")
+ SET(SINGLEO_SERVICE_SOURCE_FILES ${SINGLEO_SERVICE_SOURCE_FILES} ${LOG_DIRECTORY}/tizen/SingleoLogBackend.cpp)
else()
- FILE(GLOB SINGLEO_SERVICE_OD_SOURCE_FILES "${PROJECT_SOURCE_DIR}/src/*.cpp")
+ SET(SINGLEO_SERVICE_SOURCE_FILES ${SINGLEO_SERVICE_SOURCE_FILES} ${LOG_DIRECTORY}/src/SingleoLogBackend.cpp)
endif()
-ADD_LIBRARY(${PROJECT_NAME} SHARED ${SINGLEO_SERVICE_OD_SOURCE_FILES})
+LIST(APPEND LOG_HEADER_LIST ${LOG_HEADER_LIST} ${LOG_DIRECTORY}/include)
if (${PLATFORM_IS_TIZEN})
- TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} PRIVATE include /usr/include/dlog)
-else()
- TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} PRIVATE include)
-endif()
-
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})
\ No newline at end of file
+ LIST(APPEND LOG_HEADER_LIST ${LOG_HEADER_LIST} /usr/include/dlog)
+ LIST(APPEND LOG_LIBRARY_LIST ${LOG_LIBRARY_LIST} dlog)
+endif()
\ No newline at end of file
+++ /dev/null
-/**
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <iostream>
-#include "SingleoLogBackend.h"
-
-using namespace std;
-
-SingleoLogType singleoCurrentLogLevel = SingleoLogType::ERROR;
-
-void singleo_log_output(SingleoLogType level, const char *format, ...)
-{
- if (level > singleoCurrentLogLevel)
- return;
-
- va_list args;
- va_start(args, format);
-
- int size = vsnprintf(nullptr, 0, format, args);
- va_end(args);
-
- string buffer(size + 1, '\0');
-
- va_start(args, format);
- vsnprintf(&buffer[0], buffer.size(), format, args);
- va_end(args);
-
- cout << buffer << endl;
-}
-
-void setSingleoLogLevel(SingleoLogType level)
-{
- singleoCurrentLogLevel = level;
-}
--- /dev/null
+/**
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <iostream>
+#include "SingleoLogBackend.h"
+
+using namespace std;
+
+SingleoLogType singleoCurrentLogLevel = SingleoLogType::ERROR;
+
+void singleo_log_output(SingleoLogType level, const char *format, ...)
+{
+ if (level > singleoCurrentLogLevel)
+ return;
+
+ va_list args;
+ va_start(args, format);
+
+ int size = vsnprintf(nullptr, 0, format, args);
+ va_end(args);
+
+ string buffer(size + 1, '\0');
+
+ va_start(args, format);
+ vsnprintf(&buffer[0], buffer.size(), format, args);
+ va_end(args);
+
+ cout << buffer << endl;
+}
+
+void setSingleoLogLevel(SingleoLogType level)
+{
+ singleoCurrentLogLevel = level;
+}
%files devel
%{_libdir}/pkgconfig/*.pc
-%{_libdir}/libsingleo_log.so
%{_libdir}/libsingleo_service.so
%{_libdir}/libsingleo_visualizer.so
"${PROJECT_SOURCE_DIR}/src/*.cpp"
"${PROJECT_SOURCE_DIR}/common/src/*.cpp")
+INCLUDE(${ROOT_DIRECTORY}/log/CMakeLists.txt)
INCLUDE(${ROOT_DIRECTORY}/input/CMakeLists.txt)
INCLUDE(${ROOT_DIRECTORY}/inference/CMakeLists.txt)
ADD_LIBRARY(${PROJECT_NAME} SHARED ${SINGLEO_SERVICE_SOURCE_FILES})
-TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} PRIVATE include common/include ${ROOT_DIRECTORY}/capi/ ${ROOT_DIRECTORY}/log/include ${ROOT_DIRECTORY}/common/include ${INPUT_HEADER_LIST} ${INFERENCE_HEADER_LIST} ${SERVICE_HEADER_LIST})
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} PRIVATE opencv_core opencv_imgcodecs opencv_highgui opencv_videoio singleo_log ${INFERENCE_LIBRARY_LIST} ${SERVICE_LIBRARY_LIST})
+TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} PRIVATE include common/include ${ROOT_DIRECTORY}/capi/ ${ROOT_DIRECTORY}/common/include ${INPUT_HEADER_LIST} ${INFERENCE_HEADER_LIST} ${SERVICE_HEADER_LIST} ${LOG_HEADER_LIST})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} PRIVATE opencv_core opencv_imgcodecs opencv_highgui opencv_videoio ${INFERENCE_LIBRARY_LIST} ${SERVICE_LIBRARY_LIST} ${LOG_LIBRARY_LIST})
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})
\ No newline at end of file
../common/include
../log/include)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${${PROJECT_NAME}_DEP_LIBRARIES}
- ${OpenCV_LIBS} singleo_log)
+ ${OpenCV_LIBS})
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})