1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-02 17:46:22 +03:00

62 Commits

Author SHA1 Message Date
Pasukhin Dmitry
876ccbe977
Configuration - Add support for Google Test framework in CMake #443
Enhance Google Test integration and add support for test projects.
Each Toolkit have GTests folder with place for new tests.
For adding new tests needs to extend FILES.cmake files in each GTests folder.
The single executable is created for each toolkit with all tests.
The tests grouped by module and toolkit with :: as separator.
Added option to download GTest by Cmake if not found.
Add GTest for PLib_JacobiPolynomial with comprehensive test cases
Add GTest for TCollection_AsciiString and TCollection_ExtendedString
Set C++ standard to C++14 for GTest compatibility if required
2025-03-24 08:58:02 +00:00
Pasukhin Dmitry
efc388a211
Configuration - Remove BUILD_PATCH option in CMake #418
Refactor CMake configuration to remove patch handling and simplify includes
2025-03-07 21:07:09 +00:00
Pasukhin Dmitry
72960352ed
Configuration - Modify VTK 9x handling (#401) 2025-03-03 10:29:42 +00:00
Pasukhin Dmitry
de5406aabd
Configuration - Extend CMake file filter regex (#400)
Fixed issue when folder name contains .c or .h as a part of the name.
2025-03-03 08:42:35 +00:00
Pasukhin Dmitry
2edfe536aa
Configuration - Update file globbing and condition checks for installation paths (#399) 2025-03-02 23:57:42 +00:00
dpasukhi
33c22d1b19 Coding - Disable exporting internal RWStep* includes #223
Refactor header file extensions from .hxx to .pxx and update include statements.
Enable handling by IDE gxx and pxx extensions as a cpp header files.
Introduce Standard_HIDDEN to hide symbols
2024-12-29 11:20:53 +00:00
dpasukhi
1e17479b1f Configuration - Debug Draco linking issue #197
Refactor Draco dependency configuration to improve clarity and functionality
2024-12-15 15:15:36 +00:00
dpasukhi
3998181768 Configuration - Remove package precompiled definitions from CMake #174 2024-12-01 18:01:03 +00:00
dpasukhi
676f92fb10 Configuration - Removing '.gxx' from installation #165
Refactor file extension filters in CMake and QMake configurations.
Gxx extension used as a "old-way-template" to repeat .cxx content.
Marking gxx as a source file instead of header.
Moving to absolute path for the gxx integrations.
2024-11-18 12:43:53 +00:00
dpasukhi
d16f03b5b5 Configuration - Restoring VTK toolkit processing #99
Migration to PCH breaks some VTK search functionality.
Fixed non-unique package name caching
2024-10-12 19:44:14 +00:00
dpasukhi
1b5fc7f980 Configuration - CMake extension with PCH and symlink #90
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'
2024-10-12 16:31:03 +00:00
reciprocal
2ab4e9e180 0033319: Coding - Static linking fails with unresolved symbols due to linking order and missing transitive dependencies
The absence of target_link_libraries calls for static libraries caused CMake to fail
in modeling the link dependencies correctly.
This fix ensures that CMake correctly exports the dependencies in OpenCASCADEConfig.cmake and
resolves downstream linking errors for projects that link against static OpenCASCADE libraries.
2024-09-05 18:15:57 +00:00
dpasukhi
c36205a05e 0033378: Configuration - Moving ExpToCas into separate module
Moved ExpToCasExe and its DLL to new module - DETools
Created new module - DETools to keep tools to DE
Changed definition of main of ExpToCasExe to not const parameter
FlexLexer.h moved to general location into TKernel
2023-05-18 22:48:02 +01:00
dpasukhi
c3f6267d24 0033382: Configuration - Installation issue for debug mode for static build
Updated install command to handle BUILD_SHARED_LIBS configuration
2023-05-16 13:48:11 +01:00
dpasukhi
185d29b92f 0033198: Using a third-party Draco to compile in DEBUG mode
Added new CMake variables to build using DRACO
Windows OS works with Debug and Release configuration DRACO
Linux works with Release configuration DRACO
2022-11-12 01:19:44 +03:00
ddzama
3536158f11 0033153: Configuration: Linker error when building from source for VS2022 x64.
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
2022-10-31 18:16:19 +03:00
ddzama
e92d322d40 0032921: Configuration, CMake - allow selecting C++ standard.
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.
2022-09-06 20:06:54 +03:00
abv
05cfce4d83 0031481: Data Exchange - provide parser of STEP EXPRESS schema for generation of new STEP entities
Integration of ExpToCas tool ported to modern state of OCCT:
- new package Express and toolkit TKExpress for EXPRESS data structures and OCCT class generator
- executable ExpToCasExe including lax/yacc parsers, for parsing a Part 21 file and generating classes

Formatting added files from package Express following OCCT Coding Rules

Changes for correspondence generated files to OCCT Code Rules.

Add generation hxx files with declaration of arrays.
If field is a HArray1 method for get length of array and method for get element of array by its index are generated.

Changes for generation parser from Lex and YACC files.

Update description file ReadMe.md
2022-09-06 19:59:09 +03:00
kgv
1caf5fd317 0032924: Configuration, CMake - export INTERFACE_INCLUDE_DIRECTORIES within targets
Add 'INCLUDES' property within INSTALL targets.
2022-04-15 18:20:01 +03:00
kgv
75e2ba1695 0032856: Configuration, CMake - SONAME should include minor version in addition to major to reflect ABI compatibility
Added option BUILD_SOVERSION_NUMBERS to manage SOVERSION length.
Default option value is set to 2 (major.minor) instead of previously used 1 (major),
excluding Android/Emscripten/Windows platforms that use 0 by default.
2022-03-01 19:22:48 +03:00
kgv
19691a22fd 0032545: Configuration, CMake - add BUILD_FORCE_RelWithDebInfo option for generating VS project files with Debug info in Release mode 2021-08-31 19:53:33 +03:00
kgv
342bb7fd4d 0032323: Configuration - drop unused dependency from Xmu
Removed unused header Aspect_XWD.hxx.
Removed redundant includes of unused X11 extension headers.
Added missing dependency on pthread to TKDraw.

Added "-z defs" linker flag to qmake projects to detect missing library dependencies.
Removed unused CSF_MotifLibs.
2021-04-28 18:26:58 +03:00
kgv
a34bddcfd6 0032315: Configuration, CMake - fix building Draw Harness plugins as static libraries
DPLUGIN() macros no more defines exported function PLUGINFACTORY when building static libraries.
DRAWEXE executable now pre-loads a set of plugins when building static libraries.
dversion - added WebAssembly info.
2021-04-23 18:46:13 +03:00
kgv
b8ef513c8f 0032206: Visualization, TKOpenGl - move out OpenGL ES support to dedicated library TKOpenGles
Added TKOpenGles and TKOpenGlesTest toolkits built with HAVE_GLES2 macros.
Added CSF_OpenGlesLibs as alternative to CSF_OpenGlLibs.
2021-03-21 19:15:06 +03:00
luz paz
a110c4a377 0031939: Coding - correction of spelling errors in comments [part 2]
Fix various typos

Fixed via `codespell v2.0.dev`
2020-11-30 14:04:03 +03:00
imn
68922bccc4 0027342: STEP - support C++ streams for import / export
- STEP low-level parser is converted to C++; required minimal version of flex is elevated to 2.5.37.
- Added possibility to import STEP from stream, see new method XSControl_Reader::ReadStream() (now implemented in STEP only).
- Parsers ported to win_flex_bison 2.5.23 (flex 2.6.4, bison 3.7.1)
- Added support of C++ flex and bison scanners in in CMake scripts
- Some code clean-up in StepFile and around (unused files and functions are eliminated)
- Option to read from stream is added in DRAW command testreadstep for testing ReadStream() function
- Added test bugs step bug27342
2020-09-28 10:46:04 +03:00
abv
fba34cf8ba 0031740: Configuration - recover support of Yacc and Lex generation
Scripts adm/cmake/bison.cmake and adm/cmake/flex.cmake are refactored to enable actual search for bison and flex.
Apart of standard locations, also sub-folders of 3RDPARTY_DIR whose names contain "bison" and "flex", respectively, are added to search.
Cache variables 3RDPARTY_BISON_EXECUTABLE and 3RDPARTY_FLEX_EXECUTABLE are removed to avoid confusion (they duplicated similar variables without "3RDPARTY_" prefix).

Lex and Yacc files are corrected to match changes made manually in generated files during last years:
- StepFile/step.yacc: correction missing from #22972
- StepFile/step.lex: corrected for compilation (broken by #31060)
- MSVC-specific code is synchronized between StepFile/step.lex and ExprIntrp/ExprIntrp.lex
- Old commented code and duplicate code blocks removed

Commands for execution of Flex and Bison tools in CMake scripts are tweaked to avoid embedding line numbers (with local paths) in generated files.

Scanners and parsers are regenerated from updated source files with modified options.
Note that lex.ExprIntrp.c is regenerated with multiple differences because option -f (fast scanner) was used for generation of previous version (by WOK).
2020-09-02 19:25:24 +03:00
kgv
8e16477b50 0031582: Configuration, CMake - OCCT fails to build with VTK 9.0
Handle "VTK::" prefix instead of "vtk" used by previous VTK versions for targets.
Corrected unexpected location of endif() and broken indentation.
Obsolete $VTK_USE_FILE is no more included (basing on VTK version check).

Standard_WarningsDisable.hxx/Standard_WarningsRestore.hxx pair is now used to suppress VTK warnings instead of partial disabling.
2020-08-22 12:13:11 +03:00
kgv
d6fbb2aba4 0031632: Draw Harness - handle 3d mouse Raw HID input on Windows
WNT_HIDSpaceMouse - added auxiliary class for processing 3d mouse Raw HID input.
AIS_ViewController::Update3dMouse() - added default processor for 3d mouse input event.
ViewerTest now redirects WM_INPUT to AIS_ViewController::Update3dMouse().
Aspect_VKey enumeration has been extended by 3D view buttons.
WNT_Window::RegisterRawInputDevices() has beend added as a small wrapper
over WinAPI RegisterRawInputDevices() for common HID input devices.

AIS_ViewCube now stores animation duration within AIS_AnimationCamera instead of dedicated duplicating class property.
2020-07-03 11:03:05 +03:00
apn
6acbb1c641 0029266: Configuration - CMake install does not copy pdb files in Debug mode due to the changes in 0028287
Define variable "OCCT_INSTALL_BIN_LETTER" only if compiler is some version of Microsoft Visual C.
2018-05-25 21:54:58 +03:00
nds
1fa1615244 0029571: Samples: build qt samples together with OCCT
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
2018-03-22 15:11:27 +03:00
abv
68df847802 0022651: Impossible to build OCC as static library due to using Standard_EXPORT instead of Standard_API
All library-specific macros for defining export / import properties of symbols on Windows (like Standard_API, __Draw_API, _math_API etc.) are eliminated.
Common macro Standard_EXPORT is used in all places where it is necessary.

New macro OCCT_STATIC_BUILD is defined for disabling Standard_EXPORT, to be used instead of HAVE_NO_DLL, though the latter is still supported as well (for compatibility).

To allow building OCCT in static mode on Windows after these changes:
- Files OSD_WNT_1.hxx and OSD_WNT_BREAK.hxx are removed; useful declarations are moved to OSD_WNT.hxx
- In the class IVtkVTK_ShapeData, static fields ARRNAME_MESH_TYPES and ARRNAME_SUBSHAPE_IDS are converted to static inline functions
- Global array ChoixRef defined in IntImp_ComputeTangence.cxx is converted to static function returning element of the array by index
- Unused class Quantity_Convert is removed (it had static field accessed by inline method)
- Struct Approx_Data defined in the same way in BRepApprox_Approx.hxx and GeomInt_WLApprox.hxx is made private member of these classes to avoid name clash
- Some C++ files producing no object code are removed
- In NCollection_EBTree.hxx and StdLPersistent_Collectio.hxx, definition of template virtual method is moved to class definition to avoid MSVC linker warnings on unused symbols
2018-03-19 13:13:39 +03:00
apn
b1f350a2e1 0029266: CMake install does not copy pdb files in Debug mode due to the changes in 0028287
OCCT_INSTALL_BIN_LETTER is used only on Windows (isn't depended on type of generator) because bind/libd/bini/libi folders are not used on Linux (only bin and lib)
2018-03-16 15:05:48 +03:00
ski
8197951d7e 0029396: Configuration, Cmake: restore 3rd-party libraries into INTERFACE_LINK_LIBRARIES property of installed OCCT targets
Changes from branch CR29277 were reverted.
2017-12-22 13:16:32 +03:00
kgv
77cd443b99 0029377: Configuration, CMake - linkage errors while using static OCCT libraries on Windows platform
HAVE_NO_DLL is now defined when building Static libraries.
2017-12-20 18:50:45 +03:00
ski
5891b8ba41 0029277: Configuration, Cmake - remove 3rd-party libraries from INTERFACE_LINK_LIBRARIES property of installed OCCT targets
3rd-party libraries were removed from INTERFACE_LINK_LIBRARIES properties of OCCT targets.
2017-11-01 16:51:12 +03:00
apn
4f26118e3b 0029250: Configuration, TKIVtk - build failure with VTK 6.3+ due to vtkRenderingFreeTypeOpenGL being removed
Remove vtkRenderingFreeTypeOpenGL from EXTERNLIB if used vtk version is 6.3.0 and above
2017-10-25 18:41:32 +03:00
ski
c22e576d5e 0029056: Configuration - It is not possible to install VTK products
Added installation of vtk.
2017-08-30 13:52:48 +03:00
ski
956d63467f 0028287: CMake install does not copy pdb files in RelWithDebInfo mode
Installation of .pdb files was corrected.
2017-08-24 19:13:01 +03:00
kgv
08f8a1854d 0025382: Visualization, TKOpenGl - improved video recording capability
Image_VideoRecorder - added new class for video recording using FFmpeg framework.
Draw Harness command vanimation has been extended with new options for video recording.
New optional dependency has been introduced - CSF_FFmpeg.
2017-07-31 17:37:07 +03:00
kgv
a131689dc7 0028952: Configuration, CMake - define OCCT_NO_DEPRECATED while building OCCT by obsolete gcc versions 2017-07-28 15:34:50 +03:00
abv
896faa7296 0028417: Using PRECOMPILED HEADER to speed up compilation time
Use of Cotire tool is introduced for acceleration of CMake builds, by usage of precompiled headers.
CMake option BUILD_USE_PCH is added to enable / disable use of precompiled headers

When precompiled headers are used, additional compiler macros are defined globally in the build system to avoid problems due to different order of included files:
- NOMINMAX is defined on Windows to prevent defining "min" and "max" as macros by windows.h
- STRSAFE_NO_DEPRECATE and _SCL_SECURE_NO_WARNINGS are defined on Windows to prevent declaring functions of standard C library as deprecated by #pragma, and other warnings in system headers
- GL_GLEXT_LEGACY and GLX_GLEXT_LEGACY are defined to ensure that only OCCT's own glext.h is used
- __STDC_FORMAT_MACROS is defined to have standard C print format macros always defined

Code is corrected to avoid conflicts with system headers and in case of compiling together as unity builds (partially):
- Some locally defined variables in TKV3d, TKHLR are renamed to be unique
- Duplicated definitions of macros and global functions are eliminated in TKSTEP
- Useless header WNT_UInt.hxx is removed
- Usage of local variables conflicting with X11 macro is avoided in Draw_Viewer.cxx
- Local variables in AIS_ConcentricRelation.cxx are renamed to avoid conflict with macros defined in windows.h
- HXX files containing code are renamed to PXX or merged with corresponding CXX files.

IVtkTools classes are corrected to avoid compiler warnings disabled in non-PCH builds by inclusion of VTK headers.

Useless pragmas disabling warnings on MSVC are removed
2017-07-06 12:41:41 +03:00
ski
4fecc3651c 0028335: Configuration, Cmake - 3rdparty library names present in two places and aren't sync with each other
Libraries names from file adm/cmake/occt_csf.cmake are used to search libraries.

Removed hardcoded variants of tcl/tk libraries names for searching.
2017-04-12 17:53:14 +03:00
ski
a20cce397a 0028135: Configuration - adopt building script for using built-in Android cross-compiling support in CMake 3.7
Added toolchain file for using built-in Android cross-compiling support in CMake 3.7

Added variable CMAKE_ANDROID_STL_TYPE for Android platform build via CMake.

Updated documentation about building of occt for UWP and Android via CMake.

Eliminated CMake warning CMP0054 for Android platform build.
2016-12-29 14:23:20 +03:00
ski
d26375e22c 0027514: Configuration, CMake - relative paths are not correctly handled for INSTALL_DIR
Relative path can be used as INSTALL_DIR.
2016-10-27 17:41:37 +03:00
kgv
d52651755e 0027401: Configuration, Plugin - allow using statically linked plugins
CMake script now defines OCCT_NO_PLUGINS for static builds,
so that linking with OCAF plugins does not lead to duplicated symbols.
2016-06-23 19:15:11 +03:00
ski
88d533be65 0026512: Build fails with VTK 6.2 and OpenGL2 Rendering Backend
Support of VTK with OpenGL2 Rendering Backend was added.
2016-05-27 11:57:31 +03:00
kgv
09eca2b5b3 0027499: Configuration, CMake - add option INSTALL_NAME_DIR on OS X 2016-05-19 15:02:13 +03:00
ski
46bd680a25 0027351: Custom OCCT DLL name suffixes
Added generation of libraries with postfix.
2016-04-14 13:13:05 +03:00
ski
3321f6847d 0027380: cmake should not try to link against 3rd-party libs when configuring a static OCCT build
Linking against 3rd-party libs when configuring a static OCCT build is eliminated.

math library is not linked if build is static

also: an info message is expanded by several words describing using of only header files of 3rdparties

Removed unnecessary for static build CMake gui variables
2016-04-14 12:57:53 +03:00