include(FindPkgConfig)
include(GNUInstallDirs)
+pkg_check_modules(TIZEN_PKG QUIET capi-system-info)
+if(TIZEN_PKG_FOUND)
+ set(IS_TIZEN ON)
+else()
+ set(IS_TIZEN OFF)
+ add_compile_definitions("MV_CONFIG_PATH=\"${PROJECT_SOURCE_DIR}/\"")
+endif()
+
add_subdirectory(mv_common)
+if(NOT ${IS_TIZEN})
+ return()
+endif()
+
add_subdirectory(mv_machine_learning)
add_subdirectory(mv_barcode)
add_subdirectory(mv_image)
project(${MV_COMMON_LIB_NAME})
cmake_minimum_required(VERSION 3.13)
-file(GLOB MV_COMMON_SRC_LIST "${PROJECT_SOURCE_DIR}/src/*.cpp")
-
find_package(OpenCV REQUIRED imgproc)
if(NOT OpenCV_FOUND)
message(SEND_ERROR "Failed to find OpenCV")
return()
endif()
-pkg_check_modules(${PROJECT_NAME}_DEP REQUIRED json-glib-1.0 capi-system-info capi-media-tool dlog)
-
+set(MV_COMMON_SRC_LIST
+ src/CommonUtils.cpp src/EngineConfig.cpp src/MediaSource.cpp src/mv_common.cpp)
add_library(${PROJECT_NAME} SHARED ${MV_COMMON_SRC_LIST})
+
+set(MV_COMMON_DEP json-glib-1.0 dlog capi-media-tool)
+
+if(${IS_TIZEN})
+ list(APPEND MV_COMMON_DEP capi-system-info)
+ target_sources(${PROJECT_NAME} PRIVATE src/tizen/mv_feature_key.cpp)
+ target_compile_options(${PROJECT_NAME} PRIVATE -Werror)
+else()
+ target_sources(${PROJECT_NAME} PRIVATE src/mv_feature_key.cpp)
+endif()
+
+pkg_check_modules(${PROJECT_NAME}_DEP REQUIRED ${MV_COMMON_DEP})
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS} ${${PROJECT_NAME}_DEP_LIBRARIES})
target_include_directories(${PROJECT_NAME} PUBLIC include ${${PROJECT_NAME}_DEP_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/include)
-target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Werror)
+target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra)
install(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})
install(
DIRECTORY ${PROJECT_SOURCE_DIR}/../include/ DESTINATION include/media
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd All Rights Reserved
+ * 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.
*/
#include "mv_feature_key.h"
-#include <system_info.h>
bool mv_check_feature_key(const char *keys[], size_t num_keys, bool at_least_one)
{
- bool or_result = false;
- for (size_t i = 0; i < num_keys; i++) {
- bool supported = false;
-
- if (system_info_get_platform_bool(keys[i], &supported)) {
- return false;
- }
-
- or_result |= supported;
- if (!supported && !at_least_one)
- return false;
- }
-
- return or_result;
+ return true;
}
--- /dev/null
+/*
+ * Copyright (c) 2023 - 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 "mv_feature_key.h"
+#include <system_info.h>
+
+bool mv_check_feature_key(const char *keys[], size_t num_keys, bool at_least_one)
+{
+ bool or_result = false;
+ for (size_t i = 0; i < num_keys; i++) {
+ bool supported = false;
+
+ if (system_info_get_platform_bool(keys[i], &supported)) {
+ return false;
+ }
+
+ or_result |= supported;
+ if (!supported && !at_least_one)
+ return false;
+ }
+
+ return or_result;
+}