1project(lws-minimal-mqtt-client C) 2cmake_minimum_required(VERSION 2.8.12) 3include(CheckCSourceCompiles) 4include(LwsCheckRequirements) 5 6set(SAMP lws-minimal-mqtt-client) 7set(SRCS minimal-mqtt-client.c) 8 9set(requirements 1) 10require_lws_config(LWS_ROLE_MQTT 1 requirements) 11require_lws_config(LWS_WITH_CLIENT 1 requirements) 12require_lws_config(LWS_WITH_SYS_STATE 1 requirements) 13 14if (requirements) 15 add_executable(${SAMP} ${SRCS}) 16 17 if (websockets_shared) 18 target_link_libraries(${SAMP} websockets_shared ${LIBWEBSOCKETS_DEP_LIBS}) 19 add_dependencies(${SAMP} websockets_shared) 20 else() 21 target_link_libraries(${SAMP} websockets ${LIBWEBSOCKETS_DEP_LIBS}) 22 endif() 23endif() 24