CMakeLists.txt 548 B

1234567891011121314151617181920
  1. # 指定头文件搜索目录
  2. set(SYSTEM_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/include)
  3. # 指定源文件路径
  4. set(SYSTEM_SOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/source)
  5. set(${CMAKE_C_FLAGS} -lpthread)
  6. include_directories(${SYSTEM_INCLUDE_PATH})
  7. include_directories(${MQTT_INCLUDE_PATH})
  8. foreach(FOREACH_SRC_DIR ${SYSTEM_SOURCE_PATH})
  9. aux_source_directory(${SYSTEM_SOURCE_PATH} SRC)
  10. endforeach()
  11. add_executable(${EXENAME} ${SRC})
  12. target_link_libraries(${EXENAME} ${LIB_SYSTEM_MQTT})
  13. target_link_libraries(${EXENAME} pthread-0.9.33.2)