cmkelist 工程构建

cmkelist 工程构建
 

cmake_minimum_required(VERSION 2.8)
project(webgo)

add_definitions(-std=c++11)

aux_source_directory(src DIR_SRCS)
aux_source_directory(src/roshandler DIR_SRCS2)

file(GLOB FILES_SRC
    "src/*.h"
    "src/*.cpp"
    "src/roshandler/*.h"
    "src/roshandler/*.cpp"
    "include/*.h"
    "include/*.hpp"
    "include/uWebSockets/*.h"
    "include/uWebSockets/*.cpp"
    )

find_library(SSL_LIB
    NAMES ssl
    PATHS /usr/lib /usr/local/lib
    )
message(STATUS "${SSL_LIB}")

find_library(CRYPTO_LIB
    NAMES crypto
    PATHS /usr/lib /usr/local/lib
    )
message(STATUS "${CRYPTO_LIB}")

find_library(PTHREAD_LIB
    NAMES pthread
    PATHS /usr/lib /usr/local/lib
    )
message(STATUS "${PTHREAD_LIB}")

find_library(BOOST_SYSTEM_LIB
    NAMES boost_system
    PATHS /usr/lib /usr/local/lib
    )
message(STATUS "${BOOST_SYSTEM_LIB}")

find_library(ZLIB_LIB
    NAMES z
    PATHS /usr/lib /usr/local/lib
    )
message(STATUS "${ZLIB_LIB}")

find_library(HIREDIS_LIB
    NAMES hiredis
    PATHS /usr/lib /usr/local/lib
    )
message(STATUS "${HIREDIS_LIB}")

# 添加第三方的库
set(INC_DIR ${PROJECT_SOURCE_DIR}/include)
set(LINK_DIR ${PROJECT_SOURCE_DIR}/libs)

set(ROS_DIRS "/opt/ros/kinetic")

include_directories(
  ${INC_DIR}
  ${ROS_DIRS}/include
  ${PROJECT_SOURCE_DIR}/include
  ~/dashgo_ws/devel/include
)

message(STATUS "${ROS_DIRS}")


link_directories(
    ${LINK_DIR}
    ${ROS_DIRS}/lib
    )

link_libraries(
    uWS
    ${SSL_LIB}
    ${CRYPTO_LIB}
    ${PTHREAD_LIB}
    ${BOOST_SYSTEM_LIB}
    ${ZLIB_LIB}
    rosconsole
    roscpp
    roscpp_serialization
    rostime
    boost_thread
    ${HIREDIS_LIB}
    )

add_executable(${PROJECT_NAME} main.cpp ${DIR_SRCS} ${DIR_SRCS2})

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值