Win7 + VS2015 + CMake3.6.1-GUI + Makefile 编译开源库
CMake生成Unicode版本VC工程
Just add this line in your top CMakeLists.txt file:
add_definitions(-DUNICODE -D_UNICODE)
if(MSVC)
add_definitions(-DUNICODE -D_UNICODE)
endif()
基本配置
配置生成库输出目录 ExportDir=F:\Develop\bin\x64
Add Entry:
CMAKE_INSTALL_PREFIX F:\Develop\bin\x64\xxx
# Only enable release and debug builds
IF(CMAKE_CONFIGURATION_TYPES)
SET(CMAKE_CONFIGURATION_TYPES Release Debug )
SET(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING
"Reset the configurations to what we need"
FORCE)
ENDIF()
if(MSVC)
set(CMAKE_DEBUG_POSTFIX "d")
endif()
zlib-1.2.8
修改CMakeLists.txt, 加入字符编码
if(MSVC)
add_definitions(-DUNICODE -D_UNICODE)
endif()
配置CMAKE_INSTALL_PREFIX参数, 指定头文件及编译包Install目录. ($(ExportDir)\zlib-1.2.8)
Config –> Generate
打开zlib.sln进行批生成
OpenSSL-1.0.2k
1. 编译 见《INSTALL.W64》 To build for Win64/x64
32 $ perl Configure VC-WIN32 no-asm --prefix=$(ExportDir)\OpenSSL-1.0.2
64 $ perl Configure VC-WIN64A no-asm --prefix=$(ExportDir)\OpenSSL-1.0.2
> perl Configure VC-WIN64A no-asm --prefix=F:\Develop\bin\x64\OpenSSL-1.0.2
> ms\do_win64a
> nmake -f ms\ntdll.mak
> nmake -f ms\ntdll.mak install
> cd out32dll
> ..\ms\test
2. 环境变量设置
OPENSSL_BASE = $(ExportDir)\OpenSSL-1.0.2
OPENSSL_ROOT_DIR = $(ExportDir)\OpenSSL-1.0.2
3. 包含目录
$(OPENSSL_BASE)\include;
4. 库目录
$(OPENSSL_BASE)\lib;
5. 库文件
libeay32.lib;ssleay32.lib;
OpenSSL-1.1.0b
1. 编译 (Win64默认为 UNICODE, 不需要加 -DUNICODE -D_UNICODE)
32 $ perl Configure VC-WIN32 no-asm --prefix=$(ExportDir)\OpenSSL-1.1
64 $ perl Configure VC-WIN64A no-asm --prefix=$(ExportDir)\OpenSSL-1.1
perl Configure VC-WIN64A no-asm --prefix=F:\Develop\bin\x64\OpenSSL-1.1
$ nmake
$ nmake test
$ nmake install
2. 环境变量设置
OPENSSL_BASE = $(ExportDir)\OpenSSL
OPENSSL_ROOT_DIR = $(ExportDir)\OpenSSL
3. 包含目录
$(OPENSSL_BASE)\include;
4. 库目录
$(OPENSSL_BASE)\lib;
5. 库文件
libcrypto.lib;libssl.lib;
libpng-1.6.28
配置CMAKE_INSTALL_PREFIX参数, 指定头文件及编译包Install目录. ($(ExportDir)\jpeg-9b)
F:\Develop\bin\x64\libpng-1.6.28
ZLIB_INCLUDE_DIR
ZLIB_LIBRARY_DEBUG
ZLIB_LIBRARY_RELEASE
ld-version-script OFF
PNG_TESTS
Config –> Generate
打开zlib.sln进行批生成
jpeg-9b
方式1: 使用CMakeLists.txt
配置CMAKE_INSTALL_PREFIX参数, 指定头文件及编译包Install目录. ($(ExportDir)\libpng-1.6.28)
F:\Develop\bin\x64\jpeg-9b
LIBJPEG_SOURCE_DIR F:/Develop/libs/jpeg-9b
方式2:
0. 把Win32.mak(C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include\Win32.Mak)拷贝到源文件目录
1. Open the command prompt, change to the main directory and execute the command line
NMAKE /f makefile.vc setup-v10
This will move jconfig.vc to jconfig.h and makefiles to project files.
(Note that the renaming is critical!)
2. Open the solution file jpeg.sln, build the library project.
(If you are using Visual Studio more recent than 2010 (v10), you'll
probably get a message saying that the project files are being updated.)
3. Open the solution file apps.sln, build the application projects.
4. To perform the self-test, execute the command line
NMAKE /f makefile.vc test-build
5. Move the application .exe files from `app`\Release to an
appropriate location on your path.
tiff-4.0.7
配置CMAKE_INSTALL_PREFIX参数, ($(ExportDir)\tiff-4.0.7)
F:\Develop\bin\x64\tiff-4.0.7
配置zlib, jpeg
freetype-2.7
配置CMAKE_INSTALL_PREFIX参数, ($(ExportDir)\freetype-2.7)
F:\Develop\bin\x64\freetype-2.7
配置zlib
giflib-5.1.4
配置CMAKE_INSTALL_PREFIX参数, ($(ExportDir)\giflib-5.1.4)
F:\Develop\bin\x64\giflib-5.1.4
配置GIFLIB_SOURCE_DIR
minizip
配置CMAKE_INSTALL_PREFIX参数, ($(ExportDir)\minizip)
F:\Develop\bin\x64\minizip
ZLIB_ROOT F:\Develop\bin\x64\zlib-1.2.8
glut
配置CMAKE_INSTALL_PREFIX参数, ($(ExportDir)\glut)
F:\Develop\bin\x64\glut
GLUT_SOURCE_DIR F:\Develop\GitRepos\OpenSceneGraph3rdParty\glut
libssh2-1.8.0
修改CMakeLists.txt, 加入字符编码
if(MSVC)
add_definitions(-DUNICODE -D_UNICODE)
endif()
配置CMAKE_INSTALL_PREFIX参数, 指定头文件及编译包Install目录. ($(ExportDir)\libssh2-1.8)
F:\Develop\bin\x64\libssh2-1.8
关闭test,examples
Config –> Generate
打开 libssh2.sln
为debug输出目标名加上d后缀
进行批生成
手动拷贝src/debug目录下的libssh2d.lib到lib目录
curl-7.52.1
配置CMAKE_INSTALL_PREFIX参数, 指定头文件及编译包Install目录. ($(ExportDir)\curl-7.52.1)
Zlib相关参数, F:/Develop/bin/x64/zlib-1.2.11
OpenSSL相关参数, F:/Develop/bin/x64/OpenSSL-1.0.2
OPENSSL_ROOT_DIR, F:/Develop/bin/x64/OpenSSL-1.0.2
ENABLE_MANUAL, OFF
BUILD_RELEASE_DEBUG_DIRS
Config –> Generate
打开 CURL.sln进行批生成
拷贝 Output\lib\Release\libcurl.dll
拷贝 Output\lib\Debug\libcurl.dll 为 libcurld.dll
拷贝 Output\lib\Debug\libcurl.pdb 为 libcurld.pdb
curl-7_51_0
修改CMakeLists.txt, 加入字符编码
if(MSVC)
add_definitions(-DUNICODE -D_UNICODE)
endif()
配置CMAKE_INSTALL_PREFIX参数, 指定头文件及编译包Install目录. ($(ExportDir)\curl-7_51)
Zlib相关参数, F:/Develop/bin/x64/zlib/lib
BUILD_RELEASE_DEBUG_DIRS
Config –> Generate
打开 CURL.sln进行批生成
拷贝 Output\lib\Release\libcurl.dll
拷贝 Output\lib\Debug\libcurl.dll 为 libcurld.dll
拷贝 Output\lib\Debug\libcurl.pdb 为 libcurld.pdb
glew 2.0.0
打开VC12目录下的glew.sln,升级到VC14
设置字符集
使用x64编译 debug, release版本
拷贝 bin\debug(release)\x64下文件到 $(ExportDir)\glew-2.0.0\bin
拷贝 lib\debug(release)\x64下文件到 $(ExportDir)\glew-2.0.0\lib
拷贝 include目录到$(ExportDir)\glew-2.0.0
iconv 1.14
按照http://www.codeproject.com/Articles/302012/How-to-Build-libiconv-with-Microsoft-Visual-Studio说明进行配置
debug配置->常规-> 目标文件名: $(ProjectName)d
生成后,把
debug(release)\libiconv(d).lib拷贝到 $(ExportDir)\lib
iconv.h拷贝到 $(ExportDir)\include
debug(release)\libiconv(d).dll(pdb)拷贝到 $(ExportDir)\bin
libxml2-2.9.4
将其中的iconv.h放入$(ExportDir)\bin\include目录中,将其中的libiconv.lib放入$(ExportDir)\bin\lib中,并改名为iconv.lib.(没有相应目录就新建一个)。
修改libxml2\win32\Makefile.msvc
POST_TAG = ""
!if "$(DEBUG)" == "1"
POST_TAG = "d"
!endif
XML_SO = $(XML_BASENAME)$(POST_TAG).dll
XML_IMP = $(XML_BASENAME)$(POST_TAG).lib
XML_DEF = $(XML_BASENAME).def
XML_A = $(XML_BASENAME)$(POST_TAG)_a.lib
XML_A_DLL = $(XML_BASENAME)$(POST_TAG)_a_dll.lib
cscript configure.js compiler=msvc prefix=$(ExportDir)\bin include=$(ExportDir)\bin\include lib=$(ExportDir)\bin\lib debug=yes(no)
cscript configure.js compiler=msvc prefix=F:\Develop\bin\x64\bin include=F:\Develop\bin\x64\bin\include lib=F:\Develop\bin\x64\bin\lib debug=yes
手工拷贝文件
cscript configure.js compiler=msvc prefix=F:\Develop\bin\x64\bin include=F:\Develop\bin\x64\bin\include lib=F:\Develop\bin\x64\bin\lib debug=no
nmake install
CGAL-4.9
修改CMakeLists.txt, 加入字符编码
if(MSVC)
add_definitions(-DUNICODE -D_UNICODE)
endif()
配置CMAKE_INSTALL_PREFIX参数, 指定头文件及编译包Install目录. ($(ExportDir)\CGAL)
F:/Develop/bin/x64/CGAL
Zlib相关参数, F:/Develop/bin/x64/zlib/lib
历史:
2017-01-31: OpenSSL-1.0.2K编译
2017-02-12:
Win7 + VS2015 + CMake3.6.1-GUI + Makefile 编译开源库的更多相关文章
- 无法链接glew的解决办法-编译开源库出现: error LNK2001: 无法解析的外部符号
无法链接glew的解决办法-编译开源库出现: error LNK2001: 无法解析的外部符号 参考官方配置指南:http://glew.sourceforge.net/install.html 1. ...
- Makefile 编译静态库文件及链接静态库
本文为原创文章,转载需指明该文链接 1.代码目录结构如下: comm/ comm/inc/apue.h 3 atexit.c Makefile 5 staticlib/lib/ staticlib ...
- Win7 + VS2015 + CMake3.6.1-GUI编译库
CMake生成Unicode版本VC工程 Just add this line in your top CMakeLists.txt file: add_definitions(-DUNICO ...
- 在Windows下使用nmake+Makefile+编译ZThread库(附例子)
----------2015/01/09/23:21更新----------------------------------- 关于保留DEBUG信息的一个简单例子,见这篇随笔 ----------2 ...
- Makefile 编译动态库文件及链接动态库
本文为原创文章,转载请指明该文链接 文件目录结构如下 dynamiclibapp.c Makefile comm/inc/apue.h comm/errorhandle.c dynamiclib/Ma ...
- Makefile 编译静态库
CC = gcc AR = ar FLAGS = -Wall -lpthread CLOUD = cloud_server OBJ += cloud_server.o LIB = libccloud. ...
- Win7 64位 VS2015及MinGW环境编译矢量库agg-2.5和cairo-1.14.6
书接上文,昨天装了MinGW,主要原因之一是要用到MSYS,所以顺手把FFMPEG又编译了一遍. 回到主题,其实我是想编译矢量库,因为最近要学习一些计算几何算法,所以找个方便的2D画图库就很重要. 说 ...
- Win7 VS2015及MinGW环境编译矢量库agg-2.5和cairo-1.14.6
书接上文,昨天装了MinGW,主要原因之一是要用到MSYS,所以顺手把FFMPEG又编译了一遍. 回到主题,其实我是想编译矢量库,因为最近要学习一些计算几何算法,所以找个方便的2D画图库就很重要. 说 ...
- Win7 VS2015环境编译cegui-0.8.5
首先是去官网下载源码与依赖库 http://cegui.org.uk/ 然后得提一下,编译DX11版本带Effects11框架的话会有问题,也就是默认情况编译有问题,这是因为VS2015升级后编译器对 ...
随机推荐
- 脚本开头,python预编译,控制台输入输出,for,while循环,分支判断,break,continue
3. name = input("name:")与2.x中raw_input一回事, 注意接收的变量全部默认为字符串类型. 从控制台接收用户输入,而密文输入import getpa ...
- centos下kong源码安装
参考资料: https://docs.konghq.com/install/source/ 环境准备:操作系统 centeros7.3 1 :openssl和pcre一般系统自带,如果没有可自己安装 ...
- swing中的按钮事件
package pack2; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax ...
- Datatable 导出到execl 官网demo
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content ...
- SqlServer2008必须开启哪些服务
SQL Server 2008 大概有下面这些服务 SQL Active Directory Helper 服务支持与 Active Directory 的集成SQL Full-text Filter ...
- 438D - The Child and Sequence
D. The Child and Sequence time limit per test 4 seconds memory limit per test 256 megabytes input st ...
- poj3352
Road Construction Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7980 Accepted: 4014 Des ...
- python——正则表达式的理解
概念:又称规则表达式,常用来检索.替换符合某个规则的文本. 理解:特殊字符--------->规则---------->过滤字符串 目的:1.匹配给定的字符串,2.从字符串中过滤出我们需要 ...
- V Server Ubuntu
Ubuntu下代理伺服器通常使用squid 安裝 sudo apt-get install squid 修改squid.conf配置 sudo vim /etc/squid/squid.conf 公司 ...
- Android Path路径设置,针对error opening trace file:No such file or directory
对于android的开发者来说,首先要做的就是环境变量的配置.学习过java的人都知道,java是须要配置环境变量的,那么android开发是否也须要我们配置环境变量呢?当然,安卓的环境变量须要我们配 ...