Building using CMake - Windows: Difference between revisions

Jump to navigation Jump to search
→‎Scripted Compilation: https://sourceforge.net/p/flightgear/mailman/flightgear-devel/thread/PH7PR84MB14883876038B3075C76B4C2CCC692@PH7PR84MB1488.NAMPRD84.PROD.OUTLOOK.COM/
No edit summary
(→‎Scripted Compilation: https://sourceforge.net/p/flightgear/mailman/flightgear-devel/thread/PH7PR84MB14883876038B3075C76B4C2CCC692@PH7PR84MB1488.NAMPRD84.PROD.OUTLOOK.COM/)
Line 109: Line 109:
pause
pause
| show  = 1
| show  = 1
}}
{{tip | 10/2024: When using VS2022 make sure your osg has this fix applied: https://gitlab.com/flightgear/openscenegraph/-/commit/31082758036c12738467a7210a17604275a79517<ref>https://sourceforge.net/p/flightgear/mailman/message/58821522/</ref>
Some folks encountered the following problem when building flightgear:
<syntaxhighlight>
CMake Error at CMakeLists.txt:283 (find_package):
  By not providing "FindBoost.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Boost", but
  CMake did not find one.
  Could not find a package configuration file provided by "Boost" with any of
  the following names:
    BoostConfig.cmake
    boost-config.cmake
  Add the installation prefix of "Boost" to CMAKE_PREFIX_PATH or set
  "Boost_DIR" to a directory containing one of the above files.  If "Boost"
  provides a separate development package or SDK, be sure it has been
  installed.
</syntaxhighlight>
This could be solved by doing the following in the top-level <code>CMakeLists.txt</code> of [https://sourceforge.net/p/flightgear/simgear/ci/next/tree/CMakeLists.txt#l16 simgear] and [https://sourceforge.net/p/flightgear/flightgear/ci/next/tree/CMakeLists.txt#l26 flightgear]:
In each file search for the line
<syntaxhighlight lang='CMake'>
cmake_policy(SET CMP0167 NEW)
</syntaxhighlight>
(it should be near the top of each file) and change from <code>NEW</code> to <code>OLD</code> like this<ref>https://sourceforge.net/p/flightgear/mailman/message/58815368/</ref>:
<syntaxhighlight lang='CMake'>
cmake_policy(SET CMP0167 OLD)
</syntaxhighlight>
In addition there are reports that a linking error occurs when building flightgear:
<syntaxhighlight>
pui.lib(puValue.obj) : error LNK2019: unresolved external symbol __imp_strncat referenced in function "protected: void__cdecl puValue::copy_stringval(char const *)" (?copy_stringval@puValue@@IEAAXPEBD@Z) [F:\git\flightgear-build\src\Main\fgfs.vcxproj]
F:\git\flightgear-build\src\Main\RelWithDebInfo\fgfs.exe : fatal error LNK1120: 1 unresolved externals [F:\git\flightgear-build\src\Main\fgfs.vcxproj]
</syntaxhighlight>
A workaround could be by changing the build type from <code>RelWithDebInfo</code> to <code>Release</code> when building osg, simgear and flightgear<ref>https://sourceforge.net/p/flightgear/mailman/message/58824438/</ref>:
In the <code>build.bat</code> change all three occurrences of
<syntaxhighlight lang='batch'>
cmake --build . --config RelWithDebInfo --target INSTALL
</syntaxhighlight>
to
<syntaxhighlight lang='batch'>
cmake --build . --config Release --target INSTALL
</syntaxhighlight>
}}
}}


518

edits

Navigation menu