#include <FGFDMExec.h> #include <sg_path.hxx> using namespace std;
int main(int argc, char **argv) { JSBSim::FGFDMExec FDMExec; bool result = true; FDMExec.LoadScript(SGPath::fromUtf8(argv[1])); while (result) result = FDMExec.Run(); }
Make工具有很多,例如 GNU Make ,QT 的 qmake ,微软的 MS nmake,BSD Make(pmake),Makepp,等等。这些 Make 工具遵循着不同的规范和标准,所执行的 Makefile 格式也千差万别。这样就带来了一个严峻的问题:如果软件想跨平台,必须要保证能够在不同平台编译。而如果使用上面的 Make 工具,就得为每一种标准写一次 Makefile ,这将是一件让人抓狂的工作。
CMake就是针对上面问题所设计的工具:它首先允许开发者编写一种平台无关的 CMakeList.txt 文件来定制整个编译流程,然后再根据目标用户的平台进一步生成所需的本地化 Makefile 和工程文件,如 Unix 的 Makefile 或 Windows 的 Visual Studio 工程。从而做到“Write once, run everywhere”。显然,CMake 是一个比上述几种 make 更高级的编译配置工具。一些使用 CMake 作为项目架构系统的知名开源项目有 VTK、ITK、KDE、OpenCV、OSG 等。
from bs4 import BeautifulSoup soup = BeautifulSoup(html_doc)
print(soup.prettify()) # <html> # <head> # <title> # The Dormouse's story # </title> # </head> # <body> # <p class="title"> # <b> # The Dormouse's story # </b> # </p> # <p class="story"> # Once upon a time there were three little sisters; and their names were # <a class="sister" href="http://example.com/elsie" id="link1"> # Elsie # </a> # , # <a class="sister" href="http://example.com/lacie" id="link2"> # Lacie # </a> # and # <a class="sister" href="http://example.com/tillie" id="link2"> # Tillie # </a> # ; and they lived at the bottom of a well. # </p> # <p class="story"> # ... # </p> # </body> # </html>
# 获取所有地景链接,存入列表 def getTargetLinks(html): soup = BeautifulSoup(html) list=[] #print(soup.prettify()) for child in soup.find_all('area'): list.append(child['href']) print("Get Target Links Success!") return list
# 将地景链接逐行写入文件 def writeToFile(linkList): file = open('./sceneLink.txt','w') for link in linkList: file.write(link) file.write('\t\n') print("Write Target Link To File Success!") file.close()
if __name__ == "__main__": link = "http://www.flightgear.org/legacy-Downloads/scenery-v2.12.html" html=getUriContent(link) linkList=getTargetLinks(html) writeToFile(linkList)
下载世界地景
1 2 3 4
for line in $(cat sceneLink.txt) do axel -n 10 $line done
cd <your working directory for building FlightGear> wget -O download_and_compile.sh http://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/download_and_compile.sh?format=raw chmod +x download_and_compile.sh mkdir -p stable mkdir -p next cd stable ../download_and_compile.sh -s cd ../next ../download_and_compile.sh -p n