Just add this line in your top CMakeLists.txt file:
add_definitions(-DUNICODE -D_UNICODE)app
if(MSVC)
add_definitions(-DUNICODE -D_UNICODE)
endif()ssh
配置生成庫輸出目錄 ExportDir=F:\Develop\bin\x64
Add Entry:
CMAKE_INSTALL_PREFIX F:\Develop\bin\x64\xxxcurl
# 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()ui
修改CMakeLists.txt, 加入字符編碼
if(MSVC)
add_definitions(-DUNICODE -D_UNICODE)
endif()
配置CMAKE_INSTALL_PREFIX參數, 指定頭文件及編譯包Install目錄. ($(ExportDir)\zlib-1.2.8)
Config –> Generate
打開zlib.sln進行批生成this
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;編碼
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;url
配置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進行批生成spa
方式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.debug
配置CMAKE_INSTALL_PREFIX參數, ($(ExportDir)\tiff-4.0.7)
F:\Develop\bin\x64\tiff-4.0.7
配置zlib, jpegcode
配置CMAKE_INSTALL_PREFIX參數, ($(ExportDir)\freetype-2.7)
F:\Develop\bin\x64\freetype-2.7
配置zlib
配置CMAKE_INSTALL_PREFIX參數, ($(ExportDir)\giflib-5.1.4)
F:\Develop\bin\x64\giflib-5.1.4
配置GIFLIB_SOURCE_DIR
配置CMAKE_INSTALL_PREFIX參數, ($(ExportDir)\minizip)
F:\Develop\bin\x64\minizip
ZLIB_ROOT F:\Develop\bin\x64\zlib-1.2.8
配置CMAKE_INSTALL_PREFIX參數, ($(ExportDir)\glut)
F:\Develop\bin\x64\glut
GLUT_SOURCE_DIR F:\Develop\GitRepos\OpenSceneGraph3rdParty\glut
修改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目錄
配置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
修改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
打開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
按照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
將其中的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
修改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: