所有源文件已经打包上传csdn,大家可自行下载。
1. 下载giflib5.2.1,解压。
下载地址:GIFLIB - Browse Files at SourceForge.net
2. 下载CMakeLists.txt 及其他依赖的文件
从github上的osg-3rdparty-cmake项目:
https://github.com/bjornblissing/osg-3rdparty-cmake/tree/master/giflib
下载giflib文件夹下的文件:
以上5个文件都要下载。或者可以下载整个项目的所有代码,然后取出对应这部分的代码。
下载以上5个文件后,拷贝到步骤1下载的giflib的源码目录中。
3. 修改CMakeLists.txt
用notepad++打开CMakeLists.txt,只需要在顶部添加一行代码即可:
set(GIFLIB_SOURCE_DIR "./")
4. 开始常规的cmake-gui编译流程(以下引自github: osg-3rdparty-cmake)
- Download the CMake scripts from this repository.
- Download the source for the dependencies you would like to use from their respective location as specified below.
- Start the CMake GUI and select the directory with the CMake scripts as your source directory. Use any desired output directory as binary directory.
- Press Configure inside the CMake GUI.
- Fill in the location of the downloaded sources of your desired dependencies and press "Configure" again. Repeat until there is no more errors and warnings in CMake.
- Press Generate inside the CMake GUI. This will generate solution file inside your binary directory.
- Open the solution file in your IDE.
- Build the
ALL_BUILD
project for both debug and release.- Build the
INSTALL
project for both debug and release.
5. 完毕
6. 编译结果
7. 编译结果下载
https://download.csdn.net/download/Strive_For_Future/88504621