先把这个多看几遍
https://github.com/Stellarium/stellarium/blob/master/BUILDING.md
源码从 https://gitee.com/mirrors/stellarium 下载速度快
拿编译0.20.2举例
1.Stellarium Linux编译
Deepin 15.11和1002下均编译成功,Qt5.12.3。
很容易,照着guide走一遍就行,没试过打包,直接点击release就可以运行
sudo apt install build-essential cmake zlib1g-dev libgl1-mesa-dev libdrm-dev gcc g++ \
graphviz doxygen gettext git \
qtbase5-dev qtscript5-dev libqt5svg5-dev qttools5-dev-tools qttools5-dev libqt5opengl5-dev \
qtmultimedia5-dev libqt5multimedia5-plugins libqt5serialport5 libqt5serialport5-dev qtpositioning5-dev \
libgps-dev libqt5positioning5 libqt5positioning5-plugins
2.Stellarium Windows编译
VS 2017 community 选上C++安装,Qt5.12.5按照guide安装,然后安装cmake
stellarium源码下载时可以按照tag来git clone。如果单独下载release source code会漏掉util\spout2
如果需要,还要spout2系统变量
然后Qt Creator打开cmakelist,没问题就继续
$ md build
$ cd build
$ md msvc
$ cd msvc
$ cmake -DCMAKE_INSTALL_PREFIX=c:\stellarium-bin -G "Visual Studio 15 2017 Win64" ../..
$ cmake --build . -- /maxcpucount:N /nologo
然后vs2017打开sln,release编译出stellarium.exe
复制exe和同目录下的translations文件夹出来别的地方,然后windeployqt
然后复制出源码项目下的这些文件夹
data
guide
landscapes
models
nebulae
scenery3d
scripts
skycultures
stars
textures
webroot
还要从stellarium 现成安装目录里拷贝下面这些dll出来,这些应该是vs的依赖,但是我不知道原本要怎么产生。
api-ms-win-core…dll
concrt140.dll
libcrypto-1_1-x64.dll
libssl-1_1-x64.dll
msvcp140.dll
SpoutLibrary.dll
ucrtbase.dll
vcruntime140.dll
也就是说,编译出的核心就一个stellarium.exe
已经可以运行exe,完美。Inno Setup就不说了,自己学会打包即可,还有复制ini到appdata这些。。