mirror of
https://gitlab.com/prpl-foundation/prplmesh/prplMesh.git
synced 2025-12-20 01:21:22 +08:00
For proper integration with build systems (OpenWrt and RDK-B) it is much easier if we can build all of prplMesh in a single go with cmake, without need for maptools.py to build all components. Add a top-level CMakeLists.txt. For the time being, it only builds the framework. The helper files move from framework/cmake to the top level. Update maptools build.py to build the top-level instead of the framework component. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
25 lines
767 B
CMake
25 lines
767 B
CMake
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(JSONC json-c REQUIRED)
|
|
|
|
find_library(JSONC_LIBRARY "${JSONC_LIBRARIES}")
|
|
if(NOT JSONC_LIBRARY)
|
|
message(FATAL_ERROR "libjson-c not found!")
|
|
endif()
|
|
|
|
add_library(json-c UNKNOWN IMPORTED)
|
|
|
|
# Workaround in case pkg-config finds json-c in the build server instead of the cross compiled toolchain -
|
|
# For cross compile, we include all the staging_dir/usr/include so we don't need to explicitely include json-c dirs.
|
|
if (TARGET_PLATFORM STREQUAL "linux")
|
|
# Include directory
|
|
set_target_properties(json-c PROPERTIES
|
|
INTERFACE_INCLUDE_DIRECTORIES "${JSONC_INCLUDE_DIRS}"
|
|
)
|
|
endif()
|
|
|
|
# Library
|
|
set_target_properties(json-c PROPERTIES
|
|
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
|
IMPORTED_LOCATION "${JSONC_LIBRARY}"
|
|
) |