win10 + cmake3.17 编译 giflib5.2.1

所有源文件已经打包上传csdn,大家可自行下载。


1. 下载giflib5.2.1,解压。

        下载地址:GIFLIB - Browse Files at SourceForge.net

win10 + cmake3.17 编译 giflib5.2.1_第1张图片

2. 下载CMakeLists.txt 及其他依赖的文件

从github上的osg-3rdparty-cmake项目:

https://github.com/bjornblissing/osg-3rdparty-cmake/tree/master/giflib

win10 + cmake3.17 编译 giflib5.2.1_第2张图片

下载giflib文件夹下的文件:

win10 + cmake3.17 编译 giflib5.2.1_第3张图片

以上5个文件都要下载。或者可以下载整个项目的所有代码,然后取出对应这部分的代码。

下载以上5个文件后,拷贝到步骤1下载的giflib的源码目录中。

3. 修改CMakeLists.txt

用notepad++打开CMakeLists.txt,只需要在顶部添加一行代码即可:

set(GIFLIB_SOURCE_DIR "./")

win10 + cmake3.17 编译 giflib5.2.1_第4张图片

4. 开始常规的cmake-gui编译流程(以下引自github: osg-3rdparty-cmake)

  1. Download the CMake scripts from this repository.
  2. Download the source for the dependencies you would like to use from their respective location as specified below.
  3. Start the CMake GUI and select the directory with the CMake scripts as your source directory. Use any desired output directory as binary directory.
  4. Press Configure inside the CMake GUI.
  5. 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.
  6. Press Generate inside the CMake GUI. This will generate solution file inside your binary directory.
  7. Open the solution file in your IDE.
  8. Build the ALL_BUILD project for both debug and release.
  9. Build the INSTALL project for both debug and release.

 5. 完毕

6. 编译结果

win10 + cmake3.17 编译 giflib5.2.1_第5张图片

7. 编译结果下载

https://download.csdn.net/download/Strive_For_Future/88504621

你可能感兴趣的:(编译)