Ubuntu 16.04上源码编译Poco并编写cmake文件 | guide to compile and install poco cpp library on ubuntu 16.04
本文首发于个人博客https://kezunlin.me/post/281dd8cd/,欢迎阅读!
guide to compile and install poco cpp library on ubuntu 16.04
Series
- guide to compile and install poco cpp library on windows
- guide to compile and install poco cpp library on ubuntu 16.04
Guide
apt-get
install by apt-get, but we can not use find_package(Poco)
because no /usr/local/lib/cmake/Poco/PocoConfig.cmake
installed.
sudo apt-get install libpoco-doc libpoco-dev
compile from source
wget https://pocoproject.org/releases/poco-1.8.1/poco-1.8.1.tar.gz
#Install dependences
sudo apt-get install openssl libssl-dev
sudo apt-get install libiodbc2 libiodbc2-dev
sudo apt-get install libmysqlclient-dev
cd poco-1.8.1
#sudo ./configure --omit=Data/ODBC,Data/MySQL --no-tests --no-samples --shared
cd build
cmake-gui ..
sudo make -j8
sudo make install
OK. we install headers to /usr/local/include/Poco
and libraries to /usr/local/lib/
$ ls /usr/local/libPoco*.so
/usr/local/lib/libPocoFoundation.so /usr/local/lib/libPocoNet.so /usr/local/lib/libPocoXML.so
/usr/local/lib/libPocoJSON.so /usr/local/lib/libPocoUtil.so
we install cmake files to /usr/local/lib/cmake/Poco
$ ls /usr/local/lib/cmake/Poco
PocoConfig.cmake PocoJSONTargets.cmake PocoUtilTargets.cmake
PocoConfigVersion.cmake PocoJSONTargets-release.cmake PocoUtilTargets-release.cmake
PocoFoundationConfig.cmake PocoNetConfig.cmake PocoXMLConfig.cmake
PocoFoundationConfigVersion.cmake PocoNetConfigVersion.cmake PocoXMLConfigVersion.cmake
PocoFoundationTargets.cmake PocoNetTargets.cmake PocoXMLTargets.cmake
PocoFoundationTargets-release.cmake PocoNetTargets-release.cmake PocoXMLTargets-release.cmake
PocoJSONConfig.cmake PocoUtilConfig.cmake
PocoJSONConfigVersion.cmake PocoUtilConfigVersion.cmake
Example
CMakeLists.txt
cmake_minimum_required (VERSION 2.6)
project (event_demo)
enable_language(C)
enable_language(CXX)
# Always include the source and build directories in the include path.
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Set the output folder where your program will be created
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/bin)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
# Find Poco package 1.8.1
find_package(Poco REQUIRED COMPONENTS Foundation Util Net XML JSON)
# no Poco_INCLUDE_DIRS, we have to set by hand
if(MSVC) # WIN32
SET(Poco_INCLUDE_DIRS "C:/Program Files/Poco/include")
else()
SET(Poco_INCLUDE_DIRS "/usr/local/include/Poco")
endif(MSVC)
MESSAGE( [Main] " Poco_INCLUDE_DIRS = ${Poco_INCLUDE_DIRS}")
MESSAGE( [Main] " Poco_LIBRARIES = ${Poco_LIBRARIES}")
# The following folder will be included
include_directories(
${MY_SRC_INCLUDE}
${Poco_INCLUDE_DIRS}
)
link_directories(${CMAKE_BINARY_DIR})
add_executable(event_demo event_demo.cpp)
target_link_libraries(event_demo ${Poco_LIBRARIES})
Reference
- compile poco on ubuntu
- install and compile poco on ubuntu
- find poco
- FindPoco.cmake
- cmake-cannot-find-custom-module
- poco cmake
History
- 20180222: created.
Copyright
- Post author: kezunlin
- Post link: https://kezunlin.me/post/281dd8cd/
- Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 3.0 unless stating additionally.
Ubuntu 16.04上源码编译Poco并编写cmake文件 | guide to compile and install poco cpp library on ubuntu 16.04的更多相关文章
- Ubuntu 16.04上源码编译和安装pytorch教程,并编写C++ Demo CMakeLists.txt | tutorial to compile and use pytorch on ubuntu 16.04
本文首发于个人博客https://kezunlin.me/post/54e7a3d8/,欢迎阅读最新内容! tutorial to compile and use pytorch on ubuntu ...
- ubuntu 16.04上源码编译glog和gflags 编写glog-config.cmake和gflags-config.cmake | compile glog and glags on ubuntu 16.04
本文首发于个人博客https://kezunlin.me/post/977f5125/,欢迎阅读! compile glog and glags on ubuntu 16.04 Series comp ...
- ubuntu 16.04上源码编译和安装cgal并编写CMakeLists.txt | compile and install cgal on ubuntu 16.04
本文首发于个人博客https://kezunlin.me/post/39ab7ed9/,欢迎阅读最新内容! compile and install cgal on ubuntu 16.04 Guide ...
- [Windows篇] 在windows 10上源码编译gtest 并编写CMakeLists.txt
本文首发于个人博客https://kezunlin.me/post/aca50ff8/,欢迎阅读! compile gtest on windows 10 Guide compile gtest on ...
- ubuntu 16.04上源码编译dlib教程 | compile dlib on ubuntu 16.04
本文首发于个人博客https://kezunlin.me/post/c6ead512/,欢迎阅读! compile dlib on ubuntu 16.04 Series Part 1: compil ...
- ubuntu 16.04上源码编译opengv | compile opengv on ubuntu 16.04
本文首发于个人博客https://kezunlin.me/post/1e5d14ee/,欢迎阅读! compile opengv on ubuntu 16.04 Series compile open ...
- ubuntu 16.04上源码编译libjpeg-turbo和使用教程 | compile and use libjpeg-turbo on ubuntu 16.04
本文首发于个人博客https://kezunlin.me/post/9f626e7a/,欢迎阅读! compile and use libjpeg-turbo on ubuntu 16.04 Seri ...
- ubuntu 14.04上源码编译安装php7
wget https://downloads.php.net/~ab/php-7.0.0alpha2.tar.bz2 //用winscp把下载好的文件上传到网站中 tar jxf php-7.0.0a ...
- [Ubuntu篇] 在ubuntu上源码编译gtest,编写gtest-config.cmake并测试
本文首发于个人博客https://kezunlin.me/post/4a1427cf/,欢迎阅读! compile gtest on ubuntu 16.04 Guide compile gtest ...
随机推荐
- 百万年薪python之路 -- 列表
1.列表(list)-- list关键字 列表是python的基础数据类型之一,有顺序,可以切片方便取值,它是以[ ]括起来, 每个元素用' , '隔开而且可以存放各种数据类型(字符串,数字,布尔值, ...
- echarts画中国地图,省市区地图分享
中国地图 四川地图 重庆地图 源码分享: https://github.com/livelyPeng/ec-map
- NVDLA中Winograd卷积的设计
在AI芯片:高性能卷积计算中的数据复用曾提到,基于变换域的卷积计算--譬如Winograd卷积--并不能适应算法上对卷积计算多变的需求.但Winograd卷积依旧出现在刚刚公开的ARM Ethos-N ...
- 【Go】高效截取字符串的一些思考
原文链接:https://blog.thinkeridea.com/201910/go/efficient_string_truncation.html 最近我在 Go Forum 中发现了 [SOL ...
- Beetlex服务框架之Webapi版本访问控制
在应用服务中API更新是很普遍的事情,为了服务良好地运作很多时候需要新旧版本同时兼容:为了应对这一系列的需求FastHttpApi在新版中强化了Url重写机制来支持API访问版本控制,由原来固定的重写 ...
- JAVA NIO 获取udp数据报的 发送方ip
程序是通了,但是没法转发,获取不到对方ip.nio中 udp使用的是DatagramChannel ,但是SelectorKey.channel()转化之后的DatagramChannel,调用get ...
- js响应式布局
<!DOCTYPE html> <html class="mobile"> <head> <meta charset="UTF- ...
- python基础-数字类型及内置方法
--数字类型及内置方法 整型-int 用途:多用于年龄.电话.QQ号等变量 定义方法 age = 18 # age = int(18) 常用方式:多用于数学计算 # int(x)将x转换成整数,是向下 ...
- Web for pentester_writeup之Code injection篇
Web for pentester_writeup之Code injection篇 Code injection(代码注入) Example 1 <1> name=hacker' 添加一个 ...
- C语言I作业05
问题 答案 这个作业属于那个课程 C语言程序设计II 这个作业要求在哪里 https://edu.cnblogs.com/campus/zswxy/CST2019-4/homework/9772 我在 ...