加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CMakeLists.txt 1.31 KB
一键复制 编辑 原始数据 按行查看 历史
杰杰 提交于 2020-04-27 22:43 . set CMAKE_CXX_COMPILER to g++ ...
cmake_minimum_required(VERSION 2.8)
project(mqtt-client)
set(TARGETS "mqtt-client")
set(SUBDIRS "mqtt" "test" "platform" "network" "common" "mqttclient")
set(INCDIRS "mqtt" "platform/linux" "common" "common/log" "common/mbedtls/include" "network" "mqttclient" "test")
set(OUTDIRS "build")
set(LIBNAMES "mqtt" "platform" "network" "common" "salof" "mbedtls" "mqttclient")
set(PROJECT_ROOT_PATH "${PROJECT_SOURCE_DIR}")
set(LIBRARY_OUTPUT_PATH "${PROJECT_ROOT_PATH}/${OUTDIRS}/lib/")
set(EXECUTABLE_OUTPUT_PATH "${PROJECT_ROOT_PATH}/${OUTDIRS}/bin/")
SET(CMAKE_BUILD_TYPE "Release") # Debug Release
set(CMAKE_C_COMPILER "gcc")
set(CMAKE_CXX_COMPILER "g++" )
set(CMAKE_C_FLAGS "-Wall")
set(CMAKE_C_FLAGS "-lpthread")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -O0 -g -ggdb")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3 -DNDEBUG")
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "-std=c++11")
set(CMAKE_CXX_FLAGS "-lpthread")
set(CMAKE_CXX_FLAGS "-Wall")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -O0 -g -ggdb")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3")
endif(CMAKE_COMPILER_IS_GNUCXX)
foreach(incdir ${INCDIRS})
include_directories(${incdir})
endforeach()
foreach(subdir ${SUBDIRS})
add_subdirectory(${PROJECT_ROOT_PATH}/${subdir})
endforeach()
link_directories(${LIBRARY_OUTPUT_PATH})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化