Removed cotire PCH
Integrated native PCH by CMake with the same BUILD_USE_PCH flag
Added new option to avoid extra files in 'build/include' folder and replace it by symlink
Symlink creates link to the origin file, it has some benefits from debug and build side.
The CMake parameter for symlink is 'BUILD_INCLUDE_SYMLINK'
With enabled flag BUILD_USE_PCH we get an error of compilation of TKService:
1>Image_VideoRecorder.obj :
error LNK2019:
unresolved external symbol
"int __cdecl av_strerror(int,char *,unsigned __int64)"
(?av_strerror@@YAHHPEAD_K@Z) referenced in function
"protected: class TCollection_AsciiString __cdecl Image_VideoRecorder::formatAvError(int)const "
(?formatAvError@Image_VideoRecorder@@IEBA?AVTCollection_AsciiString@@H@Z)
1>Media_FormatContext.obj :
error LNK2001:
unresolved external symbol
"int __cdecl av_strerror(int,char *,unsigned __int64)" (?av_strerror@@YAHHPEAD_K@Z)
And many other similar errors. Similar errors occures in some other projects too:
TKService
TKOpenGl
TKOpenGles
TKXCAF
TKXDEDRAW
TKDFBrowser
TKMessageModel
TKMessageView
TKShapeView
TKTInspector
TKTreeModel
TKVInspector
TKView
Proposed solution: turn off cotire from targets, whose compilation cause error while applying cotire tool.
In this ticket migration to cotire 1.8.1 (from 1.7.9) is done.
COTIRE_PREFIX_HEADER_IGNORE_PATH does not apply here, because its employing
causes some errors in 3rdparty libraries (for example, in TKService project).
Projects (TKDFBrowser TKMessageModel TKMessageView TKShapeView TKTInspector TKTreeModel TKVInspector TKView)
which use Qt may be proceeded by cotire tool, but after fixing a bug of cotire:
https://gitlab.kitware.com/cmake/cmake/-/issues/18353
0033153: Fix cotire bug, causing impossibility of compilation targets depending from Qt.
Solution is proposed in:
https://gitlab.kitware.com/cmake/cmake/-/issues/18353
Make C++ standard to be enable from cmake settings:
User will be able choosing C++ language standard by selecting cmake variable BUILD_CPP_STANDARD.
For correct working, CMAKE_CXX_STANDARD cmake built-in variable should be available.
To enable CMAKE_CXX_STANDARD, minimum CMAKE version has been updated to 3.1.
Available next standard items:
C++11
C++14
C++17
C++20
C++23
This issue consists from several steps to achive main goal:
1) Configuratiuon, CMake - allow selecting C++ standard.
2) Require minimum CMAKE version 3.1 (for enabling CMAKE_CXX_STANDARD).
3) More flexible CMAKE_CXX_COMPILER_ID identification (fixups previous commit!)
4) Add description of new CMAKE variable `BUILD_CPP_STANDARD` into documentation.
5) Update CMAKE requirements in documentation.
6) Set C++11 standard for several projects.
Extending CMake procedure by 'BUILD_MODULE_QtSamples' variable to switch on qt samples build.
Implementation required:
- union of occt_toolkit_tool.cmake and occt_toolkit.cmake files;
- correction of qt samples sources by adding path to Qt 'plugins' folder. It helps to avoid definition of additional variable (QT_QPA_PLATFORM_PLUGIN_PATH) when staring sample.bat for qt samples;
- executable processing is extended in cmake procedure by providing 'EXECUTABLE_PROJECT' variable. Now we need not specify custom processing for DRAWEXE in occt_toolkit.cmake
The following implementation has been made:
- CMake procedure is extended to compile Qt tools. This is optional and is handled by USE_QT_TOOLS option(OFF by default)
- It is possible to build Qt tools using Qt5 or Qt4, it is settled with USE_QT4 option.
- Sample of DFBrowser tool is available in samples/tools/TInspectorEXE. It is build with tools, executable is placed in binaries. To start the sample, use dfbrowser.bat command.
- DFBrowser tool may be started from DRAW