How to Make cURL works with cmake
来源:互联网 发布:知乎关注排行 编辑:程序博客网 时间:2024/05/18 22:39
How to Make cURL works with cmake
Recently, I want to learn cURL, so downloaded it and compiled it, and use
cmake to manage the project, I wrote a CMakelists.txt as below:
But it did not work, and cmake reported that it can not find cURL, I met
this situation before, so I set the environment variable for cmake like this:
set LIBCURL_ROOT= "cURL's path"
But it did not work neither, and I was confused, what was wrong with me, and
how could I make it works?
So I configured the environment variable CPLUS_INCLUDE_PATH to libcurl's
path, it did not work neither.
Finally, I open the file FindCURL.cmake and check content, I found that the
content didn't point the path of libcurl out, so I modified sentence in
FindCURL.cmake:
to
and the sentece in FindCURL.cmake
to
and run:
cmkae .. -G "MinGW Makefiles", it worked.
The conclution:
1. don't trust the libraries so much.
2. think more.
Recently, I want to learn cURL, so downloaded it and compiled it, and use
cmake to manage the project, I wrote a CMakelists.txt as below:
cmake_minimum_required(VERSION 2.8)project(curlTest)find_package(CURL REQUIRED)include_directories(${CURL_INCLUDE_DIR})set(sources appMain.cpp)add_executable(curlTest ${sources})target_link_libraries(curlTest ${CURL_LIBRIRIES})
But it did not work, and cmake reported that it can not find cURL, I met
this situation before, so I set the environment variable for cmake like this:
set LIBCURL_ROOT= "cURL's path"
But it did not work neither, and I was confused, what was wrong with me, and
how could I make it works?
So I configured the environment variable CPLUS_INCLUDE_PATH to libcurl's
path, it did not work neither.
Finally, I open the file FindCURL.cmake and check content, I found that the
content didn't point the path of libcurl out, so I modified sentence in
FindCURL.cmake:
find_path(CURL_INCLUDE_DIR NAMES curl/curl.h)
to
find_path(CURL_INCLUDE_DIR NAMES curl/curl.h PATHS $ENV{LIBCURL_ROOT}/include)
and the sentece in FindCURL.cmake
find_library(CURL_LIBRARY NAMES curl # Windows MSVC prebuilts: curllib libcurl_imp curllib_static # Windows older "Win32 - MSVC" prebuilts (libcurl.lib, e.g. libcurl-7.15.5-win32-msvc.zip): libcurl)
to
and run:
cmkae .. -G "MinGW Makefiles", it worked.
The conclution:
1. don't trust the libraries so much.
2. think more.
0 0
- How to Make cURL works with cmake
- How to make sexy buttons with CSS
- How to post JSON to PHP with curl
- 网易云课堂 - Class Two and Three - How to make your works professional.
- [U-Boot] How make xxx_config works?
- [U-Boot] How make xxx_config works?
- how to make one bootable USB stick with OpenSolaris 2008.05
- How to Make Money Online with eBay, Yahoo!, and Google
- How To Make A Simple iPhone Game with Cocos2D Tutorial
- How To Make a Tile Based Game with Cocos2D
- How To Make A Simple iPhone Game with Cocos2D Tutorial
- How to Make a AutoBuild System with Git Server
- How To Make A Simple Android Game with Cocos2D
- How to make transparent bridge with Slackware Linux.
- How To Make Game Art With A Distinctive Style
- How To Make a Simple iPhone Game with Flash CS5
- Magical Record: how to make programming with Core Data pleasant
- How to make a simple login system with PHP
- 动态规划:从入门到专家
- ubuntu 14.04中安装phpmyadmin即mysql图形管理界面
- 远程service下载,使用aidl,队列下载Client端
- Visual Studio 2013开发 mini-filter driver step by step (3) - 查看运行结果
- 【leetcode】unique-binary-search-trees
- How to Make cURL works with cmake
- 如何查看自己电脑的CPU是几核
- AVL树的旋转
- 关于BIOS加载BOOT.S的经典解答
- Hadoop MapReduce纵表转横表 与 横表转纵表
- 07、发布项目到nexus
- 『ANDROID』Android中的onWindowFocusChanged()方法详解
- 线段树+扫描线
- Big Event in HDU