| # |
| # chl (Marvell Connection Handling Layer) project cmake |
| ################################### |
| |
| cmake_minimum_required(VERSION 2.6) |
| |
| PROJECT(CHL_AGENT) |
| |
| ADD_DEFINITIONS(-Os -ggdb -Wall -Werror --std=gnu99 -Wmissing-declarations -DMARVELL_EXTENDED) |
| |
| SET_DIRECTORY_PROPERTIES(PROPERTIES |
| ADDITIONAL_MAKE_CLEAN_FILES "Makefile;ipkg-install;ipkg-pxa1826;Makefile;CMakeCache.txt;CMakeFiles;cmake_install.cmake;install_manifest.txt;") |
| |
| # find necessary libraries |
| INCLUDE(CheckLibraryExists) |
| |
| CHECK_LIBRARY_EXISTS(log __android_log_buf_write "" CHL_LOGCAT) |
| IF(CHL_AGENT_LOGCAT) |
| LIST(APPEND LIBS log) |
| ENDIF(CHL_AGENT_LOGCAT) |
| |
| find_library(json NAMES json-c json) |
| LIST(APPEND LIBS ubox ubus uci ${json} blobmsg_json log ml_utils) |
| |
| # define sources and linked libraries |
| SET(SOURCES chl_agent_ubus.c chl_agent_uci.c chl_agent.c) |
| |
| # create and install executable |
| ADD_EXECUTABLE(chl_agent ${SOURCES}) |
| TARGET_LINK_LIBRARIES(chl_agent ${LIBS}) |
| INSTALL(TARGETS chl_agent RUNTIME DESTINATION bin) |