Skip to content

Commit

Permalink
[AITT] find library using pkgconfig
Browse files Browse the repository at this point in the history
Use pkgconfig to find AITT library.

Signed-off-by: Jaeyun Jung <[email protected]>
  • Loading branch information
jaeyun-jung authored and again4you committed Dec 6, 2023
1 parent ef28883 commit ded7b09
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}")

Expand Down

0 comments on commit ded7b09

Please sign in to comment.