User:Callahanp/fg-from-scratch: Difference between revisions

Jump to navigation Jump to search
→‎vcpkg: expand on this topic
(→‎vcpkg: expand on this topic)
 
Line 43: Line 43:
* https://www.codeproject.com/Articles/1181455/A-CMake-Tutorial-for-Visual-Cplusplus-Developers
* https://www.codeproject.com/Articles/1181455/A-CMake-Tutorial-for-Visual-Cplusplus-Developers


===vcxpkg===
===vcpkg===
* https://docs.microsoft.com/en-us/cpp/build/vcpkg?view=vs-2019
* https://docs.microsoft.com/en-us/cpp/build/vcpkg?view=vs-2019
  vcpkg compiles c++ library sources "using the most recent version of Visual Studio that it can find. In C++, it's important that both your application code and any libraries you use are compiled by the same compiler, and compiler version. By using vcpkg, you eliminate or at least greatly reduce the potential for mismatched binaries and the problems they can cause." -- [[https://docs.microsoft.com/en-us/cpp/build/vcpkg?view=vs-2019 Microsoft Article on vcpkg]]
In theory, fg-from-source depends on the value of the external variable VCPKG_DEFAULT_TRIPLET to determine which version of a library to build.  It should be set as X64-windows to build 64 bit libraries.  However it does not seem to be referenced in the script itself or in vcpkg-git/scripts/bootstrap.ps1
It is referenced in the vcpkg executable, so go ahead and set it.
fg-from-scratch will clone the vcpkg application into .vcpkg-git and run .bootstrap-vcpkg from that directory if not previously installed. 
Subsequent runs will do a git-pull and call the .boostrap-vcpkg script again. this is followed by a vcpkg update and vcpkg-upgrade
Non-vcpkg CMake usage will properly find libraries built with vcpkg if the toolchain file is set.  This setting can be seen in fg-from-scratch cmake commands for building OpenSceneGraph, SimGear and FlightGear
cmake ../my/project -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake
At this point you should take a moment to review the vcpkg documentation found in three .md files in
C:\fg\vcpkg-git\docs\users
* https://github.com/microsoft/vcpkg/blob/master/docs/index.md
* https://github.com/microsoft/vcpkg/blob/master/docs/index.md


930

edits

Navigation menu