代码拉取完成,页面将自动刷新
cmake_minimum_required(VERSION 2.6)
project(muduo-lua CXX)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "debug")
endif()
if(NOT MUDUO_PATH)
set(MUDUO_PATH "$ENV{HOME}/build/${CMAKE_BUILD_TYPE}-install")
endif()
set(CXX_FLAGS
-g
# -DVALGRIND
# -DMUDUO_STD_STRING
-DLUA_COMPAT_ALL
-DLUA_USE_LINUX
-Wall
-Wextra
# -m32
-Werror
-Wconversion
-Wno-unused-parameter
-Wold-style-cast
-Woverloaded-virtual
-Wpointer-arith
-Wshadow
-Wwrite-strings
-march=native
# -MMD
# -std=c++0x
-rdynamic
)
string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CXX_FLAGS}")
# set(CMAKE_CXX_COMPILER "g++")
set(CMAKE_CXX_FLAGS_DEBUG "-O0")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
find_path(Muduo_INCLUDE_DIR muduo "${MUDUO_PATH}/include")
find_path(Muduo_LIBRARY_DIR libmuduo_net.a "${MUDUO_PATH}/lib")
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${Muduo_LIBRARY_DIR})
message(STATUS ${Muduo_INCLUDE_DIR})
message(STATUS ${Muduo_LIBRARY_DIR})
include_directories(${Muduo_INCLUDE_DIR})
find_library(muduo_base muduo_base)
find_library(muduo_net muduo_net)
find_library(muduo_http muduo_http)
find_library(muduo_inspect muduo_inspect)
message(STATUS ${muduo_base})
message(STATUS ${muduo_net})
find_package(Boost REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
if (LUA_INCLUDE_DIR AND LUA_LIBRARY)
message(STATUS "Use Lua in ${LUA_INCLUDE_DIR}")
set(LUA_LIBRARIES "${LUA_LIBRARY}")
message(STATUS "Lua libraries: ${LUA_LIBRARIES}")
else()
# TODO: if not found, build our own ?
find_package(Lua REQUIRED)
message(STATUS "Found Lua ${LUA_VERSION_STRING} in ${LUA_INCLUDE_DIR}")
message(STATUS "Lua libraries: ${LUA_LIBRARIES}")
endif()
include_directories(${LUA_INCLUDE_DIR})
include_directories(${PROJECT_SOURCE_DIR})
add_subdirectory(hello)
add_subdirectory(world)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。