From ded7b09e3114ad6e8451823b827819fe3fc72304 Mon Sep 17 00:00:00 2001 From: Jaeyun Jung Date: Mon, 4 Dec 2023 18:15:37 +0900 Subject: [PATCH] [AITT] find library using pkgconfig Use pkgconfig to find AITT library. Signed-off-by: Jaeyun Jung --- CMakeLists.txt | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5627b66..632f7f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,8 +58,15 @@ IF(ENABLE_TIZEN) SET(REQUIRE_PKGS "${REQUIRE_PKGS} dlog") ENDIF() +# AITT Library +IF(AITT_SUPPORT) + SET(REQUIRE_PKGS "${REQUIRE_PKGS} aitt") + SET(NNS_EDGE_FLAGS "${NNS_EDGE_FLAGS} -DENABLE_AITT=1") +ENDIF() + IF(NOT ${REQUIRE_PKGS} STREQUAL "") PKG_CHECK_MODULES(EDGE_REQUIRE_PKGS REQUIRED ${REQUIRE_PKGS}) + ADD_DEFINITIONS(${EDGE_REQUIRE_PKGS_CFLAGS}) ENDIF() # MQTT Library @@ -86,18 +93,6 @@ IF(MQTT_SUPPORT) SET(NNS_EDGE_FLAGS "${NNS_EDGE_FLAGS} -DENABLE_MQTT=1") ENDIF() -# AITT Library -IF(AITT_SUPPORT) - FIND_LIBRARY(AITT_LIB NAMES aitt) - IF(NOT AITT_LIB) - MESSAGE(FATAL_ERROR "Cannot find AITT library.") - ELSE() - MESSAGE("Found AITT library.") - SET(NNS_EDGE_FLAGS "${NNS_EDGE_FLAGS} -DENABLE_AITT=1") - SET(AITT_INCLUDE_DIR ${PREFIX}/include/aitt) - ENDIF() -ENDIF() - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NNS_EDGE_FLAGS}") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${NNS_EDGE_FLAGS}")