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

Compare commits

...

316 Commits

Author SHA1 Message Date
Pasukhin Dmitry
70ba51d3a8
Modeling - ElCLib Optimization and testing #471
- Created a new test file ElCLib_Test.cxx to implement unit tests for various functions in the ElCLib class.
- Added tests for InPeriod, AdjustPeriodic, Line3D, Circle3D, Ellipse3D, Hyperbola3D, Parabola3D, and To3dConversion methods.
- Improved performance for the ElCLib methods
2025-03-31 12:55:04 +01:00
Pasukhin Dmitry
ea34d5b2b7
Modeling - Bounding BSpline periodic tolerance issue #468
Update BndLib_Add3dCurve to check the periodic case u1-u2 matching with period
2025-03-31 11:29:38 +01:00
Pasukhin Dmitry
52a93a3bdd
Modeling - Handle void bounding box case in BRepBndLib::AddOptimal #470
In some cases face without natural bound can be not have edges on curve
2025-03-31 10:01:23 +01:00
Pasukhin Dmitry
25b12541d7
Configuration - Re-Configuration time optimization #467
Refactor CMake files to hide redundant variables using mark_as_advanced.
The result - no re-find will be performed.
From 30s to 5s for second time reconfiguration stage.
2025-03-30 15:26:05 +01:00
Pasukhin Dmitry
496ffd4005 Configuration - Issue to start Draw debugging in VS #465
Fixed path for DRAWEXE project configuration in CMakeLists.txt
Updated plugin file search path to use CSF_OCCTResourcePath
2025-03-27 17:42:57 +00:00
Pasukhin Dmitry
fd7a989826
Configure - Fixed issue with static build of DRAWEXE #462
Replace EXTERNLIB_STATIC file with inline CMake variable definition.
2025-03-24 19:18:58 +00:00
Pasukhin Dmitry
43b1e47118
Testing - Remove PLib_JacobiPolynomial_Test.cxx from GTests #463 2025-03-24 17:35:21 +00:00
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
986af180e6
Foundation Classes - Checking for MallInfo version #459
Fix memory usage reporting for GLIBC compatibility in OSD_MemInfo
2025-03-23 20:26:14 +00:00
Pasukhin Dmitry
893747b46e
Foundation Classes - Update signal handling for GLIBC compatibility on Linux #458
Simply disabling the code which enables floating point exceptions
  is probably wrong, but I don't have a replacement for the
    non-posix functions fegetexcept(3) and feenableexcept(3).
2025-03-23 18:57:11 +00:00
Pasukhin Dmitry
233fd2a31f
Documentation - Convert module and toolkit names to lowercase for URL generation #460 2025-03-23 17:37:58 +00:00
Pasukhin Dmitry
2912b4dadb
Foundation Classes - Host resolving by itself #457
Fixed issue  when gethostbyname returns a nullptr, because the host can't resolve itself
2025-03-23 15:52:48 +00:00
Pasukhin Dmitry
e1528a3657
Configuration - Update resource path references in build scripts #454
Fixed issue when the path to resources in build folder is not valid.
2025-03-20 18:44:30 +00:00
Pasukhin Dmitry
c291a33d6d
Documentation - Generation schema fixing #452
Enhance documentation generation by tracking unique module connections
Ensuring lowercase page IDs for toolkits and packages
2025-03-20 14:47:17 +00:00
Pasukhin Dmitry
9cd174509c
Configuration - Resource generation source path fix #453
Fix header file path generation in OCCT resource macro.
Regression after reorganizing repository.
2025-03-20 13:09:23 +00:00
Pasukhin Dmitry
5647b46a34
Configuration - Reorganize repository structure #450
Reorganizing structure to have Module/TK/Package/FILES structure.
New structure reflect the structure inside IDE.
Migrate FILES, PACKAGES, EXTRLIB to CMake version to handle changes on updates.
No changes were done to installation layout, all installation result keep as before.
The migration was done using python script, see PR, which refactor automatically the structure.
Updated doc generation to have valid path to modules, toolkits and packages.
In case of PR into new version, IR-790 can be used as a target for the previous version.
2025-03-20 00:39:26 +00:00
Pasukhin Dmitry
606d652b41
Documentation - Migration to CMake from TCL #441
Remove OS folder with structure for refman generation.
Remove tcl scripts from adm folder which used only for doc generation
Migrate all the processes of doc generation to cmake (adm/cmake/occt_doc.cmake)
RefMan and Overview build from CMake as a new utility option, no TCL is needed.
2025-03-19 09:58:55 +00:00
Pasukhin Dmitry
df4b931988
Configuration - Resource structure reorganization #429
Reorganized resources to keep source part in src and real-time scripts in resource folder.
For the installation result no changes, still installed to src for windows.
2025-03-18 22:54:43 +00:00
Pasukhin Dmitry
99c7ce57c1
Coding - Migration of ExpToCas to own repository #442
New repository for ExpToCas: https://github.com/Open-Cascade-SAS/ExpToCas
Documentation and all build process are fully migrated.
2025-03-18 20:41:12 +00:00
Pasukhin Dmitry
c29c19bb0a
Coding - Migration of Inspector to own repository #438
New repository for Inspector: https://github.com/Open-Cascade-SAS/Inspector
Documentation and all build process are fully migrated.
"tools" folder keep to share information for some time.
Keep building inspector as before to keep control of API changes via GitHub actions.
2025-03-18 19:25:03 +00:00
Pasukhin Dmitry
de831d2935
Data Exchange, Step - AP242 SchemaName Remove dot #448
Fix schema format for AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF in StepAP214_Protocol.cxx
2025-03-18 17:24:07 +00:00
Pasukhin Dmitry
d9d62b4c3c
Configuration - Adding resource packages to toolkit #427
Adding resources with some source code to the packages.
The source code mostly are pxx searched by relative path.
2025-03-14 10:48:50 +00:00
Pasukhin Dmitry
ddf81f2b93
Configuration - Remove -symbolic linker flag (#432)
Updated VCPKG workflow to follow the type of linking with the triplet.
Removed symbolic linker flag. As a result downgrade of performance.
The symbolic flag has high risk of instability, better to disable.
2025-03-12 22:18:44 +00:00
Pasukhin Dmitry
3840d19d7b
Configuration - Enhance Qt5 directory detection for Windows #419
Update the detection Qt5 folder to search for bin folder.
That will affected for the starting DRAW or samples as a part of env.
2025-03-09 18:04:44 +00:00
Pasukhin Dmitry
94637ac370
Coding - Include gxx files from global path #423
Refactor includes to use angle brackets for gxx files back [as for before 7.9]
2025-03-09 09:48:53 +00:00
Pasukhin Dmitry
c0c9f04c04
Visualization - AIS_Shape bounding box re-computation is not working properly #422
Fixed issue with bounding box cleaning algorithm that was causing the bounding box to be only increased.
Now the bounding box is increased and decreased to fit the shape.
2025-03-09 00:07:17 +00:00
Pasukhin Dmitry
478afa4eea
Configuration - Checking for FILES content #424
Added checking for file in package or toolkit.
Removed not-existed files from the list
2025-03-08 22:48:09 +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
sshutina
c4911b9652
Visualization, Selection - allow HandleMouseClick for schemes, allowing to select an object #416 2025-03-07 19:05:37 +00:00
luzpaz
db58517016
Documentation - Fix various typos found in codebase #414
Found via codespell
2025-03-07 15:34:32 +00:00
luzpaz
dbdff3b004
Documentation - Fix various typos found in codebase (#413)
Found via `codespell -q 3 -S "*.fr" -L aadd,abnd,abord,acces,acount,adn,afile,aline,alo,alocation,alog,als,anc,ane,anid,anormal,anout,ans,anumber,aother,aparent,apoints,aprogram,asender,asign,asnd,ba,bbuild,bloc,bord,bu,caf,cas,childrens,childs,classe,clen,commun,cylindre,discret,don,dout,dum,ede,enew,entite,entites,extrem,fo,fonction,geometrie,guid,hilight,hilights,hist,identic,ii,indx,inout,invalide,ist,iterm,llength,lod,maked,mape,mke,modeling,methode,mye,myu,nam,nd,nin,normale,normales,ons,parametre,parametres,periode,pinter,pres,projet,remplace,reste,resul,secont,serie,siz,shs,slin,som,somme,syntaxe,sur,te,thei,theis,ther,theres,thes,thev,thex,thet,tol,transfert,unhilight,unhilights,va,vas,verifie,vertexes,weight`
2025-03-06 13:10:51 +00:00
Pasukhin Dmitry
896b6aa69f
Testing - Repeating failed tests in GH Action (#412) 2025-03-06 10:28:46 +00:00
Pasukhin Dmitry
8cb6ea8b0e
Modeling - Improve handling of polygon parameters in NURBS conversion (#410) 2025-03-05 15:48:41 +00:00
Pasukhin Dmitry
811e6c7f0d
Configuration - Update VTK optional components (#403)
Updated missed components leaded to the issue with VCPKG
2025-03-05 14:23:05 +00:00
Pasukhin Dmitry
55f8c6d1bf
Data Exchange - Datum Axis extraction issue (#407)
Refactor axis handling with correct positioning and handling exceptions.
2025-03-05 10:45:18 +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
Pasukhin Dmitry
84334d8019
Configuration - Update VTK configuration and enable optional components (#395) 2025-03-02 20:41:56 +00:00
Markus Freilinger
df546f5aca
Modeling - Degenerated curves were not handled by Arrange function (#396) 2025-03-02 16:47:06 +00:00
jboissy-mediasofts
4556423a04
Visualization - Refactor mouse click handling logic for improved double-click detection (#385) 2025-02-27 11:39:32 +00:00
Pasukhin Dmitry
79198f7297
Data Exchange - DE Wrapper invalidating parameters after 'Load' (#393)
Fix configuration loading to correctly use FileCS parameter
Add stability test for configuration changes
Update documentation's de wrapping names
2025-02-27 11:38:43 +00:00
sshutina
aa630b33b7
Visualization - Add flag for font mgr to avoid error message (#392) 2025-02-27 11:38:09 +00:00
Pasukhin Dmitry
95d8c85c2b
Coding - Bump version to 8.0.0.dev (#394)
New maintaining schema will be applied:
 maintenance stable release on top of minor (3 times per year).
   with binary compatible changes
   name - 7.9.1, 7.9.2, 7.9.3
 development fully-tested release based on master (every 5+- weeks)
    no binary compatible changes
    the latest features available the same as in master
    name - 8.0.0.rc1, 8.0.0.rc2, 8.0.0.rc3,...
the weekly branch IR still will be weekly and usually type of release will be "dev"
  of the next minor release. In current case "8.0.0".
2025-02-27 11:37:20 +00:00
Pasukhin Dmitry
858dd02fed
Coding - Bump version to 7.9.0 stable release #380 2025-02-17 22:00:23 +00:00
Pasukhin Dmitry
7f7e7df782
Documentation - Update coding rules and formatting guidelines #379 2025-02-17 22:00:07 +00:00
dpasukhi
20c7202089 Testing - Remove unstable test cases 2025-02-17 18:15:58 +00:00
Zernova Marina
8fb662b0aa
Visualization - NCollection_DataMap::Find() exception from AIS_Selection::Select() #375
Problem with NCollection_DataMap::Find() exception during multiple selection in OCC viewer.
Incorrect call is made from AIS_Selection::Select() method at line:
AIS_NListOfEntityOwner::Iterator aListIter = myResultMap.Find (theOwner);
Original issue: 0033742
2025-02-17 15:52:24 +00:00
jfa
e375bd7c3e Modeling Algorithms - UnifySameDomain improvement #371
Extend ShapeUpgrade_UnifySameDomain algorithm working on cases,
  where SurfaceOfRevolution or SurfaceOfLinearExtrusion was made on basis of TrimmedCurve.
Original issue: 0033328
2025-02-17 14:12:49 +00:00
astromko
4c5f9c77cb Modeling - Removing surface after transformation #374
Old surface is not removed after translation or rotation with geometry copying
Removed unnecessary condition that was added by an earlier fix.
Added a test case.
Original issue: 0033591
2025-02-17 14:12:43 +00:00
Pasukhin Dmitry
ed6005b75a
Testing - Summarize only with success reference #377
Fix GitHub Actions workflow to filter completed runs by success status
2025-02-17 14:11:03 +00:00
Pasukhin Dmitry
04a15e36f7
Testing - Remove installation of Visual C++ 2010 #376 2025-02-17 14:10:48 +00:00
jfa
0a73cac759 Configuration - CMake symbol isolation issue on Windows #373
Fixed Salome compilation problem on Windows by M.Bernhard
2025-02-17 12:52:41 +00:00
jfa
6f42ada2e6 Modeling - SIGSEGV BRepAdaptor_Curve2d and UnifySameDomain #372
SIGSEGV with MakeVertexInsideFace.
Fixed exceptions with loading null curve and using out of range index.
By K.Leontev. [bos #37951]
2025-02-17 11:12:21 +00:00
Pasukhin Dmitry
5b574af01f
Testing - WebAssembly build validation #256
Add WebAssembly build workflow for Ubuntu and update CMake warnings for OpenGL usage
Add workaround for platform-specific macros setup before project command
Update CMake configuration for Emscripten and Android toolchains;
Disable default features for vcpkg manifest
Update GitHub workflows to support multiple build types and improve compiler flag handling
Disabled DETools module for Emscripten support in CMake configuration
2025-02-14 16:08:45 +00:00
Pasukhin Dmitry
67bd61d4d3
Data Exchange - IGES Import Degenerated BSpline crash #368
Degenerated bspline leads to null dereference
Fix BSpline curve check and improve exception handling in TransferBSplineCurve
2025-02-14 13:13:53 +00:00
Pasukhin Dmitry
425f88e63a
CMake - Disable building Overview by default #369
Updated default behavior to not build documentation
  when find doxygen (in case of windows it ofter exist in env variables).
Fixed issue when not defined BUILD_DOC_Overview, but found doxygen cmake issue.
2025-02-14 10:47:45 +00:00
Pasukhin Dmitry
5a186c7b1a
Testing - Update GH testing to filter completed reference branch testing #365 2025-02-13 10:24:12 +00:00
Pasukhin Dmitry
fb73c3b712
Coding - Initialize member variables with default values #362
Clang-tidy applying rule for cppcoreguidelines-pro-type-member-init.
Updated: TKernel and TKMath
Update constructor in some classes instead of direct initialization
Refactor Bnd_BoundSortBox and Bnd_Box constructors to initialize member variables directly
2025-02-12 14:26:00 +00:00
Pasukhin Dmitry
a8950426b5
Data Exchange - Step Import metadata crash protecting #357
Fix null checks and improve attribute handling in STEPCAFControl_Reader
2025-02-12 14:25:19 +00:00
luzpaz
f423143109
Documentation - Fix various typos found in codebase #361
Found via `codespell -q 3 -S "*.fr" -L aadd,abnd,abord,acount,adn,afile,aline,alo,alocation,alog,als,anc,ane,anid,anormal,anout,ans,anumber,aother,aparent,apoints,aprogram,asender,asign,asnd,ba,bbuild,bloc,bord,bu,caf,cas,childrens,childs,classe,clen,commun,cylindre,don,dout,dum,ede,entites,fo,fonction,guid,hist,identic,ii,indx,inout,invalide,ist,iterm,llength,lod,mape,modeling,methode,mye,myu,nam,nd,nin,normale,normales,ons,parametre,parametres,periode,pres,reste,resul,secont,serie,shs,slin,som,somme,syntaxe,sur,te,thei,theis,ther,theres,thes,thev,thex,thet,tol,transfert,va,vas,verifie,vertexes,weight`
2025-02-11 12:38:56 +00:00
dpasukhi
87c04f1833 Coding - Bump version to 7.9.0.beta2 #359 2025-02-10 20:27:33 +00:00
Pasukhin Dmitry
49ae0d106f
Data Exchange, Step Import - Disable Product Metadata mode by default #358
Add default initialization for myProductMetaMode in STEPCAFControl_Reader
2025-02-10 19:39:41 +00:00
Pasukhin Dmitry
fd03c58d3b
Data Exchange - STEP Export ignore write schema #355
Refactor StepData_StepModel constructor and initialization logic for write unit
2025-02-10 15:26:39 +00:00
Pasukhin Dmitry
a5aa7bcd91
Testing - Samples build on GH #331
Add GitHub Action to build CSharp sample on Windows
Add MFC and Qt sample build actions
Improve CASROOT assignment logic in env.build.sh and env.install.sh for better compatibility with binary directories
2025-02-09 23:00:37 +00:00
Pasukhin Dmitry
9d727d09f4
Testing - Update GH Action for 7.9.0 #340
Update CAD files with new public data
Update 3rd-party archives with new versions of dependencies
Disable signal catching in bug28054_2
2025-02-09 21:20:05 +00:00
Pasukhin Dmitry
bd77f8af4a
Coding - Refactor ShapeHealingMap to NCollection #346
Update container type to OCCT to avoid allocation on creating.
Refactor shape processing parameter handling to use XSAlgo_ShapeProcessor for consistency.
2025-02-08 21:01:14 +00:00
luzpaz
7e3d063cae
Documentation - Fix various typos found in codebase #350 2025-02-08 09:44:51 +00:00
Zernova Marina
a1d887e0c4
Data Exchange - Fix GLTF Export for vertices and edges #348
Only free vertices and edges are exported now
2025-02-07 16:06:47 +00:00
Zernova Marina
85b40aba2a
Data Exchange, GLTF Import - Fix visualization of colors #347
Fixed issue with material color space
2025-02-07 10:13:54 +00:00
oan
62e085c5ed Configuration - regression in wasm build #342
Quick fix absent definitions
2025-02-04 16:30:14 +00:00
Pasukhin Dmitry
10d1902820
Data Exchange - Schema missed during export #343
Refactor model creating to apply schema based on DE parameters.
New model creating stage no more inject header info.
2025-02-04 16:27:16 +00:00
Zernova Marina
6c77143364
Data Exchange - Fix GLTF Export Materials for edges #341
Fixed issue with edge colors
2025-02-04 09:22:45 +00:00
Zernova Marina
4b318b8bf6
Data Exchange - RWMesh_CafReader deferred loading issue for no faces #339
Fixed issue when trying to apply deferred loading for edges or vertexes.
2025-02-03 22:29:33 +00:00
Pasukhin Dmitry
bfb00b243e
Configuration - TCL OCCT version extraction issue #337
Enhance version detection in OCCDoc_DetectCasVersion
Refactor documentation build workflow and integrate into multiplatform CI
2025-02-03 22:25:29 +00:00
dpasukhi
cc30b93700 Coding - Bump version to 7.9.0.beta1 #335 2025-02-03 13:35:09 +00:00
Pasukhin Dmitry
1f386af59f
Coding - Update method guards for consistency #333
Apply new regex replacement with method's guards in .cxx
Update GH workflow with style checking
2025-02-03 11:16:00 +00:00
Pasukhin Dmitry
3ce9ec7651
Testing - Marking failed code formatting #332 2025-02-03 09:26:58 +00:00
mzernova
b9429d0708 GLTF Import - Edge and Vertex support #242
Added functionality to import Points and Lines from GLTF format
2025-02-02 21:30:21 +00:00
mzernova
174b985fd5 GLTF Export - Edge and Vertex support #243
Added functionality to export TopoDS_Vertex and TopoDS_Edge to GLTF format
2025-02-02 21:25:53 +00:00
Pasukhin Dmitry
053e01ec68
Testing - Inspector building on GH #329
Add GitHub Actions for TInspector build and clang-format check
Reorganize QT search to work with native Linux packages
Reorganize build-and-test workflow to have actions
2025-02-02 15:35:20 +00:00
Pasukhin Dmitry
16d36a47fc
Testing - Disable summarization on cancellation #330 2025-02-02 10:34:32 +00:00
Pasukhin Dmitry
68a9da9f37
Testing - Summary image diff keeping #326
Add script to clean unused test images and update workflow to include it
2025-02-01 19:57:50 +00:00
Zernova Marina
fda875b293
Visualization - Add test for flipped view #328
Test case for #312
2025-02-01 19:56:25 +00:00
Zernova Marina
98a28c41a8
Visualization - flat skin for AIS_Manipulator presentation #321
Created flat skin for AIS_Manipulator presentation
Added "-flat" option to vmanipulator command
Added functionality to transform the manipulator depending on the camera rotation.
Added local transformation for Graphic3d_Group.
Added RecomputeTransformation method to PrsMgr_PresentableObject.
When overloading this method, you can set a transformation for an object depending on the rotation of the camera.
v3d/manipulator/flat: test case added
2025-02-01 17:20:22 +00:00
Pasukhin Dmitry
159f5b82aa
Data Exchange - StepExport non-manifold missed parameter #324
Added missed configuration for non-manifold topology writing
2025-02-01 17:17:46 +00:00
Pasukhin Dmitry
afb0a7e4c4
Testing - GH Summary disabling for cancellation #325 2025-02-01 17:17:21 +00:00
Pasukhin Dmitry
45a52dfce7
Configuration - Git commit info missed #323
Fixed issue with missed git info as a part of dev version.
Add option to enable/disable git hash extraction in version string.
2025-02-01 17:16:58 +00:00
Dmitrii Kulikov
4b608f0bf8
Data Exchange, Step Import - Adding product attributes to metadata #315
Product attributes metadata for step files is now handled during import.
Attribute ReadProductMetadata is added to DESTEP_Parameters.
Method STEPCAFControl_Reader::ReadMetadata() is partially refactored.
Metadata tests for STEP are updated with new data.
Metadata tests for GLTF are updated with new data (since original
metadata in those tests is acquired from STEP files).
2025-02-01 17:16:21 +00:00
oan
60360e3204 Foundation Classes - BVH surface area calculation for transformed boxes #322
BVH::SurfaceCalculator::Area() fails to calculate area of transformed box.
Use absolute values of intermediate calculations to
  compute surface area of a box, so they do not diminish each other.
2025-02-01 00:22:19 +00:00
Pasukhin Dmitry
4012dc463e
Testing - Marking Win retesting failed #314 2025-01-31 23:04:55 +00:00
Pasukhin Dmitry
8a067c43b7
Configuration - Version detection on MacOS #313
Improve version extraction and add error handling for missing version file
2025-01-31 23:04:27 +00:00
Pasukhin Dmitry
2027acc3de
Configuration - Message about compiler limitation #311
Build System - Add compiler version checks for C++17 support
2025-01-31 23:04:01 +00:00
Kirill Gavrilov
73fcf4b4ed Coding, Emscripten - fix runtime crashes on WASM64 (-sMEMORY64=1) #320
by explicitly casting between BigInt and Number within EM_JS() blocks.
2025-01-31 21:06:18 +00:00
Kirill Gavrilov
69281b1bac Configuration, TKV3d - remove redundant dependency from OpenGL #319 2025-01-31 15:43:10 +00:00
Kirill Gavrilov
fb3c2c739c Visualization, OpenGl_GraduatedTrihedron - fix misprint in drawing line within OOZ_XOZ orientation #318 2025-01-31 15:41:02 +00:00
Kirill Gavrilov
104c5f4261 Data Exchange, XCAFDoc_ColorTool::AddColor() - fix generated HEX name of a color #317
Quantity_ColorRGBA::ColorToHex() is now used for consistent HEX formatting of RGBA colors.
2025-01-31 15:38:07 +00:00
Kirill Gavrilov
2d4070bed7 Visualization, Aspect_OpenVRSession - fix JSON file path when it is located relative to executable #316 2025-01-31 15:33:13 +00:00
Zernova Marina
c8c36fda1c
Visualization - Implement interface to change myToFlipOutput of OpenGl_View #312 2025-01-31 13:44:31 +00:00
Pasukhin Dmitry
fbee65efd6
Configuration - Static library warning #310
Add warning message about LGPL 2.1 licensing limitations for static linking
2025-01-31 13:37:12 +00:00
Pasukhin Dmitry
d65feb6928
Configuration - Version information update #308
Refactor version handling to use version.cmake and update related scripts.
Created new symbols to extract information by C function
2025-01-31 13:17:38 +00:00
Zernova Marina
491e742d67
Visualization - AIS_Manipulator is unusable when attaching to objects with Graphic3d_TMF_ZoomPers #309
Recalculation of manipulator position if attached object has zoom transform persistence
  as well as set its anchor point in Transformation.
2025-01-31 11:26:31 +00:00
Dmitrii Kulikov
870d891898
Data Exchange - Step thread safety improvement #307
Mutex is added to XSControl_WorkSession to prevent data races
  during reading and writing.
Tests are added to check the behavior of STEP readers/writers in
  multithreading environment.
2025-01-30 17:42:07 +00:00
dpasukhi
2889518f7a Modeling - Degenerated curve on offset #301
Skip degenerated curves in BRepOffset_Tool::TryProject to improve robustness
2025-01-28 16:37:58 +00:00
dpasukhi
22126df210 Modeling - Add boundary check in BRepFill_Filling to handle empty boundaries #300 2025-01-28 16:29:56 +00:00
dpasukhi
d409a3642d Modeling - Add warning for incomplete wire detection in WireFromList #299 2025-01-28 15:49:11 +00:00
dpasukhi
8caf5157dd Modeling - Enhance intersection handling for closed curves in IntPatch_Intersection #298 2025-01-28 12:21:26 +00:00
dpasukhi
cde7baba0d Modeling - Add closed state handling in BRepLib_MakeEdge #297 2025-01-28 12:17:02 +00:00
dpasukhi
16ed3b4ced Modeling - Resetting Plane YVector #296
Fix calculation of myOY in GeomPlate_BuildAveragePlane to use cross product with OZ
2025-01-28 12:11:53 +00:00
dpasukhi
78fb1869fe Modeling - NURB Convert fix for degenerated #295
Fix logic for processing degenerated edges in NewPolygon function
2025-01-28 10:41:23 +00:00
dpasukhi
16d112481e Documentation - Update links in README #293 2025-01-27 12:37:08 +00:00
dpasukhi
bef42e89ef Revert "Configuration - Single config lib direct linking #289"
This reverts commit 81a807b6cf5704f39379fc7bcabd6a61a63c7eed.
2025-01-26 18:29:45 +00:00
dpasukhi
81a807b6cf Configuration - Single config lib direct linking #289
Enhance PROCESS_CSF_LIBRARIES function to track last detected library for improved directory handling
2025-01-26 13:04:23 +00:00
dpasukhi
398c507264 Coding - Add .git-blame-ignore-revs for global formatting #288 2025-01-26 10:59:36 +00:00
dpasukhi
a5a7b3185b Coding - Apply .clang-format formatting #286
Update empty method guards to new style with regex (see PR).
Used clang-format 18.1.8.
New actions to validate code formatting is added.
Update .clang-format with disabling of include sorting.
  It is temporary changes, then include will be sorted.
Apply formatting for /src and /tools folder.
The files with .hxx,.cxx,.lxx,.h,.pxx,.hpp,*.cpp extensions.
2025-01-26 00:43:57 +00:00
dpasukhi
dbba6f1289 Data Exchange - Losing attributes on NonManifold STEP #284
Move step related processing from XSBase to STP module.
Added history apply after reading of NonManifold
2025-01-24 09:51:54 +00:00
dpasukhi
a0401c7872 Data Exchange - Clear up Step from Static_Interface #283
Remove unused Interface_Static includes
Update SchemaName method signatures
2025-01-24 09:51:15 +00:00
dpasukhi
1e0d8c3f1e Data Exchange - DE Wrapper Shape Healing Parameters #282
Propagate shape healing parameters to STP and IGES nodes.
Update naming to avoid misunderstanding.
2025-01-24 00:20:14 +00:00
dkulikov
f5a02d2b0c Data Exchange - Update Readers with ShapeHealing parameters #247
All instances of using XSAlgo_AlgoContainer are replaced with
XSAlgo_ShapeProcessor.

Parameters for XSAlgo_ShapeProcessor operations are now can be passes
via the updated interface of respective classes.

Staqtic function to read processing parameters from file is added to
XSAlgo_ShapeProcessor.
2025-01-23 22:51:31 +01:00
Elias Cohenca
bb84ecf5c6
Coding - Fix draco buffer index out of bounds
Fixed an exception where the bufferIndex is out of bounds.
Happens when Draco compression is combined with SetMergeFaces.
2025-01-23 00:25:08 +00:00
Elias Cohenca
87a64bbad5
Configuration - fix jemalloc installation #281 2025-01-22 19:28:29 +00:00
dpasukhi
a02c267a13 Testing - Update retest artifact uploading #272
Add "bugs moddata_1 bug20627" to ignore in linux related to
  performance issue.
2025-01-20 08:22:15 +00:00
dpasukhi
c24871f654 Testing - Retesting step for GH Actions #268
Adding new step to retest result per each job line.
Rework logic to minimize retesting.
Creating base for splitting into actions.
Adding new TCL command to clear up test folder from skipped
2025-01-19 17:55:15 +00:00
dpasukhi
22379e84ef Testing - Add cpulimit to address critical issue on Ubuntu #267 2025-01-17 19:20:01 +00:00
dpasukhi
5c64284f9a Testing - Update path for propeller script in video recorder tests #266 2025-01-17 18:40:49 +00:00
dpasukhi
ac450989ef Testing - Fix loading order of OCAF and XDE in bug tests #265
GNU compiler have some optimization leads to multiple definitions
  of static global objects.
In case of static linking there are no possible issues, but in case of plug-in
  application can have multiple definitions of single object.
2025-01-17 18:34:14 +00:00
dpasukhi
f9c046f5ff Testing - Specify test result folder #264
Update build-and-test workflow to specify output directories for test results
2025-01-17 17:48:41 +00:00
dpasukhi
6222d1b1f0 Coding - Move StepData_ConfParameters to DESTEP package #261
Replace StepData_ConfParameters with DESTEP_Parameters across multiple files.
New location will help to keep any translate related stuff in one place for high level usage.
2025-01-17 15:48:38 +00:00
dpasukhi
1083052cc2 Coding - Separate DE Wrapper's plugins to own packages #260
Reorganize DE Wrapper classes to have single style and logic.
Each TKDE* will have own DE*_Provider and DE*_ConfigurationNode
DE* package will have all necessary classes and enums inside instead of another places.
2025-01-17 15:29:17 +00:00
dpasukhi
e6b2e97f13 Testing - Update file handling outside catch block #263 2025-01-17 13:58:14 +00:00
dpasukhi
3744d7c687 Testing - Update dependencies to include additional font packages #262 2025-01-17 12:19:15 +00:00
dpasukhi
f91655b0c5 Coding - Isolate long attached comments for clang-format #259
Automatically update code with clang-format disabling for avoiding formatting.
You can check the python script in GitHub PR
2025-01-16 20:15:29 +00:00
dpasukhi
9a6854774d Data Exchange - STP provider missed parameters #257
Update STEPCAFControl_Provider and StepData_ConfParameters for improved parameter handling.
Update the default write parameters for WriteMode_Assembly to auto
2025-01-16 14:48:00 +00:00
dpasukhi
fe1382f3c2 Coding - Add clang-format configuration #246
New clang-format configuration added to determinate code style.
The default version is 16.
Extend CMake to copy config file to build root.
Method/function separator deprecation:
  In case if function/method has declaration in header,
    definition must not have related comment.
    Only //==== [100 chars] ==== is allowed as a not connected
    separator.
  In case if function/method has  NOT declaration in header,
    definition must have related comment in doxygen style:
    // Descriptions
    // @param
    // @return
    Or just function/method separator:
    //==== [100 chars] ====
  All old separators with no description must be replaced to
    //==== [100 chars] ====
2025-01-14 23:07:40 +00:00
dpasukhi
e9855c9335 Foundation Classes - Standard_Type destructor static_assert #255
Fix assertion logic in Standard_Type destructor for registry unbinding
2025-01-13 15:29:41 +00:00
dpasukhi
d4197764ab Testing - MinGW build validation #253
Add MinGW build validation workflow for Windows
Fix MinGW freetype linkings
2025-01-12 21:01:02 +00:00
dpasukhi
835ba7f104 Testing - MSVC build validation #252
Add MSVC and Clang build validation workflow for Windows
2025-01-11 01:24:23 +00:00
dpasukhi
39da39668b Testing - Ubuntu build validation #251
Add GitHub Actions workflow for Ubuntu build validation
TODO: check static build with VTK support
2025-01-10 22:23:56 +00:00
dpasukhi
30a23ff7a2 Configuration - Headers are missed during installing #250
Regression after #223
Fix regex in OCCT header files installation to include files with xx at the end
2025-01-09 18:02:40 +00:00
dpasukhi
a7f679e70f Configuration - Library CSF directory separation #248
Refactor jemalloc CMake processing to handling in CMake scripts
2025-01-09 17:58:21 +00:00
dpasukhi
3d6c21124a Coding - Deprecate Handle_* type usage #240
Handle_* require special processing in Windows
  and it is already not needed for VS15+
In 7.9 dev will be reorginized to use typedef even for MSVC.
In  8.0 will be fully removed.
2025-01-05 14:48:27 +00:00
dpasukhi
9687f7369c Foundation Classes - TopoDS_Shape accept scaling by default #239
Refactor Location and Move methods to validate transformations.
New default value to raise exception is false.
2025-01-04 23:47:53 +00:00
dpasukhi
a4443d74ad Coding - Remove static global variables #238
Refactor IGES Protocols to eliminate redundant type registrations
2025-01-04 23:45:07 +00:00
dpasukhi
0665ef79f8 Foundation Classes - Standard_Type avoiding C++ RTTI #236
Refactor OCCT RTTI to not keep reference to std::type_info.
Deep copy is returned as before version 7.8.0.
Keep only owning information about classes.
2025-01-04 20:13:36 +00:00
dpasukhi
d7d5b123b7 Foundation Classes - Standard_Type Instance reorganization #235
Refactor Standard_Type to have inline instances.
Now types are stored directly in classes.
2025-01-04 18:56:39 +00:00
dpasukhi
6766feb5ed Foundation Classes - Optimize IsKind operation #234
Refactor Standard_Type::SubType methods for improved clarity and performance
2025-01-04 15:19:49 +00:00
dpasukhi
ba2f25cfa5 DRAW - Static plugin factory refactor #233
Reorganize Static plug-in mapping to be more transparent.
2025-01-04 12:07:25 +00:00
dpasukhi
9e3e17d41e Foundation Classes - Update type declaration #232
Refactor type handling in BinMDataStd and Interface modules;
update RTTI implementations in StepVisual and XCAFDoc
2025-01-04 11:06:47 +00:00
dpasukhi
6d28546add Coding - Moving to use IsKind by type #224
Refactor AIS_InteractiveContext and MeshVS_Mesh to use STANDARD_TYPE for type checks;
deprecate old FindBuilder method
2024-12-29 14:16:37 +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
abf2e1bacb Coding - Combining multiple gxx IntWalk and IntPatch #222
Refactor IntWalk and IntPatch to remove unused gxx files
  and combine to one with refactoring
2024-12-28 23:29:40 +00:00
dpasukhi
fade88f72d Coding - Refactor TopoDS.hxx #221
Remove TopoDS.lxx and move inline definition to declarations.
Refactor TopoDS.hxx with more detailed description.
2024-12-28 21:49:09 +00:00
dpasukhi
b9bcbb457b Coding - Remove unused source files and clean up header includes #220 2024-12-28 21:14:47 +00:00
dpasukhi
5c0ad5d8ea Coding - Refactor IntCurveSurface to remove gxx files #219
Refactor IntCurveSurface: Remove unused HCurveTool files
2024-12-28 19:49:18 +00:00
dpasukhi
a90cf73afd Coding - Coding - Refactor TopClass to remove gxx files #218
Refactor TopClass and BRepClass3d files by renaming and removing obsolete Classifier3d implementations
2024-12-28 18:56:47 +00:00
dpasukhi
ad315a4221 Coding - Refactor Blend to remove gxx files #217
Refactor Blend and BRepBlend files by renaming and removing obsolete Walking implementations
2024-12-28 18:19:21 +00:00
dpasukhi
fe92094cc4 Testing - GH Mesa3D script update #216
Update Mesa3D download links and set environment variables for software rendering
2024-12-27 21:50:04 +00:00
dpasukhi
727f8fa188 Foundation Classes - Move Map's algo part to external file #213
Updated multiple classes to utilize the new NCollection_MapAlgo
  for union, intersection, and other set operations,
    improving code structure and maintainability.
Deprecated older methods in NCollection_Map in favor of the new algorithmic approaches.
2024-12-27 13:07:05 +00:00
dpasukhi
1b4bb62150 Foundation Classes - Separate map's prime declaration #211
Refactor TCollection to use NCollection_Primes and remove obsolete TCollection.cxx
New prime declaration now will be more clear to use.
2024-12-27 10:40:54 +00:00
dpasukhi
ca688cfac3 Coding - Reorganize packages between TKExpress and TKMath #210
- Moved expressions libraries to TKExpress.
- Updated package dependencies in TKExpress and TKMath.
2024-12-26 11:51:01 +00:00
dpasukhi
8e4bda3043 Coding - Fixing warning for Clang #209
Update CMake flags and override methods for improved compatibility
Enhance build configurations and improve code quality with compiler flags
2024-12-23 21:12:11 +00:00
dpasukhi
f7dea47c33 Coding - Fixing clang-tidy warnings #207
First iteration for fixing warnings for:
- TKernel
- TKMath
- TKGeomBase
2024-12-22 12:16:58 +00:00
dpasukhi
0ffcc44c82 Coding - Remove obsolete Standard_Copy.tcl file 2024-12-21 13:27:29 +00:00
dpasukhi
4bda7ebe40 Coding - GeomTools performance update #19
Update size of buffer for the brep parsing according standard
2024-12-21 11:13:07 +00:00
dpasukhi
819ae9a55f Configuration - Add VCPKG Manifest mode support #205
The basic implementation of VCPKG as a beta version.
By default will be disabled.
To enable needs to remove CMake cache and reconfigure with BUILD_USE_VCPKG flag to ON.
The current version do not support whole list of 3rd-party, only limited.
  and VCPKG_ROOT reachable as a CMake or env variable
Add vcpkg support for FFmpeg and Jemalloc, including configuration files and patches.
2024-12-20 16:55:36 +00:00
dpasukhi
e71d92a133 Configuration - Remove obsolete qmake configuration files #206
QtCreator supports CMake natively.
At the moment OCCT qmake configuration is out-of-date and better to clean.
In case if support of qmake will require for specific platform - can be returned.
  But with requirement to be tested by test system Jenkins/GitLab or GH.
2024-12-20 15:03:13 +00:00
dpasukhi
1dfcac2978 Documentation - Add GH overview documentation build #200 2024-12-18 10:17:02 +00:00
dpasukhi
73ec4a59da Documentation - Move gendoc to adm directory #199
Update documentation paths and improve generation instructions
2024-12-16 16:17:31 +00:00
dkulikov
9df5967d6e Shape Healing interface update #189
New class XSAlgo_ShapeProcessor is added. It reimplements functionality
of XSAlgo_AlgoContainer and makes it more convenient to use.
XSAlgo_AlgoContainer is now internally uses methods of
XSAlgo_ShapeProcessor when possible.
New overload of Perform() method is added to class ShapeProcess. It
accepts a set of flags that defines required operations instead of
string.
2024-12-16 13:46:46 +00:00
dpasukhi
73dcda743b Configuration - Inspector with SymLink error #198
When configure Inspector with Symlink flag - configuration failed.
Added force creating include folder to symlink creating.
2024-12-15 15:37:37 +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
007992d349 Documentation - Issue Template update #193
Update issue templates to include '0. New' label for bug reports and feature requests.
The new labels helps to mark not checked issues from development side.
2024-12-14 13:55:07 +00:00
dpasukhi
25906563a3 Coding, GLTF - Isolate RapidJSon part #192
Regression after #184 where some methods are not isolated.
2024-12-14 13:06:32 +00:00
dpasukhi
673e133a51 Coding - Clear up XSAlgo package #188
Removed XSAlgo_ToolContainer which is have no functionality.
Removed XSAlgo_Caller as no more used.
Remove XSAlgo_AlgoContainer.lxx as no more needed.
2024-12-12 20:59:56 +00:00
dpasukhi
7fe67ff441 Coding - Change Tk to tcl header in IVtkDraw_Interactor.hxx #187 2024-12-12 20:52:13 +00:00
dpasukhi
b03c2ff23e Revert "0023638: Data Exchange - Reading IGES file produced invalid shape" #186
This reverts commit c479c4f6d89ed7c5e33dd35a5e110f13776b7cab.
The problem related with no changes on the ShapeHealing stage.
ReShape do not propagated well for all scenarios.
The test case update is not relevant.
2024-12-12 10:30:58 +00:00
dpasukhi
41ee315e1c Documentation - Remove unnecessary fields from issue templates #185 2024-12-11 14:26:44 +00:00
dkulikov
bbbb8ea79d GLTF Import - Metadata support #184
Limited support of metadata import is added to RWGltf_GltfJsonParser.
Following Json data types are currently supported: int32, double, string,
array of int32, array of double, array of strings, Json object.
Notable unsupported types are: binary data, array of Json objects.
Metadata is processed for nodes and meshes.
Tests "gltf_export" are updated with import testing and renamed to "gltf".

Method RWGltf_GltfJsonParser::gltfParseSceneNode() is slightly
refactored: parsing of transformations and transformation matrices is
moved into separate functions.
2024-12-10 17:05:38 +00:00
mzernova
d5afabec90 Visualization - Selection does not work for simple shape #182
Fixed direction calculation for Select3D_SensitiveCylinder created from Geom_CylindricalSurface
2024-12-06 14:40:35 +00:00
dkulikov
875660a560 Documentation - Enhance comments in StlAPI_Reader.hxx #180
Update comments to clarify STL file reading inefficiencies
2024-12-05 15:03:10 +00:00
dpasukhi
1c94e9e877 Coding - Missing include in TopoDSToStep_Builder.hxx #179 2024-12-04 17:26:08 +00:00
dpasukhi
3998181768 Configuration - Remove package precompiled definitions from CMake #174 2024-12-01 18:01:03 +00:00
dpasukhi
129eb07cea Configuration - Update minimum CMake version to 3.10 #169 2024-11-24 19:18:22 +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
0a7449da36 Testing - GH Enabling multiprocessor testing on Win #162
tcl threads required VC C++ 2010 redistribution package for run-time.
Downloading dll helps to start testing in multiprocessor env
2024-11-17 20:27:39 +00:00
dpasukhi
604c3b890c Documentation - Update parameter annotations for consistency #161
Reorganized style for param to the next templates:
 - "@param theParameter description ..."
 - "@param[in] theParameter description ..."
 - "@param[out] theParameter description ..."
 - "@param[in][out] theParameter description ..."
 The replacement was with keeping spacing, no removing of extra spaces.
In some files '/' was used instead of '@', that was not updated yet.
2024-11-17 20:22:51 +00:00
dpasukhi
ac5a612645 Coding - PCH improvements #160
Refactor precompiled headers and improve Windows compatibility.
Extend TKernel, TKMath and TKBRep pch with more usage headers.
Implement PCH for TKDEIGES, TKDESTEP, TKMesh, and TKXSBase.
2024-11-17 20:14:04 +00:00
dpasukhi
4ebc468140 Configuration - Optimize include copy logic #155
Avoiding re-copying the existed header file.
2024-11-14 21:44:31 +00:00
dpasukhi
0744d56fee Coding - Update env.sh to handle aarch64 #158
Fix architecture check to include aarch64 in build and install scripts
2024-11-14 07:43:25 +00:00
dpasukhi
6b06684539 Coding - Compiling issue on aarch64 #157
Enumerator value evaluates to -1, which cannot be narrowed to type 'char' [-Wc++11-narrowing]
2024-11-14 07:41:02 +00:00
dpasukhi
fd4fb824c7 Testing - Limit for MacOS on GH #149
Limit MacOS for testing only "caf basic" to view only DRAW status.
Simplify cmake install operation for each job
2024-11-10 18:19:43 +00:00
dpasukhi
05ec4972c3 Testing - Update tests with direct VIS loading #148
XShow and XDisplay XDE require VISUALIZATION for correct work.
In some scenario DRAWEXE can generate a duplicates of the internal static singletons.
This means each dynamic library will have their own instance of the static singleton.
Update all direct library loading to use the XDE plugin mechanism.
This will ensure that the XDE plugin is loaded only once and that the correct instance is used.
Originally issue is reproduced only Linux with dlopen with "RTLD_LAZY".
Can be resolved additionally adding "RTLD_LAZY | RTLD_GLOBAL" for dlopen
2024-11-05 19:45:59 +00:00
dpasukhi
ea86bfe2fa Testing - Removing direct DCAF loading #147
DCAF require VISUALIZATION for correct work.
  In some scenario DRAWEXE can generate a dublicates of the
  internal static singletons. This means each dynamic library
  will have their own instance of the static singleton.
Update all direct library loading to use the DCAF plugin
  mechanism. This will ensure that the DCAF plugin is loaded
  only once and that the correct instance is used.
Originally issue is reproduced only Linux with dlopen with "RTLD_LAZY".
Can be resolved additionally adding "RTLD_LAZY | RTLD_GLOBAL" for dlopen
2024-11-05 17:00:06 +00:00
dpasukhi
e09563c802 Configuration - MinGW Clang build support #144
Clang with GNU needs the same compiler flags as for GCC.
Refactor compiler flag to be more flexible.
2024-11-03 20:14:36 +00:00
dpasukhi
3ec8891916 Testing - Update GH Win Jobs with Mesa3D #143
Extend GH actions on windows with mesa3D
2024-11-03 15:05:58 +00:00
dpasukhi
2d9c5a868d Testing - Disable GH master summarizing #138
Disable GH action for summarize on master branch
2024-10-31 21:53:57 +00:00
dpasukhi
3ddb860a44 Foundation Classes - AsciiString RemoveAll do not trunk the string #136
Updated RemoveAll to trunk the string and
  reuse single method for case sensitive and not sensitive
2024-10-31 21:30:59 +00:00
dpasukhi
f180697d9c Configuration - Update optimization flag to O3 #132
By Default CMake was used O3 in release mode.
It means on production mode we override from O3 to O2.
2024-10-30 09:27:58 +00:00
dpasukhi
eb69515cb5 Testing - GH Actions RefMan on Windows #131
The RefMan doc generation is OS depended.
All previous versions were generated on Win.
2024-10-30 09:03:02 +00:00
dpasukhi
802ef8ce4c Configuration - Second installation failed #129
After first installation, second will be failed
Regression after#97
2024-10-28 15:52:38 +00:00
dpasukhi
1b65bc8f68 Documentation - Issue template simplification #127
Combine the templates into group with bug and feature
2024-10-28 12:19:08 +00:00
dpasukhi
158ed439c4 Coding - GH Issue templates #125
Add new issue templates for DRAW, Mesh, Coding, Build,
  Samples, Testing, Modeling, and Configuration
2024-10-27 17:54:36 +00:00
dpasukhi
5c242e8d9d Testing - Update GH test compare handling #124
Extend workflow to work on master
Extend the retention days for summary for 2 weeks
2024-10-27 16:52:29 +00:00
dpasukhi
328ffa1679 Documentation - Add Contribution guidelines #121 2024-10-27 09:24:02 +00:00
dpasukhi
a1dba069fd Testing - Extend GH Actions to compare results #119
Implement new logic to compare test result with target branch.
The compare results  are stored in single archive contained .html file per job.
Tests results stored as an artefact per job separately.
Extend the jobs with new 3rd-party and new use_* flags
2024-10-27 09:20:24 +00:00
dpasukhi
9f685bf453 Configuration - Extend support Ubuntu packages #118
Draco, vtk and openvr now can be used from ubuntu packages
Fixed issue for Clang with msvc lib detection
2024-10-26 22:00:18 +01:00
dpasukhi
72415a8313 Testing - Upgrading action script versions #111
Fixing dependabot alert issue with version upgrade
2024-10-20 21:09:14 +01:00
dpasukhi
857b1b648d Tests - DRAWEXE Testing integration into GH #109
Introduced a comprehensive multi-platform build and
  test workflow for OCCT, supporting Windows, macOS, and Linux.
Added a new workflow for automated documentation building.
Reorganized a code analysis workflow using CodeQL
  and Microsoft C++ Code Analysis.
2024-10-20 16:07:45 +01:00
dpasukhi
674c246128 Configuration - Update optimization flags for release build #108 2024-10-20 15:03:00 +01:00
dpasukhi
191fc37915 Coding - OpenVR module compilation fail #107
Compilation failed with Clang on OpenVR module
2024-10-20 14:59:18 +01:00
dpasukhi
a97a8e66e3 Configuration - Production build type for linux #106
Fixed problem with not relevant flags and missed C language flags.
2024-10-19 17:05:16 +01:00
dpasukhi
3cdf8e79f9 Configuration - JeMalloc from default package #105
Fixed issue with jemalloc from ubuntu, debian and etc default packages
2024-10-19 17:03:33 +01:00
dpasukhi
96bdb9db84 Tests - Action to build Refman doc #103
Add GitHub Actions workflow for building OCCT refman documentation
2024-10-19 15:07:38 +01:00
dpasukhi
83b4e3f988 Configuration - Option to disable PCH after enabling #102
After enabling PCH it was not possible to disable back.
New CMake feature used for disabling
2024-10-13 09:03:26 +00:00
dpasukhi
f336684b26 Configuration - CLang-cl msvc support #101
Update compiler flags and env.bat to work with clang-cl
2024-10-12 22:57:13 +01: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
50f1e73469 0033565: Configuration - JeMalloc process different build types
Accept only static build of JeMalloc
2024-10-12 17:28:09 +00:00
dpasukhi
6c92579764 Configuration - custom.bat/sh disappearance #97
Fixed issue when  custom.bat/sh not regeneration in build directory
  in case when exists in install directory.
2024-10-12 17:09:51 +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
dpasukhi
55527ad756 Coding - GCC13 warning suppressing #96 2024-10-12 16:26:32 +00:00
dpasukhi
858709699a Coding - Non-dependency include update #89
Removed or reorganized include that are not a part of the project dependency.
The new file for typedef is added because Select is not direct dependency.
2024-10-07 21:57:14 +00:00
dpasukhi
e83a646c14 Coding - Reorganize code with constexpr #85
Continue rework Precision.hxx and Standard type definitions
2024-09-30 17:38:25 +00:00
ika
5cc7cbea8b Data Exchange, Gltf Export - Metadata support #79
Add supporting of metadata key-value export into extras section of each node.
2024-09-30 16:04:12 +00:00
dpasukhi
3462ea5716 0033813: Data Exchange - Implementing common logic for scaling during Write procedure
Fixed inconsistency of tests.
'IGES.OCC.write.unit no more' used.
2024-09-28 18:49:22 +00:00
dkulikov
6faeaa4b62 Data Exchange, Step Export - Crash on PCurve processing #80
Crash in TopoDSToStep_MakeStepFace::Init() that occured due to attempt
to copy null Geom2d_Curve is fixed.
2024-09-28 18:01:11 +02:00
dkulikov
ff15a5d1ab 0033498: Data Exchange, Step Export - Meshed pretessellated geometry is skipped on write
Processing of complex_triangulated_surface_set is added to
  STEPCAFControl_GDTProperty::GetTessellation().
Processing of tessellated_curve_set is refactored and moved to a
  separate function.

Problems related to normals list are fixed in
RWStepVisual_RWComplexTriangulatedSurfaceSet::WriteStep():
  Normals list is now checked for nullptr. It is a valid situation that
  occurs when complex_triangulated_surface_set in STEP file has no
  normals.
  Traversing of normals list is performed in correct order. Previously
  rows and columns were switched, which led to crashes or incorrect data.
2024-09-28 15:59:02 +00:00
dpasukhi
50a7319b45 Coding - GitIgnore update with .cache #84
Updated .gitignore
2024-09-28 15:56:04 +00:00
dpasukhi
aa7c38d60e Documentation - Update the main ReadMe #81
ReadMe was moved to markdown format.
Updated a links to the resources
2024-09-26 15:25:04 +00:00
jfa
b0922ff9a1 0033828: Modeling Algorithms - GCPnts_QuasiUniformDeflection returns very different results under small change in deflection 2024-09-26 13:47:31 +00:00
anv
d8a26498d2 0033813: Data Exchange - Implementing common logic for scaling during Write procedure
Implementation of common logic for OCCT formats.
2024-09-26 11:28:15 +00:00
dkulikov
071f14697f 0027410: Data Exchange, Iges Import - Possible resource leak when parsing an invalid file
fclose() call is added before early return statement in igesread() function.
2024-09-25 10:05:51 +00:00
dpasukhi
5c454ed695 0033723: Configuration - Removing Genproj and Update files
Cleaning repo from not maintaining functionality - genproj and wok
Only 'gendoc' functionality kept.
TODO: migrate gendoc to cmake
2024-09-25 08:23:52 +00:00
dkulikov
539ddf30fb 0033487: Data Exchange, Step Import - Unresolved reference crashes
Fixed crash in STEPConstruct_Styles::GetColors() due to nullptr
  dereferencing when source step file has missing
  FILL_AREA_STYLE_COLOUR entities.
2024-09-25 08:16:26 +00:00
dpasukhi
495a6a642d Testing, GitHub - Marking warnings as errors #73
Windows, Linux builds now starts checking the warning.
  In warning case the job will be failed.
MacOS having too much warnings related with sprintf.
Linux Clang having a problem with Flex and Bison.

TODO: Fix the warnings for MacOS and Linux Clang.
2024-09-22 13:32:33 +00:00
dkulikov
e5998666ee 0033665: Data Exchange, Step Import - TransferRoots crashes for invalid STEP files
Fixed exception in RWStepShape_RWEdgeCurve::Check() thrown when trying
    to access step entity in Interface_EntityIterator with zero entities.
Fixed a crash in StepToTopoDS_TranslateFace::Init() caused by
    dereferencing nullptr.
RWStepShape_RWEdgeCurve and RWStepShape_RWEdgeCurve are refactored.
Test bug33665 is added to check the fixed behavior.
2024-09-22 12:46:54 +00:00
dpasukhi
8082b955bd Coding - Reorganize code with constexpr #68
After rework Precision.hxx some local
  variables can be marked as constexpr
2024-09-22 12:46:46 +00:00
dpasukhi
72c6d55bf2 0033765: Data Exchange, IGES Export - Missing Model Curves in transfer cache
Curve list should be not unique, list is recommended.
One curve can be used by multiple edges.
2024-09-14 20:26:41 +00:00
oan
d0e33902bc 0033806: Shape Healing - ShapeCustom optimization while rebuilding compounds
Avoid double binding of shapes to context.
Take all changes into account by reshape
2024-09-14 20:26:41 +00:00
dpasukhi
a52ee17c73 Coding - Precision.hxx file optimization
Precision.hxx optimized to have compiler-time
  constants for the most common floating-point values.
Reorganized code to avoid static jumping for parametric.
2024-09-14 20:26:41 +00:00
dpasukhi
72b244bc98 Coding - Resolving C26439 & type formatting warnings
Sprintf  with %s always convert values into char*, not safety from int.
Move operators and constructors can be marked as noexcept
2024-09-14 20:26:41 +00:00
dpasukhi
9c6914c3cc Coding - Resolving C6319 warning
Use of the comma-operator in a tested expression
  causes the left argument to be ignored when it has no side-effects.
2024-09-14 20:26:41 +00:00
dpasukhi
4ab54d60ef Coding - Resolving C26498 warning
C26498 - marking variables constexpr to improve performance
2024-09-14 20:26:41 +00:00
dpasukhi
09a69618da Coding - Resolving C6287 & C6282 warnings
Removing redundant code and incorrect operator
2024-09-14 15:16:54 +00:00
dpasukhi
6cb0b9b4e3 Coding - Resolving C6263 warnings
Reorganizing code to not call alloca inside loop.
  alloca allocated memory from stack and free after finishing function
2024-09-14 15:16:54 +00:00
dpasukhi
33339b0dc2 Coding - GeomConvert_CurveToAnaCurve warnings fix 2024-09-14 11:01:24 +00:00
dpasukhi
392ba7dbb6 Coding - Image_AlienPixMap unused parameters 2024-09-14 11:01:10 +00:00
dpasukhi
ed20837d8b 0033703: Data Exchange, Step Export - Transfer edge speed improvement
Move optional code close to use case to avoid extra calculation
2024-09-06 20:22:00 +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
d83d72acf9 0033805: Configuration - Implement GitHub Actions build scripts
Enable MSVC code analyzing to push SARIF files
2024-09-05 17:55:07 +00:00
dpasukhi
fae5678dc7 0033750: Configuration - make file configuration failed in mfc example
Updated MFC sample to build together with OCCT
2024-09-05 17:55:01 +00:00
dpasukhi
488c43ed0c 0033812: Configuration, MacOS - Debug Symbols Stripped From Dynamic Libraries
Update optimization flag to release only
2024-09-05 09:14:24 +00:00
dpasukhi
2fa9309186 0033805: Configuration - Implement GitHub Actions build scripts
Build Scripts:
- Linux GCC x64 dynamic
- Linux Clang x64 dynamic
- Windows MSVC x64 dynamic
- macOS Clang x64 dynamic
Security scanning:
- CodeQL security scanning
- MSVC code scanning
2024-08-31 13:33:59 +00:00
dpasukhi
4309cf7362 0033810: Coding - GitIgnore update with .vscode
Updated .gitignore
2024-08-31 13:31:34 +00:00
dpasukhi
7236e83dcc 0033808: Coding - FreeType Use unsigned point and contour indexing in FT_Outline
Changes to auto instead of specific type
2024-08-31 13:28:20 +00:00
luzpaz
099e0d2524
0033807: Documentation - Fix various typos found in codebase 2024-08-31 14:26:15 +01:00
astromko
b332761e13 0033648: Modeling Algorithms - Bad partition result
Removed unnecessary tolerance increase for Line\Line intersection.
Tolerance increasing logic for some specific curve types
  was added with #26619.
Original fix had no test for Line/Line case and
  theoretically was added as a possible issue.
After research Line/Line case doesn't need a special tolerance case.
2024-08-25 08:37:51 +00:00
dpasukhi
da71394f31 0033612: Configuration - Build configuration may fail to detect TBB
Fixed TBB type to depends on package
2024-08-25 08:35:49 +00:00
oan
2736652117 0033791: Shape Healing - ShapeCustom not take location of source shape for the cached context and misses root one
Pass ShapeBuild_ReShape to recursive call to retrieve complete change history.
Update history of changes by the source shape (if changed), not only by its subshapes.
Check the context for a cached shape using a reference shape without location.
2024-08-09 15:27:03 +00:00
ichesnok
677f383561 0033788: Data Exchange, DE Wrapper - Shape Healing configuration node
DE_ShapeFixParameters class added for shape healing parameters storage.
DE_ShapeFixConfigurationNode class added for work with parameters.
2024-08-09 15:26:59 +00:00
oan
bd14b69336 0033790: Data Exchange - XCAFDoc_LayerTool creates temporary instances during initialization of layer attributes
Removed initialization of temporary objects.
2024-08-09 15:26:53 +00:00
anv
f0620a8d65 0033781: Modeling Algorithms - Using incorrect boundaries while traversing through triangulation
Upper boundary updated for triangulation normals traversing.
2024-08-05 08:28:17 +00:00
luzpaz
245febe036
0033778: Documentation - Fix various typos found in codebase 2024-07-26 08:51:12 +01:00
carlosah
9fcfec881c 0033513: Visualization - Integration of the ability to zoom with vertical mouse movements
Added a new gesture for zooming after vertical mouse movement - AIS_MouseGesture_ZoomVertical
2024-07-17 12:52:16 +01:00
Vitaut Tryputsin
ca0c5a4074 0033729: Visualization - Fixed transparency for capping in 'Graphic3d_RTM_BLEND_OIT' mode
Added changes connected with restoring of color mask (if we store and restore only rgb part, we can miss transparency)
2024-07-17 12:51:03 +01:00
luzpaz
d51eb087ab
0033766: Documentation - Fix various typos found in codebase 2024-07-15 16:57:52 +01:00
luzpaz
76df27830b
0033762: Documentation - Fix various typos found in codebase 2024-07-14 15:19:44 +01:00
akaftasev
5cf1003a66 0033689: Canonical Recognition - Circle construction problem
Fixed problem with creating null-length gp_Dir
2024-07-12 10:31:22 +01:00
akaftasev
c6065f5da9 0033570: Modeling Algorithms - Incorrect result of cutting spheres
The reason of current problem lies inside projection algorithm
Function_SetUVBounds() for projection of circle onto sphere produces shifted bounds.
Incorrect checking of placement on summit of the sphere was fixed.
2024-07-09 09:49:22 +01:00
anv
f39f9838e4 0033751: Shape Healing - Use static values in case of an absent Resource file
If a Resource file with parameters for ShapeFix is absent, use static parameters instead if possible.
2024-07-08 17:28:00 +02:00
anv
100d03d273 0033748: OCCT:Coding - Changing function signature to a more common one
Changing function virtual specifier and return type order to a more common to avoid wrapping issues.
2024-07-08 17:28:00 +02:00
hosali
dc997b884b 0033423: Coding - Memory leak with locale conversion
use of stack allocated temp string instead of dynamic one
2024-07-08 17:28:00 +02:00
akaftase
b828814131 0033541: Modeling Algorithms - Simple sphere cut from cylinder fails
Changed condition for combination of WLines into one.
WLine would be excluded from consideration for merging, if one of its middle points between vertices is out of domain (does not lie on both surfaces).
2024-07-08 17:28:00 +02:00
akaftase
5811a330c7 0033615: Modeling Algorithms - Partition algorithm creates unexpected vertices
This problem occurs because of obtaining 2 ALines which share same vertex on the seam edge.
There should be 2 different vertices with same(or almost the same) 3d parameters, but
with different UV parameters because of periodic surface.
Current fix allows to avoid the same vertices on seam edge and also checks the next vertex.
Added consideration of predicted next point to avoid skipping tha point which is not on seam edge.
Added test case for #33702
2024-07-08 17:28:00 +02:00
Pasukhin Dmitry
818c68f22e 0033737: Data Exchange, XCAF - Implementing filter tree functionality
Implemented base functionality to filter tree with input label to keep.
2024-07-08 17:28:00 +02:00
Pasukhin Dmitry
25d3030ed5 0033752: Configuration - Update permission inspector.sh
Updated permission to  owner write only
2024-07-08 17:28:00 +02:00
Thomas
cf27d6cada 0033749: Configuration - Update permission draw.sh
Limit draw.sh permission to 755 instead of 777
2024-07-08 17:28:00 +02:00
drochalo
4c8faa5e2d 0032752: Visualization, TKOpenGl - extend V3d_View::ToPixMap() options with Z-layer
Added option to dump only a selection of zlayer's content.
Changed zlayers redraw and render method for selection of layers to render.
Added filters for layer parsing.
Modified vdump command.
Added test with multiple dumps for comparison.
Added option to dump shadow maps.
2024-05-19 16:03:09 +01:00
astromko
65d8eece35 0032964: Modeling Algorithms - 2d Offset sometimes 'split' straight edges
Implemented avoiding force cut of an edge in case of simple edge (that contains just 1 curve).
2024-05-19 16:03:09 +01:00
astromko
8991082051 0033156: Modeling Algorithms - Planar face creation problem
Implemented suggested patch to avoid unnecessary replacement of a wire.
Added the second test case.
2024-05-19 16:03:09 +01:00
astromko
1db93f640e 0033146: Modeling Algorithms - 2D Offset with arc-lin approximation fails on open B-spline edge
Added additional conditions to avoid crash.
Added a test case.
2024-05-19 16:03:09 +01:00
drochalo
fc51ce503e 0030484: Visualization, SelectMgr_ViewerSelector - Graphic3d_TMF_2d persistence sorting issues
Added property to SelectableObject for selection focused on display priority.
Modified SelectMgr_ViewerSelector CompareResults based on the focus priority property.
Added display priority to the sorting criterion
Added tests for multiple types of sensitive entities.
Modified vpriority command to change an object's selection priority.
2024-05-19 16:03:08 +01:00
drochalo
ad9840d4d4 0033533: Visualization - possibility to redefine Graphic3d_TransformPers
Split template method apply and moved calculations to virtual method.
2024-05-19 16:02:30 +01:00
drochalo
7f1d0563bb 0033514: Visualization - Scaled view twists zoom persistence objects
Added flag to transform persistence to handle axial scaling.
Modified manipulator's zoom transform persistence to fit in axial scaling events.
Added tests for cases 27832 and 33514.
Logic change on Graphic3d_TransformPers::Apply for Graphic3d_TMF_AxialScalePers.
Logic fixes in AIS_Manipulator to integrate axial scale in both zoomable and unzoomable states.
2024-05-17 08:31:06 +00:00
dpasukhi
69f380ae32 0033699: Data Exchange, DE Wrapper - Integration activation plug-in mechanism plug-in
New virtual function is implemented
2024-05-06 10:53:55 +01:00
ika
36dc3d2037 0033371: USD - Implementation of import and export USD files using the USD SDK. 1 Stage
Do auxiliary improvement in OCCT.
2024-04-17 23:19:49 +01:00
anv
ead71c66a3 0033430: IFC Import - Adding basic support of materials
Updated XStat to show VisMaterials info
2024-04-17 23:19:48 +01:00
drochalo
d4dbeab49b 0032750: Visualization, AIS_Manipulator - selection of moved object is broken
Completed the stop transform action when dragging manipulator with mouse.
Added context redisplay for update of interactive object sensitive areas.
Added test.
2024-04-17 23:19:48 +01:00
dpasukhi
4fb9b2f250 Update version to 7.8.2 dev 2024-04-17 23:14:47 +01:00
ika
b78ccf1f9b 0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
Add processing of tessellated_annotation_occurrence.
Add test cases.
2024-04-07 10:46:17 +01:00
oan
2956d432e2 0033560: PARASOLID Import - XT importer raises exception SIGFPE Arithmetic Exception
Prevent division by zero in exceptional cases when vector of parameters contains only a single value.
2024-03-28 13:58:36 +00:00
anv
d3e00bfaa6 0033616: Application Framework - Using filter while reading XBF may result in unresolved links
- Added tracking of unresolved links for TreeNodes;
- Test case added.
2024-03-28 13:55:46 +00:00
ichesnok
983e35ed71 0033410: Data Exchange, Step Import - TRIANGULATED_FACE from STEP where there are no pnval entries
Problem fixed by using array of nodes in case when aPnindices is empty.
2024-03-24 22:26:23 +00:00
astromko
74095a8b46 0033367: Modeling Algorithms - Normal projection or BOP problem [Regression]
Fixed passing of an incorrect curve into GeomAdaptor::MakeCurve() function.
2024-03-24 22:25:59 +00:00
astromko
576f376108 0031601: Modeling Algorithms - BRepOffset_Tool Segmentation Fault
Added protection against null pointer dereferencing.
Modified BRepOffset_MakeOffset::MakeThickSolid method.
Fixed the problem with negative volume values.
Fixed several unit tests and added a new one.
2024-03-24 22:25:42 +00:00
ichesnok
447396c9b9 0029241: Data Exchange - Empty shape after reading STEP file.
Entity mechanical_design_and_draughting_relationship and function for its transfer added.
2024-03-18 22:17:56 +00:00
ichesnok
9d93d9b9b8 0033638: Data Exchange, Step Import - Style for tessellated object missed
TransferBRep_ShapeBinder used for tessellated face.
2024-03-16 19:36:33 +00:00
ichesnok
d5bcd33386 0033631: Data Exchange, Step import - Crash by reading STEP file
Creating Poly_Triangulation from ComplexTriangulatedSurfaceSet was fixed.
2024-03-16 19:36:18 +00:00
ichesnok
3888b58c27 0033603: Data Exchange, Step Import - Crash reading corrupted STEP file
Crash fixed by checking IsNull().
2024-03-16 19:35:48 +00:00
ichesnok
d1eae5b0d0 0033602: Data Exchange, Step - Carriage return removing
Carriage removing integrated
2024-03-16 19:35:29 +00:00
ichesnok
32f7b4e5bf 0033641: Data Exchange, Step Import - Changing default value for metadata flag
Value for myMetaMode flag changed from 'false' to 'true'.
2024-03-13 17:18:41 +00:00
ichesnok
993da38d54 0033611: Data Exchange - Incorrect header guard for STEP property
Incorrect header guard fixed.
2024-03-13 17:18:27 +00:00
ichesnok
a9becad233 0033596: Documentation - Incorrect default value read.step.tessellated
Default value of read.step.tessellated corrected.
2024-03-13 17:18:13 +00:00
abv
5939991070 0025415: Data Exchange - Invalid result of loading a STEP file
Handling of special case found on some STEP files produced by FPX Expert 2013 (PCB design system):
edge curve is line displaced from its true position but with correct direction;
we shift the line in this case so that it passes through vertices correcty.

Protection against possible exception in writing XDE.
2024-03-13 17:17:45 +00:00
astromko
e8a36f3a02 0033383: Modeling Algorithms - Wire/Face creation problem
ProjCurve3d and BRepAlgo_FaceRestrictor::Perform functions should not continue to work and should terminate if the BRep_Tool::Curve function returns null pointer.
2024-02-28 18:30:11 +00:00
ichesnok
f286953d85 0033530: Data Exchange, Step Import - Implement GENERAL_PROPERTY support
The necessary classes for GeneralProperty support were added.
The ReadMetadata method was created for reading and saving attributes.
2024-02-15 14:00:40 +00:00
ichesnok
20955d88da 0033261: Data Exchange, Step Import - Empty shape after reading process
Added a transfer for ShapeRepresentationRelationship in Transfer of MappedItem method,
in order to support link of components according to ISO 10303-203-2003.
2024-02-08 19:15:58 +00:00
ichesnok
80705eaf31 0033569: Data Exchange, STEP - Crash when reading multi-body file
Datum reading changed in ReadDatums() method:
using DatumSystemAP242 (DatumSystem or DatumReference) array
instead of DatumSystem array (DatumReference)
2024-02-02 12:11:45 +00:00
ichesnok
7b9bda716e 0025188: Data Exchange, Step Export - Losing shapes after import
Check on null for description added to WriteStep methods
(for product, product_definition and product_definition_formation)
2024-02-02 12:10:51 +00:00
ichesnok
dec56592dd 0032980: Data Exchange - STEP import produce a crash
Check on null for loop added
2024-01-30 11:02:05 +00:00
rodrlyra
f035e0718b 0033551: Visualization - Add new transform persistence mode to force orthographic projection on object.
The new transform persistence mode, with flag `Graphic3d_TMF_OrthoPers`, can be combined (bitwise OR operation) with the other persistence modes (2D, Trihedron or Zoom/Rotate Persistence) to make objects be rendered with orthographic projection when it is on a view with perspective projection.

If the view already uses orthographic projection, there will be no difference.

This feature was implemented to fix ViewCube being distorted when view with perspective projection changes size.
2024-01-17 12:53:49 +00:00
vglukhik
cb290cc932 Revert "0033551: Visualization - Add new transform persistence mode to force orthographic projection on object."
This reverts commit 0141024df595cdc8db3004927ca48c249776603b.
2024-01-15 15:15:41 +00:00
dpasukhi
cdc6566c3c 0033564: Data Exchange, STEP - Making default unit parameter
Updated signature for step makers with units
  to have default unit as a mm (no scaling)
2024-01-12 17:24:16 +00:00
oan
631a34a05f 0033567: Modeling Data - GeomLib_IsPlanarSurface raises exception SIGFPE Arithmetic Exception in Release mode
Add protection against zero-division
2024-01-12 17:23:55 +00:00
rodrlyra
0141024df5 0033551: Visualization - Add new transform persistence mode to force orthographic projection on object.
The new transform persistence mode, with flag `Graphic3d_TMF_OrthoPers`, can be combined (bitwise OR operation) with the other persistence modes (2D, Trihedron or Zoom/Rotate Persistence) to make objects be rendered with orthographic projection when it is on a view with perspective projection.

If the view already uses orthographic projection, there will be no difference.

This feature was implemented to fix ViewCube being distorted when view with perspective projection changes size.
2024-01-05 18:36:54 +00:00
drochalo
5c94806385 0032487: Visualization - synchronize myHasEntityWithPersistence with such entities number
Changed myHasEntityWithPersistence to a counter.
Renamed variable to myNbEntityWithPersistence.
Modified HasEntityWithPersistence() method.
Modified logical test in SelectMgr_ViewerSelector::traverseObject.
2023-12-26 08:38:03 +00:00
dpasukhi
f0caf64f54 Update version to 7.8.1 dev 2023-12-26 08:38:01 +00:00
25667 changed files with 2495664 additions and 2464379 deletions

41
.clang-format Normal file
View File

@ -0,0 +1,41 @@
# clang-format configuration file trying to apply OCCT coding style
#
# Clang formatting rules: https://clang.llvm.org/docs/ClangFormatStyleOptions.html
# The clang-format npm package (https://github.com/angular/clang-format) uses
# a pre-built clang-format.exe from http://llvm.org/builds/
#
# We use defaults from the Microsoft style
BasedOnStyle: Microsoft
#
# Style options
AllowAllParametersOfDeclarationOnNextLine: false
AllowAllArgumentsOnNextLine: false
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: Consecutive
AlignConsecutiveDeclarations: Consecutive
AlignTrailingComments: true
AllowShortFunctionsOnASingleLine: Inline
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: true
ColumnLimit: 100
ContinuationIndentWidth: 2
IndentCaseLabels: true
IndentPPDirectives: BeforeHash
IndentWidth: 2
IndentWrappedFunctionNames: true
PackConstructorInitializers: Never
PointerAlignment: Left
ReferenceAlignment: Left
SeparateDefinitionBlocks: Always
SortIncludes: false
UseTab: Never
#
# OCCT specific settings
StatementMacros:
- Standard_FALLTHROUGH
- Standard_DEPRECATED
TypenameMacros:
- Handle

2
.git-blame-ignore-revs Normal file
View File

@ -0,0 +1,2 @@
# Global formatting with new rules using clang-format 18.1.8
a5a7b3185b83c39d5b26cfaf138b9b87b5776e59

59
.github/CLA.md vendored Normal file
View File

@ -0,0 +1,59 @@
# Contributor License Agreement - OPEN CASCADE TECHNOLOGY
Thank You for Your interest in Open CASCADE Technology.
In order to clarify the intellectual property rights and the license granted to OPEN CASCADE SAS with contributions from You, any person or entity, OPEN CASCADE SAS must have this Contributor License Agreement (hereinafter referred to as "CLA") signed by You, indicating Your acceptance and consent to the license terms below. This license is for Your protection as a contributor as well as for the protection of OPEN CASCADE SAS and its users; it does not change Your rights to use Your own contributions for any other purpose.
This CLA applies to any contribution that You make to the product "Open CASCADE Technology" (hereinafter referred to as "OCCT", "the Product") developed by OPEN CASCADE SAS, including all contributions You made prior to signing this CLA and all of Your future contributions submitted to OPEN CASCADE SAS as long as You agree to this CLA, and sets out the intellectual property rights You grant to OPEN CASCADE SAS in the contributed materials. The term "us" shall also mean OPEN CASCADE SAS.
The term "You" shall mean the person or entity identified below, representing the copyright owner or legal entity authorized by the copyright owner that is making this agreement with OPEN CASCADE SAS. For legal entities, the entity making a contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single contributor. For the purposes of this definition, "control" means (i) the power, either direct or indirect, to exert influence on the direction or management of such entity, whether by contract or otherwise, or (ii) the ownership of fifty percent (50%) or more of the outstanding shares, or (iii) the beneficial ownership of such entity.
Read this CLA carefully before signing and keep a copy for Your records. This CLA, its terms and conditions, constitute a binding legal agreement.
If You agree to be bound by the terms of this CLA, please complete and sign this CLA where indicated below, then scan and submit the scanned copy as a PDF file to OPEN CASCADE SAS via Your user account section on the Web portal. Alternatively, You may send the signed CLA to OPEN CASCADE SAS by facsimile or in hard copy to the attention of DANIEL BRUNIER-COULIN at OPEN CASCADE SAS headquarters using the contact information provided in the "Contact Us" section.
1. The term "contribution" or "contributed materials" means any source code, object code, patch, tool, sample, graphic, specification, manual, documentation, any original work of authorship, including any modifications or additions to an existing work or any other material intentionally posted or submitted by You to us. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to OPEN CASCADE SAS or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, OPEN CASCADE SAS for the purpose of, but not limited to, discussing and improving a work or possible integration to future certified releases of OCCT, but excluding communication that is conspicuously marked or otherwise designated in writing by You or OPEN CASCADE SAS as "Not A Contribution" or "NAC".
2. With respect to any worldwide copyrights, or copyright applications and registrations, in Your contribution:
a) You hereby assign to OPEN CASCADE SAS joint ownership, and to the extent that such assignment is or becomes invalid, ineffective or unenforceable, You hereby grant to OPEN CASCADE SAS a perpetual, irrevocable, non-exclusive, worldwide, no-charge, royalty-free, unrestricted license to exercise all rights under the intellectual property law and rules in force or under the copyright if chosen by OPEN CASCADE SAS. This includes, at the option of OPEN CASCADE SAS, the right to sublicense these same rights to third parties through multiple levels of sub-licensees or other licensing arrangements;
b) You agree that OPEN CASCADE SAS can do all things in relation to Your contribution as if OPEN CASCADE SAS were its sole owner, and if OPEN CASCADE SAS makes a derivative work of Your contribution, OPEN CASCADE SAS will be the sole owner of that derivative work;
c) You agree that You will not assert any moral rights in Your contribution against OPEN CASCADE SAS, our licensees or transferees;
d) You agree that OPEN CASCADE SAS may register a copyright or any other intellectual property law in force in Your contribution and exercise all ownership rights associated with it; and
e) You agree that OPEN CASCADE SAS has no duty to consult with, obtain the consent of, pay or render an accounting to You or any third parties for any use or distribution of Your contribution.
3. With respect to any patents You own, or that You can license without payment to any third party, You hereby grant to OPEN CASCADE SAS a perpetual, irrevocable, non-exclusive, worldwide, no-charge, royalty-free, unrestricted license to:
a) make, have made, use, sell, offer to sell, import, and otherwise transfer Your contribution in whole or in part, alone or in combination with or included in any product, work or materials arising out of the Product which Your contribution was submitted for;
b) sublicense these same rights to third parties through multiple levels of sub-licensees or other licensing arrangements; and
c) reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your contributions and such derivative works.
4. Except as set out above, You keep all right, title, and interest in Your contribution. The rights that You grant to OPEN CASCADE SAS under these terms are effective on the date You first submitted a contribution to OPEN CASCADE SAS, even if Your submission took place before the date You sign these terms. Any contribution OPEN CASCADE SAS makes available under any license will also be made available under the Open Cascade Technology Public License (OCCTPL) or a suitable FSF (Free Software Foundation) or OSI (Open Source Initiative) approved license, if adopted by OPEN CASCADE SAS.
5. You covenant, represent and warrant that:
a) each contribution that You submit is and shall be an original work of authorship and that You can legally grant the rights set out in this CLA; and
b) each contribution will not violate any third party's copyrights, trademarks, patents, or other intellectual property rights; and
c) if any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that Your contribution, or the work to which You have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this CLA for that contribution or work shall terminate as of the date such litigation is filed; and
d) You have received permission to make contributions on behalf of the employer, that Your employer has waived such rights for Your contributions to OPEN CASCADE SAS, or that Your employer (that has rights to intellectual property that You create that includes Your contributions) has executed a separate corporate CLA with OPEN CASCADE SAS.
6. Should You wish to submit work that is not Your original creation, You may submit it to OPEN CASCADE SAS separately from any contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements), and conspicuously marking the work as "Submitted on behalf of a third-party: [named here]".
7. You agree to notify OPEN CASCADE SAS if You become aware of any circumstance which would make any of the foregoing representations inaccurate in any respect. OPEN CASCADE SAS may publicly disclose Your contribution to the Product and the fact that You have signed this CLA.
8. You are not expected to provide support for Your contributions, except to the extent You desire to provide support.
9. This CLA is governed by the laws of France or an applicable law at the sole written choice of OPEN CASCADE SAS.
10. You may stop being bound by the terms of this CLA at any time, for any reason, by asking OPEN CASCADE through the Contact Us form. Even after its termination, this CLA still applies to all contributions You made prior to terminating the CLA. On the other hand, if You want to contribute again, You'll need to sign a new CLA.
[Contributor_License_Agreement.pdf](https://dev.opencascade.org/sites/default/files/Contributor_License_Agreement.pdf)

39
.github/CLA_SIGNING.md vendored Normal file
View File

@ -0,0 +1,39 @@
# Signing the Contributor License Agreement
## In order to contribute code to OCCT, you (or the legal entity you represent) must sign the Contributor License Agreement (CLA).
### What is the Contributor License Agreement and why is it necessary to sign it?
The Contributor License Agreement is needed to clarify the terms of usage of contributions by OPEN CASCADE SAS and the entire open source community.
The Contributor License Agreement clarifies the intellectual property rights applicable to contributions. It confirms that the contributor retains ownership of his contributions (the OPEN CASCADE company does not require exclusive copyright transfer for these contributions) and gives all rights to OPEN CASCADE to use the contribution. In turn, OPEN CASCADE guarantees the open source availability of all integrated contributions.
### How to sign the Contributor License Agreement
Accepting and signing the Contributor License Agreement is a prerequisite for contributing code. To sign the CLA, please register yourself first, and then follow the steps below:
1. Select the "Get Involved" menu
2. Download the Contribution License Agreement pdf file and print it
3. Read the agreement and sign it
4. Scan the signed CLA to a pdf file
5. If not yet done, log on to this website
6. In the CLA sending form, press the "Browse" button
7. Select your signed CLA file
8. Press "Send"
We will need some time to approve the CLA that you have submitted. You will be notified by e-mail when your CLA is approved and you are assigned the Contributor role.
### Q&A on the Contribution Agreement
**I want to contribute code that I developed as part of my job. Can I contribute this code?**
Yes, but as (under applicable legislation) your employer typically will own all intellectual property that you create as part of your employment, it is important that your employer has consented to your participation and contributions in the OCCT Project. That provides clarity to all parties involved.
**Can we sign a CLA to enable contributions from several employees in our company?**
Yes, if your company has several employees ready to contribute, a person representing your company can sign the CLA whereby your employer can specify and manage who is able to contribute from your company.
**I want to notify the OCCT Project of a bug I found. Can I report this bug?**
Yes, you simply need to register (you then become a Member) for entering a bug. The bug can be entered using our bug tracker from the Get Involved page. But please note that as a Member of this project, you have accepted the Terms and Conditions of this website, so the materials you provide must conform to these Terms.
**Can I terminate my Contributor License Agreement?**
Yes, you may terminate your Contributor License Agreement by sending a written notice through the contact form of this portal. The termination of your CLA will become effective not later than 5 days from the notice date. Please note, however, that all contributions you might have made to the OCCT Project before your CLA termination remain covered by that CLA.

41
.github/CONTRIBUTING.md vendored Normal file
View File

@ -0,0 +1,41 @@
# Contributing to OCCT
## Contribute Code
In order to contribute code to OCCT, you must register on this [portal](https://dev.opencascade.org/) and sign the Contributor License Agreement (CLA).
- [Introduction: What is CLA and Why It Is Needed?](CLA_SIGNING.md)
- [Contribution License Agreement](CLA.md)
- [CLA Submission Form](https://dev.opencascade.org/get_involed/cla_submission_form)
### Steps to Submit Your Contribution
1. **Clone OCCT Git Repository**: See [Guide to installing and using Git for OCCT development](https://dev.opencascade.org/doc/overview/html/occt_contribution__git_guide.html) if you are not familiar with Git.
2. **Develop Your Change**: Ensure it complies with [OCCT Coding Rules](https://dev.opencascade.org/doc/overview/html/occt_contribution__coding_rules.html).
3. **Build and Verify**: Build the modified version of OCCT and verify it works as expected. Consider creating a test case.
4. **Register an Issue**: Register an issue in the [Mantis bug tracker](https://tracker.dev.opencascade.org/login_select_proj_page.php?ref=bug_report_page.php) or [GitHub issues](https://github.com/Open-Cascade-SAS/OCCT/issues) describing your change.
5. **Push Your Change**: Push your change to the Git repository in a branch with a name starting with "CR" followed by the issue ID, then switch the issue to Resolved.
The contribution then passes code review and testing; if everything is OK, it will be integrated into the master branch in about one week.
See [Contribution Workflow](https://dev.opencascade.org/doc/overview/html/occt_contribution__contribution_workflow.html) for other possibilities and details on how contributions are processed.
For more details on integration into GitHub, see the [GitHub Discussions Guide](https://github.com/Open-Cascade-SAS/OCCT/discussions/36).
## Contribute Ideas
Every big thing starts with an idea. We appreciate your vision on how to enhance Open CASCADE technology. Share your thoughts on the [OCCT product development forum](https://dev.opencascade.org/forums) or submit your meaningful ideas and bug reports via [Mantis tracker](https://tracker.dev.opencascade.org) or [GitHub issues](https://github.com/Open-Cascade-SAS/OCCT/issues).
- **Forum**: [OCCT product development forum](https://dev.opencascade.org/forums)
- **Reporting Issues**: [Mantis tracker](https://tracker.dev.opencascade.org) or [GitHub issues](https://github.com/Open-Cascade-SAS/OCCT/issues)
## Contribute Knowledge
Know a lot about OCCT? You can help educate other OCCT users by writing OCCT-related articles or blog posts, creating samples, examples, or tutorials, and even by writing a book about OCCT! If you would like us to share your content via official OCCT resources, please [contact us](https://dev.opencascade.org/webform/contact_us).
## Contribute Documentation and Tutorials
Do you have an idea on how to make OCCT Documentation easier for new users or even more exhaustive for professionals? Or want to help with proofreading and technical writing? Translating OCCT Documentation and materials into your native language is also very much appreciated. You are always welcome to submit your documentation improvement suggestions via [Mantis tracker](https://tracker.dev.opencascade.org) or [GitHub issues](https://github.com/Open-Cascade-SAS/OCCT/issues)..
## Contribute to the Community
At any community interaction points, we value your support in starting forum topics or replying to other users posts, joining Open CASCADE social networks, participating in GitHub or Stack Overflow projects, and just spreading the word about OCCT! Welcome to our community!

92
.github/ISSUE_TEMPLATE/Bug Report.yaml vendored Normal file
View File

@ -0,0 +1,92 @@
name: "Bug Report"
description: "Report a bug related to the OCCT"
labels: ["2. Bug", "0. New"]
body:
- type: markdown
attributes:
value: |
**Please provide the following information:**
- type: textarea
id: description
attributes:
label: Description
description: "A detailed description of the bug"
validations:
required: true
- type: textarea
id: expected_behavior
attributes:
label: Expected Behavior
description: "What you expected to happen"
validations:
required: true
- type: textarea
id: actual_behavior
attributes:
label: Actual Behavior
description: "What actually happened"
validations:
required: true
- type: textarea
id: sample_code
attributes:
label: Sample Code or DRAW Tcl Script
description: "Provide a C++ sample or DRAW Tcl script to reproduce the issue"
validations:
required: true
- type: dropdown
id: os
attributes:
label: Operating System
description: "Select the operating system"
options:
- Linux
- Windows
- macOS
default: 0
validations:
required: true
- type: dropdown
id: compiler
attributes:
label: Compiler
description: "Select the compiler"
options:
- GCC
- Clang
- MSVC
default: 0
validations:
required: true
- type: dropdown
id: bitness
attributes:
label: Bitness
description: "Select the bitness"
options:
- 32-bit
- 64-bit
default: 1
validations:
required: true
- type: dropdown
id: occt_version
attributes:
label: OCCT Version
description: "Select the OCCT version where the issue was detected"
options:
- 7.4
- 7.5
- 7.6
- 7.7
- 7.8
- 7.9
- latest
default: 6
validations:
required: true
- type: textarea
id: additional_files
attributes:
label: Additional Files
description: "Attach any additional files that may help in reproducing the issue"

View File

@ -0,0 +1,34 @@
name: "Feature Request"
description: "Request a new feature or enhancement for the OCCT"
labels: ["2. Enhancement", "0. New"]
body:
- type: markdown
attributes:
value: |
**Please provide the following information:**
- type: textarea
id: description
attributes:
label: Description
description: "A detailed description of the feature request"
validations:
required: true
- type: textarea
id: use_case
attributes:
label: Use Case
description: "Describe the use case for the feature"
validations:
required: true
- type: textarea
id: benefits
attributes:
label: Benefits
description: "Explain the benefits of the feature"
validations:
required: true
- type: textarea
id: additional_context
attributes:
label: Additional Context
description: "Any additional context or information"

14
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,14 @@
blank_issues_enabled: false
contact_links:
- name: Collaborative development portal
url: https://dev.opencascade.org/forums
about: You can also use the collaborative development portal to ask questions and discuss the problem you are seeing
- name: GitHub discussions
url: https://github.com/Open-Cascade-SAS/OCCT/discussions
about: You can also use GitHub discussions to ask questions and discuss the problem you are seeing
- name: Mantis bug tracker
url: https://tracker.dev.opencascade.org/
about: You can also use the Mantis bug tracker to report bugs and issues
- name: Contact US form
url: https://dev.opencascade.org/webform/contact_us
about: You can also use the Contact US form to ask questions and discuss the problem you are seeing

68
.github/actions/build-docs/action.yml vendored Normal file
View File

@ -0,0 +1,68 @@
name: Build Documentation
description: 'Build OCCT documentation using doxygen'
runs:
using: composite
steps:
- name: Install dependencies
run: |
choco install -y graphviz
choco install -y doxygen.install
shell: pwsh
- name: Download and extract 3rdparty dependencies
run: |
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
shell: pwsh
- name: Configure OCCT
run: |
mkdir build
cd build
cmake -T host=x64 `
-D USE_FREETYPE=ON `
-D USE_TK=OFF `
-D BUILD_USE_PCH=ON `
-D BUILD_OPT_PROFILE=Production `
-D BUILD_INCLUDE_SYMLINK=ON `
-D CMAKE_BUILD_TYPE=Release `
-D BUILD_DOC_Overview=ON `
-D BUILD_DOC_RefMan=ON `
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
-D INSTALL_DIR=${{ github.workspace }}/install `
-D USE_D3D=ON `
-D USE_DRACO=ON `
-D USE_FFMPEG=ON `
-D USE_FREEIMAGE=ON `
-D USE_GLES2=ON `
-D USE_OPENVR=ON `
-D USE_VTK=ON `
-D USE_TBB=ON `
-D USE_RAPIDJSON=ON `
-D USE_OPENGL=ON `
-D CMAKE_CXX_FLAGS="/W4 /WX" `
-D CMAKE_C_FLAGS="/W4 /WX" ..
shell: pwsh
- name: Build documentation
run: |
set PATH=%PATH%;C:\Program Files\doxygen\bin;C:\Program Files\Graphviz\bin;C:\Program Files\doxygen
cd build
cmake --build . --target doc --config Release
shell: cmd
- name: Upload refman documentation
uses: actions/upload-artifact@v4.4.3
with:
name: refman-doc
path: build/doc/refman
retention-days: 90
- name: Upload overview documentation
uses: actions/upload-artifact@v4.4.3
with:
name: overview-doc
path: build/doc/overview
retention-days: 90

View File

@ -0,0 +1,57 @@
name: 'Build CSharp Sample'
description: 'Build CSharp sample using OCCT installation'
inputs:
platform:
description: 'Build platform (windows)'
required: true
install-artifact-name:
description: 'OCCT installation artifact name'
required: true
runs:
using: "composite"
steps:
- name: Download OCCT installation
uses: actions/download-artifact@v4.1.7
with:
name: ${{ inputs.install-artifact-name }}
path: occt-install
- name: Build CSharp Sample
if: inputs.platform == 'windows'
shell: cmd
run: |
REM Setup environment
call "${{ github.workspace }}\occt-install\env.bat" vc14 win64 Release
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" x64
set "PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE;%PATH%"
cd ${{ github.workspace }}/samples/CSharp
REM First upgrade solutions to VS2022
echo "Upgrading solution files to VS2022..."
devenv.exe CSharp.sln /upgrade
devenv.exe CSharp_D3D.sln /upgrade
REM Update project platform toolset
powershell -Command "(Get-Content OCCTProxy\OCCTProxy.vcxproj) -replace '<PlatformToolset>v100</PlatformToolset>', '<PlatformToolset>v143</PlatformToolset>' | Set-Content OCCTProxy\OCCTProxy.vcxproj"
powershell -Command "(Get-Content OCCTProxy_D3D\OCCTProxy_D3D.vcxproj) -replace '<PlatformToolset>v100</PlatformToolset>', '<PlatformToolset>v143</PlatformToolset>' | Set-Content OCCTProxy_D3D\OCCTProxy_D3D.vcxproj"
REM Restore NuGet packages
echo "Upgrading solution files..."
msbuild.exe CSharp.sln -t:Restore -p:Configuration=Release -p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=restore_csharp.log;Verbosity=detailed
msbuild.exe CSharp_D3D.sln -t:Restore -p:Configuration=Release -p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=restore_d3d.log;Verbosity=detailed
REM Build solutions with real-time console output
echo "Building CSharp.sln..."
msbuild.exe CSharp.sln /p:Configuration=Release /p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=build_csharp.log;Verbosity=detailed /m
echo "Building CSharp_D3D.sln..."
msbuild.exe CSharp_D3D.sln /p:Configuration=Release /p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=build_d3d.log;Verbosity=detailed /m
- name: Upload CSharp Sample
uses: actions/upload-artifact@v4.4.3
with:
name: csharp-sample-${{ inputs.platform }}-x64
path: samples/CSharp
retention-days: 7

View File

@ -0,0 +1,54 @@
name: 'Build MFC Sample'
description: 'Build MFC sample using OCCT installation'
inputs:
platform:
description: 'Build platform (windows)'
required: true
install-artifact-name:
description: 'OCCT installation artifact name'
required: true
runs:
using: "composite"
steps:
- name: Download OCCT installation
uses: actions/download-artifact@v4.1.7
with:
name: ${{ inputs.install-artifact-name }}
path: occt-install
- name: Build MFC Sample
if: inputs.platform == 'windows'
shell: cmd
run: |
REM Setup environment
call "${{ github.workspace }}\occt-install\env.bat" vc14 win64 Release
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" x64
cd ${{ github.workspace }}/samples/mfc/standard
set "PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE;%PATH%"
REM First restore the solution
echo "Restoring solution..."
msbuild.exe ALL-vc14.sln -t:Restore -p:Configuration=Release -p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=restore.log;Verbosity=detailed
REM Build solution with detailed logging
echo "Building solution..."
msbuild.exe ALL-vc14.sln /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v143 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=build.log;Verbosity=detailed /m
REM Display logs if build fails
if errorlevel 1 (
echo "Build failed. Contents of restore.log:"
type restore.log
echo "Contents of build.log:"
type build.log
exit /b 1
)
- name: Upload MFC Sample
uses: actions/upload-artifact@v4.4.3
with:
name: mfc-sample-${{ inputs.platform }}-x64
path: samples/mfc/
retention-days: 7

View File

@ -0,0 +1,108 @@
name: 'Build Qt Sample'
description: 'Build Qt samples using OCCT installation'
inputs:
platform:
description: 'Build platform (windows/linux)'
required: true
install-artifact-name:
description: 'OCCT installation artifact name'
required: true
thirdparty_url:
description: 'URL to download 3rdparty dependencies'
required: false
default: 'https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip'
runs:
using: "composite"
steps:
- name: Download OCCT installation
uses: actions/download-artifact@v4.1.7
with:
name: ${{ inputs.install-artifact-name }}
path: occt-install
- name: Install Windows dependencies
if: inputs.platform == 'windows'
shell: pwsh
run: |
Invoke-WebRequest -Uri ${{ inputs.thirdparty_url }} -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
- name: Install Linux dependencies
if: inputs.platform == 'linux'
shell: bash
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev qtbase5-dev qt5-qmake qtbase5-dev-tools qtdeclarative5-dev qttools5-dev qttools5-dev-tools
- name: Setup MSBuild
if: inputs.platform == 'windows'
uses: microsoft/setup-msbuild@v2
- name: Build Qt Samples - Windows
if: inputs.platform == 'windows'
shell: cmd
run: |
REM Setup environment
cd ${{ github.workspace }}/occt-install/
call env.bat vc14 win64 Release
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" x64
REM Setup Qt environment
set "QTDIR=${{ github.workspace }}\3rdparty-vc14-64\qt5.11.2-vc14-64"
set "PATH=%QTDIR%\bin;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE;%PATH%"
cd ${{ github.workspace }}/samples/qt
for %%s in (IESample Tutorial FuncDemo) do (
cd %%s
echo "Generating project for %%s..."
qmake -tp vc -r -o %%s.sln %%s0.pro
echo "Restoring %%s..."
msbuild.exe %%s.sln -t:Restore -p:Configuration=Release -p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=%%s_restore.log;Verbosity=detailed
echo "Building %%s..."
msbuild.exe %%s.sln /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v143 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=%%s_build.log;Verbosity=detailed /m
REM Display logs if build fails
if errorlevel 1 (
echo "Build failed for %%s. Contents of restore log:"
type %%s_restore.log
echo "Contents of build log:"
type %%s_build.log
exit /b 1
)
cd ..
)
- name: Build Qt Samples - Linux
if: inputs.platform == 'linux'
shell: bash
run: |
cd ${{ github.workspace }}/occt-install/bin
source env.sh
cd ${{ github.workspace }}/samples/qt
for sample in IESample Tutorial FuncDemo; do
cd $sample
aQMakePath=`which qmake`
host=`uname -s`
export STATION=$host
export RES_DIR="${{ github.workspace }}/samples/qt/${sample}/result"
qmake $sample.pro
aNbJobs="$(getconf _NPROCESSORS_ONLN)"
make -j$aNbJobs release
cd ..
done
- name: Upload Qt Samples
uses: actions/upload-artifact@v4.4.3
with:
name: qt-samples-${{ inputs.platform }}-x64
path: |
samples/qt/
samples/qt/
retention-days: 7

View File

@ -0,0 +1,93 @@
name: 'Build TInspector'
description: 'Build TInspector using OCCT installation as a separate job'
inputs:
platform:
description: 'Build platform (windows/linux)'
required: true
install-artifact-name:
description: 'OCCT installation artifact name'
required: true
thirdparty_url:
description: 'URL to download 3rdparty dependencies'
required: false
default: 'https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip'
runs:
using: "composite"
steps:
- name: Download OCCT installation
uses: actions/download-artifact@v4.1.7
with:
name: ${{ inputs.install-artifact-name }}
path: occt-install
- name: Install Windows dependencies
if: inputs.platform == 'windows'
shell: pwsh
run: |
Invoke-WebRequest -Uri ${{ inputs.thirdparty_url }} -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
- name: Install Linux dependencies
if: inputs.platform == 'linux'
shell: bash
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev qtbase5-dev qt5-qmake qtbase5-dev-tools qtdeclarative5-dev qttools5-dev qttools5-dev-tools
- name: Checkout TInspector
shell: bash
run: |
git clone https://github.com/Open-Cascade-SAS/Inspector.git inspector
cd inspector
git checkout 6da9ba776ef72a17dca3331974df4200024c7f34
- name: Configure TInspector - Windows
if: inputs.platform == 'windows'
shell: pwsh
run: |
cd inspector
mkdir build
cd build
cmake -G "Visual Studio 17 2022" -A x64 `
-D CMAKE_BUILD_TYPE=Release `
-D BUILD_SHARED_LIBS=ON `
-D 3RDPARTY_DIR=${{ github.workspace }}//3rdparty-vc14-64 `
-D OpenCASCADE_DIR=${{ github.workspace }}/occt-install `
-D INSTALL_DIR=${{ github.workspace }}/inspector/install `
..
- name: Configure TInspector - Linux
if: inputs.platform == 'linux'
shell: bash
run: |
cd inspector
mkdir build
cd build
cmake -G "Unix Makefiles" \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_SHARED_LIBS=ON \
-D OpenCASCADE_DIR=${{ github.workspace }}/occt-install \
-D INSTALL_DIR=${{ github.workspace }}/inspector/install \
..
- name: Build TInspector - Windows
if: inputs.platform == 'windows'
shell: pwsh
run: |
cd inspector/build
cmake --build . --config Release --target install
- name: Build TInspector - Linux
if: inputs.platform == 'linux'
shell: bash
run: |
cd inspector/build
make install -j$(nproc)
- name: Upload TInspector installation
uses: actions/upload-artifact@v4.4.3
with:
name: inspector-${{ inputs.platform }}-x64
path: inspector/install
retention-days: 7

View File

@ -0,0 +1,85 @@
name: 'Clang-Format Code Check'
description: 'Check code formatting of changed files using clang-format'
inputs:
base-ref:
description: 'Base reference to compare changes against'
required: true
default: 'master'
file-pattern:
description: 'Pattern to match files for formatting check'
required: false
default: '^(src)/.*\.(cpp|hxx|cxx|lxx|h|pxx|hpp)$'
clang-format-version:
description: 'Required clang-format version'
required: false
default: '18.1.8'
outputs:
has-changes:
description: 'Whether any files needed formatting'
value: ${{ steps.git-check.outputs.has_changes }}
runs:
using: "composite"
steps:
- name: Check clang-format version
shell: pwsh
run: |
$version = clang-format --version
Write-Output "Detected clang-format version: $version"
$version | Select-String "${{ inputs.clang-format-version }}" >$null
if ($LASTEXITCODE -ne 0) {
echo "::error::Wrong clang-format version. Expected ${{ inputs.clang-format-version }}"
Write-Output "Error: Version mismatch - expected ${{ inputs.clang-format-version }}"
exit 1
}
- name: Get changed files
id: changed-files
shell: pwsh
run: |
$changedFiles = git diff --name-only origin/${{ inputs.base-ref }} HEAD |
Where-Object { $_ -match '${{ inputs.file-pattern }}' } |
Where-Object { Test-Path $_ }
$changedFiles | Set-Content "changed_files.txt"
if ($changedFiles.Count -gt 0) {
echo "has_files=true" >> $env:GITHUB_OUTPUT
}
- name: Check formatting
if: steps.changed-files.outputs.has_files == 'true'
shell: pwsh
run: |
$files = Get-Content "changed_files.txt" | Where-Object { Test-Path $_ }
$files | ForEach-Object -ThrottleLimit 8 -Parallel {
clang-format -i -style=file $_
}
- name: Check git status
id: git-check
if: steps.changed-files.outputs.has_files == 'true'
shell: pwsh
run: |
git diff > format.patch
if ((Get-Item format.patch).length -gt 0) {
echo "has_changes=true" >> $env:GITHUB_OUTPUT
}
- name: Upload patch
if: steps.git-check.outputs.has_changes == 'true'
uses: actions/upload-artifact@v4
with:
name: format-patch
path: format.patch
- name: Failing step for formatting issues
if: steps.git-check.outputs.has_changes == 'true'
shell: pwsh
run: |
echo "::error::Files need formatting. To fix: 1. Download format.patch 2. \"git apply format.patch\" 3. Commit and push"
exit 1
branding:
icon: 'check-square'
color: 'green'

145
.github/actions/run-gtest/action.yml vendored Normal file
View File

@ -0,0 +1,145 @@
name: 'Run GTest Validation'
description: 'Execute GTest suite and validate results'
inputs:
platform:
description: 'Platform (windows, macos, linux)'
required: true
compiler:
description: 'Compiler (msvc, clang, gcc)'
required: true
install-artifact-name:
description: 'Name of the artifact containing the installed files'
required: true
artifact-suffix:
description: 'Suffix for the GTest results artifact name'
required: true
default: 'x64'
outputs:
has-failures:
description: 'Whether any tests failed'
value: ${{ steps.check-failures.outputs.has_failures }}
runs:
using: "composite"
steps:
- name: Download and extract install directory
uses: actions/download-artifact@v4.1.7
with:
name: ${{ inputs.install-artifact-name }}
path: install
- name: Download and extract 3rdparty dependencies for Windows
if: inputs.platform == 'windows'
shell: pwsh
run: |
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
- name: Install macOS dependencies
if: inputs.platform == 'macos'
shell: bash
run: |
brew update
brew install tcl-tk tbb gl2ps xerces-c \
libxmu libxi libxft libxpm \
glew freeimage draco glfw
- name: Install Linux dependencies
if: inputs.platform == 'linux'
shell: bash
run: |
sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake clang make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev
- name: Setup Xvfb and Mesa for Linux
if: inputs.platform == 'linux'
uses: ./.github/actions/setup-xvfb-mesa
- name: Set execute permissions on Unix platforms
if: inputs.platform != 'windows'
shell: bash
run: |
chmod +x install/bin/OpenCascadeGTest
- name: Run OpenCascadeGTest on Windows
if: inputs.platform == 'windows'
id: run-gtest-windows
shell: cmd
run: |
cd install
call env.bat ${{ inputs.compiler == 'msvc' && 'vc14' || 'clang' }} win64 release
cd bin
set GTEST_OUTPUT=""
OpenCascadeGTest.exe --gtest_output=xml:gtest_results.xml > gtest_output.log 2>&1
type gtest_output.log
exit /b 0
- name: Run OpenCascadeGTest on Unix platforms
if: inputs.platform != 'windows'
id: run-gtest-unix
shell: bash
env:
DISPLAY: ${{ inputs.platform == 'linux' && ':99' || '' }}
LIBGL_ALWAYS_SOFTWARE: 1
run: |
cd install/bin
source env.sh
./OpenCascadeGTest --gtest_output=xml:gtest_results.xml > gtest_output.log 2>&1
cat gtest_output.log
- name: Upload GTest results
uses: actions/upload-artifact@v4.4.3
with:
name: gtest-results-${{ inputs.platform }}-${{ inputs.compiler }}-${{ inputs.artifact-suffix }}
path: |
install/bin/gtest_results.xml
install/bin/gtest_output.log
retention-days: 15
- name: Check for test failures on Windows
if: inputs.platform == 'windows'
id: check-failures-windows
shell: pwsh
run: |
cd install/bin
$log = Get-Content "gtest_output.log" -Raw
if ($log -match "\[\s+FAILED\s+\]") {
Write-Error "GTest failures detected in the output."
echo "has_failures=true" >> $env:GITHUB_OUTPUT
} else {
Write-Output "No GTest failures detected."
echo "has_failures=false" >> $env:GITHUB_OUTPUT
}
- name: Check for test failures on Unix
if: inputs.platform != 'windows'
id: check-failures-unix
shell: bash
run: |
cd install/bin
if grep -q "\[ FAILED \]" gtest_output.log; then
echo "::error::GTest failures detected in the output."
echo "has_failures=true" >> $GITHUB_OUTPUT
else
echo "No GTest failures detected."
echo "has_failures=false" >> $GITHUB_OUTPUT
fi
- name: Set combined output
id: check-failures
shell: bash
run: |
if [ "${{ inputs.platform }}" == "windows" ]; then
echo "has_failures=${{ steps.check-failures-windows.outputs.has_failures }}" >> $GITHUB_OUTPUT
else
echo "has_failures=${{ steps.check-failures-unix.outputs.has_failures }}" >> $GITHUB_OUTPUT
fi
- name: Fail job if tests failed
if: steps.check-failures.outputs.has_failures == 'true'
shell: bash
run: |
echo "::error::GTest failures detected"
exit 1

View File

@ -0,0 +1,90 @@
import os
import re
from bs4 import BeautifulSoup
from pathlib import Path
import glob
import os.path
def get_referenced_images(html_file):
# Get the directory containing the HTML file
html_dir = os.path.dirname(os.path.abspath(html_file))
with open(html_file, 'r', encoding='utf-8') as f:
soup = BeautifulSoup(f.read(), 'html.parser')
images = set()
# Extract direct image references
for img in soup.find_all('img'):
if src := img.get('src'):
# Convert relative path to absolute
abs_path = os.path.normpath(os.path.join(html_dir, src))
images.add(abs_path)
# Extract toggle references
for elem in soup.find_all(attrs={'onclick': True}):
onclick = elem['onclick']
paths = re.findall(r'diffimage_toggle\(this,"([^"]+)","([^"]+)"\)', onclick)
for src1, src2 in paths:
# Convert relative paths to absolute
abs_path1 = os.path.normpath(os.path.join(html_dir, src1))
abs_path2 = os.path.normpath(os.path.join(html_dir, src2))
images.add(abs_path1)
images.add(abs_path2)
return images
def cleanup_platform_images(results_dir, platform):
html_file = f"{results_dir}/current/{platform}/diff-*.html"
html_files = glob.glob(html_file)
if not html_files:
print(f"No diff HTML found for {platform}")
return
# Get referenced images from HTML
referenced = set()
for html in html_files:
images = get_referenced_images(html)
referenced.update(images)
# Convert relative paths to absolute
base_dir = Path(results_dir)
current_dir = base_dir / "current" / platform
master_dir = base_dir / "master" / platform
# Find all PNGs
png_files = set()
for directory in [current_dir, master_dir]:
for root, _, files in os.walk(directory):
for file in files:
if file.lower().endswith('.png'):
png_files.add(Path(root) / file)
# Remove unreferenced PNGs
for png in png_files:
if str(png) not in referenced:
try:
png.unlink()
except OSError as e:
print(f"Error removing {png}: {e}")
def main():
platforms = [
"windows-x64",
"windows-clang-x64",
"macos-x64",
"macos-gcc-x64",
"linux-clang-x64",
"linux-gcc-x64"
]
results_dir = Path("./").resolve()
for platform in platforms:
print(f"\nProcessing {platform}...")
cleanup_platform_images(results_dir, platform)
if __name__ == "__main__":
main()

View File

@ -0,0 +1,18 @@
name: 'Setup Xvfb and Mesa'
description: 'Installs and configures Xvfb and Mesa for graphical testing on Linux'
runs:
using: composite
steps:
- name: Install Xvfb and Mesa
run: |
sudo apt-get update
sudo apt-get install -y xvfb mesa-utils libgl1-mesa-dri
shell: bash
- name: Start Xvfb
run: |
Xvfb :99 -screen 0 1920x1080x24 &
echo "DISPLAY=:99" >> $GITHUB_ENV
echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV
shell: bash

View File

@ -0,0 +1,32 @@
set exclude_list [list \
"bugs caf bug31075" \
"bugs caf bug31546" \
"bugs fclasses bug6143" \
"bugs fclasses bug25574" \
"bugs fclasses bug29064" \
"bugs fclasses bug7287_3" \
"bugs fclasses bug7287_5" \
"bugs moddata_2 bug712_2" \
"bugs moddata_1 bug20627" \
"collections n arrayMove" \
"lowalgos intss bug565" \
"lowalgos intss bug567_1" \
"lowalgos intss bug23972" \
"lowalgos intss bug29910_2" \
"opengl background bug27836" \
"opengl text C4" \
"opengles3 background bug27836" \
"opengles3 general msaa" \
"opengles3 geom interior1" \
"opengles3 geom interior2" \
"opengles3 raytrace msaa" \
"opengles3 text C4" \
"opengles3 textures alpha_mask" \
"boolean bopfuse_simple ZP6" \
"boolean gdml_private B5" \
"bugs modalg_1 bug19071" \
"bugs modalg_5 bug25199"
]
set exclude_str [join $exclude_list ,]
testgrid -exclude {*}$exclude_str -outdir results/linux-clang-x64

View File

@ -0,0 +1,28 @@
set exclude_list [list \
"bugs caf bug31075" \
"bugs caf bug31546" \
"bugs fclasses bug6143" \
"bugs moddata_2 bug712_2" \
"bugs moddata_1 bug20627" \
"bugs modalg_6 bug27884" \
"lowalgos intss bug565" \
"lowalgos intss bug567_1" \
"lowalgos intss bug23972" \
"lowalgos intss bug29910_2" \
"opengl background bug27836" \
"opengl text C4" \
"opengles3 background bug27836" \
"opengles3 general msaa" \
"opengles3 geom interior1" \
"opengles3 geom interior2" \
"opengles3 raytrace msaa" \
"opengles3 text C4" \
"opengles3 textures alpha_mask" \
"boolean bopfuse_simple ZP6" \
"boolean gdml_private B5" \
"bugs modalg_1 bug19071" \
"bugs modalg_5 bug25199"
]
set exclude_str [join $exclude_list ,]
testgrid -exclude {*}$exclude_str -outdir results/linux-gcc-x64

View File

@ -0,0 +1 @@
testgrid -outdir results/macos-x64 caf basic

View File

@ -0,0 +1 @@
testgrid -outdir results/macos-gcc-x64 caf basic

View File

@ -0,0 +1,24 @@
set exclude_list [list \
"bugs fclasses bug6143" \
"bugs modalg_5 bug24639" \
"bugs modalg_7 bug83" \
"bugs caf bug31918_1" \
"chamfer dist_angle_sequence A5" \
"opengl background bug27836" \
"opengl drivers d3dhost" \
"opengl background srgb" \
"opengl text C4" \
"opengles2 text C4" \
"opengles3 text C4" \
"boolean gdml_private B5" \
"chamfer dist_angle A3" \
"chamfer dist_angle E5" \
"chamfer dist_angle_complex A1" \
"chamfer dist_angle_complex A4" \
"chamfer dist_angle_complex A5" \
"chamfer dist_angle_sequence A1" \
"chamfer dist_angle_sequence A4"
]
set exclude_str [join $exclude_list ,]
testgrid -exclude {*}$exclude_str -outdir results/windows-x64

View File

@ -0,0 +1,25 @@
set exclude_list [list \
"bugs caf bug31918_1" \
"bugs fclasses bug6143" \
"bugs fclasses bug25574" \
"bugs fclasses bug29064" \
"chamfer dist_angle_sequence A5" \
"collections n arrayMove" \
"opengl background bug27836" \
"opengl drivers d3dhost" \
"opengl background srgb" \
"opengl text C4" \
"opengles2 text C4" \
"opengles3 text C4" \
"boolean gdml_private B5" \
"chamfer dist_angle A3" \
"chamfer dist_angle E5" \
"chamfer dist_angle_complex A1" \
"chamfer dist_angle_complex A4" \
"chamfer dist_angle_complex A5" \
"chamfer dist_angle_sequence A1" \
"chamfer dist_angle_sequence A4"
]
set exclude_str [join $exclude_list ,]
testgrid -exclude {*}$exclude_str -outdir results/windows-clang-x64

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,219 @@
# This workflow validates the build on Windows using MinGW and MSYS2.
# It is triggered on pushes to the master branch.
# The workflow includes steps to install dependencies, configure, build, and clean up the project.
name: MinGW build validation
on:
push:
branches:
- 'master'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
main_job:
name: Windows MinGW validation
runs-on: windows-2022
strategy:
matrix:
config:
- {
name: "GCC",
cc: "x86_64-w64-mingw32-gcc",
cxx: "x86_64-w64-mingw32-g++",
package: "mingw-w64-x86_64-toolchain",
thirdparty_dir: "/mingw64",
compiler_flags: "",
dependencies: "mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-rapidjson mingw-w64-x86_64-freetype mingw-w64-x86_64-draco mingw-w64-x86_64-freeimage mingw-w64-x86_64-tbb mingw-w64-x86_64-tk mingw-w64-x86_64-tcl mingw-w64-x86_64-openvr mingw-w64-x86_64-jemalloc mingw-w64-x86_64-mesa mingw-w64-x86_64-angleproject mingw-w64-x86_64-llvm-openmp mingw-w64-x86_64-winpthreads-git mingw-w64-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
}
- {
name: "Clang",
cc: "clang",
cxx: "clang++",
package: "mingw-w64-clang-x86_64-toolchain",
thirdparty_dir: "/clang64",
compiler_flags: "-D CMAKE_CXX_FLAGS=\"-Wall -Wextra\" -D CMAKE_C_FLAGS=\"-Wall -Wextra\"",
dependencies: "mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-ninja mingw-w64-clang-x86_64-rapidjson mingw-w64-clang-x86_64-freetype mingw-w64-clang-x86_64-draco mingw-w64-clang-x86_64-freeimage mingw-w64-clang-x86_64-tbb mingw-w64-clang-x86_64-tk mingw-w64-clang-x86_64-tcl mingw-w64-clang-x86_64-openvr mingw-w64-clang-x86_64-jemalloc mingw-w64-clang-x86_64-mesa mingw-w64-clang-x86_64-angleproject mingw-w64-clang-x86_64-llvm-openmp mingw-w64-clang-x86_64-winpthreads-git mingw-w64-clang-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
}
- {
name: "UCRT",
cc: "x86_64-w64-mingw32-gcc",
cxx: "x86_64-w64-mingw32-g++",
package: "mingw-w64-ucrt-x86_64-toolchain",
thirdparty_dir: "/ucrt64",
compiler_flags: "",
dependencies: "mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-gcc-libs mingw-w64-ucrt-x86_64-omp mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-ninja mingw-w64-ucrt-x86_64-rapidjson mingw-w64-ucrt-x86_64-freetype mingw-w64-ucrt-x86_64-draco mingw-w64-ucrt-x86_64-freeimage mingw-w64-ucrt-x86_64-tbb mingw-w64-ucrt-x86_64-tk mingw-w64-ucrt-x86_64-tcl mingw-w64-ucrt-x86_64-openvr mingw-w64-ucrt-x86_64-jemalloc mingw-w64-ucrt-x86_64-mesa mingw-w64-ucrt-x86_64-angleproject mingw-w64-ucrt-x86_64-llvm-openmp mingw-w64-ucrt-x86_64-winpthreads-git mingw-w64-ucrt-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
}
build_type: [Debug, Release]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Set up MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.config.name == 'Clang' && 'CLANG64' || matrix.config.name == 'UCRT' && 'UCRT64' || 'MINGW64' }}
update: true
install: ${{ matrix.config.package }} ${{ matrix.config.dependencies }}
- name: Setup environment
shell: msys2 {0}
run: |
echo "Checking compiler version:"
${{ matrix.config.cc }} --version
echo "Checking CMake version:"
cmake --version
echo "Setting up environment variables..."
echo "$MSYSTEM_PREFIX/bin" >> $GITHUB_PATH
echo "CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX" >> $GITHUB_ENV
- name: Configure basic
shell: msys2 {0}
run: |
mkdir -p build
cd build
cmake -G "Ninja" \
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
${{ matrix.config.compiler_flags }} ..
- name: Build basic
shell: msys2 {0}
run: |
cd build
cmake --build . --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
shell: pwsh
run: |
Remove-Item -Recurse -Force build
- name: Configure full shared
shell: msys2 {0}
run: |
mkdir -p build
cd build
cmake -G "Ninja" \
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
-D BUILD_USE_PCH=OFF \
-D BUILD_INCLUDE_SYMLINK=ON \
-D BUILD_OPT_PROFILE=Production \
-D BUILD_LIBRARY_TYPE=Shared \
-D USE_TK=ON \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D USE_MMGR_TYPE=JEMALLOC \
-D INSTALL_DIR="${{ github.workspace }}/install-${{ matrix.build_type }}" \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=OFF \
-D USE_TBB=OFF \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON \
${{ matrix.config.compiler_flags }} ..
- name: Build full shared
shell: msys2 {0}
run: |
cd build
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
shell: pwsh
run: |
Remove-Item -Recurse -Force build
Remove-Item -Recurse -Force ${{ github.workspace }}/install-${{ matrix.build_type }}
- name: Configure full static
shell: msys2 {0}
run: |
mkdir -p build
cd build
cmake -G "Ninja" \
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
-D BUILD_USE_PCH=OFF \
-D BUILD_INCLUDE_SYMLINK=ON \
-D BUILD_OPT_PROFILE=Default \
-D BUILD_LIBRARY_TYPE=Static \
-D USE_TK=ON \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D USE_MMGR_TYPE=JEMALLOC \
-D INSTALL_DIR="${{ github.workspace }}/install-${{ matrix.build_type }}" \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=OFF \
-D USE_TBB=OFF \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON \
${{ matrix.config.compiler_flags }} ..
- name: Build full static
shell: msys2 {0}
run: |
cd build
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
shell: pwsh
run: |
Remove-Item -Recurse -Force build
Remove-Item -Recurse -Force ${{ github.workspace }}/install-${{ matrix.build_type }}
- name: Configure full with DEBUG define
shell: msys2 {0}
run: |
mkdir -p build
cd build
cmake -G "Ninja" \
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
-D BUILD_WITH_DEBUG=ON \
-D BUILD_USE_PCH=OFF \
-D BUILD_INCLUDE_SYMLINK=ON \
-D BUILD_OPT_PROFILE=Production \
-D BUILD_LIBRARY_TYPE=Shared \
-D USE_TK=ON \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D INSTALL_DIR="${{ github.workspace }}/install-${{ matrix.build_type }}" \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=OFF \
-D USE_TBB=OFF \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON \
${{ matrix.config.compiler_flags }} ..
- name: Build full with DEBUG define
shell: msys2 {0}
run: |
cd build
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
shell: pwsh
run: |
Remove-Item -Recurse -Force build
Remove-Item -Recurse -Force ${{ github.workspace }}/install-${{ matrix.build_type }}

View File

@ -0,0 +1,213 @@
# This workflow validates the build on Windows using MSVC and Clang compilers.
# It is triggered on pushes to the master branch.
# The workflow includes steps to install dependencies, configure, build, and clean up the project for different configurations.
name: MSVC build validation
on:
push:
branches:
- 'master'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
main_job:
name: Windows MSVC/Clang validation
runs-on: windows-2022
strategy:
matrix:
config:
- {
name: "MSVC",
cc: "cl",
cxx: "cl",
generator: "Visual Studio 17 2022",
toolset: "host=x64",
c_flags: "/W4 /WX",
cxx_flags: "/W4 /WX"
}
- {
name: "Clang",
cc: "clang",
cxx: "clang++",
generator: "Ninja",
toolset: "",
c_flags: "-Werror -Wall -Wextra -Wno-unknown-warning-option",
cxx_flags: "-Werror -Wall -Wextra -Wno-unknown-warning-option"
}
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Set up MSVC
uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: x64
- name: Download and extract 3rdparty dependencies
run: |
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
shell: pwsh
- name: Download and extract Mesa3D
run: |
curl -L -o mesa3d.7z https://github.com/pal1000/mesa-dist-win/releases/download/24.3.2/mesa3d-24.3.2-release-mingw.7z
7z x mesa3d.7z -omesa3d
- name: Run system-wide deployment
run: |
cd mesa3d
.\systemwidedeploy.cmd 1
.\systemwidedeploy.cmd 5
shell: cmd
- name: Configure basic
run: |
mkdir build
cd build
cmake -G "${{ matrix.config.generator }}" ${{ matrix.config.toolset }} `
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} `
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} `
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
-D CMAKE_CXX_FLAGS="${{ matrix.config.cxx_flags }}" `
-D CMAKE_C_FLAGS="${{ matrix.config.c_flags }}" ..
shell: pwsh
- name: Build basic
run: |
cd build
cmake --build . --config Release
shell: pwsh
- name: Clear up after build
run: |
Remove-Item -Recurse -Force build
shell: pwsh
- name: Configure full shared
run: |
mkdir build
cd build
cmake -G "${{ matrix.config.generator }}" ${{ matrix.config.toolset }} `
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} `
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} `
-D BUILD_USE_PCH=OFF `
-D BUILD_INCLUDE_SYMLINK=ON `
-D BUILD_OPT_PROFILE=Production `
-D BUILD_LIBRARY_TYPE=Shared `
-D CMAKE_BUILD_TYPE=Debug `
-D INSTALL_DIR=${{ github.workspace }}/install `
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
-D USE_MMGR_TYPE=JEMALLOC `
-D USE_FREETYPE=ON `
-D USE_DRACO=ON `
-D USE_FFMPEG=ON `
-D USE_FREEIMAGE=ON `
-D USE_GLES2=ON `
-D USE_OPENVR=ON `
-D USE_VTK=${{ matrix.config.name == 'MSVC' && 'ON' || 'OFF' }} `
-D USE_TBB=ON `
-D USE_RAPIDJSON=ON `
-D USE_OPENGL=ON `
-D CMAKE_CXX_FLAGS="${{ matrix.config.cxx_flags }}" `
-D CMAKE_C_FLAGS="${{ matrix.config.c_flags }}" ..
shell: pwsh
- name: Build full shared
run: |
cd build
cmake --build . --target install --config Debug
shell: pwsh
- name: Clear up after build
run: |
Remove-Item -Recurse -Force build
Remove-Item -Recurse -Force ${{ github.workspace }}/install
shell: pwsh
- name: Configure full static
run: |
mkdir build
cd build
cmake -G "${{ matrix.config.generator }}" ${{ matrix.config.toolset }} `
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} `
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} `
-D BUILD_USE_PCH=OFF `
-D BUILD_INCLUDE_SYMLINK=ON `
-D BUILD_OPT_PROFILE=Default `
-D BUILD_LIBRARY_TYPE=Static `
-D CMAKE_BUILD_TYPE=Debug `
-D INSTALL_DIR=${{ github.workspace }}/install `
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
-D USE_MMGR_TYPE=JEMALLOC `
-D USE_FREETYPE=ON `
-D USE_DRACO=ON `
-D USE_FFMPEG=ON `
-D USE_FREEIMAGE=ON `
-D USE_GLES2=ON `
-D USE_OPENVR=ON `
-D USE_VTK=OFF `
-D USE_TBB=ON `
-D USE_RAPIDJSON=ON `
-D USE_OPENGL=ON `
-D CMAKE_CXX_FLAGS="${{ matrix.config.cxx_flags }}" `
-D CMAKE_C_FLAGS="${{ matrix.config.c_flags }}" ..
shell: pwsh
- name: Build full static
run: |
cd build
cmake --build . --target install --config Debug
shell: pwsh
- name: Clear up after build
run: |
Remove-Item -Recurse -Force build
Remove-Item -Recurse -Force ${{ github.workspace }}/install
shell: pwsh
- name: Configure full with DEBUG define
run: |
mkdir build
cd build
cmake -G "${{ matrix.config.generator }}" ${{ matrix.config.toolset }} `
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} `
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} `
-D BUILD_WITH_DEBUG=ON `
-D BUILD_USE_PCH=OFF `
-D BUILD_INCLUDE_SYMLINK=ON `
-D BUILD_OPT_PROFILE=Production `
-D BUILD_LIBRARY_TYPE=Shared `
-D CMAKE_BUILD_TYPE=Debug `
-D INSTALL_DIR=${{ github.workspace }}/install `
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
-D USE_FREETYPE=ON `
-D USE_DRACO=ON `
-D USE_FFMPEG=ON `
-D USE_FREEIMAGE=ON `
-D USE_GLES2=ON `
-D USE_OPENVR=ON `
-D USE_VTK=${{ matrix.config.name == 'MSVC' && 'ON' || 'OFF' }} `
-D USE_TBB=ON `
-D USE_RAPIDJSON=ON `
-D USE_OPENGL=ON ` ..
shell: pwsh
- name: Build full with DEBUG define
run: |
cd build
cmake --build . --target install --config Debug
shell: pwsh
- name: Clear up after build
run: |
Remove-Item -Recurse -Force build
Remove-Item -Recurse -Force ${{ github.workspace }}/install
shell: pwsh

View File

@ -0,0 +1,180 @@
# This workflow validates the build on the latest Ubuntu version (24.04) using multiple configurations.
# It is triggered on pushes to the master branch.
# The workflow includes steps to install dependencies, configure, build, and clean up the project for different configurations.
name: Ubuntu build validation
on:
push:
branches:
- 'master'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
main_job:
name: Latest ubuntu validation
runs-on: ubuntu-24.04
strategy:
matrix:
config:
- {
name: "GCC",
cc: "gcc",
cxx: "g++",
compiler_flags: ""
}
- {
name: "Clang",
cc: "clang",
cxx: "clang++",
compiler_flags: "-D CMAKE_CXX_FLAGS=\"-Werror -Wall -Wextra\" -D CMAKE_C_FLAGS=\"-Werror -Wall -Wextra\""
}
build_type: [Debug, Release]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y ninja-build tcl-dev tk-dev cmake clang gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev libjemalloc-dev
- name: Install rapidjson
run: |
wget https://github.com/Tencent/rapidjson/archive/858451e5b7d1c56cf8f6d58f88cf958351837e53.zip -O rapidjson.zip
unzip rapidjson.zip
- name: Configure basic
run: |
mkdir -p build
cd build
cmake -G "Ninja" \
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
${{ matrix.config.compiler_flags }} ..
- name: Build basic
run: |
cd build
cmake --build . --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
run: |
rm -rf build
- name: Configure full shared
run: |
mkdir -p build
cd build
cmake -G "Ninja" \
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D BUILD_USE_PCH=OFF \
-D BUILD_INCLUDE_SYMLINK=ON \
-D BUILD_OPT_PROFILE=Production \
-D BUILD_LIBRARY_TYPE=Shared \
-D USE_TK=ON \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D USE_MMGR_TYPE=JEMALLOC \
-D INSTALL_DIR=${{ github.workspace }}/install-${{ matrix.build_type }} \
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=ON \
-D USE_TBB=ON \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON \
${{ matrix.config.compiler_flags }} ..
- name: Build full shared
run: |
cd build
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
run: |
rm -rf build
rm -rf ${{ github.workspace }}/install-${{ matrix.build_type }}
- name: Configure full static
run: |
mkdir -p build
cd build
cmake -G "Ninja" \
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D BUILD_USE_PCH=OFF \
-D BUILD_INCLUDE_SYMLINK=ON \
-D BUILD_OPT_PROFILE=Default \
-D BUILD_LIBRARY_TYPE=Static \
-D USE_TK=ON \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D USE_MMGR_TYPE=JEMALLOC \
-D INSTALL_DIR=${{ github.workspace }}/install-${{ matrix.build_type }} \
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=OFF \
-D USE_TBB=ON \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON \
${{ matrix.config.compiler_flags }} ..
- name: Build full static
run: |
cd build
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
run: |
rm -rf build
rm -rf ${{ github.workspace }}/install-${{ matrix.build_type }}
- name: Configure full with DEBUG define
run: |
mkdir -p build
cd build
cmake -G "Ninja" \
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D BUILD_WITH_DEBUG=ON \
-D BUILD_USE_PCH=OFF \
-D BUILD_INCLUDE_SYMLINK=ON \
-D BUILD_OPT_PROFILE=Production \
-D BUILD_LIBRARY_TYPE=Shared \
-D USE_TK=ON \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D INSTALL_DIR=${{ github.workspace }}/install-${{ matrix.build_type }} \
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=ON \
-D USE_TBB=ON \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON ..
- name: Build full with DEBUG define
run: |
cd build
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
run: |
rm -rf build
rm -rf ${{ github.workspace }}/install-${{ matrix.build_type }}

View File

@ -0,0 +1,102 @@
# This workflow validates the WebAssembly build on Ubuntu.
# It is triggered on pushes to the master branch.
# The workflow includes steps to install dependencies, configure, build, and clean up the project.
name: WebAssembly build (Ubuntu)
on:
push:
branches:
- 'master'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
env:
USERNAME: Open-Cascade-SAS
VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg
FEED_URL: https://nuget.pkg.github.com/Open-Cascade-SAS/index.json
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/Open-Cascade-SAS/index.json,readwrite"
EMSDK_VERSION: 3.1.74
jobs:
wasm-build:
name: WebAssembly Build
runs-on: ubuntu-24.04
strategy:
matrix:
build_type: [Debug, Release]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential ninja-build curl zip unzip tar nasm autoconf mono-complete
sudo apt-get install -y libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxrandr-dev libxxf86vm-dev
- name: Setup vcpkg
run: |
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
- name: Add NuGet sources
run: |
mono $(${VCPKG_EXE} fetch nuget | tail -n 1) \
sources add \
-Source "${FEED_URL}" \
-StorePasswordInClearText \
-Name GitHubPackages \
-UserName "${USERNAME}" \
-Password "${{ secrets.GITHUB_TOKEN }}"
mono $(${VCPKG_EXE} fetch nuget | tail -n 1) \
setapikey "${{ secrets.GITHUB_TOKEN }}" \
-Source "${FEED_URL}"
- name: Setup Emscripten
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install ${EMSDK_VERSION}
./emsdk activate ${EMSDK_VERSION}
echo "EMSDK=${{ github.workspace }}/emsdk" >> $GITHUB_ENV
echo "${{ github.workspace }}/emsdk" >> $GITHUB_PATH
echo "${{ github.workspace }}/emsdk/upstream/emscripten" >> $GITHUB_PATH
- name: Configure OCCT with vcpkg
run: |
source "${{ github.workspace }}/emsdk/emsdk_env.sh"
mkdir -p "build-${{ matrix.build_type }}"
cd "build-${{ matrix.build_type }}"
export VCPKG_ROOT="${{ github.workspace }}/vcpkg"
emcmake cmake -G "Ninja" \
-DCMAKE_TOOLCHAIN_FILE="${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" \
-DVCPKG_TARGET_TRIPLET=wasm32-emscripten \
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE="$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake" \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DBUILD_USE_VCPKG=ON \
-DUSE_MMGR_TYPE=NATIVE \
-DBUILD_LIBRARY_TYPE=Static \
-DBUILD_MODULE_Draw=OFF \
-DUSE_FREETYPE=OFF \
-DUSE_TK=OFF \
-DUSE_TCL=OFF \
-DUSE_DRACO=ON \
-DUSE_FFMPEG=OFF \
-DUSE_FREEIMAGE=OFF \
-DUSE_OPENVR=OFF \
-DUSE_VTK=OFF \
-DUSE_TBB=OFF \
-DUSE_RAPIDJSON=ON \
-DINSTALL_DIR="${{ github.workspace }}/install-wasm-${{ matrix.build_type }}" \
-DCMAKE_CXX_FLAGS="-s WASM=1 -s EXPORTED_RUNTIME_METHODS=['ccall','cwrap'] -s ALLOW_MEMORY_GROWTH=1" \
-DCMAKE_EXECUTABLE_SUFFIX=".js" ..
- name: Build
run: |
cd build-${{ matrix.build_type }}
cmake --build . --config ${{ matrix.build_type }} --target install -- -j4

View File

@ -0,0 +1,170 @@
# This workflow builds OCCT using vcpkg on multiple platforms (Windows, macOS, Linux).
# It builds in both Debug and Release modes.
# All dependencies except the compiler are installed using vcpkg.
# The workflow includes steps to clone vcpkg, install dependencies, configure and build.
name: Build OCCT with vcpkg
on:
push:
branches:
- 'master'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
env:
USERNAME: Open-Cascade-SAS
VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg
FEED_URL: https://nuget.pkg.github.com/Open-Cascade-SAS/index.json
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/Open-Cascade-SAS/index.json,readwrite"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04, ubuntu-22.04, windows-2022, windows-2019, macos-15, macos-14, macos-13]
build_type: [Debug, Release]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Install required packages (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential ninja-build curl zip unzip tar nasm autoconf mono-complete
sudo apt-get install -y libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxrandr-dev libxxf86vm-dev
- name: Install required packages (macOS)
if: runner.os == 'macOS'
run: |
brew update || true
brew install cmake ninja nasm autoconf mono || true
# temporary workaround for missing tcl-tk
brew install tcl-tk || true
# Force link any conflicting packages
brew link --overwrite python@3.12 || true
brew link --overwrite python@3.13 || true
- name: Install required packages (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: x64
- name: Set up vcpkg (Unix)
if: runner.os != 'Windows'
run: |
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
shell: bash
- name: Set up vcpkg (Windows)
if: runner.os == 'Windows'
run: |
git clone https://github.com/microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
shell: cmd
- name: Add NuGet sources
if: runner.os == 'Windows'
run: |
.$(${{ env.VCPKG_EXE }} fetch nuget) `
sources add `
-Source "${{ env.FEED_URL }}" `
-StorePasswordInClearText `
-Name GitHubPackages `
-UserName "${{ env.USERNAME }}" `
-Password "${{ secrets.GITHUB_TOKEN }}"
.$(${{ env.VCPKG_EXE }} fetch nuget) `
setapikey "${{ secrets.GITHUB_TOKEN }}" `
-Source "${{ env.FEED_URL }}"
shell: pwsh
- name: Add NuGet sources
if: runner.os != 'Windows'
run: |
mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \
sources add \
-Source "${{ env.FEED_URL }}" \
-StorePasswordInClearText \
-Name GitHubPackages \
-UserName "${{ env.USERNAME }}" \
-Password "${{ secrets.GITHUB_TOKEN }}"
mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \
setapikey "${{ secrets.GITHUB_TOKEN }}" \
-Source "${{ env.FEED_URL }}"
shell: bash
- name: Configure OCCT ${{ matrix.build_type }} (Unix)
if: runner.os != 'Windows'
run: |
mkdir build-${{ matrix.build_type }}
cd build-${{ matrix.build_type }}
cmake -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DBUILD_USE_VCPKG=ON \
-DUSE_MMGR_TYPE=NATIVE \
-DUSE_FREETYPE=ON \
-DUSE_TK=OFF \
-DBUILD_USE_PCH=ON \
-DBUILD_INCLUDE_SYMLINK=ON \
-DBUILD_LIBRARY_TYPE="Static" \
-DINSTALL_DIR=${{ github.workspace }}/install-${{ matrix.build_type }} \
-DUSE_DRACO=ON \
-DUSE_FFMPEG=ON \
-DUSE_FREEIMAGE=ON \
-DUSE_GLES2=OFF \
-DUSE_VTK=ON \
-DUSE_TBB=ON \
-DUSE_RAPIDJSON=ON \
-DUSE_OPENGL=ON \
-DBUILD_MODULE_Draw=OFF \
-DVCPKG_INSTALL_OPTIONS=--clean-buildtrees-after-build \
${{ runner.os != 'macOS' && '-DUSE_OPENVR=ON' || '' }} ..
shell: bash
- name: Configure OCCT ${{ matrix.build_type }} (Windows)
if: runner.os == 'Windows'
run: |
mkdir build-${{ matrix.build_type }}
cd build-${{ matrix.build_type }}
cmake -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake ^
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ^
-DBUILD_USE_VCPKG=ON ^
-DUSE_MMGR_TYPE=JEMALLOC ^
-DUSE_FREETYPE=ON ^
-DUSE_TK=OFF ^
-DBUILD_USE_PCH=ON ^
-DBUILD_INCLUDE_SYMLINK=ON ^
-DINSTALL_DIR=${{ github.workspace }}/install-${{ matrix.build_type }} ^
-DUSE_DRACO=ON ^
-DUSE_FFMPEG=OFF ^
-DUSE_FREEIMAGE=ON ^
-DUSE_GLES2=ON ^
-DUSE_OPENVR=ON ^
-DUSE_VTK=ON ^
-DUSE_TBB=ON ^
-DUSE_RAPIDJSON=ON ^
-DVCPKG_INSTALL_OPTIONS=--clean-buildtrees-after-build ^
-DUSE_OPENGL=ON ..
shell: cmd
- name: Build OCCT ${{ matrix.build_type }} (Unix)
if: runner.os != 'Windows'
run: |
cd build-${{ matrix.build_type }}
cmake --build . --target install --config ${{ matrix.build_type }}
shell: bash
- name: Build OCCT ${{ matrix.build_type }} (Windows)
if: runner.os == 'Windows'
run: |
cd build-${{ matrix.build_type }}
cmake --build . --target install --config ${{ matrix.build_type }}
shell: cmd

97
.github/workflows/code-analysis.yml vendored Normal file
View File

@ -0,0 +1,97 @@
# This workflow performs code analysis using both CodeQL and Microsoft C++ Code Analysis.
# It is triggered on pushes to the 'master' branch and publishes warnings into the security GitHub tab.
# The workflow includes two jobs: one for CodeQL analysis on Ubuntu and another for MSVC Code Analysis on Windows.
name: Code Analysis
on:
push:
branches:
- 'master'
permissions:
contents: read
security-events: write
packages: read
env:
# Path to the CMake build directory.
build: '${{ github.workspace }}/build'
config: 'Debug'
jobs:
codeql-analyze:
name: CodeQL Analyze (C/C++)
runs-on: ubuntu-latest
steps:
# Step: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4.1.7
# Step: Install necessary dependencies for building the project
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev
# Step: Initialize CodeQL for scanning
- name: Initialize CodeQL
uses: github/codeql-action/init@v3.26.5
with:
languages: c-cpp
build-mode: manual
# Step: Build the project using CMake and Make
- name: Build project
shell: bash
run: |
mkdir -p build
cd build
cmake -G "Unix Makefiles" \
-D CMAKE_C_COMPILER=gcc \
-D CMAKE_CXX_COMPILER=g++ \
-D USE_FREETYPE=OFF \
-D CMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
# Step: Perform CodeQL Analysis
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3.26.5
with:
category: "/language:c-cpp"
msvc-analyze:
name: Microsoft C++ Code Analysis
runs-on: windows-latest
steps:
# Step: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4.1.7
# Step: Install necessary dependencies using Chocolatey
- name: Install dependencies
run: |
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y
choco install magicsplat-tcl-tk -y
# Step: Configure the project using CMake
- name: Configure CMake
run: |
mkdir build
cd build
cmake -D USE_FREETYPE=OFF -DCMAKE_BUILD_TYPE=${{ env.config }} ..
# Step: Run MSVC Code Analysis
- name: Run MSVC Code Analysis
uses: microsoft/msvc-code-analysis-action@v0.1.1
id: run-analysis
with:
cmakeBuildDirectory: ${{ env.build }}
buildConfiguration: ${{ env.config }}
ruleset: NativeRecommendedRules.ruleset
# Step: Upload SARIF file to GitHub Code Scanning Alerts
- name: Upload SARIF to GitHub
uses: github/codeql-action/upload-sarif@v3.26.5
with:
sarif_file: ${{ steps.run-analysis.outputs.sarif }}

5
.gitignore vendored
View File

@ -1,6 +1,8 @@
# standard directories for derived files in CASROOT
/.adm
/.cache
/.vscode
/lin
/mac
/wnt
@ -52,4 +54,5 @@ win64
/libtool
/stamp*
/build*
/install
/install*
/tools/build*

File diff suppressed because it is too large Load Diff

64
README.md Normal file
View File

@ -0,0 +1,64 @@
# Open CASCADE Technology
Open CASCADE Technology (OCCT) is a software development platform providing services for 3D surface and solid modeling, CAD data exchange, and visualization. Most of OCCT functionality is available in the form of C++ libraries. OCCT is ideal for developing software dealing with 3D modeling (CAD), manufacturing/measuring (CAM), or numerical simulation (CAE).
## License
Open CASCADE Technology is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation, with a special exception defined in the file `OCCT_LGPL_EXCEPTION.txt`. Consult the file `LICENSE_LGPL_21.txt` included in the OCCT distribution for the complete text of the license.
Alternatively, Open CASCADE Technology may be used under the terms of the Open CASCADE commercial license or a contractual agreement.
**Note:** Open CASCADE Technology is provided on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND. The entire risk related to any use of the OCCT code and materials is on you. See the license text for a formal disclaimer.
## Packaging
You can receive certified versions of OCCT code in different packages:
- **Snapshot of Git repository:** Contains C++ header and source files of OCCT, documentation sources, build scripts, and CMake project files.
- **Complete source archive:** Contains all sources of OCCT, generated HTML and PDF documentation, and ready-to-use projects for building on all officially supported platforms.
- **Binary package (platform-specific):** In addition to the complete source archive, it includes binaries of OCCT and third-party libraries built on one platform. This package allows using OCCT immediately after installation.
Certified versions of OCCT can be downloaded from:
- [Open CASCADE Releases](https://dev.opencascade.org/release)
- [GitHub Releases](https://github.com/Open-Cascade-SAS/OCCT/releases)
You can also find OCCT pre-installed on your system or install it from packages provided by a third party. Note that packaging and functionality of such versions can be different from certified releases. Please consult the documentation accompanying your version for details.
## Documentation
Documentation is available at the following links:
- [Latest version](https://dev.opencascade.org/doc/overview)
- [Version 7.8](https://dev.opencascade.org/doc/occt-7.8.0/overview)
Documentation can be part of the package. To preview documentation as part of the package, open the file `doc/html/index.html` to browse HTML documentation.
If HTML documentation is not available in your package, you can:
- **Generate it from sources:** You need to have Tcl and Doxygen 1.8.4 (or above) installed on your system and accessible in your environment (check the environment variable PATH). Use the batch file `adm/gendoc.bat` on Windows or the Bash script `adm/gendoc` on Linux or OS X to (re)generate documentation.
- **Generate together with sources:** You need to have CMake and 1.8.4 (or above) installed on your system. Enable `BUILD_DOC_Overview` CMake parameter and set the path to Doxygen `3RDPARTY_DOXYGEN_EXECUTABLE`. Then build ALL or only `Overview`.
- **Read documentation in source plain text (Markdown) format** found in the subfolder `dox` or [GitHub Wiki](https://github.com/Open-Cascade-SAS/OCCT/wiki).
See [dox/build/build_documentation/building_documentation.md](dox/build/build_documentation/building_documentation.md) or [Building Documentation](https://dev.opencascade.org/doc/occt-7.8.0/overview/html/build_upgrade__building_documentation.html) for details.
## Building
In most cases, you need to rebuild OCCT on your platform (OS, compiler) before using it in your project to ensure binary compatibility.
Consult the file [dox/build/build_occt/building_occt.md](dox/build/build_occt/building_occt.md) or [Building OCCT](https://dev.opencascade.org/doc/overview/html/build_upgrade__building_occt.html) or [Building OCCT Wiki](https://github.com/Open-Cascade-SAS/OCCT/wiki/build_upgrade) for instructions on building OCCT from sources on supported platforms.
## Version
The current version of OCCT can be found in the file [`adm/cmake/version.cmake`](adm/cmake/version.cmake).
## Development
### Bug Tracker
- [GitHub Issues](https://github.com/Open-Cascade-SAS/OCCT/issues)
- [OCCT Tracker](https://tracker.dev.opencascade.org/)
For information regarding OCCT code development, please consult the official OCCT Collaborative Development Portal:
- [OCCT Development Portal](http://dev.opencascade.org)
### Forum and Discussions
- [OCCT Forums](https://dev.opencascade.org/forums)
- [GitHub Discussions](https://github.com/Open-Cascade-SAS/OCCT/discussions)

View File

@ -1,89 +0,0 @@
Open CASCADE Technology
=======================
This directory contains sources of Open CASCADE Technology (OCCT), a software
development platform providing services for 3D surface and solid modeling, CAD
data exchange, and visualization. Most of OCCT functionality is available in
the form of C++ libraries. OCCT can be best applied in development of software
dealing with 3D modeling (CAD), manufacturing / measuring (CAM) or numerical
simulation (CAE).
License
-------
Open CASCADE Technology is free software; you can redistribute it and / or
modify it under the terms of the GNU Lesser General Public version 2.1 as
published by the Free Software Foundation, with special exception defined in
the file OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included
in OCCT distribution for complete text of the license.
Alternatively, Open CASCADE Technology may be used under the terms of Open
CASCADE commercial license or contractual agreement.
Note that Open CASCADE Technology is provided on an "AS IS" basis, WITHOUT
WARRANTY OF ANY KIND. The entire risk related to any use of the OCCT code and
materials is on you. See the license text for formal disclaimer.
Packaging
---------
You can receive certified version of OCCT code in different packages.
- Snapshot of Git repository: contains C++ header and source files of OCCT,
documentation sources, build scripts, and CMake project files.
- Complete source archive: contains all sources of OCCT, generated HTML and PDF
documentation, and ready-to-use projects for building on all officially
supported platforms.
- Binary package (platform-specific): in addition to complete source archive,
it includes binaries of OCCT and third-party libraries built on one platform.
This package allows using OCCT immediately after installation.
Certified versions of OCCT can be downloaded from http://www.opencascade.com
You can also find OCCT pre-installed on your system, or install it from
packages provided by a third party. Note that packaging and functionality
of such versions can be different from certified releases. Please consult
documentation accompanying your version for details.
Documentation
-------------
Open file doc/html/index.html to browse HTML documentation.
If HTML documentation is not available in your package, you can:
- Generate it from sources.
You need to have Tcl and Doxygen 1.8.4 (or above) installed on your system.
and accessible in your environment (check environment variable PATH).
Use batch file *gendoc.bat* on Windows or Bash script *gendoc* on Linux
or OS X to (re)generate documentation.
- Read documentation in source plain text (MarkDown) format found in
subfolder *dox*
See *dox/dev_guides/documentation/documentation.md* for details.
Building
--------
In most cases you need to rebuild OCCT on your platform (OS, compiler) before
using it in your project, to ensure binary compatibility.
Consult the file *dox/dev_guides/building/building.md* for instructions on
building OCCT from sources on supported platforms.
Version
-------
The current version of OCCT can be consulted in the file
*src/Standard/Standard_Version.hxx*
Development
-----------
For information regarding OCCT code development please consult the official
OCCT Collaborative Development Portal:
http://dev.opencascade.org

1
adm/.gitignore vendored
View File

@ -1 +0,0 @@
/build-*

View File

@ -1,18 +0,0 @@
wnt WOKSteps_exec_link DRAWEXE #WOKStep_EXELink(exec.tks)
lin WOKSteps_exec_link DRAWEXE #WOKStep_EXELink(exec.tks)
wnt cmplrs_cxx f -D_CRT_SECURE_NO_DEPRECATE -DHAVE_FREEIMAGE -DHAVE_TBB -DHAVE_OPENCL
wnt cmplrs_cxx b -D_CRT_SECURE_NO_DEPRECATE -DHAVE_FREEIMAGE -DHAVE_TBB -DHAVE_OPENCL
wnt cmplrs_cxx Aspect (wnt cmplrs_cxx b) -D_AFXDLL
wnt cmplrs_cxx (wnt cmplrs_cxx b) -D_AFXDLL -D_AFXDLL
wnt cmplrs_c f -D_CRT_SECURE_NO_DEPRECATE -DHAVE_FREEIMAGE -DHAVE_TBB -DHAVE_OPENCL
wnt cmplrs_c b -D_CRT_SECURE_NO_DEPRECATE -DHAVE_FREEIMAGE -DHAVE_TBB -DHAVE_OPENCL
wnt cmplrs_c NIS (wnt cmplrs_c b) -DSILGL -DSILGL_VRS=50
lin cmplrs_cxx f -DOCC_CONVERT_SIGNALS -D_GNU_SOURCE=1 -DHAVE_FREEIMAGE -DHAVE_TBB -DHAVE_OPENCL
lin cmplrs_cxx b -DOCC_CONVERT_SIGNALS -D_GNU_SOURCE=1 -DHAVE_FREEIMAGE -DHAVE_TBB -DHAVE_OPENCL
lin cmplrs_c f -D_GNU_SOURCE=1 -fexceptions
lin cmplrs_c b -D_GNU_SOURCE=1 -fexceptions

View File

@ -1,8 +1,7 @@
FoundationClasses TKernel TKMath
ModelingData TKG2d TKG3d TKGeomBase TKBRep
ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing
ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing TKExpress
Visualization TKService TKV3d TKOpenGl TKOpenGles TKMeshVS TKIVtk TKD3DHost
ApplicationFramework TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml TKStdL TKStd TKTObj TKBinTObj TKXmlTObj TKVCAF
DataExchange TKDE TKXSBase TKDESTEP TKDEIGES TKDESTL TKDEVRML TKDECascade TKDEOBJ TKDEGLTF TKDEPLY TKXCAF TKXmlXCAF TKBinXCAF TKRWMesh
DETools TKExpress ExpToCasExe
Draw TKDraw TKTopTest TKOpenGlTest TKOpenGlesTest TKD3DHostTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE TKXSDRAWDE TKXSDRAWGLTF TKXSDRAWIGES TKXSDRAWOBJ TKXSDRAWPLY TKXSDRAWSTEP TKXSDRAWSTL TKXSDRAWVRML

View File

@ -1,4 +0,0 @@
TModelingData TKShapeView TKMessageModel TKMessageView
TVisualization TKView TKVInspector
TApplicationFramework TKTreeModel TKTInspectorAPI TKDFBrowser
TTool TKTInspector TKToolsDraw TInspectorEXE

View File

@ -1,497 +0,0 @@
n NCollection
n BSplCLib
n BSplSLib
n Bnd
n BVH
n CSLib
n Convert
n ElCLib
n ElSLib
n Expr
n ExprIntrp
n FSD
n GeomAbs
n Message
n OSD
n PLib
n Plugin
n Poly
n Precision
n Quantity
n Resource
n Standard
n StdFail
n Storage
n TColStd
n TColgp
n TCollection
n TShort
n TopLoc
n Units
n UnitsAPI
n gp
n math
r OS
n FlexLexer
t TKMath
t TKernel
n Adaptor2d
n Adaptor3d
n AdvApp2Var
n AdvApprox
n AppCont
n AppDef
n AppParCurves
n Approx
n BRep
n BRepAdaptor
n BRepLProp
n BRepTools
n BndLib
n CPnts
n Extrema
n FEmTool
n GC
n GCE2d
n GCPnts
n GProp
n Geom
n Geom2d
n Geom2dAdaptor
n Geom2dConvert
n Geom2dLProp
n GeomAdaptor
n GeomConvert
n GeomLProp
n GeomLib
n GeomProjLib
n GeomTools
n GeomEvaluator
n Hermit
n IntAna
n IntAna2d
n LProp
n LProp3d
n ProjLib
n TColGeom
n TColGeom2d
n TopAbs
n TopExp
n TopTools
n TopoDS
n gce
t TKBRep
t TKG2d
t TKG3d
t TKGeomBase
n AppBlend
n ApproxInt
n BOPTools
n BRepAlgo
n BRepAlgoAPI
n BRepApprox
n BRepBlend
n BRepBndLib
n BRepBuilderAPI
n BRepCheck
n BRepClass
n BRepClass3d
n BRepExtrema
n BRepFeat
n BRepFill
n BRepFilletAPI
n BRepGProp
n BRepIntCurveSurface
n BRepLib
n BRepMAT2d
n BRepMesh
n BRepMeshData
n BRepOffset
n BRepOffsetAPI
n BRepPreviewAPI
n BRepPrim
n BRepPrimAPI
n BRepProj
n BRepSweep
n BRepTopAdaptor
n BiTgte
n Bisector
n Blend
n BlendFunc
n ChFi2d
n ChFi3d
n ChFiDS
n ChFiKPart
n Contap
n Draft
n FairCurve
n FilletSurf
n GccAna
n GccEnt
n GccInt
n Geom2dAPI
n Geom2dGcc
n Geom2dHatch
n Geom2dInt
n GeomAPI
n GeomFill
n GeomInt
n GeomPlate
n HLRAlgo
n HLRBRep
n HLRTopoBRep
n HLRAppli
n Hatch
n HatchGen
n IMeshData
n IMeshTools
n IntCurve
n IntCurveSurface
n IntCurvesFace
n IntImp
n IntImpParGen
n IntPatch
n IntPolyh
n IntRes2d
n IntStart
n IntSurf
n IntTools
n IntWalk
n Intf
n Intrv
n Law
n LocOpe
n LocalAnalysis
n MAT
n MAT2d
n NLPlate
n Plate
n ShapeAlgo
n ShapeAnalysis
n ShapeBuild
n ShapeConstruct
n ShapeCustom
n ShapeExtend
n ShapeFix
n ShapeProcess
n ShapeProcessAPI
n ShapeUpgrade
n Sweep
n TopBas
n TopClass
n TopCnx
n TopOpeBRep
n TopOpeBRepBuild
n TopOpeBRepDS
n TopOpeBRepTool
n TopTrans
n XBRepMesh
t TKBO
t TKBool
t TKFeat
t TKFillet
t TKGeomAlgo
t TKHLR
t TKMesh
t TKOffset
t TKPrim
t TKShHealing
t TKTopAlgo
t TKXMesh
n AIS
n Aspect
n DsgPrs
n PrsDim
n Graphic3d
n Image
n Media
n MeshVS
n OpenGl
n OpenGles
n D3DHost
n Prs3d
n PrsMgr
n Select3D
n SelectBasics
n SelectMgr
n StdPrs
n StdSelect
n V3d
n Wasm
n WNT
n Xw
n Cocoa
r Textures
r Shaders
r XRResources
t TKMeshVS
t TKOpenGl
t TKOpenGles
t TKD3DHost
t TKService
t TKV3d
n BinTObjDrivers
n LDOM
n TObj
n XmlTObjDrivers
n AppStd
n AppStdL
n BinDrivers
n BinLDrivers
n BinMDF
n BinMDataStd
n BinMDataXtd
n BinMDocStd
n BinMFunction
n BinMNaming
n BinObjMgt
n BinTools
n CDF
n CDM
n PCDM
n StdLDrivers
n StdLPersistent
n StdObjMgt
n StdDrivers
n StdObject
n StdPersistent
n StdStorage
n ShapePersistent
n TDF
n TDataStd
n TDataXtd
n TDocStd
n TFunction
n TNaming
n TPrsStd
n UTL
n XmlDrivers
n XmlLDrivers
n XmlMDF
n XmlMDataStd
n XmlMDataXtd
n XmlMDocStd
n XmlMFunction
n XmlMNaming
n XmlObjMgt
r StdResource
r XmlOcafResource
t TKBin
t TKBinL
t TKBinTObj
t TKCAF
t TKCDF
t TKLCAF
t TKStdL
t TKStd
t TKTObj
t TKXml
t TKXmlL
t TKXmlTObj
n IGESFile
n StepFile
n APIHeaderSection
n BRepToIGES
n BRepToIGESBRep
n BinMXCAFDoc
n BinXCAFDrivers
n Geom2dToIGES
n GeomToIGES
n GeomToStep
n HeaderSection
n IFGraph
n IFSelect
n IGESAppli
n IGESBasic
n IGESCAFControl
n IGESControl
n IGESConvGeom
n IGESData
n IGESDefs
n IGESDimen
n IGESDraw
n IGESGeom
n IGESGraph
n IGESSelect
n IGESSolid
n IGESToBRep
n Interface
n LibCtl
n MoniTool
n RWHeaderSection
n RWStepAP203
n RWStepAP214
n RWStepAP242
n RWStepBasic
n RWStepDimTol
n RWStepElement
n RWStepFEA
n RWStepGeom
n RWStepKinematics
n RWStepRepr
n RWStepShape
n RWStepVisual
n RWStl
n STEPCAFControl
n STEPConstruct
n STEPControl
n STEPEdit
n STEPSelections
n StepAP203
n StepAP209
n StepAP214
n StepAP242
n StepBasic
n StepData
n StepDimTol
n StepElement
n StepFEA
n StepGeom
n StepKinematics
n StepRepr
n StepSelect
n StepShape
n StepToGeom
n StepToTopoDS
n StepVisual
n StlAPI
n TopoDSToStep
n Transfer
n TransferBRep
n UnitsMethods
n Vrml
n VrmlAPI
n VrmlConverter
n VrmlData
n XCAFApp
n XCAFDimTolObjects
n XCAFDoc
n XCAFPrs
n XSAlgo
n XSControl
n XmlMXCAFDoc
n XmlXCAFDrivers
r SHMessage
r XSMessage
r XSTEPResource
t TKBinXCAF
t TKDESTL
t TKDEVRML
t TKXCAF
t TKDE
t TKDECascade
t TKDEIGES
t TKDESTEP
t TKXSBase
t TKXmlXCAF
n BOPTest
n BRepTest
n DBRep
n DDF
n DDataStd
n DDocStd
n DE
n DEXCAFCascade
n DEBRepCascade
n DNaming
n DPrsStd
n Draw
n DrawDim
n DrawFairCurve
n DrawTrSurf
n GeometryTest
n GeomliteTest
n HLRTest
n MeshTest
n SWDRAW
n TObjDRAW
n OpenGlTest
n OpenGlesTest
n D3DHostTest
n ViewerTest
n XDEDRAW
n XSDRAW
n XSDRAWIGES
n XSDRAWSTEP
n XSDRAWSTL
n XSDRAWVRML
n XSDRAWDE
n XSDRAWGLTF
n XSDRAWOBJ
n XSDRAWPLY
r DrawResources
t TKDCAF
t TKDraw
t TKTObjDRAW
t TKTopTest
t TKOpenGlTest
t TKOpenGlesTest
t TKD3DHostTest
t TKViewerTest
t TKXDEDRAW
t TKXSDRAW
t TKXSDRAWIGES
t TKXSDRAWSTEP
t TKXSDRAWSTL
t TKXSDRAWVRML
t TKXSDRAWDE
t TKXSDRAWGLTF
t TKXSDRAWOBJ
t TKXSDRAWPLY
x DRAWEXE
n QADraw
n QANCollection
n QANewBRepNaming
n QANewDBRepNaming
n QANewModTopOpe
t TKQADraw
n QADNaming
n QABugs
n Font
n BOPAlgo
n BOPDS
n BOPCol
n IVtk
n IVtkOCC
n IVtkVTK
n IVtkTools
t TKIVtk
n IVtkDraw
t TKIVtkDraw
n Geom2dEvaluator
t TKVCAF
n XCAFView
n XCAFNoteObjects
t TKRWMesh
t TKDEGLTF
t TKDEOBJ
t TKDEPLY
n RWGltf
n RWMesh
n RWObj
n RWPly
n DFBrowser
n DFBrowserPane
n DFBrowserPaneXDE
n ShapeView
n TInspector
n TInspectorAPI
x TInspectorEXE
t TKDFBrowser
t TKShapeView
t TKTInspector
t TKTInspectorAPI
t TKToolsDraw
t TKTreeModel
t TKView
t TKVInspector
n ToolsDraw
n TreeModel
n View
n ViewControl
n VInspector
n Express
t TKExpress
x ExpToCasExe

View File

@ -19,7 +19,7 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME
# include occt macros. compiler_bitness, os_wiht_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
# specify product folder in connectin with 3RDPARTY_DIR
# specify product folder in connection with 3RDPARTY_DIR
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
#CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_${PRODUCT_NAME}_DIR PATH "The directory containing ${PRODUCT_NAME}")
@ -101,8 +101,9 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
string(TOLOWER ${PRODUCT_NAME} LOW_CASE_PRODUCT_NAME)
find_path (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR NAMES ${HEADER_NAME}
PATH_SUFFIXES include inc headers
PATH_SUFFIXES include inc headers ${LOW_CASE_PRODUCT_NAME}
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
endif()
@ -120,7 +121,7 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME
# if (BUILD_SHARED_LIBS)
# library
if (NOT 3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX} OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib .a)
set (CMAKE_FIND_LIBRARY_SUFFIXES .dll.a .lib .so .dylib .a)
set (${PRODUCT_NAME}_PATH_SUFFIXES lib)
if (WIN32)

View File

@ -12,7 +12,7 @@ if (NOT BISON_EXECUTABLE OR NOT EXISTS "${BISON_EXECUTABLE}")
endif()
# Add paths to 3rdparty subfolders containing name "bison" to CMAKE_PROGRAM_PATH variable to make
# these paths searhed by find_package
# these paths searched by find_package
if (3RDPARTY_DIR)
file (GLOB BISON_PATHS LIST_DIRECTORIES true "${3RDPARTY_DIR}/*bison*/")
foreach (candidate_path ${BISON_PATHS})

File diff suppressed because it is too large Load Diff

View File

@ -56,7 +56,7 @@ else()
endif()
endif()
# unset all redundant variables
OCCT_CHECK_AND_UNSET (DOXYGEN_SKIP_DOT)
OCCT_CHECK_AND_UNSET (DOXYGEN_EXECUTABLE)
OCCT_CHECK_AND_UNSET (DOXYGEN_DOT_EXECUTABLE)
# hide all redundant variables
mark_as_advanced (DOXYGEN_SKIP_DOT)
mark_as_advanced (DOXYGEN_EXECUTABLE)
mark_as_advanced (DOXYGEN_DOT_EXECUTABLE)

View File

@ -1,6 +1,51 @@
# Draco - a library for a lossy vertex data compression, used as extension to glTF format.
# https://github.com/google/draco
macro (SEARCH_DRACO_LIB)
if (3RDPARTY_DRACO_DIR AND EXISTS "${3RDPARTY_DRACO_DIR}")
if (NOT 3RDPARTY_DRACO_LIBRARY OR NOT EXISTS "${3RDPARTY_DRACO_LIBRARY}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .a)
set (3RDPARTY_DRACO_LIBRARY "3RDPARTY_DRACO_LIBRARY-NOTFOUND" CACHE FILEPATH "The path to Draco library" FORCE)
find_library (3RDPARTY_DRACO_LIBRARY NAMES ${CSF_Draco}
PATHS "${3RDPARTY_DRACO_DIR}"
PATH_SUFFIXES lib
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
if (3RDPARTY_DRACO_LIBRARY AND EXISTS "${3RDPARTY_DRACO_LIBRARY}")
get_filename_component (3RDPARTY_DRACO_LIBRARY_DIR "${3RDPARTY_DRACO_LIBRARY}" PATH)
set (3RDPARTY_DRACO_LIBRARY_DIR "${3RDPARTY_DRACO_LIBRARY_DIR}" CACHE FILEPATH "The directory containing Draco library" FORCE)
endif()
endif()
if (WIN32 AND (NOT 3RDPARTY_DRACO_LIBRARY_DEBUG OR NOT EXISTS "${3RDPARTY_DRACO_LIBRARY_DEBUG}"))
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .a)
set (3RDPARTY_DRACO_LIBRARY_DEBUG "3RDPARTY_DRACO_LIBRARY_DEBUG-NOTFOUND" CACHE FILEPATH "The path to debug Draco library" FORCE)
find_library (3RDPARTY_DRACO_LIBRARY_DEBUG NAMES ${CSF_Draco}
PATHS "${3RDPARTY_DRACO_DIR}"
PATH_SUFFIXES libd debug/lib
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
if (3RDPARTY_DRACO_LIBRARY_DEBUG AND EXISTS "${3RDPARTY_DRACO_LIBRARY_DEBUG}")
get_filename_component (3RDPARTY_DRACO_LIBRARY_DIR_DEBUG "${3RDPARTY_DRACO_LIBRARY_DEBUG}" PATH)
set (3RDPARTY_DRACO_LIBRARY_DIR_DEBUG "${3RDPARTY_DRACO_LIBRARY_DIR_DEBUG}" CACHE FILEPATH "The directory containing debug Draco library" FORCE)
endif()
endif()
endif()
endmacro()
# vcpkg processing
if (BUILD_USE_VCPKG)
find_package (draco CONFIG REQUIRED)
set (3RDPARTY_DRACO_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}")
SEARCH_DRACO_LIB()
list (APPEND 3RDPARTY_INCLUDE_DIRS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/draco")
return()
endif()
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
if (NOT DEFINED 3RDPARTY_DRACO_DIR)
@ -51,6 +96,11 @@ if (NOT 3RDPARTY_DRACO_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_DRACO_INCLUDE_DIR}"
PATH_SUFFIXES "include"
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_path (3RDPARTY_DRACO_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATHS ${3RDPARTY_DRACO_DIR}
PATH_SUFFIXES "include"
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
endif()
@ -60,34 +110,4 @@ else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_DRACO_INCLUDE_DIR)
endif()
if (3RDPARTY_DRACO_DIR AND EXISTS "${3RDPARTY_DRACO_DIR}")
if (NOT 3RDPARTY_DRACO_LIBRARY OR NOT EXISTS "${3RDPARTY_DRACO_LIBRARY}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .a)
set (3RDPARTY_DRACO_LIBRARY "3RDPARTY_DRACO_LIBRARY-NOTFOUND" CACHE FILEPATH "The path to Draco library" FORCE)
find_library (3RDPARTY_DRACO_LIBRARY NAMES ${CSF_Draco}
PATHS "${3RDPARTY_DRACO_DIR}"
PATH_SUFFIXES lib
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
if (3RDPARTY_DRACO_LIBRARY AND EXISTS "${3RDPARTY_DRACO_LIBRARY}")
get_filename_component (3RDPARTY_DRACO_LIBRARY_DIR "${3RDPARTY_DRACO_LIBRARY}" PATH)
set (3RDPARTY_DRACO_LIBRARY_DIR "${3RDPARTY_DRACO_LIBRARY_DIR}" CACHE FILEPATH "The directory containing Draco library" FORCE)
endif()
endif()
if (WIN32 AND (NOT 3RDPARTY_DRACO_LIBRARY_DEBUG OR NOT EXISTS "${3RDPARTY_DRACO_LIBRARY_DEBUG}"))
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .a)
set (3RDPARTY_DRACO_LIBRARY_DEBUG "3RDPARTY_DRACO_LIBRARY_DEBUG-NOTFOUND" CACHE FILEPATH "The path to debug Draco library" FORCE)
find_library (3RDPARTY_DRACO_LIBRARY_DEBUG NAMES ${CSF_Draco}
PATHS "${3RDPARTY_DRACO_DIR}"
PATH_SUFFIXES libd
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
if (3RDPARTY_DRACO_LIBRARY_DEBUG AND EXISTS "${3RDPARTY_DRACO_LIBRARY_DEBUG}")
get_filename_component (3RDPARTY_DRACO_LIBRARY_DIR_DEBUG "${3RDPARTY_DRACO_LIBRARY_DEBUG}" PATH)
set (3RDPARTY_DRACO_LIBRARY_DIR_DEBUG "${3RDPARTY_DRACO_LIBRARY_DIR_DEBUG}" CACHE FILEPATH "The directory containing debug Draco library" FORCE)
endif()
endif()
endif()
SEARCH_DRACO_LIB()

View File

@ -83,5 +83,5 @@ else()
set (3RDPARTY_EIGEN_INCLUDE_DIR "" CACHE PATH "the path to Eigen header file" FORCE)
endif()
# unset all redundant variables
OCCT_CHECK_AND_UNSET(Eigen3_DIR)
# hide all redundant variables
mark_as_advanced(Eigen3_DIR)

View File

@ -1,4 +1,15 @@
# FFmpeg
# vcpkg processing
if (BUILD_USE_VCPKG)
find_package(FFMPEG REQUIRED)
set(CSF_FFmpeg ${FFMPEG_LIBRARIES})
if (WIN32)
set (USED_3RDPARTY_FREEIMAGE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin")
else()
set (USED_3RDPARTY_FREEIMAGE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib")
endif()
list (APPEND 3RDPARTY_INCLUDE_DIRS "${FFMPEG_INCLUDE_DIRS}")
return()
endif()
if (NOT DEFINED INSTALL_FFMPEG)
set (INSTALL_FFMPEG OFF CACHE BOOL "${INSTALL_FFMPEG_DESCR}")
@ -236,7 +247,7 @@ foreach (LIBRARY_NAME ${CSF_FFmpeg})
mark_as_advanced (3RDPARTY_FFMPEG_LIBRARY_${LIBRARY_NAME} 3RDPARTY_FFMPEG_DLL_${LIBRARY_NAME})
endforeach()
# unset all redundant variables
OCCT_CHECK_AND_UNSET (FFMPEG_INCLUDE_DIRS)
OCCT_CHECK_AND_UNSET (FFMPEG_LIBRARY_DIRS)
OCCT_CHECK_AND_UNSET (FFMPEG_DIR)
# hide all redundant variables
mark_as_advanced (FFMPEG_INCLUDE_DIRS)
mark_as_advanced (FFMPEG_LIBRARY_DIRS)
mark_as_advanced (FFMPEG_DIR)

View File

@ -15,7 +15,7 @@ if (NOT FLEX_INCLUDE_DIR OR NOT EXISTS "${FLEX_INCLUDE_DIR}")
endif()
# Add paths to 3rdparty subfolders containing name "flex" to CMAKE_PROGRAM_PATH and
# CMAKE_INCLUDE_PATH variables to make these paths searhed by find_package
# CMAKE_INCLUDE_PATH variables to make these paths searched by find_package
if (3RDPARTY_DIR)
file (GLOB FLEX_PATHS LIST_DIRECTORIES true "${3RDPARTY_DIR}/*flex*")
foreach (candidate_path ${FLEX_PATHS})
@ -31,3 +31,13 @@ find_package (FLEX 2.6.4)
if (NOT FLEX_FOUND OR NOT FLEX_INCLUDE_DIR OR NOT EXISTS "${FLEX_INCLUDE_DIR}/FlexLexer.h")
list (APPEND 3RDPARTY_NOT_INCLUDED FLEX_INCLUDE_DIR)
endif()
# remove old general version of FlexLexer
if (EXISTS ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/FlexLexer/FlexLexer.h)
message (STATUS "Info: remove old FLEX header file: ${CMAKE_SOURCE_DIR}/src/FlexLexer/FlexLexer.h")
file(REMOVE ${CMAKE_SOURCE_DIR}/src/FlexLexer/FlexLexer.h)
endif()
# install copy of FlexLexer.h locally to allow further building without flex
if (FLEX_INCLUDE_DIR AND EXISTS "${FLEX_INCLUDE_DIR}/FlexLexer.h")
configure_file("${FLEX_INCLUDE_DIR}/FlexLexer.h" "${CMAKE_SOURCE_DIR}/src/FlexLexer/FlexLexer.h" @ONLY NEWLINE_STYLE LF)
endif()

View File

@ -1,3 +1,16 @@
#freeimage
# vcpkg processing
if (BUILD_USE_VCPKG)
find_package(freeimage CONFIG REQUIRED)
set(CSF_FreeImagePlus freeimage::FreeImagePlus)
if (WIN32)
set (USED_3RDPARTY_FREEIMAGE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin")
else()
set (USED_3RDPARTY_FREEIMAGE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib")
endif()
list (APPEND 3RDPARTY_INCLUDE_DIRS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/")
return()
endif()
THIRDPARTY_PRODUCT("FREEIMAGE" "FreeImage.h" "CSF_FreeImagePlus" "d")

View File

@ -1,5 +1,18 @@
# freetype
# vcpkg processing
if (BUILD_USE_VCPKG)
find_package (Freetype MODULE REQUIRED)
set (CSF_FREETYPE Freetype::Freetype)
if (WIN32)
set (USED_3RDPARTY_FREETYPE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin")
else()
set (USED_3RDPARTY_FREETYPE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib")
endif()
list (APPEND 3RDPARTY_INCLUDE_DIRS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
return()
endif()
if (NOT DEFINED INSTALL_FREETYPE AND BUILD_SHARED_LIBS)
set (INSTALL_FREETYPE OFF CACHE BOOL "${INSTALL_FREETYPE_DESCR}")
endif()
@ -14,7 +27,7 @@ OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
OCCT_MAKE_COMPILER_SHORT_NAME()
OCCT_MAKE_COMPILER_BITNESS()
# specify freetype folder in connectin with 3RDPARTY_DIR
# specify freetype folder in connection with 3RDPARTY_DIR
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
#CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_FREETYPE_DIR PATH "The directory containing freetype")
@ -164,6 +177,14 @@ if (IS_BUILTIN_SEARCH_REQUIRED)
set (3RDPARTY_FREETYPE_LIBRARY_DIR "" CACHE PATH "The directory containing freetype library" FORCE)
endif()
endif()
# In case of MinGW some libraries can have .dll.a extension, so we should check it and use instead of .a
if (MINGW AND 3RDPARTY_FREETYPE_LIBRARY AND EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
string (REPLACE ".a" ".dll.a" 3RDPARTY_FREETYPE_LIBRARY_TEST "${3RDPARTY_FREETYPE_LIBRARY}")
if (EXISTS "${3RDPARTY_FREETYPE_LIBRARY_TEST}")
set (3RDPARTY_FREETYPE_LIBRARY "${3RDPARTY_FREETYPE_LIBRARY_TEST}" CACHE FILEPATH "The path to freetype library" FORCE)
endif()
endif()
endif()
# the SECOND step in search for freetype library and header folders (additional search algorithms)
@ -368,10 +389,10 @@ endif()
endif()
#endif()
# unset all redundant variables
OCCT_CHECK_AND_UNSET(FREETYPE_INCLUDE_DIR_ft2build)
OCCT_CHECK_AND_UNSET(FREETYPE_INCLUDE_DIR_freetype2)
OCCT_CHECK_AND_UNSET(FREETYPE_LIBRARY_RELEASE)
# hide all redundant variables
mark_as_advanced(FREETYPE_INCLUDE_DIR_ft2build)
mark_as_advanced(FREETYPE_INCLUDE_DIR_freetype2)
mark_as_advanced(FREETYPE_LIBRARY_RELEASE)
if (BUILD_SHARED_LIBS)
mark_as_advanced (3RDPARTY_FREETYPE_LIBRARY 3RDPARTY_FREETYPE_DLL)

66
adm/cmake/gtest.cmake Normal file
View File

@ -0,0 +1,66 @@
# Google Test integration for OCCT
# Only proceed if tests are enabled
if (NOT BUILD_GTEST)
set(GOOGLETEST_FOUND FALSE)
return()
endif()
# Check if the user has specified whether to install Google Test
if (NOT DEFINED INSTALL_GTEST)
set(INSTALL_GTEST OFF CACHE BOOL "Install Google Test")
endif()
# Google Test configuration options
option(GTEST_USE_EXTERNAL "Use externally provided Google Test installation" OFF)
option(GTEST_USE_FETCHCONTENT "Use FetchContent to download and build Google Test" ON)
# Try to find existing GTest installation
find_package(GTest QUIET)
if(GTest_FOUND)
message(STATUS "Found Googletest installation")
set(GOOGLETEST_FOUND TRUE)
set(GTEST_USE_EXTERNAL TRUE)
set(GTEST_USE_FETCHCONTENT FALSE)
else()
message(STATUS "Googletest not found in system paths")
if(GTEST_USE_FETCHCONTENT)
include(FetchContent)
# Set option to disable GMock before declaring the content
set(BUILD_GMOCK OFF CACHE BOOL "Builds the googlemock subproject" FORCE)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/refs/tags/v1.16.0.zip
DOWNLOAD_EXTRACT_TIMESTAMP true
)
FetchContent_MakeAvailable(googletest)
# Set proper grouping for the targets in solution explorer
if(TARGET gtest)
set_target_properties(gtest PROPERTIES FOLDER "ThirdParty/GoogleTest")
target_compile_definitions(gtest PRIVATE GTEST_CREATE_SHARED_LIBRARY=1)
endif()
if(TARGET gtest_main)
set_target_properties(gtest_main PROPERTIES FOLDER "ThirdParty/GoogleTest")
target_compile_definitions(gtest_main PRIVATE GTEST_CREATE_SHARED_LIBRARY=1)
endif()
# Set variables for consistent use throughout the build system
set(GOOGLETEST_FOUND TRUE)
else()
message(STATUS "Google Test not available. Tests will be skipped.")
set(GOOGLETEST_FOUND FALSE)
endif()
endif()
# Enable CTest if Google Test is available
if(GOOGLETEST_FOUND)
include(GoogleTest)
endif()

View File

@ -1,5 +1,105 @@
# JeMalloc
function (JEMALLOC_LIB_SEARCH MMGR_LIB PREFIX)
if (NOT 3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB})
set (JEMALLOC_PATH_SUFFIXES "lib" "bin")
set (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} "3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}-NOTFOUND")
if (3RDPARTY_JEMALLOC_DIR AND EXISTS "${3RDPARTY_JEMALLOC_DIR}")
find_library (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} NAMES ${MMGR_LIB}
PATHS "${3RDPARTY_JEMALLOC_LIBRARY_DIR}" "${3RDPARTY_JEMALLOC_DIR}"
PATH_SUFFIXES ${JEMALLOC_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_library (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} NAMES ${MMGR_LIB}
PATH_SUFFIXES ${JEMALLOC_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
if (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB})
get_filename_component (3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} "${3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}}" PATH)
set (3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} "${3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB}}")
else()
set (3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} "")
endif()
endif()
if (3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB})
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB}}" PARENT_SCOPE)
set (3RDPARTY_JEMALLOC_LIBRARY_DIR "${3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB}}" CACHE PATH "The directory containing JEMALLOC libraries" FORCE)
elseif("${PREFIX}" STREQUAL "SHARED")
return()
else()
message(STATUS "Cannot find ${MMGR_LIB} library in jemalloc 3rdparty")
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} PARENT_SCOPE)
set (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} "" PARENT_SCOPE)
endif()
set(JEMALLOC_IS_STATIC_LIB FALSE)
if ("${PREFIX}" STREQUAL "STATIC")
set(JEMALLOC_IS_STATIC_LIB TRUE)
endif()
if (${JEMALLOC_IS_STATIC_LIB})
set (OLD_CSF_MMGR ${CSF_MMGR})
list (APPEND OLD_CSF_MMGR "${3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}}")
set (CSF_MMGR "${OLD_CSF_MMGR}" PARENT_SCOPE)
endif()
# install instructions
if (INSTALL_JEMALLOC AND NOT JEMALLOC_IS_STATIC_LIB)
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
get_filename_component(3RDPARTY_JEMALLOC_LIBRARY ${3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}} REALPATH)
if (SINGLE_GENERATOR)
install (FILES "${3RDPARTY_JEMALLOC_LIBRARY}"
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}")
else()
install (FILES "${3RDPARTY_JEMALLOC_LIBRARY}"
CONFIGURATIONS Debug
DESTINATION "${JEMALLOC_INSTALL_DESTINATION}d")
install (FILES "${3RDPARTY_JEMALLOC_LIBRARY}"
CONFIGURATIONS Release
DESTINATION "${JEMALLOC_INSTALL_DESTINATION}")
install (FILES "${3RDPARTY_JEMALLOC_LIBRARY}"
CONFIGURATIONS RelWithDebInfo
DESTINATION "${JEMALLOC_INSTALL_DESTINATION}i")
endif()
set (USED_3RDPARTY_JEMALLOC_DIR "" PARENT_SCOPE)
elseif(NOT JEMALLOC_IS_STATIC_LIB)
# the library directory for using by the executable
set (USED_3RDPARTY_JEMALLOC_DIR ${3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB}} PARENT_SCOPE)
endif()
unset(3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} CACHE)
unset(3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} CACHE)
endfunction()
macro (SEARCH_JEMALLOC)
# find static jemalloc lib
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".lib" ".a")
if (WIN32)
JEMALLOC_LIB_SEARCH ("jemalloc" "STATIC")
elseif(NOT WIN32)
JEMALLOC_LIB_SEARCH ("jemalloc_pic" "STATIC")
SET(CMAKE_FIND_LIBRARY_SUFFIXES "" "so")
JEMALLOC_LIB_SEARCH ("jemalloc.so.2" "SHARED")
endif()
# find shared jemalloc lib
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dll" ".so")
JEMALLOC_LIB_SEARCH ("jemalloc" "SHARED")
endmacro()
# Reset CSF variable
set (CSF_MMGR "")
# vcpkg processing
if (BUILD_USE_VCPKG)
set (3RDPARTY_JEMALLOC_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}")
OCCT_CHECK_AND_UNSET_GROUP (3RDPARTY_JEMALLOC_LIBRARY_SHARED)
OCCT_CHECK_AND_UNSET_GROUP (3RDPARTY_JEMALLOC_LIBRARY_STATIC)
SEARCH_JEMALLOC()
list (APPEND 3RDPARTY_INCLUDE_DIRS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/jemalloc")
return()
endif()
if (NOT DEFINED INSTALL_JEMALLOC)
set (INSTALL_JEMALLOC OFF CACHE BOOL "${INSTALL_INSTALL_JEMALLOC_DESCR}")
endif()
@ -40,10 +140,15 @@ if (NOT 3RDPARTY_JEMALLOC_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_JEMALLOC_INCLUDE
if (3RDPARTY_JEMALLOC_DIR AND EXISTS "${3RDPARTY_JEMALLOC_DIR}")
find_path (3RDPARTY_JEMALLOC_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATHS ${3RDPARTY_JEMALLOC_DIR}
PATH_SUFFIXES include/jemalloc
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
PATHS ${3RDPARTY_JEMALLOC_DIR}
PATH_SUFFIXES include/jemalloc
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_path (3RDPARTY_JEMALLOC_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATHS ${3RDPARTY_JEMALLOC_DIR}
PATH_SUFFIXES include/jemalloc
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
endif()
@ -61,83 +166,5 @@ else()
set (JEMALLOC_INSTALL_DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}")
endif()
macro (JEMALLOC_LIB_SEARCH MMGR_LIB PREFIX)
if (NOT 3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB})
set (JEMALLOC_PATH_SUFFIXES "lib" "bin")
set (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} "3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}-NOTFOUND")
if (3RDPARTY_JEMALLOC_DIR AND EXISTS "${3RDPARTY_JEMALLOC_DIR}")
find_library (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} NAMES ${MMGR_LIB}
PATHS "${3RDPARTY_JEMALLOC_LIBRARY_DIR}" "${3RDPARTY_JEMALLOC_DIR}"
PATH_SUFFIXES ${JEMALLOC_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_library (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} NAMES ${MMGR_LIB}
PATH_SUFFIXES ${JEMALLOC_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
if (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB})
get_filename_component (3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} "${3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}}" PATH)
set (3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} "${3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB}}")
else()
set (3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} "")
endif()
endif()
if (3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB})
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB}}")
set (3RDPARTY_JEMALLOC_LIBRARY_DIR "${3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB}}" CACHE PATH "The directory containing JEMALLOC libraries" FORCE)
else()
message("Cannot find ${MMGR_LIB} library in jemalloc 3rdparty")
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB})
set (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} "")
endif()
set (JEMALLOC_IS_STATIC_LIB FALSE)
if (((${3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}} MATCHES "\.lib$")) OR ((${3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}} MATCHES "\.a$")))
get_filename_component(STATIC_LIB_NAME ${3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}} NAME)
list(APPEND CSF_MMGR "${STATIC_LIB_NAME}")
set (JEMALLOC_IS_STATIC_LIB TRUE)
endif()
# install instructions
if (INSTALL_JEMALLOC AND NOT JEMALLOC_IS_STATIC_LIB)
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
get_filename_component(3RDPARTY_JEMALLOC_LIBRARY ${3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}} REALPATH)
if (SINGLE_GENERATOR)
install (FILES "${3RDPARTY_JEMALLOC_LIBRARY}"
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}")
else()
install (FILES "${3RDPARTY_JEMALLOC_LIBRARY}"
CONFIGURATIONS Debug
DESTINATION "${JEMALLOC_INSTALL_DESTINATION}d")
install (FILES "${3RDPARTY_JEMALLOC_LIBRARY}"
CONFIGURATIONS Release
DESTINATION "${JEMALLOC_INSTALL_DESTINATION}")
install (FILES "${3RDPARTY_JEMALLOC_LIBRARY}"
CONFIGURATIONS RelWithDebInfo
DESTINATION "${JEMALLOC_INSTALL_DESTINATION}i")
endif()
set (USED_3RDPARTY_JEMALLOC_DIR "")
elseif(NOT JEMALLOC_IS_STATIC_LIB)
# the library directory for using by the executable
set (USED_3RDPARTY_JEMALLOC_DIR ${3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB}})
endif()
unset(3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} CACHE)
unset(3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} CACHE)
endmacro()
# Reset CSF variable
set (CSF_MMGR "")
# find static jemalloc lib
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".a")
if (WIN32)
JEMALLOC_LIB_SEARCH ("jemalloc" "STATIC")
elseif(NOT WIN32)
JEMALLOC_LIB_SEARCH ("jemalloc_pic" "STATIC")
SET(CMAKE_FIND_LIBRARY_SUFFIXES "" "so")
JEMALLOC_LIB_SEARCH ("jemalloc.so.2" "SHARED")
endif()
# find shared jemalloc lib
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dll" ".so")
JEMALLOC_LIB_SEARCH ("jemalloc" "SHARED")
SEARCH_JEMALLOC()

View File

@ -82,6 +82,25 @@ else()
set (CSF_Draco)
endif()
# VTK
if (USE_VTK)
# the variable must to be empty, but keep there the list of libs
# that is used in the VTK component.
set (CSF_VTK
# vtkCommonCore
# vtkRenderingCore
# vtkRenderingFreeType
# vtkFiltersGeneral
# vtkIOImage
# vtkImagingCore
# vtkInteractionStyle
# vtkRenderingOpenGL
# vtkRenderingFreeTypeOpenGL
)
else()
set (CSF_VTK)
endif()
if (WIN32)
set (CSF_advapi32 "advapi32.lib")
set (CSF_gdi32 "gdi32.lib")

View File

@ -26,12 +26,22 @@ endif()
if (MSVC)
# suppress C26812 on VS2019/C++20 (prefer 'enum class' over 'enum')
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:precise /wd\"26812\"")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:precise /wd26812")
# suppress warning on using portable non-secure functions in favor of non-portable secure ones
add_definitions (-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
else()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -fPIC")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions -fPIC")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions")
if (NOT CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
else()
add_definitions (-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
endif()
if (APPLE)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations")
endif()
add_definitions(-DOCC_CONVERT_SIGNALS)
endif()
@ -141,14 +151,19 @@ elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPIL
# /GL (whole program optimization) is similar to -flto (Link Time Optimization) in GCC/Clang.
# /GF (eliminate duplicate strings) doesn't have a direct equivalent in GCC/Clang, but the compilers do string pooling automatically.
# /Gy (enable function-level linking) is similar to -ffunction-sections in GCC/Clang.
# /fp:precise (improve floating-point consistency) is similar to -ffloat-store in GCC, but there isn't a perfect equivalent in Clang.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -fomit-frame-pointer -flto -ffunction-sections -ffloat-store")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -fomit-frame-pointer -flto -ffunction-sections")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -fomit-frame-pointer -flto -ffunction-sections")
# Link-Time Code Generation(LTCG) is requared for Whole Program Optimisation(GL)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto")
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -flto")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -flto")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -flto")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -flto")
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -flto")
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -flto")
if (NOT WIN32)
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -Wl,--gc-sections")
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -Wl,--gc-sections")
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -Wl,--gc-sections")
endif()
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshorten-64-to-32")
@ -167,19 +182,21 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
# CLang can be used with both libstdc++ and libc++, however on OS X libstdc++ is outdated.
set (CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}")
endif()
# Optimize size of binaries
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS}")
elseif(MINGW)
if (NOT WIN32)
# Optimize size of binaries
set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
endif()
endif()
if(MINGW)
add_definitions(-D_WIN32_WINNT=0x0601)
# _WIN32_WINNT=0x0601 (use Windows 7 SDK)
#set (CMAKE_SYSTEM_VERSION "6.1")
# workaround bugs in mingw with vtable export
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--export-all-symbols")
# Optimize size of binaries
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wattributes")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wattributes")
endif()
if (CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE)
# Optimize size of binaries
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")

687
adm/cmake/occt_doc.cmake Normal file
View File

@ -0,0 +1,687 @@
##
# Function to collect modules, toolkits, and packages information for documentation
function(OCCT_DOC_COLLECT_MODULES_INFO)
# Set output variables in parent scope
set(OCCT_MODULES ${OCCT_MODULES} PARENT_SCOPE)
# For each module, collect its toolkits
foreach(OCCT_MODULE ${OCCT_MODULES})
if(NOT "${OCCT_MODULE}" STREQUAL "")
set(MODULES_TOOLKITS ${${OCCT_MODULE}_TOOLKITS})
set(TOOLKITS_IN_MODULE_${OCCT_MODULE} ${MODULES_TOOLKITS} PARENT_SCOPE)
# For each toolkit, collect its packages
foreach(TOOLKIT ${MODULES_TOOLKITS})
set(TOOLKIT_PARENT_MODULE_${TOOLKIT} ${OCCT_MODULE} PARENT_SCOPE)
# Get packages from toolkit
set(TOOLKIT_PACKAGES "")
EXTRACT_TOOLKIT_PACKAGES("src" ${TOOLKIT} TOOLKIT_PACKAGES)
set(PACKAGES_IN_TOOLKIT_${TOOLKIT} ${TOOLKIT_PACKAGES} PARENT_SCOPE)
endforeach()
endif()
endforeach()
endfunction()
# Function to generate module dependency graph
function(OCCT_DOC_CREATE_MODULE_DEPENDENCY_GRAPH OUTPUT_DIR FILENAME)
set(DOT_FILE "${OUTPUT_DIR}/${FILENAME}.dot")
# Create .dot file for module dependencies
file(WRITE ${DOT_FILE} "digraph ${FILENAME}\n{\n")
# Create a list to track unique module connections
set(MODULE_CONNECTIONS)
foreach(MODULE ${OCCT_MODULES})
if(NOT "${MODULE}" STREQUAL "")
# Convert module name to lowercase for URL
string(TOLOWER ${MODULE} MODULE_LOWER)
file(APPEND ${DOT_FILE} "\t${MODULE} [ URL = \"module_${MODULE_LOWER}.html\" ]\n")
# Add dependencies between modules
foreach(MODULE_TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE}})
foreach(DEPENDENT_TOOLKIT ${TOOLKIT_DEPENDENCY_${MODULE_TOOLKIT}})
if(DEFINED TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT} AND
NOT "${TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT}}" STREQUAL "${MODULE}")
# Create a unique connection identifier
set(CONNECTION "${TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT}}->${MODULE}")
list(FIND MODULE_CONNECTIONS "${CONNECTION}" CONNECTION_EXISTS)
# Add connection only if it doesn't exist yet
if(${CONNECTION_EXISTS} EQUAL -1)
list(APPEND MODULE_CONNECTIONS "${CONNECTION}")
file(APPEND ${DOT_FILE} "\t${TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT}} -> ${MODULE} [ dir = \"back\", color = \"midnightblue\", style = \"solid\" ]\n")
endif()
endif()
endforeach()
endforeach()
endif()
endforeach()
file(APPEND ${DOT_FILE} "}\n")
# Return the output file name
set(DOT_OUTPUT_FILE "${FILENAME}" PARENT_SCOPE)
endfunction()
# Function to generate toolkit dependency graph for a module
function(OCCT_DOC_CREATE_TOOLKIT_DEPENDENCY_GRAPH OUTPUT_DIR FILENAME MODULE_NAME)
set(DOT_FILE "${OUTPUT_DIR}/${FILENAME}.dot")
# Create .dot file for toolkit dependencies within a module
file(WRITE ${DOT_FILE} "digraph ${FILENAME}\n{\n")
foreach(TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE_NAME}})
# Convert toolkit name to lowercase for URL
string(TOLOWER ${TOOLKIT} TOOLKIT_LOWER)
file(APPEND ${DOT_FILE} "\t${TOOLKIT} [ URL = \"toolkit_${TOOLKIT_LOWER}.html\" ]\n")
# Add dependencies between toolkits in the same module
foreach(DEPENDENT_TOOLKIT ${TOOLKIT_DEPENDENCY_${TOOLKIT}})
if(DEFINED TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT} AND
"${TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT}}" STREQUAL "${MODULE_NAME}")
file(APPEND ${DOT_FILE} "\t${DEPENDENT_TOOLKIT} -> ${TOOLKIT} [ dir = \"back\", color = \"midnightblue\", style = \"solid\" ]\n")
endif()
endforeach()
endforeach()
file(APPEND ${DOT_FILE} "}\n")
# Return the output file name
set(DOT_OUTPUT_FILE "${FILENAME}" PARENT_SCOPE)
endfunction()
# Function to generate dependency graph for a specific toolkit
function(OCCT_DOC_CREATE_SINGLE_TOOLKIT_DEPENDENCY_GRAPH OUTPUT_DIR FILENAME TOOLKIT_NAME)
set(DOT_FILE "${OUTPUT_DIR}/${FILENAME}.dot")
# Create .dot file for dependencies of a single toolkit
file(WRITE ${DOT_FILE} "digraph ${FILENAME}\n{\n")
# Convert toolkit name to lowercase for URL
string(TOLOWER ${TOOLKIT_NAME} TOOLKIT_NAME_LOWER)
file(APPEND ${DOT_FILE} "\t${TOOLKIT_NAME} [ URL = \"toolkit_${TOOLKIT_NAME_LOWER}.html\", shape = box ]\n")
# Add toolkit dependencies
foreach(DEPENDENT_TOOLKIT ${TOOLKIT_DEPENDENCY_${TOOLKIT_NAME}})
# Convert dependent toolkit name to lowercase for URL
string(TOLOWER ${DEPENDENT_TOOLKIT} DEPENDENT_TOOLKIT_LOWER)
file(APPEND ${DOT_FILE} "\t${DEPENDENT_TOOLKIT} [ URL = \"toolkit_${DEPENDENT_TOOLKIT_LOWER}.html\", shape = box ]\n")
file(APPEND ${DOT_FILE} "\t${TOOLKIT_NAME} -> ${DEPENDENT_TOOLKIT} [ color = \"midnightblue\", style = \"solid\" ]\n")
endforeach()
if(TOOLKIT_DEPENDENCY_${TOOLKIT_NAME})
list(LENGTH TOOLKIT_DEPENDENCY_${TOOLKIT_NAME} DEPS_COUNT)
if(DEPS_COUNT GREATER 1)
file(APPEND ${DOT_FILE} "\taspect = 1\n")
endif()
endif()
file(APPEND ${DOT_FILE} "}\n")
# Return the output file name
set(DOT_OUTPUT_FILE "${FILENAME}" PARENT_SCOPE)
endfunction()
# Function to generate main page for documentation
function(OCCT_DOC_GENERATE_MAIN_PAGE OUTPUT_DIR OUTPUT_FILE)
set(MAIN_PAGE_FILE "${OUTPUT_DIR}/${OUTPUT_FILE}")
file(WRITE ${MAIN_PAGE_FILE} "/**\n")
# Check if we're generating documentation for a single module
if(DOC_SINGLE_MODULE)
file(APPEND ${MAIN_PAGE_FILE} "\\mainpage OCCT Module ${DOC_SINGLE_MODULE}\n")
else()
file(APPEND ${MAIN_PAGE_FILE} "\\mainpage Open CASCADE Technology Reference Manual\n\n")
# List all modules
foreach(MODULE ${OCCT_MODULES})
if(NOT "${MODULE}" STREQUAL "")
# page id must be in lowercase
string(TOLOWER ${MODULE} MODULE_LOWER)
file(APPEND ${MAIN_PAGE_FILE} "\\li \\subpage module_${MODULE_LOWER}\n")
endif()
endforeach()
# Add modules relationship diagram
OCCT_DOC_CREATE_MODULE_DEPENDENCY_GRAPH("${OUTPUT_DIR}/html" "schema_all_modules")
file(APPEND ${MAIN_PAGE_FILE} "\\dotfile schema_all_modules.dot\n")
endif()
file(APPEND ${MAIN_PAGE_FILE} "**/\n\n")
# Generate pages for modules and their toolkits
foreach(MODULE ${OCCT_MODULES})
if(NOT "${MODULE}" STREQUAL "")
file(APPEND ${MAIN_PAGE_FILE} "/**\n")
if(DOC_SINGLE_MODULE)
file(APPEND ${MAIN_PAGE_FILE} "\\mainpage OCCT Module ${MODULE}\n")
else()
# page id must be in lowercase
string(TOLOWER ${MODULE} MODULE_LOWER)
file(APPEND ${MAIN_PAGE_FILE} "\\page module_${MODULE_LOWER} Module ${MODULE}\n")
endif()
# List toolkits in the module
foreach(TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE}})
# page id must be in lowercase
string(TOLOWER ${TOOLKIT} TOOLKIT_LOWER)
file(APPEND ${MAIN_PAGE_FILE} "\\li \\subpage toolkit_${TOOLKIT_LOWER}\n")
endforeach()
# Add module diagram
OCCT_DOC_CREATE_TOOLKIT_DEPENDENCY_GRAPH("${OUTPUT_DIR}/html" "schema_${MODULE}" ${MODULE})
file(APPEND ${MAIN_PAGE_FILE} "\\dotfile schema_${MODULE}.dot\n")
file(APPEND ${MAIN_PAGE_FILE} "**/\n\n")
endif()
endforeach()
# Generate pages for toolkits and their packages
foreach(MODULE ${OCCT_MODULES})
if(NOT "${MODULE}" STREQUAL "")
foreach(TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE}})
file(APPEND ${MAIN_PAGE_FILE} "/**\n")
# page id must be in lowercase
string(TOLOWER ${TOOLKIT} TOOLKIT_LOWER)
file(APPEND ${MAIN_PAGE_FILE} "\\page toolkit_${TOOLKIT_LOWER} Toolkit ${TOOLKIT}\n")
# List packages in toolkit
foreach(PACKAGE ${PACKAGES_IN_TOOLKIT_${TOOLKIT}})
set(PACKAGE_NAME ${PACKAGE})
# page id must be in lowercase
string(TOLOWER ${PACKAGE_NAME} PACKAGE_NAME_LOWER)
file(APPEND ${MAIN_PAGE_FILE} "\\li \\subpage package_${PACKAGE_NAME_LOWER}\n")
endforeach()
# Add toolkit dependencies diagram
OCCT_DOC_CREATE_SINGLE_TOOLKIT_DEPENDENCY_GRAPH("${OUTPUT_DIR}/html" "schema_${TOOLKIT}" ${TOOLKIT})
file(APPEND ${MAIN_PAGE_FILE} "\\dotfile schema_${TOOLKIT}.dot\n")
file(APPEND ${MAIN_PAGE_FILE} "**/\n\n")
endforeach()
endif()
endforeach()
# Generate pages for packages and their classes
foreach(MODULE ${OCCT_MODULES})
if(NOT "${MODULE}" STREQUAL "")
foreach(TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE}})
foreach(PACKAGE ${PACKAGES_IN_TOOLKIT_${TOOLKIT}})
file(APPEND ${MAIN_PAGE_FILE} "/**\n")
# page id must be in lowercase
string(TOLOWER ${PACKAGE} PACKAGE_LOWER)
file(APPEND ${MAIN_PAGE_FILE} "\\page package_${PACKAGE_LOWER} Package ${PACKAGE}\n")
# Find header files in the package
EXTRACT_PACKAGE_FILES ("src" ${PACKAGE} ALL_FILES _)
set (HEADER_FILES_FILTERING ${ALL_FILES})
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|hxx|hpp)$")
foreach(HEADER ${HEADER_FILES_FILTERING})
get_filename_component(HEADER_NAME ${HEADER} NAME_WE)
file(APPEND ${MAIN_PAGE_FILE} "\\li \\subpage ${HEADER_NAME}\n")
# Append header file to DOXYGEN_INPUT_FILES list
list(APPEND DOXYGEN_INPUT_FILES "${HEADER}")
endforeach()
file(APPEND ${MAIN_PAGE_FILE} "**/\n\n")
endforeach()
endforeach()
endif()
endforeach()
# Create a variable containing all input files for Doxygen
string(REPLACE ";" " " DOXYGEN_INPUT_FILES_STRING "${DOXYGEN_INPUT_FILES}")
set(DOXYGEN_INPUT_FILES_STRING ${DOXYGEN_INPUT_FILES_STRING} PARENT_SCOPE)
endfunction()
# Function to extract dependency information for toolkits
function(OCCT_DOC_EXTRACT_TOOLKIT_DEPENDENCIES)
foreach(MODULE ${OCCT_MODULES})
if(NOT "${MODULE}" STREQUAL "")
foreach(TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE}})
EXTRACT_TOOLKIT_EXTERNLIB("src" ${TOOLKIT} EXTERNLIB_LIST)
set(DEPENDENT_TOOLKITS "")
foreach(EXTERNLIB ${EXTERNLIB_LIST})
if(EXTERNLIB MATCHES "^TK")
list(APPEND DEPENDENT_TOOLKITS ${EXTERNLIB})
endif()
endforeach()
set(TOOLKIT_DEPENDENCY_${TOOLKIT} ${DEPENDENT_TOOLKITS} PARENT_SCOPE)
endforeach()
endif()
endforeach()
endfunction()
# Function to load file lists for documentation
function(OCCT_DOC_LOAD_FILE_LISTS)
# Load list of HTML documentation files
set(FILES_HTML_PATH "${CMAKE_SOURCE_DIR}/dox/FILES_HTML.txt")
if(EXISTS ${FILES_HTML_PATH})
file(STRINGS ${FILES_HTML_PATH} HTML_FILES REGEX "^[^#]+")
set(OCCT_DOC_HTML_FILES ${HTML_FILES} PARENT_SCOPE)
else()
set(OCCT_DOC_HTML_FILES "" PARENT_SCOPE)
endif()
# Load list of PDF documentation files
set(FILES_PDF_PATH "${CMAKE_SOURCE_DIR}/dox/FILES_PDF.txt")
if(EXISTS ${FILES_PDF_PATH})
file(STRINGS ${FILES_PDF_PATH} PDF_FILES REGEX "^[^#]+")
set(OCCT_DOC_PDF_FILES ${PDF_FILES} PARENT_SCOPE)
else()
set(OCCT_DOC_PDF_FILES "" PARENT_SCOPE)
endif()
endfunction()
# Function to collect image directories from input files
function(OCCT_DOC_COLLECT_IMAGE_DIRS INPUT_DIRS RESULT_IMAGE_DIRS)
set(IMAGE_DIRS "")
foreach(INPUT_DIR ${INPUT_DIRS})
# Check if directory exists
if(EXISTS "${INPUT_DIR}")
# Add the standard "images" subdirectory if it exists
if(EXISTS "${INPUT_DIR}/images")
list(APPEND IMAGE_DIRS "${INPUT_DIR}/images")
endif()
# Find all subdirectories containing images
file(GLOB_RECURSE IMAGE_FILES
"${INPUT_DIR}/*.png"
"${INPUT_DIR}/*.jpg"
"${INPUT_DIR}/*.jpeg"
"${INPUT_DIR}/*.gif"
"${INPUT_DIR}/*.svg")
foreach(IMAGE_FILE ${IMAGE_FILES})
get_filename_component(IMAGE_DIR ${IMAGE_FILE} DIRECTORY)
list(APPEND IMAGE_DIRS "${IMAGE_DIR}")
endforeach()
endif()
endforeach()
if(IMAGE_DIRS)
list(REMOVE_DUPLICATES IMAGE_DIRS)
endif()
set(${RESULT_IMAGE_DIRS} ${IMAGE_DIRS} PARENT_SCOPE)
endfunction()
# Function to configure and run Doxygen for documentation generation
function(OCCT_DOC_CONFIGURE_DOXYGEN OUTPUT_DIR CONFIG_FILE DOC_TYPE)
# Create output directory if it doesn't exist
file(MAKE_DIRECTORY ${OUTPUT_DIR})
# Use existing Doxygen template file as base
if(DOC_TYPE STREQUAL "OVERVIEW")
set(TEMPLATE_DOXYFILE "${CMAKE_SOURCE_DIR}/dox/resources/occt_ug_html.doxyfile")
else()
set(TEMPLATE_DOXYFILE "${CMAKE_SOURCE_DIR}/dox/resources/occt_rm.doxyfile")
endif()
# Define Doxygen parameters that need to be overridden from the template
set(DOXYGEN_CONFIG_FILE "${OUTPUT_DIR}/${CONFIG_FILE}")
# Check if template file exists
if(NOT EXISTS ${TEMPLATE_DOXYFILE})
message(FATAL_ERROR "ERROR: Doxygen template file not found: ${TEMPLATE_DOXYFILE}")
return()
endif()
# Read template content
file(READ ${TEMPLATE_DOXYFILE} DOXYGEN_TEMPLATE_CONTENT)
# Create the output Doxyfile
file(WRITE ${DOXYGEN_CONFIG_FILE} "# Doxyfile generated by OCCT_DOC_CONFIGURE_DOXYGEN\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "# Base template: ${TEMPLATE_DOXYFILE}\n\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "${DOXYGEN_TEMPLATE_CONTENT}\n\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "# Custom overrides set by CMake:\n")
# Project information
file(APPEND ${DOXYGEN_CONFIG_FILE} "PROJECT_NUMBER = ${OCC_VERSION_STRING_EXT}\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "OUTPUT_DIRECTORY = ${OUTPUT_DIR}\n")
# Ensure client-side search is configured correctly
file(APPEND ${DOXYGEN_CONFIG_FILE} "\n# Search engine settings\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "SEARCHENGINE = YES\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "SERVER_BASED_SEARCH = NO\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTERNAL_SEARCH = NO\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "SEARCHDATA_FILE = searchdata.xml\n")
# Additional parameters based on the document type
if(DOC_TYPE STREQUAL "OVERVIEW")
# Settings for Overview documentation
file(APPEND ${DOXYGEN_CONFIG_FILE} "PROJECT_LOGO = ${CMAKE_SOURCE_DIR}/dox/resources/occ_logo.png\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTRACT_ALL = NO\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTRACT_PRIVATE = NO\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTRACT_STATIC = NO\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXCLUDE_PATTERNS = */src/* */inc/* */drv/* */Properties/*\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "ENABLED_SECTIONS = OVERVIEW_SECTION\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "GENERATE_TAGFILE = ${OUTPUT_DIR}/occt.tag\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "GENERATE_TREEVIEW = YES\n")
# Setup tag file for cross-referencing with Reference Manual
if(BUILD_DOC_RefMan)
file(APPEND ${DOXYGEN_CONFIG_FILE} "\n# Cross-referencing with Reference Manual\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "TAGFILES = \"${CMAKE_BINARY_DIR}/doc/refman/occt_refman.tag=../../refman/html\"\n")
endif()
# Input files for overview
if(DEFINED OCCT_OVERVIEW_FILES)
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT = ${OCCT_OVERVIEW_FILES}\n")
else()
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT = ${CMAKE_SOURCE_DIR}/dox\n")
endif()
# Collect image directories for overview
set(OVERVIEW_INPUT_DIRS ${CMAKE_SOURCE_DIR}/dox)
OCCT_DOC_COLLECT_IMAGE_DIRS("${OVERVIEW_INPUT_DIRS}" OVERVIEW_IMAGE_DIRS)
# Image path for overview
if(OVERVIEW_IMAGE_DIRS)
string(REPLACE ";" " " OVERVIEW_IMAGE_DIRS_STR "${OVERVIEW_IMAGE_DIRS}")
file(APPEND ${DOXYGEN_CONFIG_FILE} "IMAGE_PATH = ${OVERVIEW_IMAGE_DIRS_STR} ${CMAKE_SOURCE_DIR}/dox/resources\n")
else()
file(APPEND ${DOXYGEN_CONFIG_FILE} "IMAGE_PATH = ${CMAKE_SOURCE_DIR}/dox/resources\n")
endif()
# Example paths
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXAMPLE_PATH = ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/samples\n")
else()
# Settings for Reference Manual
file(APPEND ${DOXYGEN_CONFIG_FILE} "PROJECT_NAME = \"Open CASCADE Technology Reference Manual\"\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "PROJECT_LOGO = ${CMAKE_SOURCE_DIR}/dox/resources/occ_logo.png\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "BUILTIN_STL_SUPPORT = YES\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTRACT_PRIVATE = NO\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTRACT_PACKAGE = YES\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXCLUDE_PATTERNS = */Properties/*\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "FILE_PATTERNS = *.h *.hxx *.lxx *.gxx *.pxx *.cxx *.cpp *.c *.md\n")
# Generate a tag file for cross-referencing from Overview
file(APPEND ${DOXYGEN_CONFIG_FILE} "\n# Generate tag file for cross-referencing\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "GENERATE_TAGFILE = ${OUTPUT_DIR}/occt_refman.tag\n")
# Input files for reference manual - CRITICAL FOR PROPER GENERATION
file(APPEND ${DOXYGEN_CONFIG_FILE} "\n# Input files for reference manual\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT = ${CMAKE_SOURCE_DIR}/src\n")
# If generating documentation for specific modules
if(DEFINED OCCT_DOC_MODULES)
set(MODULE_PATHS "")
foreach(MODULE ${OCCT_DOC_MODULES})
foreach(TOOLKIT ${${MODULE}_TOOLKITS})
list(APPEND MODULE_PATHS "${CMAKE_SOURCE_DIR}/src/${TOOLKIT}")
endforeach()
endforeach()
string(REPLACE ";" " " MODULE_PATHS_STR "${MODULE_PATHS}")
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT += ${MODULE_PATHS_STR}\n") # Use += to append to existing INPUT
endif()
# Configure image path for reference manual
set(REFMAN_INPUT_DIRS ${CMAKE_SOURCE_DIR}/src)
OCCT_DOC_COLLECT_IMAGE_DIRS("${REFMAN_INPUT_DIRS}" REFMAN_IMAGE_DIRS)
if(REFMAN_IMAGE_DIRS)
string(REPLACE ";" " " REFMAN_IMAGE_DIRS_STR "${REFMAN_IMAGE_DIRS}")
file(APPEND ${DOXYGEN_CONFIG_FILE} "IMAGE_PATH = ${REFMAN_IMAGE_DIRS_STR} ${CMAKE_SOURCE_DIR}/dox/resources\n")
else()
file(APPEND ${DOXYGEN_CONFIG_FILE} "IMAGE_PATH = ${CMAKE_SOURCE_DIR}/dox/resources\n")
endif()
# Add main page file if generated
if(EXISTS "${OUTPUT_DIR}/main_page.dox")
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT += ${OUTPUT_DIR}/main_page.dox\n") # Use += to append to existing INPUT
endif()
# Add header files to Doxygen input
if(DEFINED DOXYGEN_INPUT_FILES_STRING)
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT += ${DOXYGEN_INPUT_FILES_STRING}\n") # Use += to append to existing INPUT
endif()
endif()
# Custom CSS
if(EXISTS "${CMAKE_SOURCE_DIR}/dox/resources/custom.css")
file(APPEND ${DOXYGEN_CONFIG_FILE} "HTML_EXTRA_STYLESHEET = ${CMAKE_SOURCE_DIR}/dox/resources/custom.css\n")
endif()
# Set paths for dot tool
if(GRAPHVIZ_DOT_EXECUTABLE)
file(APPEND ${DOXYGEN_CONFIG_FILE} "DOT_PATH = ${GRAPHVIZ_DOT_EXECUTABLE}\n")
get_filename_component(DOT_DIRECTORY ${GRAPHVIZ_DOT_EXECUTABLE} DIRECTORY)
file(APPEND ${DOXYGEN_CONFIG_FILE} "DOTFONTPATH = ${DOT_DIRECTORY}\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "DOTFILE_DIRS = ${OUTPUT_DIR}/html\n")
endif()
# Confirm file creation
if(EXISTS ${DOXYGEN_CONFIG_FILE})
message(STATUS "Successfully created Doxygen configuration file at: ${DOXYGEN_CONFIG_FILE}")
else()
message(FATAL_ERROR "Failed to create Doxygen configuration file at: ${DOXYGEN_CONFIG_FILE}")
endif()
endfunction()
# Function to check if required tools are available
function(OCCT_DOC_CHECK_TOOLS)
# Find Doxygen
find_package(Doxygen QUIET)
if(NOT DOXYGEN_FOUND)
message(WARNING "Doxygen not found. Documentation will not be generated.")
set(OCCT_DOC_TOOLS_AVAILABLE FALSE PARENT_SCOPE)
return()
endif()
# Find Graphviz
find_program(GRAPHVIZ_DOT_EXECUTABLE NAMES dot)
# Check for MathJax for LaTeX formulas
if(NOT MATHJAX_PATH)
set(MATHJAX_PATH "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5")
endif()
# Find tools for PDF generation if needed
if(BUILD_DOC_PDF)
# Find pdflatex
find_program(PDFLATEX_EXECUTABLE NAMES pdflatex)
if(NOT PDFLATEX_EXECUTABLE)
message(WARNING "pdflatex not found. PDF documentation will not be generated.")
set(BUILD_DOC_PDF FALSE PARENT_SCOPE)
endif()
# Find Inkscape (for SVG to PNG conversion for PDFs)
find_program(INKSCAPE_EXECUTABLE NAMES inkscape)
if(NOT INKSCAPE_EXECUTABLE)
message(WARNING "Inkscape not found. SVG images will not be properly converted in PDF documentation.")
endif()
set(PDFLATEX_EXECUTABLE ${PDFLATEX_EXECUTABLE} PARENT_SCOPE)
set(INKSCAPE_EXECUTABLE ${INKSCAPE_EXECUTABLE} PARENT_SCOPE)
endif()
# Find tools for CHM generation if needed
if(BUILD_DOC_CHM AND WIN32)
# Find HTML Help Compiler
find_program(HHC_EXECUTABLE NAMES hhc HHC)
if(NOT HHC_EXECUTABLE)
message(WARNING "HTML Help Compiler not found. CHM documentation will not be generated.")
set(BUILD_DOC_CHM FALSE PARENT_SCOPE)
endif()
set(HHC_EXECUTABLE ${HHC_EXECUTABLE} PARENT_SCOPE)
endif()
set(GRAPHVIZ_DOT_EXECUTABLE ${GRAPHVIZ_DOT_EXECUTABLE} PARENT_SCOPE)
set(MATHJAX_PATH ${MATHJAX_PATH} PARENT_SCOPE)
set(OCCT_DOC_TOOLS_AVAILABLE TRUE PARENT_SCOPE)
endfunction()
# Function to process LaTeX files for PDF generation
function(OCCT_DOC_PROCESS_LATEX OUTPUT_DIR)
# Skip if PDF generation is not enabled or pdflatex not found
if(NOT BUILD_DOC_PDF OR NOT PDFLATEX_EXECUTABLE)
return()
endif()
message(STATUS "Processing LaTeX files for PDF generation...")
# Process SVG images if Inkscape is available
if(INKSCAPE_EXECUTABLE)
file(GLOB SVG_FILES "${OUTPUT_DIR}/latex/*.svg")
foreach(SVG_FILE ${SVG_FILES})
get_filename_component(FILE_NAME ${SVG_FILE} NAME_WE)
set(PNG_FILE "${OUTPUT_DIR}/latex/${FILE_NAME}.png")
execute_process(
COMMAND ${INKSCAPE_EXECUTABLE} -z -e ${PNG_FILE} ${SVG_FILE}
RESULT_VARIABLE INKSCAPE_RESULT
)
if(NOT INKSCAPE_RESULT EQUAL 0)
message(WARNING "Failed to convert ${SVG_FILE} to PNG")
endif()
endforeach()
endif()
# Generate PDF from LaTeX
execute_process(
COMMAND ${PDFLATEX_EXECUTABLE} -interaction=nonstopmode refman.tex
WORKING_DIRECTORY "${OUTPUT_DIR}/latex"
RESULT_VARIABLE LATEX_RESULT
OUTPUT_VARIABLE LATEX_OUTPUT
ERROR_VARIABLE LATEX_ERROR
)
if(NOT LATEX_RESULT EQUAL 0)
message(WARNING "Error generating PDF: ${LATEX_ERROR}")
else()
# Run pdflatex again for references
execute_process(
COMMAND ${PDFLATEX_EXECUTABLE} -interaction=nonstopmode refman.tex
WORKING_DIRECTORY "${OUTPUT_DIR}/latex"
)
message(STATUS "PDF documentation generated at ${OUTPUT_DIR}/latex/refman.pdf")
# Copy the PDF to a more accessible location
file(COPY "${OUTPUT_DIR}/latex/refman.pdf" DESTINATION "${OUTPUT_DIR}")
file(RENAME "${OUTPUT_DIR}/refman.pdf" "${OUTPUT_DIR}/${DOC_OUTPUT_NAME}.pdf")
endif()
endfunction()
# Main function to set up documentation targets
function(OCCT_SETUP_DOC_TARGETS)
# Check if required tools are available
OCCT_DOC_CHECK_TOOLS()
if(NOT OCCT_DOC_TOOLS_AVAILABLE)
return()
endif()
# Load lists of documentation files
OCCT_DOC_LOAD_FILE_LISTS()
# Collect module information
OCCT_DOC_COLLECT_MODULES_INFO()
# Extract toolkit dependencies
OCCT_DOC_EXTRACT_TOOLKIT_DEPENDENCIES()
# Create documentation output directories
set(DOC_ROOT_DIR "${CMAKE_BINARY_DIR}/doc")
file(MAKE_DIRECTORY ${DOC_ROOT_DIR})
# Setup Reference Manual target
if(BUILD_DOC_RefMan)
# Create output directories
set(REFMAN_OUTPUT_DIR "${DOC_ROOT_DIR}/refman")
file(MAKE_DIRECTORY ${REFMAN_OUTPUT_DIR})
file(MAKE_DIRECTORY "${REFMAN_OUTPUT_DIR}/html")
# Copy index file to provide fast access to HTML documentation
file(COPY "${CMAKE_SOURCE_DIR}/dox/resources/index.html" DESTINATION "${REFMAN_OUTPUT_DIR}")
# Generate main page for reference manual
OCCT_DOC_GENERATE_MAIN_PAGE(${REFMAN_OUTPUT_DIR} "main_page.dox")
# Configure Doxygen
set(DOC_TYPE "REFMAN")
OCCT_DOC_CONFIGURE_DOXYGEN(${REFMAN_OUTPUT_DIR} "Doxyfile" ${DOC_TYPE})
# Add custom target for reference manual
add_custom_target(RefMan
COMMAND ${DOXYGEN_EXECUTABLE} ${REFMAN_OUTPUT_DIR}/Doxyfile
COMMENT "Generating Reference Manual with Doxygen"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
VERBATIM
)
# Add custom command to install generated documentation if required
if(INSTALL_DOC_RefMan)
install(DIRECTORY "${REFMAN_OUTPUT_DIR}/html/"
DESTINATION "${INSTALL_DIR_DOC}/refman/html"
OPTIONAL)
endif()
endif()
# Setup Overview documentation target (after RefMan so it can use the RefMan tag file)
if(BUILD_DOC_Overview)
# Create output directories
set(OVERVIEW_OUTPUT_DIR "${DOC_ROOT_DIR}/overview")
file(MAKE_DIRECTORY ${OVERVIEW_OUTPUT_DIR})
file(MAKE_DIRECTORY "${OVERVIEW_OUTPUT_DIR}/html")
# Configure Doxygen for Overview
set(DOC_TYPE "OVERVIEW")
OCCT_DOC_CONFIGURE_DOXYGEN(${OVERVIEW_OUTPUT_DIR} "Doxyfile" ${DOC_TYPE})
# Add custom target for overview documentation
add_custom_target(Overview
COMMAND ${DOXYGEN_EXECUTABLE} ${OVERVIEW_OUTPUT_DIR}/Doxyfile
COMMENT "Generating Overview documentation with Doxygen"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
VERBATIM
)
# Copy index file to provide fast access to HTML documentation
file(COPY "${CMAKE_SOURCE_DIR}/dox/resources/index.html" DESTINATION "${OVERVIEW_OUTPUT_DIR}")
# Add custom command to copy generated documentation to install location if required
if(INSTALL_DOC_Overview)
install(DIRECTORY "${OVERVIEW_OUTPUT_DIR}/html/"
DESTINATION "${INSTALL_DIR_DOC}/overview/html"
OPTIONAL)
# Create overview.html only for windows
if(WIN32)
install(FILES "${CMAKE_SOURCE_DIR}/dox/resources/overview.html"
DESTINATION "${INSTALL_DIR_DOC}")
endif()
endif()
endif()
# Combined documentation target
if(BUILD_DOC_Overview AND BUILD_DOC_RefMan)
add_custom_target(doc ALL
DEPENDS RefMan Overview
COMMENT "Generating all documentation"
)
set_property (TARGET Overview PROPERTY FOLDER "Documentation")
set_property (TARGET RefMan PROPERTY FOLDER "Documentation")
add_dependencies(Overview RefMan) # Ensure Overview uses RefMan tag file
elseif(BUILD_DOC_Overview)
add_custom_target(doc ALL
DEPENDS Overview
COMMENT "Generating Overview documentation"
)
set_property (TARGET Overview PROPERTY FOLDER "Documentation")
elseif(BUILD_DOC_RefMan)
add_custom_target(doc ALL
DEPENDS RefMan
COMMENT "Generating Reference Manual"
)
set_property (TARGET RefMan PROPERTY FOLDER "Documentation")
endif()
set_property (TARGET doc PROPERTY FOLDER "Documentation")
endfunction()

245
adm/cmake/occt_gtest.cmake Normal file
View File

@ -0,0 +1,245 @@
# Google Test integration for OCCT toolkits
set (TEST_PROJECT_NAME OpenCascadeGTest)
# Initialize Google Test environment and create the target
function(OCCT_INIT_GTEST)
if (NOT GOOGLETEST_FOUND)
message(STATUS "Google Test not available. Skipping test project ${TEST_PROJECT_NAME}")
return()
endif()
# Initialize test data collections
set(OCCT_GTEST_SOURCE_FILES "" PARENT_SCOPE)
set(OCCT_GTEST_SOURCE_FILES_ABS "" PARENT_SCOPE)
set(OCCT_GTEST_TESTS_LIST "" PARENT_SCOPE)
# Create the test executable once
add_executable(${TEST_PROJECT_NAME})
set_target_properties(${TEST_PROJECT_NAME} PROPERTIES FOLDER "Testing")
# Link with Google Test
target_link_libraries(${TEST_PROJECT_NAME} PRIVATE GTest::gtest_main)
# Add pthreads if necessary (for Linux)
if (UNIX AND NOT APPLE)
target_link_libraries(${TEST_PROJECT_NAME} PRIVATE pthread)
endif()
target_compile_definitions(${TEST_PROJECT_NAME} PRIVATE GTEST_LINKED_AS_SHARED_LIBRARY=1)
# Link with all active toolkits that are libraries
foreach(TOOLKIT ${BUILD_TOOLKITS})
if(TARGET ${TOOLKIT})
get_target_property(TOOLKIT_TYPE ${TOOLKIT} TYPE)
if(TOOLKIT_TYPE STREQUAL "SHARED_LIBRARY" OR TOOLKIT_TYPE STREQUAL "STATIC_LIBRARY")
target_link_libraries(${TEST_PROJECT_NAME} PRIVATE ${TOOLKIT})
endif()
endif()
endforeach()
if (INSTALL_GTEST)
# Install the test executable
install (TARGETS ${TEST_PROJECT_NAME}
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
if (EMSCRIPTEN)
install(FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${TEST_PROJECT_NAME}.wasm DESTINATION "${INSTALL_DIR_BIN}/${OCCT_INSTALL_BIN_LETTER}")
endif()
endif()
endfunction()
# Add tests from a specific toolkit to the main test executable
function(OCCT_COLLECT_TOOLKIT_TESTS TOOLKIT_NAME)
# Skip if Google Test is not available or the test executable wasn't created
if (NOT GOOGLETEST_FOUND OR NOT TARGET ${TEST_PROJECT_NAME})
return()
endif()
# Extract test source files from FILES.cmake
set(FILES_CMAKE_PATH "${OCCT_${TOOLKIT_NAME}_FILES_LOCATION}/GTests/FILES.cmake")
if(EXISTS "${FILES_CMAKE_PATH}")
# Reset toolkit test files list
set(OCCT_${TOOLKIT_NAME}_GTests_FILES)
# Include the toolkit's FILES.cmake which sets OCCT_${TOOLKIT_NAME}_GTests_FILES
include("${FILES_CMAKE_PATH}")
set(TEST_SOURCE_FILES "${OCCT_${TOOLKIT_NAME}_GTests_FILES}")
# Skip if no test files found
if(NOT TEST_SOURCE_FILES)
return()
endif()
# Get module name for test organization
get_target_property(TOOLKIT_MODULE ${TOOLKIT_NAME} MODULE)
if(NOT TOOLKIT_MODULE)
set(TOOLKIT_MODULE "Unknown")
endif()
# Get absolute paths of test source files and add them to the executable
set(TEST_SOURCE_FILES_ABS)
foreach(TEST_SOURCE_FILE ${TEST_SOURCE_FILES})
set(TEST_SOURCE_FILE_ABS "${OCCT_${TOOLKIT_NAME}_GTests_FILES_LOCATION}/${TEST_SOURCE_FILE}")
list(APPEND TEST_SOURCE_FILES_ABS "${TEST_SOURCE_FILE_ABS}")
endforeach()
# Add test sources to the executable
target_sources(${TEST_PROJECT_NAME} PRIVATE ${TEST_SOURCE_FILES_ABS})
# Create a more reliable test discovery approach
# Use the WORKING_DIRECTORY parameter to ensure proper test execution context
gtest_add_tests(
TARGET ${TEST_PROJECT_NAME}
TEST_PREFIX "${TOOLKIT_MODULE}::${TOOLKIT_NAME}::"
SOURCES ${TEST_SOURCE_FILES_ABS}
TEST_LIST TOOLKIT_TESTS
SKIP_DEPENDENCY
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
)
# Configure test output properties to improve result capture
foreach(test_name ${TOOLKIT_TESTS})
set_tests_properties(${test_name} PROPERTIES
# Use proper result detection by checking output and return code
PASS_REGULAR_EXPRESSION "\\[ PASSED \\]"
FAIL_REGULAR_EXPRESSION "\\[ FAILED \\]"
)
endforeach()
# Add these tests to the main list so we can set environment for all tests later
# Get the existing list first
if(DEFINED OCCT_GTEST_TESTS_LIST)
set(TEMP_GTEST_TESTS_LIST ${OCCT_GTEST_TESTS_LIST})
else()
set(TEMP_GTEST_TESTS_LIST "")
endif()
# Append the new tests
list(APPEND TEMP_GTEST_TESTS_LIST ${TOOLKIT_TESTS})
# Update the parent scope variable
set(OCCT_GTEST_TESTS_LIST "${TEMP_GTEST_TESTS_LIST}" PARENT_SCOPE)
endif()
endfunction()
# Set environment variables for all collected tests
function(OCCT_SET_GTEST_ENVIRONMENT)
if (NOT GOOGLETEST_FOUND OR NOT TARGET ${TEST_PROJECT_NAME})
return()
endif()
if (OCCT_GTEST_TESTS_LIST)
# Set common environment variables
set(TEST_ENVIRONMENT
"CSF_LANGUAGE=us"
"MMGT_CLEAR=1"
"CSF_SHMessage=${CMAKE_SOURCE_DIR}/resources/SHMessage"
"CSF_MDTVTexturesDirectory=${CMAKE_SOURCE_DIR}/resources/Textures"
"CSF_ShadersDirectory=${CMAKE_SOURCE_DIR}/resources/Shaders"
"CSF_XSMessage=${CMAKE_SOURCE_DIR}/resources/XSMessage"
"CSF_TObjMessage=${CMAKE_SOURCE_DIR}/resources/TObj"
"CSF_StandardDefaults=${CMAKE_SOURCE_DIR}/resources/StdResource"
"CSF_PluginDefaults=${CMAKE_SOURCE_DIR}/resources/StdResource"
"CSF_XCAFDefaults=${CMAKE_SOURCE_DIR}/resources/StdResource"
"CSF_TObjDefaults=${CMAKE_SOURCE_DIR}/resources/StdResource"
"CSF_StandardLiteDefaults=${CMAKE_SOURCE_DIR}/resources/StdResource"
"CSF_IGESDefaults=${CMAKE_SOURCE_DIR}/resources/XSTEPResource"
"CSF_STEPDefaults=${CMAKE_SOURCE_DIR}/resources/XSTEPResource"
"CSF_XmlOcafResource=${CMAKE_SOURCE_DIR}/resources/XmlOcafResource"
"CSF_MIGRATION_TYPES=${CMAKE_SOURCE_DIR}/resources/StdResource/MigrationSheet.txt"
"CSF_OCCTResourcePath=${CMAKE_SOURCE_DIR}/resources"
"CSF_OCCTDataPath=${CMAKE_SOURCE_DIR}/data"
"CSF_OCCTDocPath=${CMAKE_SOURCE_DIR}/doc"
"CSF_OCCTSamplesPath=${CMAKE_SOURCE_DIR}/samples"
"CSF_OCCTTestsPath=${CMAKE_SOURCE_DIR}/tests"
"CSF_OCCTBinPath=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
"CSF_OCCTLibPath=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}"
"CSF_OCCTIncludePath=${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}"
"CASROOT=${CMAKE_SOURCE_DIR}"
)
# Build PATH environment variable
set(PATH_ELEMENTS
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
)
# Add 3rdparty paths to PATH
if(3RDPARTY_TCL_LIBRARY_DIR)
list(APPEND PATH_ELEMENTS "${3RDPARTY_TCL_LIBRARY_DIR}")
endif()
if(3RDPARTY_TK_LIBRARY_DIR)
list(APPEND PATH_ELEMENTS "${3RDPARTY_TK_LIBRARY_DIR}")
endif()
if(3RDPARTY_FREETYPE_LIBRARY_DIR)
list(APPEND PATH_ELEMENTS "${3RDPARTY_FREETYPE_LIBRARY_DIR}")
endif()
if(3RDPARTY_FREEIMAGE_LIBRARY_DIRS)
list(APPEND PATH_ELEMENTS "${3RDPARTY_FREEIMAGE_LIBRARY_DIRS}")
endif()
if(3RDPARTY_TBB_LIBRARY_DIR)
list(APPEND PATH_ELEMENTS "${3RDPARTY_TBB_LIBRARY_DIR}")
endif()
if(3RDPARTY_VTK_LIBRARY_DIR)
list(APPEND PATH_ELEMENTS "${3RDPARTY_VTK_LIBRARY_DIR}")
endif()
if(3RDPARTY_FFMPEG_LIBRARY_DIR)
list(APPEND PATH_ELEMENTS "${3RDPARTY_FFMPEG_LIBRARY_DIR}")
endif()
if(3RDPARTY_QT_DIR)
list(APPEND PATH_ELEMENTS "${3RDPARTY_QT_DIR}/bin")
endif()
if (3RDPARTY_DLL_DIRS)
foreach(DLL_DIR ${3RDPARTY_DLL_DIRS})
list(APPEND PATH_ELEMENTS "${DLL_DIR}")
endforeach()
endif()
# Create the PATH variable that ctest will use
if(WIN32)
string(REPLACE ";" "\\;" TEST_PATH_ENV "$ENV{PATH}")
string(REPLACE ";" "\\;" PATH_ELEMENTS_STR "${PATH_ELEMENTS}")
list(APPEND TEST_ENVIRONMENT "PATH=${PATH_ELEMENTS_STR}\\;${TEST_PATH_ENV}")
else()
string(REPLACE ";" ":" PATH_ELEMENTS_STR "${PATH_ELEMENTS}")
list(APPEND TEST_ENVIRONMENT "PATH=${PATH_ELEMENTS_STR}:$ENV{PATH}")
# Set LD_LIBRARY_PATH for Unix systems
list(APPEND TEST_ENVIRONMENT "LD_LIBRARY_PATH=${PATH_ELEMENTS_STR}:$ENV{LD_LIBRARY_PATH}")
# Set DYLD_LIBRARY_PATH for macOS
if(APPLE)
list(APPEND TEST_ENVIRONMENT "DYLD_LIBRARY_PATH=${PATH_ELEMENTS_STR}:$ENV{DYLD_LIBRARY_PATH}")
endif()
endif()
# Add DrawResources related environment if it exists
if(EXISTS "${CMAKE_SOURCE_DIR}/resources/DrawResources")
list(APPEND TEST_ENVIRONMENT "DRAWHOME=${CMAKE_SOURCE_DIR}/resources/DrawResources")
list(APPEND TEST_ENVIRONMENT "CSF_DrawPluginDefaults=${CMAKE_SOURCE_DIR}/resources/DrawResources")
if(EXISTS "${CMAKE_SOURCE_DIR}/resources/DrawResources/DrawDefault")
list(APPEND TEST_ENVIRONMENT "DRAWDEFAULT=${CMAKE_SOURCE_DIR}/resources/DrawResources/DrawDefault")
endif()
endif()
# Set FPE signal handler if enabled
if(BUILD_ENABLE_FPE_SIGNAL_HANDLER)
list(APPEND TEST_ENVIRONMENT "CSF_FPE=1")
endif()
# Set TCL/TK library paths if they differ
if(3RDPARTY_TCL_LIBRARY_DIR AND 3RDPARTY_TK_LIBRARY_DIR AND NOT 3RDPARTY_TCL_LIBRARY_DIR STREQUAL 3RDPARTY_TK_LIBRARY_DIR)
if(3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT)
list(APPEND TEST_ENVIRONMENT "TCL_LIBRARY=${3RDPARTY_TCL_LIBRARY_DIR}/../lib/tcl${3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT}")
endif()
if(3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT)
list(APPEND TEST_ENVIRONMENT "TK_LIBRARY=${3RDPARTY_TK_LIBRARY_DIR}/../lib/tk${3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT}")
endif()
endif()
# Set environment for all tests in the project
set_tests_properties(${OCCT_GTEST_TESTS_LIST} PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT}")
endif()
endfunction()

View File

@ -32,6 +32,23 @@ macro (OCCT_CHECK_AND_UNSET_INSTALL_DIR_SUBDIRS)
OCCT_CHECK_AND_UNSET (INSTALL_DIR_DOC)
endmacro()
function (FILE_TO_LIST FILE_NAME FILE_CONTENT)
set (LOCAL_FILE_CONTENT)
if (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_NAME}")
file (STRINGS "${CMAKE_SOURCE_DIR}/${FILE_NAME}" LOCAL_FILE_CONTENT)
endif()
set (${FILE_CONTENT} ${LOCAL_FILE_CONTENT} PARENT_SCOPE)
endfunction()
function(FIND_FOLDER_OR_FILE FILE_OR_FOLDER_NAME RESULT_PATH)
if (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_OR_FOLDER_NAME}")
set (${RESULT_PATH} "${CMAKE_SOURCE_DIR}/${FILE_OR_FOLDER_NAME}" PARENT_SCOPE)
else()
set (${RESULT_PATH} "" PARENT_SCOPE)
endif()
endfunction()
# COMPILER_BITNESS variable
macro (OCCT_MAKE_COMPILER_BITNESS)
math (EXPR COMPILER_BITNESS "32 + 32*(${CMAKE_SIZEOF_VOID_P}/8)")
@ -54,6 +71,10 @@ endmacro()
# COMPILER variable
macro (OCCT_MAKE_COMPILER_SHORT_NAME)
if (MSVC)
if (MSVC_VERSION LESS 1914)
message (AUTHOR_WARNING "Microsoft Visual C++ 19.14 (VS 2017 15.7) or newer is required for C++17 support")
endif()
if ((MSVC_VERSION EQUAL 1300) OR (MSVC_VERSION EQUAL 1310))
set (COMPILER vc7)
elseif (MSVC_VERSION EQUAL 1400)
@ -71,20 +92,39 @@ macro (OCCT_MAKE_COMPILER_SHORT_NAME)
elseif ((MSVC_VERSION GREATER 1900) AND (MSVC_VERSION LESS 2000))
# Since Visual Studio 15 (2017), its version diverged from version of
# compiler which is 14.1; as that compiler uses the same run-time as 14.0,
# we keep its id as "vc14" to be compatibille
# we keep its id as "vc14" to be compatible
set (COMPILER vc14)
else()
message (FATAL_ERROR "Unrecognized MSVC_VERSION")
endif()
elseif (DEFINED CMAKE_COMPILER_IS_GNUCC)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
message (AUTHOR_WARNING "GCC version 8.0 or newer is required for C++17 support")
endif()
set (COMPILER gcc)
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
message (AUTHOR_WARNING "GCC version 8.0 or newer is required for C++17 support")
endif()
set (COMPILER gxx)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
if(APPLE)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.0)
message (AUTHOR_WARNING "Apple Clang version 11.0.0 or newer is required for C++17 support")
endif()
else()
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
message (AUTHOR_WARNING "Clang version 7.0 or newer is required for C++17 support")
endif()
endif()
set (COMPILER clang)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Ii][Nn][Tt][Ee][Ll]")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.1.1)
message (AUTHOR_WARNING "Intel C++ Compiler version 17.1.1 or newer is required for C++17 support")
endif()
set (COMPILER icc)
else()
message (AUTHOR_WARNING "Unknown compiler - please verify C++17 support")
set (COMPILER ${CMAKE_GENERATOR})
string (REGEX REPLACE " " "" COMPILER ${COMPILER})
endif()
@ -131,25 +171,19 @@ function (FIND_SUBDIRECTORY ROOT_DIRECTORY DIRECTORY_SUFFIX SUBDIRECTORY_NAME)
endfunction()
function (OCCT_ORIGIN_AND_PATCHED_FILES RELATIVE_PATH SEARCH_TEMPLATE RESULT)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_PATH}")
file (GLOB FOUND_FILES "${BUILD_PATCH}/${RELATIVE_PATH}/${SEARCH_TEMPLATE}")
endif()
file (GLOB ORIGIN_FILES "${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${SEARCH_TEMPLATE}")
foreach (ORIGIN_FILE ${ORIGIN_FILES})
# check for existence of patched version of current file
if (NOT BUILD_PATCH OR NOT EXISTS "${BUILD_PATCH}/${RELATIVE_PATH}")
list (APPEND FOUND_FILES ${ORIGIN_FILE})
else()
get_filename_component (ORIGIN_FILE_NAME "${ORIGIN_FILE}" NAME)
if (NOT EXISTS "${BUILD_PATCH}/${RELATIVE_PATH}/${ORIGIN_FILE_NAME}")
list (APPEND FOUND_FILES ${ORIGIN_FILE})
endif()
endif()
endforeach()
set (${RESULT} ${ORIGIN_FILES} PARENT_SCOPE)
endfunction()
set (${RESULT} ${FOUND_FILES} PARENT_SCOPE)
function (FILLUP_PRODUCT_SEARCH_TEMPLATE PRODUCT_NAME COMPILER COMPILER_BITNESS SEARCH_TEMPLATES)
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[a-zA-Z]*[0-9]*-${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*")
set (SEARCH_TEMPLATES ${SEARCH_TEMPLATES} PARENT_SCOPE)
endfunction()
function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
@ -163,13 +197,11 @@ function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
elseif ("${lower_PRODUCT_NAME}" STREQUAL "tbb")
list (APPEND SEARCH_TEMPLATES "^.*${lower_PRODUCT_NAME}.*")
else()
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[a-zA-Z]*[0-9]*-${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*")
FILLUP_PRODUCT_SEARCH_TEMPLATE(${lower_PRODUCT_NAME} ${COMPILER} ${COMPILER_BITNESS} SEARCH_TEMPLATES)
if (WIN32 AND "${COMPILER}" STREQUAL "clang")
# for clang on Windows, search for "vc" as well
FILLUP_PRODUCT_SEARCH_TEMPLATE(${lower_PRODUCT_NAME} "vc" ${COMPILER_BITNESS} SEARCH_TEMPLATES)
endif()
endif()
SUBDIRECTORY_NAMES ("${ROOT_DIR}" SUBDIR_NAME_LIST)
@ -196,208 +228,236 @@ function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
endfunction()
macro (OCCT_INSTALL_FILE_OR_DIR BEING_INSTALLED_OBJECT DESTINATION_PATH)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_INSTALLED_OBJECT}")
if (IS_DIRECTORY "${BUILD_PATCH}/${BEING_INSTALLED_OBJECT}")
# first of all, install original files
install (DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
# secondly, rewrite original files with patched ones
install (DIRECTORY "${BUILD_PATCH}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
else()
install (FILES "${BUILD_PATCH}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
endif()
if (IS_DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}")
install (DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
else()
if (IS_DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}")
install (DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
else()
install (FILES "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
endif()
install (FILES "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
endif()
endmacro()
macro (OCCT_CONFIGURE_AND_INSTALL BEING_CONGIRUGED_FILE BUILD_NAME INSTALL_NAME DESTINATION_PATH)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_CONGIRUGED_FILE}")
configure_file("${BUILD_PATCH}/${BEING_CONGIRUGED_FILE}" "${BUILD_NAME}" @ONLY)
else()
configure_file("${CMAKE_SOURCE_DIR}/${BEING_CONGIRUGED_FILE}" "${BUILD_NAME}" @ONLY)
endif()
configure_file("${CMAKE_SOURCE_DIR}/${BEING_CONGIRUGED_FILE}" "${BUILD_NAME}" @ONLY)
install(FILES "${OCCT_BINARY_DIR}/${BUILD_NAME}" DESTINATION "${DESTINATION_PATH}" RENAME ${INSTALL_NAME})
endmacro()
macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOOLKITS OCCT_COLLECT_SOURCE_DIR OCCT_INSTALL_DIR_PREFIX)
function (EXTRACT_TOOLKIT_PACKAGES RELATIVE_PATH OCCT_TOOLKIT RESULT_PACKAGES)
set (${RESULT_PACKAGES} ${OCCT_${OCCT_TOOLKIT}_LIST_OF_PACKAGES} PARENT_SCOPE)
endfunction()
function(EXTRACT_TOOLKIT_EXTERNLIB RELATIVE_PATH OCCT_TOOLKIT RESULT_LIBS)
set (${RESULT_LIBS} ${OCCT_${OCCT_TOOLKIT}_EXTERNAL_LIBS} PARENT_SCOPE)
endfunction()
function (EXTRACT_PACKAGE_FILES RELATIVE_PATH OCCT_PACKAGE RESULT_FILES RESULT_INCLUDE_FOLDER)
# Package name can be relative path, need to get only the name of the final element
get_filename_component (OCCT_PACKAGE ${OCCT_PACKAGE} NAME)
# package name is not unique, it can be reuse in tools and src,
# use extra parameter as relative path to distinguish between them
set (OCCT_PACKAGE_FILES "")
get_property(OCCT_PACKAGE_FILES GLOBAL PROPERTY OCCT_PACKAGE_${RELATIVE_PATH}_${OCCT_PACKAGE}_FILES)
get_property(OCCT_PACKAGE_INCLUDE_DIR GLOBAL PROPERTY OCCT_PACKAGE_${RELATIVE_PATH}_${OCCT_PACKAGE}_INCLUDE_DIR)
if (OCCT_PACKAGE_FILES)
set (${RESULT_FILES} ${OCCT_PACKAGE_FILES} PARENT_SCOPE)
set (${RESULT_INCLUDE_FOLDER} ${OCCT_PACKAGE_INCLUDE_DIR} PARENT_SCOPE)
return()
endif()
set (OCCT_PACKAGE_INCLUDE_DIR "${OCCT_${OCCT_PACKAGE}_FILES_LOCATION}")
set (OCCT_PACKAGE_FILES "${OCCT_${OCCT_PACKAGE}_FILES}")
# collect and search for the files in the package directory or patched one
# FILE contains inly filename that must to be inside package or patched directory
set (FILE_PATH_LIST)
foreach (OCCT_FILE ${OCCT_PACKAGE_FILES})
string (REGEX REPLACE "[^:]+:+" "" OCCT_FILE "${OCCT_FILE}")
list (APPEND FILE_PATH_LIST "${OCCT_PACKAGE_INCLUDE_DIR}/${OCCT_FILE}")
endforeach()
if (NOT FILE_PATH_LIST)
message (WARNING "FILES has not been found in ${OCCT_PACKAGE_INCLUDE_DIR} for package ${OCCT_PACKAGE}")
endif()
set (${RESULT_FILES} ${FILE_PATH_LIST} PARENT_SCOPE)
set (${RESULT_INCLUDE_FOLDER} ${OCCT_PACKAGE_INCLUDE_DIR} PARENT_SCOPE)
set_property(GLOBAL PROPERTY OCCT_PACKAGE_${RELATIVE_PATH}_${OCCT_PACKAGE}_FILES "${FILE_PATH_LIST}")
set_property(GLOBAL PROPERTY OCCT_PACKAGE_${RELATIVE_PATH}_${OCCT_PACKAGE}_INCLUDE_DIR "${OCCT_PACKAGE_INCLUDE_DIR}")
endfunction()
# SOLUTION_TYPE: MODULES, TOOLS, SAMPLES
# OCCT_TOOLKIT: TK*
# RESULT_TKS_AS_DEPS: TK* dependencies
# RESULT_INCLUDE_FOLDERS: include folders
function(EXCTRACT_TOOLKIT_DEPS SOLUTION_TYPE OCCT_TOOLKIT RESULT_TKS_AS_DEPS RESULT_INCLUDE_FOLDERS)
set (OCCT_TOOLKIT_DEPS "")
set (OCCT_TOOLKIT_INCLUDE_FOLDERS "")
get_property(OCCT_TOOLKIT_DEPS GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_DEPS)
get_property(OCCT_TOOLKIT_INCLUDE_FOLDERS GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_INCLUDE_FOLDERS)
if (OCCT_TOOLKIT_DEPS)
set (${RESULT_TKS_AS_DEPS} ${OCCT_TOOLKIT_DEPS} PARENT_SCOPE)
set (${RESULT_INCLUDE_FOLDERS} ${OCCT_TOOLKIT_INCLUDE_FOLDERS} PARENT_SCOPE)
return()
endif()
set (EXTERNAL_LIBS)
EXTRACT_TOOLKIT_EXTERNLIB (${SOLUTION_TYPE} ${OCCT_TOOLKIT} EXTERNAL_LIBS)
foreach (EXTERNAL_LIB ${EXTERNAL_LIBS})
string (REGEX MATCH "^TK" TK_FOUND ${EXTERNAL_LIB})
if (TK_FOUND)
list (APPEND OCCT_TOOLKIT_DEPS ${EXTERNAL_LIB})
endif()
endforeach()
set (OCCT_TOOLKIT_PACKAGES)
EXTRACT_TOOLKIT_PACKAGES (${SOLUTION_TYPE} ${OCCT_TOOLKIT} OCCT_TOOLKIT_PACKAGES)
foreach(OCCT_PACKAGE ${OCCT_TOOLKIT_PACKAGES})
EXTRACT_PACKAGE_FILES (${SOLUTION_TYPE} ${OCCT_PACKAGE} OCCT_PACKAGE_FILES OCCT_PACKAGE_INCLUDE_DIR)
list (APPEND OCCT_TOOLKIT_INCLUDE_FOLDERS ${OCCT_PACKAGE_INCLUDE_DIR})
endforeach()
set (${RESULT_TKS_AS_DEPS} ${OCCT_TOOLKIT_DEPS} PARENT_SCOPE)
set (${RESULT_INCLUDE_FOLDERS} ${OCCT_TOOLKIT_INCLUDE_FOLDERS} PARENT_SCOPE)
set_property(GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_DEPS "${OCCT_TOOLKIT_DEPS}")
set_property(GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_INCLUDE_FOLDERS "${OCCT_TOOLKIT_INCLUDE_FOLDERS}")
endfunction()
# SOLUTION_TYPE: MODULES, TOOLS, SAMPLES
# OCCT_TOOLKIT: TK*
# RESULT_TKS_AS_DEPS: list of TK* dependencies
# RESULT_INCLUDE_FOLDERS: list of include folders
function(EXCTRACT_TOOLKIT_FULL_DEPS SOLUTION_TYPE OCCT_TOOLKIT RESULT_TKS_AS_DEPS RESULT_INCLUDE_FOLDERS)
set (OCCT_TOOLKIT_DEPS "")
set (OCCT_TOOLKIT_INCLUDE_FOLDERS "")
get_property(OCCT_TOOLKIT_DEPS GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_FULL_DEPS)
get_property(OCCT_TOOLKIT_INCLUDE_FOLDERS GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_FULL_INCLUDE_FOLDERS)
if (OCCT_TOOLKIT_DEPS)
set (${RESULT_TKS_AS_DEPS} ${OCCT_TOOLKIT_DEPS} PARENT_SCOPE)
set (${RESULT_INCLUDE_FOLDERS} ${OCCT_TOOLKIT_INCLUDE_FOLDERS} PARENT_SCOPE)
return()
endif()
EXCTRACT_TOOLKIT_DEPS(${SOLUTION_TYPE} ${OCCT_TOOLKIT} OCCT_TOOLKIT_DEPS OCCT_TOOLKIT_INCLUDE_DIR)
list(APPEND OCCT_TOOLKIT_FULL_DEPS ${OCCT_TOOLKIT_DEPS})
list(APPEND OCCT_TOOLKIT_INCLUDE_FOLDERS ${OCCT_TOOLKIT_INCLUDE_DIR})
foreach(DEP ${OCCT_TOOLKIT_DEPS})
EXCTRACT_TOOLKIT_FULL_DEPS(${SOLUTION_TYPE} ${DEP} DEP_TOOLKIT_DEPS DEP_INCLUDE_DIRS)
list(APPEND OCCT_TOOLKIT_FULL_DEPS ${DEP_TOOLKIT_DEPS})
list(APPEND OCCT_TOOLKIT_INCLUDE_FOLDERS ${DEP_INCLUDE_DIRS})
endforeach()
list(REMOVE_DUPLICATES OCCT_TOOLKIT_FULL_DEPS)
list(REMOVE_DUPLICATES OCCT_TOOLKIT_INCLUDE_FOLDERS)
set (${RESULT_TKS_AS_DEPS} ${OCCT_TOOLKIT_FULL_DEPS} PARENT_SCOPE)
set (${RESULT_INCLUDE_FOLDERS} ${OCCT_TOOLKIT_INCLUDE_FOLDERS} PARENT_SCOPE)
set_property(GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_FULL_DEPS "${OCCT_TOOLKIT_FULL_DEPS}")
set_property(GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_FULL_INCLUDE_FOLDERS "${OCCT_TOOLKIT_INCLUDE_FOLDERS}")
endfunction()
function (FILE_TO_LIST FILE_NAME FILE_CONTENT)
set (LOCAL_FILE_CONTENT)
if (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_NAME}")
file (STRINGS "${CMAKE_SOURCE_DIR}/${FILE_NAME}" LOCAL_FILE_CONTENT)
endif()
set (${FILE_CONTENT} ${LOCAL_FILE_CONTENT} PARENT_SCOPE)
endfunction()
function (COLLECT_AND_INSTALL_OCCT_HEADER_FILES THE_ROOT_TARGET_OCCT_DIR THE_OCCT_BUILD_TOOLKITS THE_RELATIVE_PATH THE_OCCT_INSTALL_DIR_PREFIX)
set (OCCT_USED_PACKAGES)
# consider patched header.in template
set (TEMPLATE_HEADER_PATH "${CMAKE_SOURCE_DIR}/adm/templates/header.in")
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/adm/templates/header.in")
set (TEMPLATE_HEADER_PATH "${BUILD_PATCH}/adm/templates/header.in")
endif()
set (ROOT_OCCT_DIR ${CMAKE_SOURCE_DIR})
foreach (OCCT_USED_TOOLKIT ${OCCT_BUILD_TOOLKITS})
# append all required package folders
set (OCCT_TOOLKIT_PACKAGES)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/src/${OCCT_USED_TOOLKIT}/PACKAGES")
file (STRINGS "${BUILD_PATCH}/src/${OCCT_USED_TOOLKIT}/PACKAGES" OCCT_TOOLKIT_PACKAGES)
elseif (EXISTS "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_USED_TOOLKIT}/PACKAGES")
file (STRINGS "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_USED_TOOLKIT}/PACKAGES" OCCT_TOOLKIT_PACKAGES)
endif()
list (APPEND OCCT_USED_PACKAGES ${OCCT_TOOLKIT_PACKAGES})
endforeach()
list (REMOVE_DUPLICATES OCCT_USED_PACKAGES)
set (OCCT_HEADER_FILES_COMPLETE)
set (OCCT_HEADER_FILE_NAMES_NOT_IN_FILES)
set (OCCT_HEADER_FILE_WITH_PROPER_NAMES)
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "Info: \(${CURRENT_TIME}\) Compare FILES with files in package directories...")
foreach (OCCT_PACKAGE ${OCCT_USED_PACKAGES})
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/src/${OCCT_PACKAGE}/FILES")
file (STRINGS "${BUILD_PATCH}/src/${OCCT_PACKAGE}/FILES" OCCT_ALL_FILE_NAMES)
elseif (EXISTS "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/FILES")
file (STRINGS "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/FILES" OCCT_ALL_FILE_NAMES)
else()
message (WARNING "FILES has not been found in ${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}")
continue()
endif()
list (LENGTH OCCT_ALL_FILE_NAMES ALL_FILES_NB)
math (EXPR ALL_FILES_NB "${ALL_FILES_NB} - 1" )
# emit warnings if there are unprocessed headers
file (GLOB OCCT_ALL_FILES_IN_DIR "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/*.*")
file (GLOB OCCT_ALL_FILES_IN_PATCH_DIR "${BUILD_PATCH}/src/${OCCT_PACKAGE}/*.*")
# use patched header files
foreach (OCCT_FILE_IN_PATCH_DIR ${OCCT_ALL_FILES_IN_PATCH_DIR})
get_filename_component (OCCT_FILE_IN_PATCH_DIR_NAME ${OCCT_FILE_IN_PATCH_DIR} NAME)
list (REMOVE_ITEM OCCT_ALL_FILES_IN_DIR "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/${OCCT_FILE_IN_PATCH_DIR_NAME}")
list (APPEND OCCT_ALL_FILES_IN_DIR "${OCCT_FILE_IN_PATCH_DIR}")
endforeach()
foreach (OCCT_FILE_IN_DIR ${OCCT_ALL_FILES_IN_DIR})
get_filename_component (OCCT_FILE_IN_DIR_NAME ${OCCT_FILE_IN_DIR} NAME)
set (OCCT_FILE_IN_DIR_STATUS OFF)
if (${ALL_FILES_NB} LESS 0)
break()
endif()
foreach (FILE_INDEX RANGE ${ALL_FILES_NB})
list (GET OCCT_ALL_FILE_NAMES ${FILE_INDEX} OCCT_FILE_NAME)
string (REGEX REPLACE "[^:]+:+" "" OCCT_FILE_NAME "${OCCT_FILE_NAME}")
if ("${OCCT_FILE_IN_DIR_NAME}" STREQUAL "${OCCT_FILE_NAME}")
set (OCCT_FILE_IN_DIR_STATUS ON)
string (REGEX MATCH ".+\\.[hlg]xx|.+\\.h$" IS_HEADER_FOUND "${OCCT_FILE_NAME}")
if (IS_HEADER_FOUND)
list (APPEND OCCT_HEADER_FILES_COMPLETE ${OCCT_FILE_IN_DIR})
# collect header files with name that does not contain its package one
string (REGEX MATCH "^${OCCT_PACKAGE}[_.]" IS_HEADER_MATHCING_PACKAGE "${OCCT_FILE_NAME}")
if (NOT IS_HEADER_MATHCING_PACKAGE)
list (APPEND OCCT_HEADER_FILE_WITH_PROPER_NAMES "${OCCT_FILE_NAME}")
endif()
endif()
# remove found element from list
list (REMOVE_AT OCCT_ALL_FILE_NAMES ${FILE_INDEX})
math (EXPR ALL_FILES_NB "${ALL_FILES_NB} - 1" ) # decrement number
break()
endif()
endforeach()
if (NOT OCCT_FILE_IN_DIR_STATUS)
message (STATUS "Warning. File ${OCCT_FILE_IN_DIR} is not listed in ${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/FILES")
string (REGEX MATCH ".+\\.[hlg]xx|.+\\.h$" IS_HEADER_FOUND "${OCCT_FILE_NAME}")
if (IS_HEADER_FOUND)
list (APPEND OCCT_HEADER_FILE_NAMES_NOT_IN_FILES ${OCCT_FILE_NAME})
endif()
endif()
foreach(OCCT_TOOLKIT ${THE_OCCT_BUILD_TOOLKITS})
# parse PACKAGES file
EXTRACT_TOOLKIT_PACKAGES (${THE_RELATIVE_PATH} ${OCCT_TOOLKIT} USED_PACKAGES)
foreach(OCCT_PACKAGE ${USED_PACKAGES})
EXTRACT_PACKAGE_FILES (${THE_RELATIVE_PATH} ${OCCT_PACKAGE} ALL_FILES _)
set (HEADER_FILES_FILTERING ${ALL_FILES})
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|g|p|lxx|hxx|pxx|hpp|gxx)$")
list (APPEND OCCT_HEADER_FILES_COMPLETE ${HEADER_FILES_FILTERING})
endforeach()
endforeach()
# create new file including found header
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "Info: \(${CURRENT_TIME}\) Create header-links in inc folder...")
# Check that copying is done and match the include installation type.
# Check by first file in list.
list(GET OCCT_HEADER_FILES_COMPLETE 0 FIRST_OCCT_HEADER_FILE)
get_filename_component (FIRST_OCCT_HEADER_FILE ${FIRST_OCCT_HEADER_FILE} NAME)
set (TO_FORCE_COPY FALSE)
if (NOT EXISTS "${THE_ROOT_TARGET_OCCT_DIR}/${THE_OCCT_INSTALL_DIR_PREFIX}/${FIRST_OCCT_HEADER_FILE}")
set (TO_FORCE_COPY TRUE)
else()
# get content and check the number of lines inside file.
# If more then 1 then it is a symlink.
file (STRINGS "${THE_ROOT_TARGET_OCCT_DIR}/${THE_OCCT_INSTALL_DIR_PREFIX}/${FIRST_OCCT_HEADER_FILE}" FIRST_OCCT_HEADER_FILE_CONTENT)
list (LENGTH FIRST_OCCT_HEADER_FILE_CONTENT FIRST_OCCT_HEADER_FILE_CONTENT_LEN)
if (${FIRST_OCCT_HEADER_FILE_CONTENT_LEN} EQUAL 1 AND BUILD_INCLUDE_SYMLINK)
set (TO_FORCE_COPY TRUE)
elseif(${FIRST_OCCT_HEADER_FILE_CONTENT_LEN} GREATER 1 AND NOT BUILD_INCLUDE_SYMLINK)
set (TO_FORCE_COPY TRUE)
endif()
endif()
foreach (OCCT_HEADER_FILE ${OCCT_HEADER_FILES_COMPLETE})
get_filename_component (HEADER_FILE_NAME ${OCCT_HEADER_FILE} NAME)
set (OCCT_HEADER_FILE_CONTENT "#include \"${OCCT_HEADER_FILE}\"")
configure_file ("${TEMPLATE_HEADER_PATH}" "${ROOT_TARGET_OCCT_DIR}/${OCCT_INSTALL_DIR_PREFIX}/${HEADER_FILE_NAME}" @ONLY)
endforeach()
install (FILES ${OCCT_HEADER_FILES_COMPLETE} DESTINATION "${INSTALL_DIR}/${OCCT_INSTALL_DIR_PREFIX}")
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "Info: \(${CURRENT_TIME}\) Checking headers in inc folder...")
file (GLOB OCCT_HEADER_FILES_OLD "${ROOT_TARGET_OCCT_DIR}/${OCCT_INSTALL_DIR_PREFIX}/*")
foreach (OCCT_HEADER_FILE_OLD ${OCCT_HEADER_FILES_OLD})
get_filename_component (HEADER_FILE_NAME ${OCCT_HEADER_FILE_OLD} NAME)
string (REGEX MATCH "^[a-zA-Z0-9]+" PACKAGE_NAME "${HEADER_FILE_NAME}")
list (FIND OCCT_USED_PACKAGES ${PACKAGE_NAME} IS_HEADER_FOUND)
if (NOT ${IS_HEADER_FOUND} EQUAL -1)
if (NOT EXISTS "${OCCT_COLLECT_SOURCE_DIR}/${PACKAGE_NAME}/${HEADER_FILE_NAME}")
message (STATUS "Warning. ${OCCT_HEADER_FILE_OLD} is not present in the sources and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
file (REMOVE "${OCCT_HEADER_FILE_OLD}")
set(TARGET_FILE "${THE_ROOT_TARGET_OCCT_DIR}/${THE_OCCT_INSTALL_DIR_PREFIX}/${HEADER_FILE_NAME}")
# Check if the file already exists in the target directory
if (TO_FORCE_COPY OR NOT EXISTS "${TARGET_FILE}")
if (BUILD_INCLUDE_SYMLINK)
file (CREATE_LINK "${OCCT_HEADER_FILE}" "${TARGET_FILE}" SYMBOLIC)
else()
list (FIND OCCT_HEADER_FILE_NAMES_NOT_IN_FILES ${PACKAGE_NAME} IS_HEADER_FOUND)
if (NOT ${IS_HEADER_FOUND} EQUAL -1)
message (STATUS "Warning. ${OCCT_HEADER_FILE_OLD} is present in the sources but not involved in FILES and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
file (REMOVE "${OCCT_HEADER_FILE_OLD}")
endif()
endif()
else()
set (IS_HEADER_FOUND -1)
if (NOT "${OCCT_HEADER_FILE_WITH_PROPER_NAMES}" STREQUAL "")
list (FIND OCCT_HEADER_FILE_WITH_PROPER_NAMES ${HEADER_FILE_NAME} IS_HEADER_FOUND)
endif()
if (${IS_HEADER_FOUND} EQUAL -1)
message (STATUS "Warning. \(${PACKAGE_NAME}\) ${OCCT_HEADER_FILE_OLD} is not used and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
file (REMOVE "${OCCT_HEADER_FILE_OLD}")
set (OCCT_HEADER_FILE_CONTENT "#include \"${OCCT_HEADER_FILE}\"")
configure_file ("${TEMPLATE_HEADER_PATH}" "${TARGET_FILE}" @ONLY)
endif()
endif()
endforeach()
set (OCCT_HEADER_FILES_INSTALLATION ${OCCT_HEADER_FILES_COMPLETE})
list (FILTER OCCT_HEADER_FILES_INSTALLATION INCLUDE REGEX ".*[.](h|hxx|lxx)$")
install (FILES ${OCCT_HEADER_FILES_INSTALLATION} DESTINATION "${INSTALL_DIR}/${THE_OCCT_INSTALL_DIR_PREFIX}")
endfunction()
# Macro to configure and install Standard_Version.hxx file
macro (CONFIGURE_AND_INSTALL_VERSION_HEADER)
if (DEFINED BUILD_OCCT_VERSION_EXT AND "${BUILD_OCCT_VERSION_EXT}" STREQUAL "${OCC_VERSION_STRING_EXT}" AND EXISTS "${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/Standard_Version.hxx")
install(FILES "${OCCT_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/Standard_Version.hxx" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_INCLUDE}")
else()
set(BUILD_OCCT_VERSION_EXT "${OCC_VERSION_STRING_EXT}" CACHE STRING "OCCT Version string. Used only for caching, can't impact on build. For modification of version, please check adm/cmake/version.cmake" FORCE)
mark_as_advanced(BUILD_OCCT_VERSION_EXT)
string(TIMESTAMP OCCT_VERSION_DATE "%Y-%m-%d" UTC)
OCCT_CONFIGURE_AND_INSTALL ("adm/templates/Standard_Version.hxx.in" "${INSTALL_DIR_INCLUDE}/Standard_Version.hxx" "Standard_Version.hxx" "${INSTALL_DIR}/${INSTALL_DIR_INCLUDE}")
endif()
endmacro()
function(ADD_PRECOMPILED_HEADER INPUT_TARGET PRECOMPILED_HEADER THE_IS_PRIVATE)
if (NOT BUILD_USE_PCH)
return()
endif()
if (${THE_IS_PRIVATE})
target_precompile_headers(${INPUT_TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${PRECOMPILED_HEADER}>")
else()
target_precompile_headers(${INPUT_TARGET} PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${PRECOMPILED_HEADER}>")
endif()
endfunction()
macro (OCCT_COPY_FILE_OR_DIR BEING_COPIED_OBJECT DESTINATION_PATH)
# first of all, copy original files
if (EXISTS "${CMAKE_SOURCE_DIR}/${BEING_COPIED_OBJECT}")
file (COPY "${CMAKE_SOURCE_DIR}/${BEING_COPIED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
endif()
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_COPIED_OBJECT}")
# secondly, rewrite original files with patched ones
file (COPY "${BUILD_PATCH}/${BEING_COPIED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
endif()
endmacro()
macro (OCCT_CONFIGURE BEING_CONGIRUGED_FILE FINAL_NAME)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_CONGIRUGED_FILE}")
configure_file("${BUILD_PATCH}/${BEING_CONGIRUGED_FILE}" "${FINAL_NAME}" @ONLY)
else()
configure_file("${CMAKE_SOURCE_DIR}/${BEING_CONGIRUGED_FILE}" "${FINAL_NAME}" @ONLY)
endif()
configure_file("${CMAKE_SOURCE_DIR}/${BEING_CONGIRUGED_FILE}" "${FINAL_NAME}" @ONLY)
endmacro()
macro (OCCT_ADD_SUBDIRECTORY BEING_ADDED_DIRECTORY)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_ADDED_DIRECTORY}/CMakeLists.txt")
add_subdirectory(${BUILD_PATCH}/${BEING_ADDED_DIRECTORY})
elseif (EXISTS "${CMAKE_SOURCE_DIR}/${BEING_ADDED_DIRECTORY}/CMakeLists.txt")
if (EXISTS "${CMAKE_SOURCE_DIR}/${BEING_ADDED_DIRECTORY}/CMakeLists.txt")
add_subdirectory (${CMAKE_SOURCE_DIR}/${BEING_ADDED_DIRECTORY})
else()
message (STATUS "${BEING_ADDED_DIRECTORY} directory is not included")
@ -411,11 +471,8 @@ function (OCCT_IS_PRODUCT_REQUIRED CSF_VAR_NAME USE_PRODUCT)
message(STATUS "Warning: the list of being used toolkits is empty")
else()
foreach (USED_TOOLKIT ${BUILD_TOOLKITS})
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/src/${USED_TOOLKIT}/EXTERNLIB")
file (READ "${BUILD_PATCH}/src/${USED_TOOLKIT}/EXTERNLIB" FILE_CONTENT)
elseif (EXISTS "${CMAKE_SOURCE_DIR}/src/${USED_TOOLKIT}/EXTERNLIB")
file (READ "${CMAKE_SOURCE_DIR}/src/${USED_TOOLKIT}/EXTERNLIB" FILE_CONTENT)
endif()
set (FILE_CONTENT)
EXTRACT_TOOLKIT_EXTERNLIB ("src" ${USED_TOOLKIT} FILE_CONTENT)
string (REGEX MATCH "${CSF_VAR_NAME}" DOES_FILE_CONTAIN "${FILE_CONTENT}")
@ -427,17 +484,6 @@ function (OCCT_IS_PRODUCT_REQUIRED CSF_VAR_NAME USE_PRODUCT)
endif()
endfunction()
function (FILE_TO_LIST FILE_NAME FILE_CONTENT)
set (LOCAL_FILE_CONTENT)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${FILE_NAME}")
file (STRINGS "${BUILD_PATCH}/${FILE_NAME}" LOCAL_FILE_CONTENT)
elseif (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_NAME}")
file (STRINGS "${CMAKE_SOURCE_DIR}/${FILE_NAME}" LOCAL_FILE_CONTENT)
endif()
set (${FILE_CONTENT} ${LOCAL_FILE_CONTENT} PARENT_SCOPE)
endfunction()
# Function to determine if TOOLKIT is OCCT toolkit
function (IS_OCCT_TOOLKIT TOOLKIT_NAME MODULES IS_TOOLKIT_FOUND)
set (${IS_TOOLKIT_FOUND} OFF PARENT_SCOPE)
@ -451,58 +497,6 @@ function (IS_OCCT_TOOLKIT TOOLKIT_NAME MODULES IS_TOOLKIT_FOUND)
endforeach(MODULE)
endfunction()
# TOOLKIT_DEPS is defined with dependencies from file src/TOOLKIT_NAME/EXTERNLIB.
# CSF_ variables are ignored
function (OCCT_TOOLKIT_DEP TOOLKIT_NAME TOOLKIT_DEPS)
FILE_TO_LIST ("src/${TOOLKIT_NAME}/EXTERNLIB" FILE_CONTENT)
#list (APPEND LOCAL_TOOLKIT_DEPS ${TOOLKIT_NAME})
set (LOCAL_TOOLKIT_DEPS)
foreach (FILE_CONTENT_LINE ${FILE_CONTENT})
string (REGEX MATCH "^TK" TK_FOUND ${FILE_CONTENT_LINE})
if ("x${FILE_CONTENT_LINE}" STREQUAL "xDRAWEXE" OR NOT "${TK_FOUND}" STREQUAL "")
list (APPEND LOCAL_TOOLKIT_DEPS ${FILE_CONTENT_LINE})
endif()
endforeach()
set (${TOOLKIT_DEPS} ${LOCAL_TOOLKIT_DEPS} PARENT_SCOPE)
endfunction()
# TOOLKIT_FULL_DEPS is defined with complete dependencies (all levels)
function (OCCT_TOOLKIT_FULL_DEP TOOLKIT_NAME TOOLKIT_FULL_DEPS)
# first level dependencies are stored in LOCAL_TOOLKIT_FULL_DEPS
OCCT_TOOLKIT_DEP (${TOOLKIT_NAME} LOCAL_TOOLKIT_FULL_DEPS)
list (LENGTH LOCAL_TOOLKIT_FULL_DEPS LIST_LENGTH)
set (LIST_INDEX 0)
while (LIST_INDEX LESS LIST_LENGTH)
list (GET LOCAL_TOOLKIT_FULL_DEPS ${LIST_INDEX} CURRENT_TOOLKIT)
OCCT_TOOLKIT_DEP (${CURRENT_TOOLKIT} CURRENT_TOOLKIT_DEPS)
# append toolkits are not contained
foreach (CURRENT_TOOLKIT_DEP ${CURRENT_TOOLKIT_DEPS})
set (CURRENT_TOOLKIT_DEP_FOUND OFF)
foreach (LOCAL_TOOLKIT_FULL_DEP ${LOCAL_TOOLKIT_FULL_DEPS})
if ("${CURRENT_TOOLKIT_DEP}" STREQUAL "${LOCAL_TOOLKIT_FULL_DEP}")
set (CURRENT_TOOLKIT_DEP_FOUND ON)
break()
endif()
endforeach()
if ("${CURRENT_TOOLKIT_DEP_FOUND}" STREQUAL "OFF")
list (APPEND LOCAL_TOOLKIT_FULL_DEPS ${CURRENT_TOOLKIT_DEP})
endif()
endforeach()
# increment the list index
MATH(EXPR LIST_INDEX "${LIST_INDEX}+1")
# calculate new length
list (LENGTH LOCAL_TOOLKIT_FULL_DEPS LIST_LENGTH)
endwhile()
set (${TOOLKIT_FULL_DEPS} ${LOCAL_TOOLKIT_FULL_DEPS} PARENT_SCOPE)
endfunction()
# Function to get list of modules/toolkits/samples from file adm/${FILE_NAME}.
# Creates list <$MODULE_LIST> to store list of MODULES and
# <NAME_OF_MODULE>_TOOLKITS foreach module to store its toolkits, where "TOOLKITS" is defined by TOOLKITS_NAME_SUFFIX.
@ -521,42 +515,80 @@ function (OCCT_MODULES_AND_TOOLKITS FILE_NAME TOOLKITS_NAME_SUFFIX MODULE_LIST)
set (${MODULE_LIST} ${${MODULE_LIST}} PARENT_SCOPE)
endfunction()
# Returns OCC version string from file Standard_Version.hxx (if available)
# Macro to extract git hash from the source directory
# and store it in the variable GIT_HASH
# in case if git is not found or error occurs, GIT_HASH is set to empty string
macro(OCCT_GET_GIT_HASH)
set(GIT_HASH "")
find_package(Git QUIET)
if(GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_HASH
ERROR_VARIABLE GIT_ERROR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT GIT_ERROR)
# Check if working directory is clean
execute_process(
COMMAND ${GIT_EXECUTABLE} status --porcelain
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_STATUS
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT "${GIT_STATUS}" STREQUAL "")
message(DEBUG "Git working directory is not clean. Git hash may be incorrect.")
endif()
else()
set(GIT_HASH "")
endif()
endif()
endmacro()
# Returns OCC version string
function (OCC_VERSION OCC_VERSION_MAJOR OCC_VERSION_MINOR OCC_VERSION_MAINTENANCE OCC_VERSION_DEVELOPMENT OCC_VERSION_STRING_EXT)
set (OCC_VERSION_MAJOR 7)
set (OCC_VERSION_MINOR 0)
set (OCC_VERSION_MAINTENANCE 0)
set (OCC_VERSION_DEVELOPMENT dev)
set (OCC_VERSION_COMPLETE "7.0.0")
set (STANDARD_VERSION_FILE "${CMAKE_SOURCE_DIR}/src/Standard/Standard_Version.hxx")
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/src/Standard/Standard_Version.hxx")
set (STANDARD_VERSION_FILE "${BUILD_PATCH}/src/Standard/Standard_Version.hxx")
endif()
include (version)
set (OCC_VERSION_COMPLETE "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}")
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_COMPLETE}")
if (EXISTS "${STANDARD_VERSION_FILE}")
foreach (SOUGHT_VERSION OCC_VERSION_MAJOR OCC_VERSION_MINOR OCC_VERSION_MAINTENANCE)
file (STRINGS "${STANDARD_VERSION_FILE}" ${SOUGHT_VERSION} REGEX "^#define ${SOUGHT_VERSION} .*")
string (REGEX REPLACE ".*${SOUGHT_VERSION} .*([^ ]+).*" "\\1" ${SOUGHT_VERSION} "${${SOUGHT_VERSION}}" )
endforeach()
foreach (SOUGHT_VERSION OCC_VERSION_DEVELOPMENT OCC_VERSION_COMPLETE)
file (STRINGS "${STANDARD_VERSION_FILE}" ${SOUGHT_VERSION} REGEX "^#define ${SOUGHT_VERSION} .*")
string (REGEX REPLACE ".*${SOUGHT_VERSION} .*\"([^ ]+)\".*" "\\1" ${SOUGHT_VERSION} "${${SOUGHT_VERSION}}" )
endforeach()
endif()
set (OCC_VERSION_MAJOR "${OCC_VERSION_MAJOR}" PARENT_SCOPE)
set (OCC_VERSION_MINOR "${OCC_VERSION_MINOR}" PARENT_SCOPE)
set (OCC_VERSION_MAINTENANCE "${OCC_VERSION_MAINTENANCE}" PARENT_SCOPE)
set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
if (OCC_VERSION_DEVELOPMENT AND OCC_VERSION_COMPLETE)
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_COMPLETE}.${OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
else()
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_COMPLETE}" PARENT_SCOPE)
set (OCCT_ON_DEVELOPMENT OFF)
if (NOT "${OCC_VERSION_DEVELOPMENT}" STREQUAL "" AND NOT "${OCC_VERSION_DEVELOPMENT}" STREQUAL "OCC_VERSION_DEVELOPMENT")
set (OCCT_ON_DEVELOPMENT ON)
endif()
if (${OCCT_ON_DEVELOPMENT})
set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
endif()
set (SET_OCC_VERSION_DEVELOPMENT "")
if (${OCCT_ON_DEVELOPMENT})
# Use special flag from cache to turn on or off git hash extraction
if (NOT DEFINED USE_GIT_HASH)
set (USE_GIT_HASH ON CACHE BOOL "Use git hash in version string")
endif()
if (${USE_GIT_HASH})
OCCT_GET_GIT_HASH()
endif()
if (NOT "${GIT_HASH}" STREQUAL "")
set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}-${GIT_HASH}")
set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
else()
set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}")
endif()
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_COMPLETE}.${OCC_VERSION_DEVELOPMENT}")
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_STRING_EXT}" PARENT_SCOPE)
set (SET_OCC_VERSION_DEVELOPMENT "#define OCC_VERSION_DEVELOPMENT \"${OCC_VERSION_DEVELOPMENT}\"")
set (SET_OCC_VERSION_DEVELOPMENT "${SET_OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
else()
OCCT_CHECK_AND_UNSET(USE_GIT_HASH)
endif()
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_STRING_EXT}" PARENT_SCOPE)
endfunction()
macro (CHECK_PATH_FOR_CONSISTENCY THE_ROOT_PATH_NAME THE_BEING_CHECKED_PATH_NAME THE_VAR_TYPE THE_MESSAGE_OF_BEING_CHECKED_PATH)
@ -579,6 +611,74 @@ macro (CHECK_PATH_FOR_CONSISTENCY THE_ROOT_PATH_NAME THE_BEING_CHECKED_PATH_NAME
endmacro()
macro (FLEX_AND_BISON_TARGET_APPLY THE_PACKAGE_NAME RELATIVE_SOURCES_DIR)
# Generate Flex and Bison files
if (NOT ${BUILD_YACCLEX})
return()
endif()
# flex files
OCCT_ORIGIN_AND_PATCHED_FILES ("${RELATIVE_SOURCES_DIR}/${THE_PACKAGE_NAME}" "*[.]lex" SOURCE_FILES_FLEX)
list (LENGTH SOURCE_FILES_FLEX SOURCE_FILES_FLEX_LEN)
# bison files
OCCT_ORIGIN_AND_PATCHED_FILES ("${RELATIVE_SOURCES_DIR}/${THE_PACKAGE_NAME}" "*[.]yacc" SOURCE_FILES_BISON)
list (LENGTH SOURCE_FILES_BISON SOURCE_FILES_BISON_LEN)
if (NOT (${SOURCE_FILES_FLEX_LEN} EQUAL ${SOURCE_FILES_BISON_LEN} AND NOT ${SOURCE_FILES_FLEX_LEN} EQUAL 0))
message(FATAL_ERROR "Error: number of FLEX and BISON files is not equal for ${THE_PACKAGE_NAME}")
endif()
list (SORT SOURCE_FILES_FLEX)
list (SORT SOURCE_FILES_BISON)
math (EXPR SOURCE_FILES_FLEX_LEN "${SOURCE_FILES_FLEX_LEN} - 1")
foreach (FLEX_FILE_INDEX RANGE ${SOURCE_FILES_FLEX_LEN})
list (GET SOURCE_FILES_FLEX ${FLEX_FILE_INDEX} CURRENT_FLEX_FILE)
get_filename_component (CURRENT_FLEX_FILE_NAME ${CURRENT_FLEX_FILE} NAME_WE)
list (GET SOURCE_FILES_BISON ${FLEX_FILE_INDEX} CURRENT_BISON_FILE)
get_filename_component (CURRENT_BISON_FILE_NAME ${CURRENT_BISON_FILE} NAME_WE)
string (COMPARE EQUAL ${CURRENT_FLEX_FILE_NAME} ${CURRENT_BISON_FILE_NAME} ARE_FILES_EQUAL)
if (NOT (EXISTS "${CURRENT_FLEX_FILE}" AND EXISTS "${CURRENT_BISON_FILE}" AND ${ARE_FILES_EQUAL}))
continue()
endif()
# Note: files are generated in original source directory (not in patch!)
set (FLEX_BISON_TARGET_DIR "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${THE_PACKAGE_NAME}")
# choose appropriate extension for generated files: "cxx" if source file contains
# instruction to generate C++ code, "c" otherwise
set (BISON_OUTPUT_FILE_EXT "c")
set (FLEX_OUTPUT_FILE_EXT "c")
file (STRINGS "${CURRENT_BISON_FILE}" FILE_BISON_CONTENT)
foreach (FILE_BISON_CONTENT_LINE ${FILE_BISON_CONTENT})
string (REGEX MATCH "%language \"C\\+\\+\"" CXX_BISON_LANGUAGE_FOUND ${FILE_BISON_CONTENT_LINE})
if (CXX_BISON_LANGUAGE_FOUND)
set (BISON_OUTPUT_FILE_EXT "cxx")
endif()
endforeach()
file (STRINGS "${CURRENT_FLEX_FILE}" FILE_FLEX_CONTENT)
foreach (FILE_FLEX_CONTENT_LINE ${FILE_FLEX_CONTENT})
string (REGEX MATCH "%option c\\+\\+" CXX_FLEX_LANGUAGE_FOUND ${FILE_FLEX_CONTENT_LINE})
if (CXX_FLEX_LANGUAGE_FOUND)
set (FLEX_OUTPUT_FILE_EXT "cxx")
endif()
endforeach()
set (BISON_OUTPUT_FILE ${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
set (FLEX_OUTPUT_FILE lex.${CURRENT_FLEX_FILE_NAME}.${FLEX_OUTPUT_FILE_EXT})
if (EXISTS ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
message (STATUS "Info: remove old output BISON file: ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT}")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
endif()
if (EXISTS ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.hxx)
message (STATUS "Info: remove old output BISON file: ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.hxx")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.hxx)
endif()
if (EXISTS ${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE})
message (STATUS "Info: remove old output FLEX file: ${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE}")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE})
endif()
BISON_TARGET (Parser_${CURRENT_BISON_FILE_NAME} ${CURRENT_BISON_FILE} "${FLEX_BISON_TARGET_DIR}/${BISON_OUTPUT_FILE}"
COMPILE_FLAGS "-p ${CURRENT_BISON_FILE_NAME} -l -M ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/=")
FLEX_TARGET (Scanner_${CURRENT_FLEX_FILE_NAME} ${CURRENT_FLEX_FILE} "${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE}"
COMPILE_FLAGS "-P${CURRENT_FLEX_FILE_NAME} -L")
ADD_FLEX_BISON_DEPENDENCY (Scanner_${CURRENT_FLEX_FILE_NAME} Parser_${CURRENT_BISON_FILE_NAME})
endforeach()
endmacro()
# Adds OCCT_INSTALL_BIN_LETTER variable ("" for Release, "d" for Debug and
# "i" for RelWithDebInfo) in OpenCASCADETargets-*.cmake files during
# installation process.
@ -592,7 +692,7 @@ macro (OCCT_UPDATE_TARGET_FILE)
install (CODE
"string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWERCASE)
file (GLOB ALL_OCCT_TARGET_FILES \"${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADE*Targets-\${CMAKE_INSTALL_CONFIG_NAME_LOWERCASE}.cmake\")
file (GLOB ALL_OCCT_TARGET_FILES \"\$ENV{DESTDIR}${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADE*Targets-\${CMAKE_INSTALL_CONFIG_NAME_LOWERCASE}.cmake\")
foreach(TARGET_FILENAME \${ALL_OCCT_TARGET_FILES})
file (STRINGS \"\${TARGET_FILENAME}\" TARGET_FILE_CONTENT)
file (REMOVE \"\${TARGET_FILENAME}\")
@ -632,3 +732,126 @@ macro (OCCT_CREATE_SYMLINK_TO_FILE LIBRARY_NAME LINK_NAME)
")
endif()
endmacro()
# Function to process CSF libraries and append their file names to a specified list.
# Additionally, handle library directories for different build configurations.
# Arguments:
# CURRENT_CSF - The current CSF libraries to process.
# LIST_NAME - The name of the list to append the processed library file names to.
# TARGET_NAME - The target to which the library directories will be added.
function (PROCESS_CSF_LIBRARIES CURRENT_CSF LIST_NAME TARGET_NAME)
separate_arguments (CURRENT_CSF)
# Local variables to collect found libraries and directories
set(FOUND_LIBS "")
set(FOUND_DEBUG_DIRS "")
set(FOUND_RELEASE_DIRS "")
# Check if the result is already cached
string(REPLACE ";" "_" CACHE_KEY "${CURRENT_CSF}")
get_property(CACHED_LIBS GLOBAL PROPERTY "CACHED_LIBS_${CACHE_KEY}" SET)
get_property(CACHED_DEBUG_DIRS GLOBAL PROPERTY "CACHED_DEBUG_DIRS_${CACHE_KEY}" SET)
get_property(CACHED_RELEASE_DIRS GLOBAL PROPERTY "CACHED_RELEASE_DIRS_${CACHE_KEY}" SET)
if (CACHED_LIBS AND NOT "${CACHED_LIBS}" STREQUAL "1")
list (APPEND FOUND_LIBS ${CACHED_LIBS})
if (CACHED_DEBUG_DIRS)
list (APPEND FOUND_DEBUG_DIRS ${CACHED_DEBUG_DIRS})
endif()
if (CACHED_RELEASE_DIRS)
list (APPEND FOUND_RELEASE_DIRS ${CACHED_RELEASE_DIRS})
endif()
else()
foreach (CSF_LIBRARY ${CURRENT_CSF})
set (LIBRARY_FROM_CACHE 0)
set (CSF_LIBRARY_ORIGINAL ${CSF_LIBRARY})
string (TOLOWER "${CSF_LIBRARY}" CSF_LIBRARY)
string (REPLACE "+" "[+]" CSF_LIBRARY "${CSF_LIBRARY}")
string (REPLACE "." "" CSF_LIBRARY "${CSF_LIBRARY}")
get_cmake_property(ALL_CACHE_VARIABLES CACHE_VARIABLES)
string (REGEX MATCHALL "(^|;)3RDPARTY_[^;]+_LIBRARY[^;]*" ALL_CACHE_VARIABLES "${ALL_CACHE_VARIABLES}")
set (DEBUG_DIR "")
set (RELEASE_DIR "")
foreach (CACHE_VARIABLE ${ALL_CACHE_VARIABLES})
set (CURRENT_CACHE_LIBRARY ${${CACHE_VARIABLE}})
string (TOLOWER "${CACHE_VARIABLE}" CACHE_VARIABLE)
if (NOT EXISTS "${CURRENT_CACHE_LIBRARY}" OR IS_DIRECTORY "${CURRENT_CACHE_LIBRARY}")
continue()
endif()
string (REGEX MATCH "_${CSF_LIBRARY}$" IS_ENDING "${CACHE_VARIABLE}")
string (REGEX MATCH "^([a-z]+)" CSF_WO_VERSION "${CSF_LIBRARY}")
string (REGEX MATCH "_${CSF_WO_VERSION}$" IS_ENDING_WO_VERSION "${CACHE_VARIABLE}")
if ("3rdparty_${CSF_LIBRARY}_library" STREQUAL "${CACHE_VARIABLE}" OR
"3rdparty_${CSF_WO_VERSION}_library" STREQUAL "${CACHE_VARIABLE}" OR
NOT "x${IS_ENDING}" STREQUAL "x" OR
NOT "x${IS_ENDING_WO_VERSION}" STREQUAL "x")
get_filename_component(LIBRARY_NAME "${CURRENT_CACHE_LIBRARY}" NAME)
list (APPEND FOUND_LIBS "${LIBRARY_NAME}")
get_filename_component(LIBRARY_DIR "${CURRENT_CACHE_LIBRARY}" DIRECTORY)
set (RELEASE_DIR "${LIBRARY_DIR}")
set (LIBRARY_FROM_CACHE 1)
elseif ("3rdparty_${CSF_LIBRARY}_library_debug" STREQUAL "${CACHE_VARIABLE}" OR
"3rdparty_${CSF_LIBRARY}_debug_library" STREQUAL "${CACHE_VARIABLE}")
get_filename_component(LIBRARY_NAME "${CURRENT_CACHE_LIBRARY}" NAME)
list (APPEND FOUND_LIBS "${LIBRARY_NAME}")
get_filename_component(LIBRARY_DIR "${CURRENT_CACHE_LIBRARY}" DIRECTORY)
set (DEBUG_DIR "${LIBRARY_DIR}")
set (LIBRARY_FROM_CACHE 1)
endif()
if (DEBUG_DIR AND RELEASE_DIR)
break()
endif()
endforeach()
if (NOT ${LIBRARY_FROM_CACHE} AND NOT "${CSF_LIBRARY}" STREQUAL "")
list (APPEND FOUND_LIBS "${CSF_LIBRARY_ORIGINAL}")
continue()
endif()
if (DEBUG_DIR AND RELEASE_DIR)
list (APPEND FOUND_DEBUG_DIRS "${DEBUG_DIR}")
list (APPEND FOUND_RELEASE_DIRS "${RELEASE_DIR}")
elseif (DEBUG_DIR)
list (APPEND FOUND_DEBUG_DIRS "${DEBUG_DIR}")
list (APPEND FOUND_RELEASE_DIRS "${DEBUG_DIR}")
message (WARNING "Debug directory found but no release directory found. Using debug directory for both configurations.")
elseif (RELEASE_DIR)
list (APPEND FOUND_DEBUG_DIRS "${RELEASE_DIR}")
list (APPEND FOUND_RELEASE_DIRS "${RELEASE_DIR}")
endif()
endforeach()
# Cache the result
set_property(GLOBAL PROPERTY "CACHED_LIBS_${CACHE_KEY}" "${FOUND_LIBS}")
set_property(GLOBAL PROPERTY "CACHED_DEBUG_DIRS_${CACHE_KEY}" "${FOUND_DEBUG_DIRS}")
set_property(GLOBAL PROPERTY "CACHED_RELEASE_DIRS_${CACHE_KEY}" "${FOUND_RELEASE_DIRS}")
endif()
# Append found values to the external variable
list(APPEND ${LIST_NAME} ${FOUND_LIBS})
set(${LIST_NAME} "${${LIST_NAME}}" PARENT_SCOPE)
# Handle library directories for different build configurations
list (REMOVE_DUPLICATES FOUND_RELEASE_DIRS)
list (REMOVE_DUPLICATES FOUND_DEBUG_DIRS)
foreach (RELEASE_DIR ${FOUND_RELEASE_DIRS})
get_filename_component(RELEASE_DIR_ABS "${RELEASE_DIR}" ABSOLUTE)
target_link_directories(${TARGET_NAME} PUBLIC "$<$<CONFIG:RELEASE>:${RELEASE_DIR_ABS}>;$<$<CONFIG:RELWITHDEBINFO>:${RELEASE_DIR_ABS}>")
endforeach()
foreach (DEBUG_DIR ${FOUND_DEBUG_DIRS})
get_filename_component(DEBUG_DIR_ABS "${DEBUG_DIR}" ABSOLUTE)
target_link_directories(${TARGET_NAME} PUBLIC "$<$<CONFIG:DEBUG>:${DEBUG_DIR_ABS}>")
endforeach()
endfunction()
macro(OCCT_ADD_VCPKG_FEATURE THE_FEATURE)
if (BUILD_USE_VCPKG)
list(APPEND VCPKG_MANIFEST_FEATURES "${THE_FEATURE}" PARENT_SCOPE)
endif()
endmacro()
macro (OCCT_UNSET_VCPKG_FEATURE THE_FEATURE)
if (BUILD_USE_VCPKG)
list (REMOVE_ITEM VCPKG_MANIFEST_FEATURES "${THE_FEATURE}" PARENT_SCOPE)
endif()
endmacro()

View File

@ -3,8 +3,8 @@
macro (OCCT_GENERATE_CONTENT_ONLY CurrentResource)
set (RESOURCE_FILES)
set (isResDirectory FALSE)
if (IS_DIRECTORY "${CMAKE_SOURCE_DIR}/src/${CurrentResource}")
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${CurrentResource}/FILES" RESOURCE_FILES)
if (IS_DIRECTORY "${CMAKE_SOURCE_DIR}/resources/${CurrentResource}")
file (STRINGS "${CMAKE_SOURCE_DIR}/resources/${CurrentResource}/FILES" RESOURCE_FILES)
set (CurrentResource_Directory "${CurrentResource}")
set (isResDirectory TRUE)
else()
@ -27,37 +27,23 @@ macro (OCCT_GENERATE_CONTENT_ONLY CurrentResource)
string (REPLACE "." "_" CurrentResource_FileName "${CurrentResource_FileName}")
set (HEADER_FILE_NAME "${CurrentResource_Directory}_${CurrentResource_FileName}.pxx")
set (toProcessResFile TRUE)
if (isResDirectory)
list (FIND RESOURCE_FILES "${HEADER_FILE_NAME}" aResIndex)
if ("${aResIndex}" STREQUAL "-1")
set (toProcessResFile FALSE)
endif()
endif()
if (toProcessResFile)
message(STATUS "Info. Generating header file from resource file: ${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${RESOURCE_FILE}")
# generate content for header file
set (OCCT_HEADER_FILE_CONTENT "// This file has been automatically generated from resource file src/${CurrentResource_Directory}/${RESOURCE_FILE}\n\n")
# read resource file
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${RESOURCE_FILE}" RESOURCE_FILE_LINES_LIST)
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT}static const char ${CurrentResource_Directory}_${CurrentResource_FileName}[] =")
foreach (line IN LISTS RESOURCE_FILE_LINES_LIST)
string (REPLACE "\"" "\\\"" line "${line}")
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT}\n \"${line}\\n\"")
endforeach()
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT};")
# Save generated content to header file
set (HEADER_FILE "${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${HEADER_FILE_NAME}")
if (EXISTS "${HEADER_FILE}")
file (REMOVE "${HEADER_FILE}")
endif()
configure_file ("${CMAKE_SOURCE_DIR}/adm/templates/header.in" "${HEADER_FILE}" @ONLY NEWLINE_STYLE LF)
message(STATUS "Info. Generating header file from resource file: ${CMAKE_SOURCE_DIR}/resources/${CurrentResource_Directory}/${RESOURCE_FILE}")
# generate content for header file
set (OCCT_HEADER_FILE_CONTENT "// This file has been automatically generated from resource file resources/${CurrentResource_Directory}/${RESOURCE_FILE}\n\n")
# read resource file
file (STRINGS "${CMAKE_SOURCE_DIR}/resources/${CurrentResource_Directory}/${RESOURCE_FILE}" RESOURCE_FILE_LINES_LIST)
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT}static const char ${CurrentResource_Directory}_${CurrentResource_FileName}[] =")
foreach (line IN LISTS RESOURCE_FILE_LINES_LIST)
string (REPLACE "\"" "\\\"" line "${line}")
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT}\n \"${line}\\n\"")
endforeach()
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT};\n\n")
# Save generated content to header file
set (HEADER_FILE "${OCCT_${CurrentResource_Directory}_FILES_LOCATION}/${HEADER_FILE_NAME}")
if (EXISTS "${HEADER_FILE}")
file (REMOVE "${HEADER_FILE}")
endif()
configure_file ("${CMAKE_SOURCE_DIR}/adm/templates/header.in" "${HEADER_FILE}" @ONLY NEWLINE_STYLE LF)
endif()
endforeach()
endif()

View File

@ -23,7 +23,7 @@ if ("${OCCT_TOOLKITS_NAME_SUFFIX}" STREQUAL "")
endif()
# parse PACKAGES file
FILE_TO_LIST ("${RELATIVE_SOURCES_DIR}/${PROJECT_NAME}/PACKAGES" USED_PACKAGES)
EXTRACT_TOOLKIT_PACKAGES (${RELATIVE_SOURCES_DIR} ${PROJECT_NAME} USED_PACKAGES)
if ("${USED_PACKAGES}" STREQUAL "")
set (USED_PACKAGES ${PROJECT_NAME})
endif()
@ -47,7 +47,6 @@ endif()
# Get all used packages from toolkit
UNSET(RESOURCE_FILES)
foreach (OCCT_PACKAGE ${USED_PACKAGES})
#remove part after "/" in the OCCT_PACKAGE variable if exists
string (FIND "${OCCT_PACKAGE}" "/" _index)
if (_index GREATER -1)
@ -57,149 +56,30 @@ foreach (OCCT_PACKAGE ${USED_PACKAGES})
set (OCCT_PACKAGE_NAME "${OCCT_PACKAGE}")
endif()
if (WIN32)
list (APPEND PRECOMPILED_DEFS "-D__${OCCT_PACKAGE_NAME}_DLL")
endif()
set (SOURCE_FILES)
set (HEADER_FILES)
# Generate Flex and Bison files
if (${BUILD_YACCLEX})
# flex files
OCCT_ORIGIN_AND_PATCHED_FILES ("${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}" "*[.]lex" SOURCE_FILES_FLEX)
list (LENGTH SOURCE_FILES_FLEX SOURCE_FILES_FLEX_LEN)
EXTRACT_PACKAGE_FILES (${RELATIVE_SOURCES_DIR} ${OCCT_PACKAGE} ALL_FILES INCLUDE_FOLDER)
# remove old general version of FlexLexer
if (EXISTS ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/FlexLexer/FlexLexer.h)
message (STATUS "Info: remove old FLEX header file: ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/FlexLexer/FlexLexer.h")
file(REMOVE ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/FlexLexer/FlexLexer.h)
endif()
# install copy of FlexLexer.h locally to allow further building without flex
if (FLEX_INCLUDE_DIR AND EXISTS "${FLEX_INCLUDE_DIR}/FlexLexer.h")
configure_file("${FLEX_INCLUDE_DIR}/FlexLexer.h" "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/FlexLexer/FlexLexer.h" @ONLY NEWLINE_STYLE LF)
endif()
set (HEADER_FILES_FILTERING ${ALL_FILES})
set (SOURCE_FILES_FILTERING ${ALL_FILES})
# bison files
OCCT_ORIGIN_AND_PATCHED_FILES ("${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}" "*[.]yacc" SOURCE_FILES_BISON)
list (LENGTH SOURCE_FILES_BISON SOURCE_FILES_BISON_LEN)
if (${SOURCE_FILES_FLEX_LEN} EQUAL ${SOURCE_FILES_BISON_LEN} AND NOT ${SOURCE_FILES_FLEX_LEN} EQUAL 0)
list (SORT SOURCE_FILES_FLEX)
list (SORT SOURCE_FILES_BISON)
math (EXPR SOURCE_FILES_FLEX_LEN "${SOURCE_FILES_FLEX_LEN} - 1")
foreach (FLEX_FILE_INDEX RANGE ${SOURCE_FILES_FLEX_LEN})
list (GET SOURCE_FILES_FLEX ${FLEX_FILE_INDEX} CURRENT_FLEX_FILE)
get_filename_component (CURRENT_FLEX_FILE_NAME ${CURRENT_FLEX_FILE} NAME_WE)
list (GET SOURCE_FILES_BISON ${FLEX_FILE_INDEX} CURRENT_BISON_FILE)
get_filename_component (CURRENT_BISON_FILE_NAME ${CURRENT_BISON_FILE} NAME_WE)
string (COMPARE EQUAL ${CURRENT_FLEX_FILE_NAME} ${CURRENT_BISON_FILE_NAME} ARE_FILES_EQUAL)
if (EXISTS "${CURRENT_FLEX_FILE}" AND EXISTS "${CURRENT_BISON_FILE}" AND ${ARE_FILES_EQUAL})
# Note: files are generated in original source directory (not in patch!)
set (FLEX_BISON_TARGET_DIR "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}")
# choose appropriate extension for generated files: "cxx" if source file contains
# instruction to generate C++ code, "c" otherwise
set (BISON_OUTPUT_FILE_EXT "c")
set (FLEX_OUTPUT_FILE_EXT "c")
file (STRINGS "${CURRENT_BISON_FILE}" FILE_BISON_CONTENT)
foreach (FILE_BISON_CONTENT_LINE ${FILE_BISON_CONTENT})
string (REGEX MATCH "%language \"C\\+\\+\"" CXX_BISON_LANGUAGE_FOUND ${FILE_BISON_CONTENT_LINE})
if (CXX_BISON_LANGUAGE_FOUND)
set (BISON_OUTPUT_FILE_EXT "cxx")
endif()
endforeach()
file (STRINGS "${CURRENT_FLEX_FILE}" FILE_FLEX_CONTENT)
foreach (FILE_FLEX_CONTENT_LINE ${FILE_FLEX_CONTENT})
string (REGEX MATCH "%option c\\+\\+" CXX_FLEX_LANGUAGE_FOUND ${FILE_FLEX_CONTENT_LINE})
if (CXX_FLEX_LANGUAGE_FOUND)
set (FLEX_OUTPUT_FILE_EXT "cxx")
endif()
endforeach()
set (BISON_OUTPUT_FILE ${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
set (FLEX_OUTPUT_FILE lex.${CURRENT_FLEX_FILE_NAME}.${FLEX_OUTPUT_FILE_EXT})
if (EXISTS ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
message (STATUS "Info: remove old output BISON file: ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT}")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
endif()
if (EXISTS ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.hxx)
message (STATUS "Info: remove old output BISON file: ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.hxx")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.hxx)
endif()
if (EXISTS ${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE})
message (STATUS "Info: remove old output FLEX file: ${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE}")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE})
endif()
BISON_TARGET (Parser_${CURRENT_BISON_FILE_NAME} ${CURRENT_BISON_FILE} "${FLEX_BISON_TARGET_DIR}/${BISON_OUTPUT_FILE}"
COMPILE_FLAGS "-p ${CURRENT_BISON_FILE_NAME} -l -M ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/=")
FLEX_TARGET (Scanner_${CURRENT_FLEX_FILE_NAME} ${CURRENT_FLEX_FILE} "${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE}"
COMPILE_FLAGS "-P${CURRENT_FLEX_FILE_NAME} -L")
ADD_FLEX_BISON_DEPENDENCY (Scanner_${CURRENT_FLEX_FILE_NAME} Parser_${CURRENT_BISON_FILE_NAME})
list (APPEND SOURCE_FILES ${BISON_OUTPUT_FILE} ${FLEX_OUTPUT_FILE})
endif()
endforeach()
endif()
endif()
# header files
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES")
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_M REGEX ".+[.]h")
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_LXX REGEX ".+[.]lxx")
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_GXX REGEX ".+[.]gxx")
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
if(APPLE)
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_M REGEX ".+[.]mm")
endif()
else()
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_M REGEX ".+[.]h")
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_LXX REGEX ".+[.]lxx")
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_GXX REGEX ".+[.]gxx")
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
if(APPLE)
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_M REGEX ".+[.]mm")
endif()
endif()
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|p|g|lxx|hxx|pxx|hpp|gxx)$")
list (APPEND HEADER_FILES ${HEADER_FILES_M} ${HEADER_FILES_LXX} ${SOURCE_FILES_GXX})
list (APPEND SOURCE_FILES ${SOURCE_FILES_C})
if(APPLE)
list (APPEND SOURCE_FILES ${SOURCE_FILES_M})
list (FILTER SOURCE_FILES_FILTERING INCLUDE REGEX ".+[.](c|cxx|cpp|mm)$")
else()
list (FILTER SOURCE_FILES_FILTERING INCLUDE REGEX ".+[.](c|cpp|cxx)$")
endif()
foreach(HEADER_FILE ${HEADER_FILES})
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
message (STATUS "Info: consider patched file: ${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
list (APPEND USED_INCFILES "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE_NAME}" FILES "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
else()
list (APPEND USED_INCFILES "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE_NAME}" FILES "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
endif()
endforeach()
list (APPEND HEADER_FILES ${HEADER_FILES_FILTERING})
list (APPEND SOURCE_FILES ${SOURCE_FILES_FILTERING})
foreach(SOURCE_FILE ${SOURCE_FILES})
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
message (STATUS "Info: consider patched file: ${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
list (APPEND USED_SRCFILES "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE_NAME}" FILES "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
else()
list (APPEND USED_SRCFILES "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE_NAME}" FILES "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
endif()
endforeach()
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE_NAME}" FILES "${HEADER_FILES_FILTERING}")
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE_NAME}" FILES "${SOURCE_FILES_FILTERING}")
list (APPEND USED_INCFILES ${HEADER_FILES})
list (APPEND USED_SRCFILES ${SOURCE_FILES})
if (USE_QT)
FIND_AND_INSTALL_QT_RESOURCES (${OCCT_PACKAGE} RESOURCE_FILES)
@ -216,12 +96,7 @@ string (REGEX REPLACE ";" " " PRECOMPILED_DEFS "${PRECOMPILED_DEFS}")
set (USED_RCFILE "")
if (MSVC)
set (USED_RCFILE "${CMAKE_BINARY_DIR}/resources/${PROJECT_NAME}.rc")
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/adm/templates/occt_toolkit.rc.in")
configure_file("${APPLY_OCCT_PATCH_DIR}/adm/templates/occt_toolkit.rc.in" "${USED_RCFILE}" @ONLY)
else()
configure_file("${CMAKE_SOURCE_DIR}/adm/templates/occt_toolkit.rc.in" "${USED_RCFILE}" @ONLY)
endif()
configure_file("${CMAKE_SOURCE_DIR}/adm/templates/occt_toolkit.rc.in" "${USED_RCFILE}" @ONLY)
endif()
set (CURRENT_MODULE)
@ -245,18 +120,6 @@ endif (USE_QT)
if (EXECUTABLE_PROJECT)
add_executable (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RESOURCE_FILES} ${${PROJECT_NAME}_MOC_FILES})
if (DEFINED ${PROJECT_NAME}_DISABLE_COTIRE AND ${PROJECT_NAME}_DISABLE_COTIRE)
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ENABLE_PRECOMPILED_HEADER FALSE)
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
else()
# To avoid excluding of PROJECT_NAME from cotire tool, we may use cotire
# COTIRE_PREFIX_HEADER_IGNORE_PATH instead. But, practically it causes many 'undefined symbols' error.
# So, we just exclude PROJECT_NAME from cotire list.
# if (DEFINED ${PROJECT_NAME}_COTIRE_IGNORE_PATH)
# set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_PREFIX_HEADER_IGNORE_PATH "${${PROJECT_NAME}_COTIRE_IGNORE_PATH}")
# endif()
endif()
install (TARGETS ${PROJECT_NAME}
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
@ -266,19 +129,7 @@ if (EXECUTABLE_PROJECT)
else()
add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RESOURCE_FILES} ${${PROJECT_NAME}_MOC_FILES})
if (DEFINED ${PROJECT_NAME}_DISABLE_COTIRE AND ${PROJECT_NAME}_DISABLE_COTIRE)
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ENABLE_PRECOMPILED_HEADER FALSE)
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
else()
# To avoid excluding of PROJECT_NAME from cotire tool, we may use cotire
# COTIRE_PREFIX_HEADER_IGNORE_PATH instead. But, practically it causes many 'undefined symbols' error.
# So, we just exclude PROJECT_NAME from cotire list.
# if (DEFINED ${PROJECT_NAME}_COTIRE_IGNORE_PATH)
# set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_PREFIX_HEADER_IGNORE_PATH "${${PROJECT_NAME}_COTIRE_IGNORE_PATH}")
# endif()
endif()
if (MSVC)
if (MSVC AND BUILD_SHARED_LIBS)
if (BUILD_FORCE_RelWithDebInfo)
set (aReleasePdbConf "Release")
else()
@ -338,108 +189,59 @@ elseif (BUILD_SOVERSION_NUMBERS GREATER 1)
elseif (BUILD_SOVERSION_NUMBERS GREATER 0)
set (OCC_SOVERSION "${OCC_VERSION_MAJOR}")
endif()
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}"
SOVERSION "${OCC_SOVERSION}"
VERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}")
set (USED_TOOLKITS_BY_CURRENT_PROJECT)
set (USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT)
set (USED_EXTERNLIB_AND_TOOLKITS)
# parse EXTERNLIB file
# SOME EXECUTABLE PROJECTS MAY USE CUSTOM TOOLKITS AND EXTERNAL LIBRARIES
if (CUSTOM_EXTERNLIB)
set (USED_EXTERNLIB_AND_TOOLKITS ${CUSTOM_EXTERNLIB})
foreach (EXTERNAL_LIB ${CUSTOM_EXTERNLIB})
string (REGEX MATCH "^TK" TK_FOUND ${EXTERNAL_LIB})
if (TK_FOUND)
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT ${EXTERNAL_LIB})
endif()
endforeach()
else()
FILE_TO_LIST ("${RELATIVE_SOURCES_DIR}/${PROJECT_NAME}/EXTERNLIB" USED_EXTERNLIB_AND_TOOLKITS)
EXTRACT_TOOLKIT_EXTERNLIB ("${RELATIVE_SOURCES_DIR}" "${PROJECT_NAME}" USED_EXTERNLIB_AND_TOOLKITS)
EXCTRACT_TOOLKIT_DEPS ("${RELATIVE_SOURCES_DIR}" "${PROJECT_NAME}" USED_TOOLKITS_BY_CURRENT_PROJECT _)
list (REMOVE_ITEM USED_TOOLKITS_BY_CURRENT_PROJECT ${PROJECT_NAME})
endif()
foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
string (REGEX MATCH "^ *#" COMMENT_FOUND ${USED_ITEM})
if (NOT COMMENT_FOUND)
string (REGEX MATCH "^TK" TK_FOUND ${USED_ITEM})
string (REGEX MATCH "^vtk" VTK_FOUND ${USED_ITEM})
if (NOT "${TK_FOUND}" STREQUAL "" OR NOT "${VTK_FOUND}" STREQUAL "")
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT ${USED_ITEM})
if (NOT "${VTK_FOUND}" STREQUAL "" AND BUILD_SHARED_LIBS AND INSTALL_VTK AND COMMAND OCCT_INSTALL_VTK)
OCCT_INSTALL_VTK(${USED_ITEM})
endif()
else()
string (REGEX MATCH "^CSF_" CSF_FOUND ${USED_ITEM})
if ("${CSF_FOUND}" STREQUAL "")
message (STATUS "Info: ${USED_ITEM} from ${PROJECT_NAME} skipped due to it is empty")
else() # get CSF_ value
set (CURRENT_CSF ${${USED_ITEM}})
if (NOT "x${CURRENT_CSF}" STREQUAL "x")
if ("${CURRENT_CSF}" STREQUAL "${CSF_OpenGlLibs}")
add_definitions (-DHAVE_OPENGL)
endif()
if ("${CURRENT_CSF}" STREQUAL "${CSF_OpenGlesLibs}")
add_definitions (-DHAVE_GLES2)
endif()
if ("${CURRENT_CSF}" STREQUAL "${CSF_Draco}")
set (CURRENT_CSF "")
set (USED_DRACO 1)
endif()
set (LIBRARY_FROM_CACHE 0)
separate_arguments (CURRENT_CSF)
foreach (CSF_LIBRARY ${CURRENT_CSF})
string (TOLOWER "${CSF_LIBRARY}" CSF_LIBRARY)
string (REPLACE "+" "[+]" CSF_LIBRARY "${CSF_LIBRARY}")
string (REPLACE "." "" CSF_LIBRARY "${CSF_LIBRARY}")
get_cmake_property(ALL_CACHE_VARIABLES CACHE_VARIABLES)
string (REGEX MATCHALL "(^|;)3RDPARTY_[^;]+_LIBRARY[^;]*" ALL_CACHE_VARIABLES "${ALL_CACHE_VARIABLES}")
foreach (CACHE_VARIABLE ${ALL_CACHE_VARIABLES})
set (CURRENT_CACHE_LIBRARY ${${CACHE_VARIABLE}})
string (TOLOWER "${CACHE_VARIABLE}" CACHE_VARIABLE)
if (EXISTS "${CURRENT_CACHE_LIBRARY}" AND NOT IS_DIRECTORY "${CURRENT_CACHE_LIBRARY}")
string (REGEX MATCH "_${CSF_LIBRARY}$" IS_ENDING "${CACHE_VARIABLE}")
string (REGEX MATCH "^([a-z]+)" CSF_WO_VERSION "${CSF_LIBRARY}")
string (REGEX MATCH "_${CSF_WO_VERSION}$" IS_ENDING_WO_VERSION "${CACHE_VARIABLE}")
if ("3rdparty_${CSF_LIBRARY}_library" STREQUAL "${CACHE_VARIABLE}" OR
"3rdparty_${CSF_WO_VERSION}_library" STREQUAL "${CACHE_VARIABLE}" OR
NOT "x${IS_ENDING}" STREQUAL "x" OR
NOT "x${IS_ENDING_WO_VERSION}" STREQUAL "x")
list (APPEND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT "${CURRENT_CACHE_LIBRARY}")
set (LIBRARY_FROM_CACHE 1)
endif()
endif()
endforeach()
endforeach()
if (NOT ${LIBRARY_FROM_CACHE} AND NOT "${CURRENT_CSF}" STREQUAL "")
# prepare a list from a string with whitespaces
separate_arguments (CURRENT_CSF)
list (APPEND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT ${CURRENT_CSF})
endif()
endif()
endif()
endif()
if (COMMENT_FOUND)
continue()
endif()
string (REGEX MATCH "^CSF_" CSF_FOUND ${USED_ITEM})
string (REGEX MATCH "^vtk" VTK_FOUND ${USED_ITEM})
if (NOT "${VTK_FOUND}" STREQUAL "")
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT ${USED_ITEM})
if (BUILD_SHARED_LIBS AND INSTALL_VTK AND COMMAND OCCT_INSTALL_VTK)
OCCT_INSTALL_VTK(${USED_ITEM})
endif()
continue()
endif()
# Search for 3rd-party libraries as a dependency
set (CURRENT_CSF ${${USED_ITEM}})
if ("x${CURRENT_CSF}" STREQUAL "x")
continue()
endif()
if ("${CURRENT_CSF}" STREQUAL "${CSF_OpenGlLibs}")
add_definitions (-DHAVE_OPENGL)
endif()
if ("${CURRENT_CSF}" STREQUAL "${CSF_OpenGlesLibs}")
add_definitions (-DHAVE_GLES2)
endif()
PROCESS_CSF_LIBRARIES ("${CURRENT_CSF}" USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT "${PROJECT_NAME}")
endforeach()
if (USE_DRACO)
if (USED_DRACO)
set (USED_LIB_RELEASE ${3RDPARTY_DRACO_LIBRARY})
if (WIN32)
set (USED_LIB_DEBUG ${3RDPARTY_DRACO_LIBRARY_DEBUG})
else()
set (USED_LIB_DEBUG ${3RDPARTY_DRACO_LIBRARY})
endif()
set (USED_LIB_CONF)
if (EXISTS ${USED_LIB_DEBUG})
set (USED_LIB_CONF "$<$<CONFIG:DEBUG>:${USED_LIB_DEBUG}>;${USED_LIB_CONF}")
endif()
if (EXISTS ${USED_LIB_RELEASE})
set (USED_LIB_CONF "$<$<CONFIG:RELEASE>:${USED_LIB_RELEASE}>;${USED_LIB_CONF}")
set (USED_LIB_CONF "$<$<CONFIG:RELWITHDEBINFO>:${USED_LIB_RELEASE}>;${USED_LIB_CONF}")
endif()
if (DEFINED USED_LIB_CONF)
set_property (TARGET ${PROJECT_NAME} APPEND PROPERTY LINK_LIBRARIES "${USED_LIB_CONF}")
endif()
endif()
endif()
if (APPLE)
list (FIND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT X11 IS_X11_FOUND)
if (NOT ${IS_X11_FOUND} EQUAL -1)
@ -475,13 +277,12 @@ else()
endif()
endif()
if (BUILD_SHARED_LIBS OR EXECUTABLE_PROJECT)
if(IS_VTK_9XX)
string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}")
endif()
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
if(IS_VTK_9XX)
string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}")
endif()
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
if (USE_QT)
foreach (PROJECT_LIBRARY_DEBUG ${PROJECT_LIBRARIES_DEBUG})
target_link_libraries (${PROJECT_NAME} debug ${PROJECT_LIBRARY_DEBUG})
@ -498,35 +299,3 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
message (STATUS "Warning: internal deprecation warnings by Standard_DEPRECATED have been disabled due to old gcc version being used")
endif()
endif()
# use Cotire to accelerate build via usage of precompiled headers
if (BUILD_USE_PCH)
if (WIN32)
# prevent definition of min and max macros through inclusion of Windows.h
# (for cotire builds)
add_definitions("-DNOMINMAX")
# avoid warnings on deprecated names from standard C library (see strsafe.h)
add_definitions("-DSTRSAFE_NO_DEPRECATE")
# avoid "std::Equal1" warning in QANCollection_Stl.cxx in debug mode
# suggesting using msvc "Checked Iterators"
add_definitions("-D_SCL_SECURE_NO_WARNINGS")
endif()
# Exclude system-provided glext.h.
# These macros are already defined within OpenGl_GlFunctions.hxx,
# however we have to duplicate them here for building TKOpenGl with PCH.
add_definitions("-DGL_GLEXT_LEGACY")
add_definitions("-DGLX_GLXEXT_LEGACY")
# workaround for old gcc
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
add_definitions("-D__STDC_CONSTANT_MACROS")
add_definitions("-D__STDC_FORMAT_MACROS")
endif()
# unity builds are not used since they do not add speed but cause conflicts
# in TKV3d
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
cotire(${PROJECT_NAME})
endif()

View File

@ -1,13 +0,0 @@
if ("${TARGET_FOLDER}" STREQUAL "")
set (USE_QT ON)
set (RELATIVE_DIR "tools")
set (MODULES_LIST ${OCCT_TOOLS})
set (TARGET_FOLDER "Tools")
set (TOOLKITS_NAME_SUFFIX "TOOL_TOOLKITS")
else()
unset (USE_QT)
unset (RELATIVE_DIR)
unset (MODULES_LIST)
unset (TARGET_FOLDER)
unset (TOOLKITS_NAME_SUFFIX)
endif("${TARGET_FOLDER}" STREQUAL "")

View File

@ -2,4 +2,17 @@
# OpenVR is an API and runtime that allows access to VR hardware from multiple vendors without requiring that applications have specific knowledge of the hardware they are targeting.
# https://github.com/ValveSoftware/openvr
# vcpkg processing
if (BUILD_USE_VCPKG)
set (USED_3RDPARTY_OPENVR_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin")
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib .a)
find_library (FIND_OPENVR_LIB NAMES "${CSF_OpenVR}"
PATHS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib"
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
set (CSF_OpenVR "${FIND_OPENVR_LIB}")
list (APPEND 3RDPARTY_INCLUDE_DIRS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/")
return()
endif()
THIRDPARTY_PRODUCT("OPENVR" "openvr.h" "CSF_OpenVR" "")

View File

@ -3,38 +3,54 @@
# Qt is searched manually first (just determine root)
message (STATUS "Processing Qt 3-rd party")
set (USE_QT_FROM_3RDPARTY_DIR TRUE)
if (NOT DEFINED ${3RDPARTY_QT_DIR} AND ${3RDPARTY_QT_DIR} STREQUAL "")
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" Qt 3RDPARTY_QT_DIR_NAME)
if (NOT DEFINED ${3RDPARTY_QT_DIR_NAME} AND ${3RDPARTY_QT_DIR_NAME} STREQUAL "")
set (3RDPARTY_QT_DIR "" CACHE PATH "The directory containing qt")
message (FATAL_ERROR "Could not find used third-party product: 3RDPARTY_QT_DIR")
set (USE_QT_FROM_3RDPARTY_DIR FALSE)
else()
# Combine directory name with absolute path and show in GUI
set (3RDPARTY_QT_DIR "${3RDPARTY_DIR}/${3RDPARTY_QT_DIR_NAME}" CACHE PATH "The directory containing Qt" FORCE)
endif()
# Combine directory name with absolute path and show in GUI
set (3RDPARTY_QT_DIR "${3RDPARTY_DIR}/${3RDPARTY_QT_DIR_NAME}" CACHE PATH "The directory containing Qt" FORCE)
message (STATUS "Info: Qt is used from folder: ${3RDPARTY_QT_DIR}")
endif()
set (USED_3RDPARTY_QT_DIR "${3RDPARTY_QT_DIR}")
# Now set CMAKE_PREFIX_PATH to point to local Qt installation.
# Without this setting find_package() will not work
set(CMAKE_PREFIX_PATH ${3RDPARTY_QT_DIR})
# Now we can apply standard CMake finder for Qt5. We do this mostly
# to have qt5_wrap_cpp() function available and Qt5_FOUND variable filled
find_package(Qt5 QUIET COMPONENTS Widgets Quick Xml PATHS ${3RDPARTY_QT_DIR} NO_DEFAULT_PATH)
if (${USE_QT_FROM_3RDPARTY_DIR})
# Now set CMAKE_PREFIX_PATH to point to local Qt installation.
# Without this setting find_package() will not work
set(CMAKE_PREFIX_PATH ${3RDPARTY_QT_DIR})
# Now we can apply standard CMake finder for Qt5. We do this mostly
# to have qt5_wrap_cpp() function available and Qt5_FOUND variable filled
find_package(Qt5 QUIET COMPONENTS Widgets Quick Xml PATHS ${3RDPARTY_QT_DIR} NO_DEFAULT_PATH)
else()
find_package(Qt5 QUIET COMPONENTS Widgets Quick Xml)
endif()
if (NOT ${Qt5_FOUND})
# Now we can apply standard CMake finder for Qt. We do this mostly
# to have qt4_wrap_cpp() function available
find_package(Qt4)
#message (STATUS "Qt4 cmake configuration")
else()
#message (STATUS "Qt5 cmake configuration")
elseif(NOT ${USE_QT_FROM_3RDPARTY_DIR} AND WIN32)
# Qt5_DIR typically points to lib/cmake/Qt5, need to go up to Qt root
get_filename_component(QT_CMAKE_DIR "${Qt5_DIR}" DIRECTORY)
get_filename_component(QT_LIB_DIR "${QT_CMAKE_DIR}" DIRECTORY)
get_filename_component(QT_ROOT_DIR "${QT_LIB_DIR}" DIRECTORY)
# Verify this is indeed the Qt root by checking for bin and packages directories
if(EXISTS "${QT_ROOT_DIR}/bin")
set(3RDPARTY_QT_DIR ${QT_ROOT_DIR} CACHE PATH "The directory containing Qt" FORCE)
else()
message(WARNING "Found Qt5 at ${Qt5_DIR} but could not determine Qt root directory with bin/ and plugins/ folders")
set(3RDPARTY_QT_DIR ${Qt5_DIR} CACHE PATH "The directory containing Qt" FORCE)
endif()
elseif(NOT ${USE_QT_FROM_3RDPARTY_DIR})
set(3RDPARTY_QT_DIR ${Qt5_DIR} CACHE PATH "The directory containing Qt" FORCE)
endif()
if (3RDPARTY_QT_DIR OR EXISTS "${3RDPARTY_QT_DIR}")
set (USED_3RDPARTY_QT_DIR "${3RDPARTY_QT_DIR}")
if (3RDPARTY_QT_DIR OR EXISTS "${3RDPARTY_QT_DIR}/bin")
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_QT_DIR}/bin")
else()
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_QT_DLL_DIR)

View File

@ -1,5 +1,13 @@
# RapidJSON
# vcpkg processing
if (BUILD_USE_VCPKG)
find_package(RapidJSON CONFIG REQUIRED)
set(CSF_RapidJSON rapidjson)
list (APPEND 3RDPARTY_INCLUDE_DIRS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/rapidjson")
return()
endif()
if (NOT DEFINED INSTALL_RAPIDJSON)
set (INSTALL_RAPIDJSON OFF CACHE BOOL "${INSTALL_RAPIDJSON_DESCR}")
endif()
@ -82,5 +90,5 @@ else()
set (3RDPARTY_RAPIDJSON_INCLUDE_DIR "" CACHE PATH "the path to RapidJSON header file" FORCE)
endif()
# unset all redundant variables
OCCT_CHECK_AND_UNSET(RapidJSON_DIR)
# hide all redundant variables
mark_as_advanced(RapidJSON_DIR)

View File

@ -1,5 +1,18 @@
# tbb
# vcpkg processing
if (BUILD_USE_VCPKG)
find_package(TBB CONFIG REQUIRED)
set(CSF_TBB TBB::tbb TBB::tbbmalloc)
if (WIN32)
set (USED_3RDPARTY_TBB_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin")
else()
set (USED_3RDPARTY_TBB_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib")
endif()
list (APPEND 3RDPARTY_INCLUDE_DIRS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/tbb")
return()
endif()
if (MSVC AND BUILD_SHARED_LIBS)
add_definitions (-D__TBB_NO_IMPLICIT_LINKAGE)
add_definitions (-D__TBBMALLOC_NO_IMPLICIT_LINKAGE)
@ -27,7 +40,7 @@ if (WIN32)
# Below, we have correct 3RDPARTY_DIR.
# Initialize TBB folder in connectin with 3RDPARTY_DIR.
# Initialize TBB folder in connection with 3RDPARTY_DIR.
if (("${3RDPARTY_TBB_DIR}" STREQUAL "") OR (NOT EXISTS "${3RDPARTY_TBB_DIR}"))
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" TBB TBB_DIR_NAME)
if (TBB_DIR_NAME)
@ -44,7 +57,7 @@ if (WIN32)
REQUIRED
CONFIG)
# Achive include directory
# Archive include directory
get_target_property (TBB_INCLUDE_DIR TBB::tbb INTERFACE_INCLUDE_DIRECTORIES)
if (NOT DEFINED 3RDPARTY_TBB_INCLUDE_DIR)
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "The directory containing headers of the TBB")
@ -56,13 +69,17 @@ if (WIN32)
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
endif()
# Get installed configuration of tbb
get_target_property (TARGET_TBB_IMPORT_CONFS TBB::tbb IMPORTED_CONFIGURATIONS)
list (GET TARGET_TBB_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
separate_arguments (CSF_TBB)
foreach (LIB IN LISTS CSF_TBB)
string(TOLOWER "${LIB}" LIB_LOWER)
string(TOUPPER "${LIB}" LIB_UPPER)
# Achive *.lib files and directory containing it.
get_target_property (TBB_LIB_FILE "TBB::${LIB_LOWER}" IMPORTED_IMPLIB_RELEASE)
# Archive *.lib files and directory containing it.
get_target_property (TBB_LIB_FILE "TBB::${LIB_LOWER}" IMPORTED_IMPLIB_${CHOSEN_IMPORT_CONF})
# Reserve cache variable for *.lib.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_LIBRARY)
set (3RDPARTY_${LIB_UPPER}_LIBRARY "" CACHE FILEPATH "${LIB_UPPER} library (*.lib)")
@ -88,8 +105,8 @@ if (WIN32)
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_${LIB_UPPER}_LIBRARY_DIR)
endif()
# Achive *.dll files and directory containing it.
get_target_property (TBB_DLL_FILE "TBB::${LIB_LOWER}" IMPORTED_LOCATION_RELEASE)
# Archive *.dll files and directory containing it.
get_target_property (TBB_DLL_FILE "TBB::${LIB_LOWER}" IMPORTED_LOCATION_${CHOSEN_IMPORT_CONF})
# Reserve cache variable for *.dll.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_DLL)
set (3RDPARTY_${LIB_UPPER}_DLL "" CACHE FILEPATH "${LIB_UPPER} library (*.dll)")
@ -171,9 +188,9 @@ else ()
REQUIRED
CONFIG)
endif()
# TBB has been configured (in other case FATAL_ERROR occures).
# TBB has been configured (in other case FATAL_ERROR occurs).
# Achive include directory.
# Archive include directory.
get_target_property (TBB_INCLUDE_DIR TBB::tbb INTERFACE_INCLUDE_DIRECTORIES)
if (NOT DEFINED 3RDPARTY_TBB_INCLUDE_DIR)
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "The directory containing headers of the TBB")
@ -185,13 +202,17 @@ else ()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
endif()
# Get installed configuration of tbb
get_target_property (TARGET_TBB_IMPORT_CONFS TBB::tbb IMPORTED_CONFIGURATIONS)
list (GET TARGET_TBB_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
separate_arguments (CSF_TBB)
foreach (LIB IN LISTS CSF_TBB)
string(TOLOWER "${LIB}" LIB_LOWER)
string(TOUPPER "${LIB}" LIB_UPPER)
# Achive *.so files and directory containing it.
get_target_property (TBB_SO_FILE "TBB::${LIB_LOWER}" IMPORTED_LOCATION_RELEASE)
# Archive *.so files and directory containing it.
get_target_property (TBB_SO_FILE "TBB::${LIB_LOWER}" IMPORTED_LOCATION_${CHOSEN_IMPORT_CONF})
# Reserve cache variable for *.so.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_LIBRARY)
set (3RDPARTY_${LIB_UPPER}_LIBRARY "" CACHE FILEPATH "${LIB_UPPER} library (*.so)")

View File

@ -1,6 +1,6 @@
# tcl
if (NOT DEFINED INSTALL_TCL)
if (NOT DEFINED INSTALL_TCL AND NOT BUILD_USE_VCPKG)
set (INSTALL_TCL OFF CACHE BOOL "${INSTALL_TCL_DESCR}")
endif()
@ -14,6 +14,10 @@ if (NOT DEFINED 3RDPARTY_TCL_INCLUDE_DIR)
set (3RDPARTY_TCL_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of tcl")
endif()
if (BUILD_USE_VCPKG)
set (3RDPARTY_TCL_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" CACHE PATH "The directory containing tcl" FORCE)
set (3RDPARTY_TCL_INCLUDE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include" CACHE FILEPATH "The directory containing headers of tcl" FORCE)
endif()
# tcl library file (with absolute path)
if (NOT DEFINED 3RDPARTY_TCL_LIBRARY OR NOT 3RDPARTY_TCL_LIBRARY_DIR)
@ -269,13 +273,12 @@ if (TK_FOUND AND 3RDPARTY_TCL_DIR)
endif()
endif()
# unset all redundant variables
#TCL
OCCT_CHECK_AND_UNSET (TCL_LIBRARY)
OCCT_CHECK_AND_UNSET (TCL_INCLUDE_PATH)
OCCT_CHECK_AND_UNSET (TCL_TCLSH)
# hide all redundant variables
# TCL
mark_as_advanced (TCL_LIBRARY)
mark_as_advanced (TCL_INCLUDE_PATH)
mark_as_advanced (TCL_TCLSH)
#TK
OCCT_CHECK_AND_UNSET (TK_LIBRARY)
OCCT_CHECK_AND_UNSET (TK_INCLUDE_PATH)
OCCT_CHECK_AND_UNSET (TK_WISH)
mark_as_advanced (TK_LIBRARY)
mark_as_advanced (TK_INCLUDE_PATH)
mark_as_advanced (TK_WISH)

View File

@ -18,6 +18,12 @@ if (NOT DEFINED 3RDPARTY_TK_INCLUDE_DIR)
set (3RDPARTY_TK_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of tk")
endif()
# if (BUILD_USE_VCPKG)
# set (3RDPARTY_TK_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" CACHE PATH "The directory containing tk" FORCE)
# set (3RDPARTY_TCLTK_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" CACHE PATH "The directory containing tcltk" FORCE)
# set (3RDPARTY_TK_INCLUDE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include" CACHE FILEPATH "The directory containing headers of tk" FORCE)
# endif()
if (BUILD_SHARED_LIBS)
# tk library file (with absolute path)
if (NOT DEFINED 3RDPARTY_TK_LIBRARY OR NOT 3RDPARTY_TK_LIBRARY_DIR)
@ -190,7 +196,8 @@ if (BUILD_SHARED_LIBS)
if (3RDPARTY_TK_LIBRARY AND EXISTS "${3RDPARTY_TK_LIBRARY}")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_TK_LIBRARY_DIR}")
else()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_TK_LIBRARY_DIR)
set (USE_TK OFF)
message(STATUS "Warning: TK library is not found. TK will be disabled.")
endif()
if (WIN32)
@ -267,15 +274,15 @@ if (BUILD_SHARED_LIBS)
mark_as_advanced (3RDPARTY_TK_LIBRARY 3RDPARTY_TK_DLL)
endif()
# unset all redundant variables
#TCL
OCCT_CHECK_AND_UNSET (TCL_LIBRARY)
OCCT_CHECK_AND_UNSET (TCL_INCLUDE_PATH)
OCCT_CHECK_AND_UNSET (TCL_TCLSH)
# hide all redundant variables
mark_as_advanced (TCL_LIBRARY)
mark_as_advanced (TCL_INCLUDE_PATH)
mark_as_advanced (TCL_TCLSH)
#TK
OCCT_CHECK_AND_UNSET (TK_LIBRARY)
OCCT_CHECK_AND_UNSET (TK_INCLUDE_PATH)
OCCT_CHECK_AND_UNSET (TK_WISH)
mark_as_advanced (TK_LIBRARY)
mark_as_advanced (TK_INCLUDE_PATH)
mark_as_advanced (TK_WISH)
if (NOT BUILD_SHARED_LIBS)
OCCT_CHECK_AND_UNSET (3RDPARTY_TK_LIBRARY)

View File

@ -1,13 +1,5 @@
# variable description
#
set (BUILD_PATCH_DESCR
"Points to the directory recognized as a 'patch' for OCCT. If specified,
the files from this directory take precedence over the corresponding native
OCCT sources. This way you are able to introduce patches to Open CASCADE
Technology not affecting the original source distribution")
set (BUILD_LIBRARY_TYPE_DESCR
"Specifies the type of library to be created. 'Shared' libraries
are linked dynamically and loaded at runtime. 'Static' libraries
@ -48,6 +40,11 @@ set (BUILD_USE_PCH_DESCR
"Use precompiled headers to accelerate the build.
Precompiled headers are generated automatically by Cotire tool.")
set (BUILD_INCLUDE_SYMLINK_DESCR
"Include symbolic links to the source files in the build directory.
OFF - using a reference file with direct include to the origin,
ON - symbolic link to the origin file are created")
# install variables
set (INSTALL_DIR_DESCR
"The place where built OCCT libraries, headers, test cases (INSTALL_TEST_CASES variable),
@ -116,7 +113,6 @@ endmacro()
BUILD_MODULE_MESSAGE (BUILD_MODULE_ApplicationFramework "ApplicationFramework")
BUILD_MODULE_MESSAGE (BUILD_MODULE_DataExchange "DataExchange")
BUILD_MODULE_MESSAGE (BUILD_MODULE_DETools "DETools")
BUILD_MODULE_MESSAGE (BUILD_MODULE_Draw "Draw")
BUILD_MODULE_MESSAGE (BUILD_MODULE_FoundationClasses "FoundationClasses")
BUILD_MODULE_MESSAGE (BUILD_MODULE_ModelingAlgorithms "ModelingAlgorithms")
@ -140,13 +136,6 @@ set (BUILD_SAMPLES_QT_DESCR
These samples show some possibilities of using OCCT and they can be executed
with script samples.bat from the installation directory (INSTALL_DIR)")
set (BUILD_Inspector_DESCR
"Indicates whether OCCT inspector should be built together with OCCT.
This inspector provides functionality to interactively inspect low-level content
of the OCAF data model, OCCT viewer, etc. have been introduced in OCCT.
It can be executed with script inspector.bat from the installation directory (INSTALL_DIR) or
using 'tinspector' command in DRAW interpretator")
set (BUILD_MODULE_UwpSample_DESCR
"Indicates whether OCCT UWP sample should be built together with OCCT.")
@ -210,7 +199,30 @@ set (USE_XLIB_DESCR "Indicates whether X11 is used or not")
set (USE_D3D_DESCR "Indicates whether optional Direct3D wrapper in OCCT visualization module should be build or not")
# Documentation variables
set (BUILD_DOC_Overview_DESCR
"Build OCCT overview documentation using Doxygen")
set (BUILD_DOC_RefMan_DESCR
"Build OCCT reference manual documentation using Doxygen")
set (INSTALL_DOC_Overview_DESCR
"Install OCCT overview documentation")
set (INSTALL_DOC_RefMan_DESCR
"Install OCCT reference manual documentation")
macro (BUILD_MODULE MODULE_NAME)
set (ENABLE_MODULE TRUE)
set (BUILD_MODULE_${MODULE_NAME} ${ENABLE_MODULE} CACHE BOOL "${BUILD_MODULE_${MODULE_NAME}_DESCR}")
OCCT_INCLUDE_CMAKE_FILE (src/${MODULE_NAME}/TOOLKITS)
set (${MODULE_NAME}_TOOLKITS ${OCCT_${MODULE_NAME}_LIST_OF_TOOLKITS})
foreach (TOOLKIT ${OCCT_${MODULE_NAME}_LIST_OF_TOOLKITS})
OCCT_INCLUDE_CMAKE_FILE (src/${MODULE_NAME}/${TOOLKIT}/PACKAGES)
OCCT_INCLUDE_CMAKE_FILE (src/${MODULE_NAME}/${TOOLKIT}/EXTERNLIB)
OCCT_INCLUDE_CMAKE_FILE (src/${MODULE_NAME}/${TOOLKIT}/FILES)
foreach (PACKAGE ${OCCT_${TOOLKIT}_LIST_OF_PACKAGES})
OCCT_INCLUDE_CMAKE_FILE (src/${MODULE_NAME}/${TOOLKIT}/${PACKAGE}/FILES)
endforeach()
endforeach()
endmacro()

22
adm/cmake/version.cmake Normal file
View File

@ -0,0 +1,22 @@
#======================================================================
#
# Purpose: Defines macros identifying current version of Open CASCADE
#
# OCC_VERSION_MAJOR : (integer) number identifying major version
# OCC_VERSION_MINOR : (integer) number identifying minor version
# OCC_VERSION_MAINTENANCE : (integer) number identifying maintenance version
# OCC_VERSION_DEVELOPMENT : (string) if defined, indicates development or modified version
# in case of release, remove the value
#
# Sample values of OCC_VERSION_DEVELOPMENT:
# - "dev" for development version between releases
# - "beta..." or "rc..." for beta releases or release candidates
# - "project..." for version containing project-specific fixes
#
# For development version git commit hash can be added to the version string
#======================================================================
set (OCC_VERSION_MAJOR 8 )
set (OCC_VERSION_MINOR 0 )
set (OCC_VERSION_MAINTENANCE 0 )
set (OCC_VERSION_DEVELOPMENT "dev" )

View File

@ -1,5 +1,31 @@
# vtk
# vcpkg processing
if (BUILD_USE_VCPKG)
find_package(VTK REQUIRED
COMPONENTS
CommonCore
RenderingUI
RenderingOpenGL2
OPTIONAL_COMPONENTS
mpi
utf8
eigen
doubleconversion
lz4
lzma
expat
)
set(IS_VTK_9XX 1)
if (WIN32)
set (USED_3RDPARTY_VTK_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin")
else()
set (USED_3RDPARTY_VTK_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib")
endif()
list (APPEND 3RDPARTY_INCLUDE_DIRS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
return()
endif()
if (NOT DEFINED INSTALL_VTK)
set (INSTALL_VTK OFF CACHE BOOL "${INSTALL_VTK_DESCR}")
endif()
@ -12,7 +38,7 @@ endif()
# include occt macros. compiler_bitness, os_wiht_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
# specify VTK folder in connectin with 3RDPARTY_DIR
# specify VTK folder in connection with 3RDPARTY_DIR
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
#CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_VTK_DIR PATH "The directory containing VTK")
@ -60,7 +86,20 @@ if (3RDPARTY_VTK_DIR AND EXISTS "${3RDPARTY_VTK_DIR}")
set (ENV{VTK_DIR} "${3RDPARTY_VTK_DIR}")
endif()
find_package(VTK QUIET)
find_package(VTK QUIET
COMPONENTS
CommonCore
RenderingUI
RenderingOpenGL2
OPTIONAL_COMPONENTS
mpi
utf8
eigen
doubleconversion
lz4
lzma
expat
)
if (3RDPARTY_VTK_DIR AND EXISTS "${3RDPARTY_VTK_DIR}")
set (ENV{VTK_DIR} ${CACHED_VTK_DIR})
@ -200,7 +239,7 @@ endif()
if (3RDPARTY_VTK_INCLUDE_DIR AND EXISTS "${3RDPARTY_VTK_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS ${3RDPARTY_VTK_INCLUDE_DIR})
else()
elseif (NOT VTK_FOUND)
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_VTK_INCLUDE_DIR)
endif()
@ -302,6 +341,7 @@ if (NOT INSTALL_VTK)
endif()
endif()
OCCT_CHECK_AND_UNSET (VTK_INCLUDE_DIRS)
OCCT_CHECK_AND_UNSET (VTK_LIBRARY_DIRS)
OCCT_CHECK_AND_UNSET (VTK_DIR)
# hide some variables
mark_as_advanced (VTK_INCLUDE_DIRS)
mark_as_advanced (VTK_LIBRARY_DIRS)
mark_as_advanced (VTK_DIR)

View File

@ -1,748 +0,0 @@
#!/usr/bin/tclsh
# =======================================================================
# Created on: 2012-01-26
# Created by: Kirill GAVRILOV
# Copyright (c) 2012 OPEN CASCADE SAS
#
# This file is part of Open CASCADE Technology software library.
#
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License version 2.1 as published
# by the Free Software Foundation, with special exception defined in the file
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
# distribution for complete text of the license and disclaimer of any warranty.
#
# Alternatively, this file may be used under the terms of Open CASCADE
# commercial license or contractual agreement.
# =======================================================================
# GUI procedure for search of third-party tools and generation of environment
# customization script
# =======================================================================
# load tools
source [file join [file dirname [info script]] genconfdeps.tcl]
# proxy variable for implicit file path normalization
set PRODUCTS_PATH_INPUT "$::PRODUCTS_PATH"
package require Tk
set aRowIter 0
set aCheckRowIter 0
frame .myFrame -padx 5 -pady 5
pack .myFrame -fill both -expand 1
frame .myFrame.myPrjFrame
frame .myFrame.myVsFrame
frame .myFrame.myHxxChecks
frame .myFrame.myChecks
# project file format
set SYS_PRJFMT_LIST {}
set SYS_PRJNAME_LIST {}
if { "$::tcl_platform(platform)" == "windows" } {
lappend ::SYS_PRJFMT_LIST "vcxproj"
lappend ::SYS_PRJNAME_LIST "Visual Studio (.vcxproj)"
}
if { "$tcl_platform(os)" == "Darwin" } {
lappend ::SYS_PRJFMT_LIST "xcd"
lappend ::SYS_PRJNAME_LIST "XCode (.xcd)"
}
lappend ::SYS_PRJFMT_LIST "cbp"
lappend ::SYS_PRJNAME_LIST "Code Blocks (.cbp)"
lappend ::SYS_PRJFMT_LIST "pro"
lappend ::SYS_PRJNAME_LIST "Qt Creator (.pro)"
set aPrjIndex [lsearch $::SYS_PRJFMT_LIST $::PRJFMT]
set ::PRJNAME [lindex $::SYS_PRJNAME_LIST $aPrjIndex]
set ::CONFIG "Release"
set SYS_VS_LIST {}
set SYS_VC_LIST {}
set SYS_VCVARS_LIST {}
# detect installed Visual Studio 2017+ instances by running vswhere.exe
if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2017 (15, toolset v141)"
lappend ::SYS_VC_LIST "vc141"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2017 (15, toolset v141) UWP"
lappend ::SYS_VC_LIST "vc141-uwp"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset v142)"
lappend ::SYS_VC_LIST "vc142"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset v142) UWP"
lappend ::SYS_VC_LIST "vc142-uwp"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Component.VC.ClangCL -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset ClangCL)"
lappend ::SYS_VC_LIST "vclang"
lappend ::SYS_VCVARS_LIST "$res\\VC\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[17.0,17.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2022 (17, toolset v143)"
lappend ::SYS_VC_LIST "vc143"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[17.0,17.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2022 (17, toolset v143) UWP"
lappend ::SYS_VC_LIST "vc143-uwp"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[17.0,17.99\]" -latest -requires Microsoft.VisualStudio.Component.VC.ClangCL -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2022 (17, toolset ClangCL)"
lappend ::SYS_VC_LIST "vclang"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
# detect installed Visual Studio instances from global environment
if { [info exists ::env(VS140COMNTOOLS)] } {
lappend ::SYS_VS_LIST "Visual Studio 2015 (14, toolset v140)"
lappend ::SYS_VC_LIST "vc14"
lappend ::SYS_VCVARS_LIST "%VS140COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
lappend ::SYS_VS_LIST "Visual Studio 2015 (14, toolset v140) UWP"
lappend ::SYS_VC_LIST "vc14-uwp"
lappend ::SYS_VCVARS_LIST "%VS140COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
}
if { [info exists ::env(VS120COMNTOOLS)] } {
lappend ::SYS_VS_LIST "Visual Studio 2013 (12, toolset v120)"
lappend ::SYS_VC_LIST "vc12"
lappend ::SYS_VCVARS_LIST "%VS120COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
}
if { [info exists ::env(VS110COMNTOOLS)] } {
lappend ::SYS_VS_LIST "Visual Studio 2012 (11, toolset v110)"
lappend ::SYS_VC_LIST "vc11"
lappend ::SYS_VCVARS_LIST "%VS110COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
}
if { [info exists ::env(VS100COMNTOOLS)] } {
lappend ::SYS_VS_LIST "Visual Studio 2010 (10, toolset v100)"
lappend ::SYS_VC_LIST "vc10"
lappend ::SYS_VCVARS_LIST "%VS100COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
}
if { [info exists ::env(VS90COMNTOOLS)] } {
lappend ::SYS_VS_LIST "Visual Studio 2008 (9, toolset v90)"
lappend ::SYS_VC_LIST "vc9"
lappend ::SYS_VCVARS_LIST "%VS90COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
}
if { [info exists ::env(VS80COMNTOOLS)] } {
lappend ::SYS_VS_LIST "Visual Studio 2005 (8, toolset v80)"
lappend ::SYS_VC_LIST "vc8"
lappend ::SYS_VCVARS_LIST "%VS80COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
}
lappend ::SYS_VS_LIST "Custom"
lappend ::SYS_VC_LIST "vcX"
lappend ::SYS_VCVARS_LIST "%VSXXCOMNTOOLS%..\\..\\VC\\vcvarsall.bat"
set aVcVerIndex [lsearch $::SYS_VC_LIST $::VCVER]
set ::VSVER [lindex $::SYS_VS_LIST $aVcVerIndex]
if { "$::VCVARS" == "" } {
set ::VCVARS [lindex $::SYS_VCVARS_LIST $aVcVerIndex]
}
proc wokdep:gui:Close {} {
# if changed ask
exit
}
proc wokdep:gui:configSuffix {} {
if { "$::CONFIG" == "Debug" } {
return "D"
}
return ""
}
proc wokdep:gui:SwitchConfig {} {
set ::PRJFMT [lindex $::SYS_PRJFMT_LIST [.myFrame.myPrjFrame.myPrjCombo current]]
set ::VCVER [lindex $::SYS_VC_LIST [.myFrame.myVsFrame.myVsCombo current]]
set ::VCVARS [lindex $::SYS_VCVARS_LIST [.myFrame.myVsFrame.myVsCombo current]]
set ::CSF_OPT_INC {}
set ::CSF_OPT_LIB32 {}
set ::CSF_OPT_LIB64 {}
set ::CSF_OPT_BIN32 {}
set ::CSF_OPT_BIN64 {}
set ::CSF_OPT_LIB32D {}
set ::CSF_OPT_LIB64D {}
set ::CSF_OPT_BIN32D {}
set ::CSF_OPT_BIN64D {}
wokdep:gui:UpdateList
}
proc wokdep:gui:SwitchArch {} {
wokdep:gui:Show3264Bitness ::aRowIter
if { [llength [grid info .myFrame.mySave]] != 0 } {
grid forget .myFrame.mySave .myFrame.myClose
}
# Bottom section
grid .myFrame.mySave -row $::aRowIter -column 4 -columnspan 2
grid .myFrame.myClose -row $::aRowIter -column 6 -columnspan 2
}
# update label text and visibility
font create wokdep:gui:EmptyFont -size -1
proc wokdep:gui:SetLabelText {theLabel theText} {
set aFont TkDefaultFont
if { $theText == "" } {
set aFont wokdep:gui:EmptyFont
}
$theLabel configure -text $theText -font $aFont
}
proc wokdep:gui:UpdateList {} {
set anIncErrs {}
set anLib32Errs {}
set anLib64Errs {}
set anBin32Errs {}
set anBin64Errs {}
wokdep:SearchTclTk anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
if { "$::HAVE_FREETYPE" == "true" } {
wokdep:SearchFreeType anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
wokdep:SearchX11 anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
if { "$::HAVE_GLES2" == "true" } {
wokdep:SearchEGL anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
wokdep:SearchGLES anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::HAVE_FREEIMAGE" == "true" } {
wokdep:SearchFreeImage anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::HAVE_FFMPEG" == "true" } {
wokdep:SearchFFmpeg anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::HAVE_OPENVR" == "true" } {
wokdep:SearchOpenVR anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::HAVE_TBB" == "true" } {
wokdep:SearchTBB anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
# if { "$::HAVE_OPENCL" == "true" } {
# wokdep:SearchOpenCL anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
# }
if { "$::HAVE_VTK" == "true" } {
wokdep:SearchVTK anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::HAVE_ZLIB" == "true" } {
set aCheckLib "z"
if { "$::tcl_platform(platform)" == "windows" } {
set aCheckLib "zlib"
}
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "zlib" "zlib.h" "$aCheckLib" {"zlib"}
}
if { "$::HAVE_LIBLZMA" == "true" } {
set aCheckLib "lzma"
if { "$::tcl_platform(platform)" == "windows" } {
set aCheckLib "liblzma"
}
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "liblzma" "lzma.h" "$aCheckLib" {"lzma" "xz"}
}
if { "$::HAVE_E57" == "true" } {
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "e57" "e57/E57Foundation.h" "E57RefImpl" {"e57"}
set aCheckLib "xerces-c"
if { "$::tcl_platform(platform)" == "windows" } {
set aCheckLib "xerces-c_3"
}
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "xerces-c" "xercesc/sax2/XMLReaderFactory.hpp" "$aCheckLib" {"xerces"}
}
if { "$::HAVE_RAPIDJSON" == "true" } {
wokdep:SearchRapidJson anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::HAVE_DRACO" == "true" } {
set aDummy {}
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs aDummy aDummy "draco" "draco/compression/decode.h" "draco" {"draco"}
}
if {"$::BUILD_Inspector" == "true" } {
set ::CHECK_QT "true"
}
if { "$::CHECK_QT" == "true" } {
wokdep:SearchQt anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::CHECK_JDK" == "true" } {
wokdep:SearchJDK anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
wokdep:gui:SetLabelText .myFrame.myIncErrLbl [join $anIncErrs "\n"]
wokdep:gui:SetLabelText .myFrame.myIncErrLbl [join $anIncErrs "\n"]
wokdep:gui:SetLabelText .myFrame.myLib32_ErrLbl [join $anLib32Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myLib64_ErrLbl [join $anLib64Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myBin32_ErrLbl [join $anBin32Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myBin64_ErrLbl [join $anBin64Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myLib32D_ErrLbl [join $anLib32Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myLib64D_ErrLbl [join $anLib64Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myBin32D_ErrLbl [join $anBin32Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myBin64D_ErrLbl [join $anBin64Errs "\n"]
# merge duplicates
set ::CSF_OPT_LIB32 [lsort -unique $::CSF_OPT_LIB32]
set ::CSF_OPT_LIB64 [lsort -unique $::CSF_OPT_LIB64]
set ::CSF_OPT_BIN32 [lsort -unique $::CSF_OPT_BIN32]
set ::CSF_OPT_BIN64 [lsort -unique $::CSF_OPT_BIN64]
set ::CSF_OPT_LIB32D [lsort -unique $::CSF_OPT_LIB32D]
set ::CSF_OPT_LIB64D [lsort -unique $::CSF_OPT_LIB64D]
set ::CSF_OPT_BIN32D [lsort -unique $::CSF_OPT_BIN32D]
set ::CSF_OPT_BIN64D [lsort -unique $::CSF_OPT_BIN64D]
}
proc wokdep:gui:BrowseVcVars {} {
set aResult [tk_chooseDirectory -initialdir $::VCVARS -title "Choose a directory"]
if { "$aResult" != "" } {
set ::VCVARS $aResult
}
}
proc wokdep:gui:BrowsePartiesRoot {} {
set aResult [tk_chooseDirectory -initialdir $::PRODUCTS_PATH_INPUT -title "Choose a directory"]
if { "$aResult" != "" } {
set ::PRODUCTS_PATH_INPUT $aResult
wokdep:gui:UpdateList
}
}
proc wokdep:gui:AddIncPath {} {
set aResult [tk_chooseDirectory -title "Choose a directory"]
if { "$aResult" != "" } {
lappend ::CSF_OPT_INC "$aResult"
wokdep:gui:UpdateList
}
}
proc wokdep:gui:AddLibPath {} {
set aCfg [wokdep:gui:configSuffix]
set aResult [tk_chooseDirectory -title "Choose a directory"]
if { "$aResult" != "" } {
lappend ::CSF_OPT_LIB${::ARCH}${aCfg} "$aResult"
wokdep:gui:UpdateList
}
}
proc wokdep:gui:AddBinPath {} {
set aCfg [wokdep:gui:configSuffix]
set aResult [tk_chooseDirectory -title "Choose a directory"]
if { "$aResult" != "" } {
lappend ::CSF_OPT_BIN${::ARCH}${aCfg} "$aResult"
wokdep:gui:UpdateList
}
}
proc wokdep:gui:RemoveIncPath {} {
set aSelIndices [.myFrame.myIncList curselection]
if { [llength $aSelIndices] != 0 } {
.myFrame.myIncList delete [lindex $aSelIndices 0]
}
wokdep:gui:UpdateList
}
proc wokdep:gui:RemoveLibPath {} {
set aCfg [wokdep:gui:configSuffix]
set aSelIndices [.myFrame.myLib${::ARCH}${aCfg}_List curselection]
if { [llength $aSelIndices] != 0 } {
.myFrame.myLib${::ARCH}${aCfg}_List delete [lindex $aSelIndices 0]
}
wokdep:gui:UpdateList
}
proc wokdep:gui:RemoveBinPath {} {
set aCfg [wokdep:gui:configSuffix]
set aSelIndices [.myFrame.myBin${::ARCH}${aCfg}_List curselection]
if { [llength $aSelIndices] != 0 } {
.myFrame.myBin${::ARCH}${aCfg}_List delete [lindex $aSelIndices 0]
}
wokdep:gui:UpdateList
}
proc wokdep:gui:ResetIncPath {} {
set ::CSF_OPT_INC {}
wokdep:gui:UpdateList
}
proc wokdep:gui:ResetLibPath {} {
set ::CSF_OPT_LIB${::ARCH} {}
set ::CSF_OPT_LIB${::ARCH}D {}
set ::CSF_OPT_BIN${::ARCH} {}
set ::CSF_OPT_BIN${::ARCH}D {}
wokdep:gui:UpdateList
}
proc wokdep:gui:Show3264Bitness { theRowIter } {
upvar $theRowIter aRowIter
set aArchOld ""
set aCfg [wokdep:gui:configSuffix]
if { "$::ARCH" == "32" } {
set aArchOld "64"
} else {
set aArchOld "32"
}
set aCfgOld "D"
if { "$::CONFIG" == "Debug" } { set aCfgOld "" }
set aDelArch ${aArchOld}${aCfg}
if { [llength [grid info .myFrame.myLib${aDelArch}_Lbl]] != 0 } {
grid forget .myFrame.myLib${aDelArch}_Lbl .myFrame.myLib${aDelArch}_List .myFrame.myLib${aDelArch}_Scrl
grid forget .myFrame.myLib${aDelArch}_Add .myFrame.myLib${aDelArch}_Remove .myFrame.myLib${aDelArch}_Clear .myFrame.myLib${aDelArch}_ErrLbl
grid forget .myFrame.myBin${aDelArch}_Lbl .myFrame.myBin${aDelArch}_List .myFrame.myBin${aDelArch}_Scrl
grid forget .myFrame.myBin${aDelArch}_Add .myFrame.myBin${aDelArch}_Remove .myFrame.myBin${aDelArch}_Clear .myFrame.myBin${aDelArch}_ErrLbl
}
set aDelCfg ${::ARCH}${aCfgOld}
if { [llength [grid info .myFrame.myLib${aDelCfg}_Lbl]] != 0 } {
grid forget .myFrame.myLib${aDelCfg}_Lbl .myFrame.myLib${aDelCfg}_List .myFrame.myLib${aDelCfg}_Scrl
grid forget .myFrame.myLib${aDelCfg}_Add .myFrame.myLib${aDelCfg}_Remove .myFrame.myLib${aDelCfg}_Clear .myFrame.myLib${aDelCfg}_ErrLbl
grid forget .myFrame.myBin${aDelCfg}_Lbl .myFrame.myBin${aDelCfg}_List .myFrame.myBin${aDelCfg}_Scrl
grid forget .myFrame.myBin${aDelCfg}_Add .myFrame.myBin${aDelCfg}_Remove .myFrame.myBin${aDelCfg}_Clear .myFrame.myBin${aDelCfg}_ErrLbl
}
set aNewCfg ${::ARCH}${aCfg}
# Additional libraries search paths
grid .myFrame.myLib${aNewCfg}_Lbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.myLib${aNewCfg}_List -row $aRowIter -column 0 -rowspan 4 -columnspan 5
grid .myFrame.myLib${aNewCfg}_Scrl -row $aRowIter -column 5 -rowspan 4
grid .myFrame.myLib${aNewCfg}_Add -row $aRowIter -column 6
incr aRowIter
#grid .myFrame.myLib${aNewCfg}_Edit -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib${aNewCfg}_Remove -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib${aNewCfg}_Clear -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib${aNewCfg}_ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
# Additional executables search paths
grid .myFrame.myBin${aNewCfg}_Lbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.myBin${aNewCfg}_List -row $aRowIter -column 0 -rowspan 4 -columnspan 5
grid .myFrame.myBin${aNewCfg}_Scrl -row $aRowIter -column 5 -rowspan 4
grid .myFrame.myBin${aNewCfg}_Add -row $aRowIter -column 6
incr aRowIter
#grid .myFrame.myBin${aNewCfg}_Edit -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin${aNewCfg}_Remove -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin${aNewCfg}_Clear -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin${aNewCfg}_ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
}
# Header
ttk::label .myFrame.myPrjFrame.myPrjLbl -text "Project format:" -padding {5 5 20 5}
ttk::combobox .myFrame.myPrjFrame.myPrjCombo -values $SYS_PRJNAME_LIST -state readonly -textvariable PRJNAME -width 40
ttk::label .myFrame.myVsFrame.myVsLbl -text "Visual Studio configuration:" -padding {5 5 20 5}
ttk::combobox .myFrame.myVsFrame.myVsCombo -values $SYS_VS_LIST -state readonly -textvariable VSVER -width 40
ttk::combobox .myFrame.myVsFrame.myArchCombo -values { {32} {64} } -textvariable ARCH -state readonly -width 6
ttk::combobox .myFrame.myVsFrame.myConfigCombo -values { {Release} {Debug} } -textvariable CONFIG -state readonly -width 6
entry .myFrame.myVcEntry -textvariable VCVER -width 10
entry .myFrame.myVcVarsEntry -textvariable VCVARS -width 70
ttk::button .myFrame.myVcBrowseBtn -text "Browse" -command wokdep:gui:BrowseVcVars
ttk::label .myFrame.myHxxChecks.myRelDebInfoLbl -text "Release with Debug info"
checkbutton .myFrame.myHxxChecks.myRelDebInfoCheck -offvalue "false" -onvalue "true" -variable HAVE_RelWithDebInfo
#
ttk::combobox .myFrame.myHxxChecks.myScutsCombo -values { {ShortCut} {Copy} {HardLink} } -textvariable SHORTCUT_HEADERS -state readonly -width 12
ttk::label .myFrame.myHxxChecks.myScutsLbl -text "Strategy for filling headers folder inc:"
#
ttk::label .myFrame.mySrchLbl -text "3rd-parties search path:" -padding {5 5 80 5}
entry .myFrame.mySrchEntry -textvariable PRODUCTS_PATH_INPUT -width 80
ttk::button .myFrame.mySrchBrowseBtn -text "Browse" -command wokdep:gui:BrowsePartiesRoot
checkbutton .myFrame.myChecks.myFreeTypeCheck -offvalue "false" -onvalue "true" -variable HAVE_FREETYPE -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myFreeTypeLbl -text "Use FreeType"
checkbutton .myFrame.myChecks.myFImageCheck -offvalue "false" -onvalue "true" -variable HAVE_FREEIMAGE -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myFImageLbl -text "Use FreeImage"
checkbutton .myFrame.myChecks.myTbbCheck -offvalue "false" -onvalue "true" -variable HAVE_TBB -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myTbbLbl -text "Use Intel TBB"
checkbutton .myFrame.myChecks.myOpenVrCheck -offvalue "false" -onvalue "true" -variable HAVE_OPENVR -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myOpenVrLbl -text "Use OpenVR"
if { "$::tcl_platform(os)" != "Darwin" } {
checkbutton .myFrame.myChecks.myGlesCheck -offvalue "false" -onvalue "true" -variable HAVE_GLES2 -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myGlesLbl -text "Use OpenGL ES"
}
if { "$::tcl_platform(platform)" == "windows" } {
checkbutton .myFrame.myChecks.myD3dCheck -offvalue "false" -onvalue "true" -variable HAVE_D3D -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myD3dLbl -text "Use Direct3D"
}
checkbutton .myFrame.myChecks.myFFmpegCheck -offvalue "false" -onvalue "true" -variable HAVE_FFMPEG -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myFFmpegLbl -text "Use FFmpeg"
#checkbutton .myFrame.myChecks.myOpenClCheck -offvalue "false" -onvalue "true" -variable HAVE_OPENCL -command wokdep:gui:UpdateList
#ttk::label .myFrame.myChecks.myOpenClLbl -text "Use OpenCL"
checkbutton .myFrame.myChecks.myRapidJsonCheck -offvalue "false" -onvalue "true" -variable HAVE_RAPIDJSON -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myRapidJsonLbl -text "Use RapidJSON"
checkbutton .myFrame.myChecks.myDracoCheck -offvalue "false" -onvalue "true" -variable HAVE_DRACO -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myDracoLbl -text "Use Draco"
checkbutton .myFrame.myChecks.myXLibCheck -offvalue "false" -onvalue "true" -variable HAVE_XLIB
ttk::label .myFrame.myChecks.myXLibLbl -text "Use X11 for windows drawing"
ttk::label .myFrame.myChecks.myVtkLbl -text "Use VTK"
checkbutton .myFrame.myChecks.myVtkCheck -offvalue "false" -onvalue "true" -variable HAVE_VTK -command wokdep:gui:UpdateList
checkbutton .myFrame.myChecks.myZLibCheck -offvalue "false" -onvalue "true" -variable HAVE_ZLIB -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myZLibLbl -text "Use zlib"
checkbutton .myFrame.myChecks.myLzmaCheck -offvalue "false" -onvalue "true" -variable HAVE_LIBLZMA -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myLzmaLbl -text "Use liblzma"
checkbutton .myFrame.myChecks.myE57Check -offvalue "false" -onvalue "true" -variable HAVE_E57 -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myE57Lbl -text "Use E57"
checkbutton .myFrame.myChecks.myQtCheck -offvalue "false" -onvalue "true" -variable CHECK_QT -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myQtLbl -text "Search Qt"
checkbutton .myFrame.myChecks.myJDKCheck -offvalue "false" -onvalue "true" -variable CHECK_JDK -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myJDKLbl -text "Search JDK"
if { "$::tcl_platform(platform)" == "windows" } {
checkbutton .myFrame.myChecks.myInspectorBuild -offvalue "false" -onvalue "true" -variable BUILD_Inspector -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myInspectorLbl -text "Build Inspector"
}
# Additional headers search paths
ttk::label .myFrame.myIncLbl -text "Additional headers search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myIncScrl -command ".myFrame.myIncList yview"
listbox .myFrame.myIncList -listvariable CSF_OPT_INC -width 80 -height 5 -yscrollcommand ".myFrame.myIncScrl set"
ttk::button .myFrame.myIncAdd -text "Add" -command wokdep:gui:AddIncPath
ttk::button .myFrame.myIncEdit -text "Edit"
ttk::button .myFrame.myIncRemove -text "Remove" -command wokdep:gui:RemoveIncPath
ttk::button .myFrame.myIncClear -text "Reset" -command wokdep:gui:ResetIncPath
ttk::label .myFrame.myIncErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional libraries (32-bit) search paths
ttk::label .myFrame.myLib32_Lbl -text "Additional libraries (32-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myLib32_Scrl -command ".myFrame.myLib32_List yview"
listbox .myFrame.myLib32_List -listvariable CSF_OPT_LIB32 -width 80 -height 5 -yscrollcommand ".myFrame.myLib32_Scrl set"
ttk::button .myFrame.myLib32_Add -text "Add" -command wokdep:gui:AddLibPath
ttk::button .myFrame.myLib32_Edit -text "Edit"
ttk::button .myFrame.myLib32_Remove -text "Remove" -command wokdep:gui:RemoveLibPath
ttk::button .myFrame.myLib32_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myLib32_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional debug libraries (32-bit) search paths
ttk::label .myFrame.myLib32D_Lbl -text "Additional debug libraries (32-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myLib32D_Scrl -command ".myFrame.myLib32D_List yview"
listbox .myFrame.myLib32D_List -listvariable CSF_OPT_LIB32D -width 80 -height 5 -yscrollcommand ".myFrame.myLib32D_Scrl set"
ttk::button .myFrame.myLib32D_Add -text "Add" -command wokdep:gui:AddLibPath
ttk::button .myFrame.myLib32D_Edit -text "Edit"
ttk::button .myFrame.myLib32D_Remove -text "Remove" -command wokdep:gui:RemoveLibPath
ttk::button .myFrame.myLib32D_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myLib32D_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional libraries (64-bit) search paths
ttk::label .myFrame.myLib64_Lbl -text "Additional libraries (64-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myLib64_Scrl -command ".myFrame.myLib64_List yview"
listbox .myFrame.myLib64_List -listvariable CSF_OPT_LIB64 -width 80 -height 5 -yscrollcommand ".myFrame.myLib64_Scrl set"
ttk::button .myFrame.myLib64_Add -text "Add" -command wokdep:gui:AddLibPath
ttk::button .myFrame.myLib64_Edit -text "Edit"
ttk::button .myFrame.myLib64_Remove -text "Remove" -command wokdep:gui:RemoveLibPath
ttk::button .myFrame.myLib64_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myLib64_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional debug libraries (64-bit) search paths
ttk::label .myFrame.myLib64D_Lbl -text "Additional debug libraries (64-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myLib64D_Scrl -command ".myFrame.myLib64D_List yview"
listbox .myFrame.myLib64D_List -listvariable CSF_OPT_LIB64D -width 80 -height 5 -yscrollcommand ".myFrame.myLib64D_Scrl set"
ttk::button .myFrame.myLib64D_Add -text "Add" -command wokdep:gui:AddLibPath
ttk::button .myFrame.myLib64D_Edit -text "Edit"
ttk::button .myFrame.myLib64D_Remove -text "Remove" -command wokdep:gui:RemoveLibPath
ttk::button .myFrame.myLib64D_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myLib64D_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional executables (32-bit) search paths
ttk::label .myFrame.myBin32_Lbl -text "Additional executables (32-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myBin32_Scrl -command ".myFrame.myBin32_List yview"
listbox .myFrame.myBin32_List -listvariable CSF_OPT_BIN32 -width 80 -height 5 -yscrollcommand ".myFrame.myBin32_Scrl set"
ttk::button .myFrame.myBin32_Add -text "Add" -command wokdep:gui:AddBinPath
ttk::button .myFrame.myBin32_Edit -text "Edit"
ttk::button .myFrame.myBin32_Remove -text "Remove" -command wokdep:gui:RemoveBinPath
ttk::button .myFrame.myBin32_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myBin32_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional debug executables (32-bit) search paths
ttk::label .myFrame.myBin32D_Lbl -text "Additional debug executables (32-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myBin32D_Scrl -command ".myFrame.myBin32D_List yview"
listbox .myFrame.myBin32D_List -listvariable CSF_OPT_BIN32D -width 80 -height 5 -yscrollcommand ".myFrame.myBin32D_Scrl set"
ttk::button .myFrame.myBin32D_Add -text "Add" -command wokdep:gui:AddBinPath
ttk::button .myFrame.myBin32D_Edit -text "Edit"
ttk::button .myFrame.myBin32D_Remove -text "Remove" -command wokdep:gui:RemoveBinPath
ttk::button .myFrame.myBin32D_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myBin32D_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional executables (64-bit) search paths
ttk::label .myFrame.myBin64_Lbl -text "Additional executables (64-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myBin64_Scrl -command ".myFrame.myBin64_List yview"
listbox .myFrame.myBin64_List -listvariable CSF_OPT_BIN64 -width 80 -height 5 -yscrollcommand ".myFrame.myBin64_Scrl set"
ttk::button .myFrame.myBin64_Add -text "Add" -command wokdep:gui:AddBinPath
ttk::button .myFrame.myBin64_Edit -text "Edit"
ttk::button .myFrame.myBin64_Remove -text "Remove" -command wokdep:gui:RemoveBinPath
ttk::button .myFrame.myBin64_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myBin64_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional debug executables (64-bit) search paths
ttk::label .myFrame.myBin64D_Lbl -text "Additional debug executables (64-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myBin64D_Scrl -command ".myFrame.myBin64D_List yview"
listbox .myFrame.myBin64D_List -listvariable CSF_OPT_BIN64D -width 80 -height 5 -yscrollcommand ".myFrame.myBin64D_Scrl set"
ttk::button .myFrame.myBin64D_Add -text "Add" -command wokdep:gui:AddBinPath
ttk::button .myFrame.myBin64D_Edit -text "Edit"
ttk::button .myFrame.myBin64D_Remove -text "Remove" -command wokdep:gui:RemoveBinPath
ttk::button .myFrame.myBin64D_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myBin64D_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Bottom
ttk::button .myFrame.mySave -text "Save" -command wokdep:SaveCustom
ttk::button .myFrame.myClose -text "Close" -command wokdep:gui:Close
# Create grid
# Header
grid .myFrame.myPrjFrame -row $aRowIter -column 0 -columnspan 10 -sticky w
grid .myFrame.myPrjFrame.myPrjLbl -row 0 -column 0
grid .myFrame.myPrjFrame.myPrjCombo -row 0 -column 1
if { "$tcl_platform(platform)" == "windows" } {
incr aRowIter
grid .myFrame.myVsFrame -row $aRowIter -column 0 -columnspan 10 -sticky w
grid .myFrame.myVsFrame.myVsLbl -row 0 -column 0
grid .myFrame.myVsFrame.myVsCombo -row 0 -column 1 -padx 5
grid .myFrame.myVsFrame.myArchCombo -row 0 -column 2
grid .myFrame.myVsFrame.myConfigCombo -row 0 -column 3
incr aRowIter
grid .myFrame.myVcEntry -row $aRowIter -column 0
grid .myFrame.myVcVarsEntry -row $aRowIter -column 1 -columnspan 4 -sticky w
grid .myFrame.myVcBrowseBtn -row $aRowIter -column 6
incr aRowIter
} else {
grid .myFrame.myVsFrame -row $aRowIter -column 4 -sticky w
grid .myFrame.myVsFrame.myConfigCombo -row 0 -column 0
incr aRowIter
}
#
grid .myFrame.myHxxChecks -row $aRowIter -column 0 -columnspan 10 -sticky w
grid .myFrame.myHxxChecks.myScutsLbl -row 0 -column 0
grid .myFrame.myHxxChecks.myScutsCombo -row 0 -column 1
if { "$tcl_platform(platform)" == "windows" } {
grid .myFrame.myHxxChecks.myRelDebInfoCheck -row 0 -column 2
grid .myFrame.myHxxChecks.myRelDebInfoLbl -row 0 -column 3
}
incr aRowIter
#
grid .myFrame.mySrchLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.mySrchEntry -row $aRowIter -column 0 -columnspan 5
grid .myFrame.mySrchBrowseBtn -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myChecks -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.myChecks.myFreeTypeCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myFreeTypeLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myRapidJsonCheck -row $aCheckRowIter -column 2 -sticky e
grid .myFrame.myChecks.myRapidJsonLbl -row $aCheckRowIter -column 3 -sticky w
if { "$::tcl_platform(os)" != "Darwin" } {
grid .myFrame.myChecks.myGlesCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myGlesLbl -row $aCheckRowIter -column 5 -sticky w
}
#grid .myFrame.myChecks.myOpenClCheck -row $aCheckRowIter -column 6 -sticky e
#grid .myFrame.myChecks.myOpenClLbl -row $aCheckRowIter -column 7 -sticky w
grid .myFrame.myChecks.myZLibCheck -row $aCheckRowIter -column 6 -sticky e
grid .myFrame.myChecks.myZLibLbl -row $aCheckRowIter -column 7 -sticky w
grid .myFrame.myChecks.myQtCheck -row $aCheckRowIter -column 12 -sticky e
grid .myFrame.myChecks.myQtLbl -row $aCheckRowIter -column 13 -sticky w
incr aCheckRowIter
grid .myFrame.myChecks.myFImageCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myFImageLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myDracoCheck -row $aCheckRowIter -column 2 -sticky e
grid .myFrame.myChecks.myDracoLbl -row $aCheckRowIter -column 3 -sticky w
if { "$::tcl_platform(platform)" == "windows" } {
grid .myFrame.myChecks.myD3dCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myD3dLbl -row $aCheckRowIter -column 5 -sticky w
} else {
grid .myFrame.myChecks.myXLibCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myXLibLbl -row $aCheckRowIter -column 5 -sticky w
}
grid .myFrame.myChecks.myLzmaCheck -row $aCheckRowIter -column 6 -sticky e
grid .myFrame.myChecks.myLzmaLbl -row $aCheckRowIter -column 7 -sticky w
grid .myFrame.myChecks.myJDKCheck -row $aCheckRowIter -column 12 -sticky e
grid .myFrame.myChecks.myJDKLbl -row $aCheckRowIter -column 13 -sticky w
incr aCheckRowIter
grid .myFrame.myChecks.myFFmpegCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myFFmpegLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myVtkCheck -row $aCheckRowIter -column 2 -sticky e
grid .myFrame.myChecks.myVtkLbl -row $aCheckRowIter -column 3 -sticky w
grid .myFrame.myChecks.myOpenVrCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myOpenVrLbl -row $aCheckRowIter -column 5 -sticky w
grid .myFrame.myChecks.myE57Check -row $aCheckRowIter -column 6 -sticky e
grid .myFrame.myChecks.myE57Lbl -row $aCheckRowIter -column 7 -sticky w
if { "$::tcl_platform(platform)" == "windows" } {
grid .myFrame.myChecks.myInspectorBuild -row $aCheckRowIter -column 12 -sticky e
grid .myFrame.myChecks.myInspectorLbl -row $aCheckRowIter -column 13 -sticky w
}
incr aCheckRowIter
grid .myFrame.myChecks.myTbbCheck -row $aCheckRowIter -column 12 -sticky e
grid .myFrame.myChecks.myTbbLbl -row $aCheckRowIter -column 13 -sticky w
incr aCheckRowIter
# Additional headers search paths
grid .myFrame.myIncLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.myIncList -row $aRowIter -column 0 -rowspan 4 -columnspan 5
grid .myFrame.myIncScrl -row $aRowIter -column 5 -rowspan 4
grid .myFrame.myIncAdd -row $aRowIter -column 6
incr aRowIter
#grid .myFrame.myIncEdit -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myIncRemove -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myIncClear -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myIncErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
# Additional search paths
wokdep:gui:Show3264Bitness aRowIter
# Bottom section
grid .myFrame.mySave -row $aRowIter -column 4 -columnspan 2
grid .myFrame.myClose -row $aRowIter -column 6 -columnspan 2
# Bind events
bind .myFrame.myPrjFrame.myPrjCombo <<ComboboxSelected>> {
wokdep:gui:SwitchConfig
}
bind .myFrame.myVsFrame.myVsCombo <<ComboboxSelected>> {
wokdep:gui:SwitchConfig
}
bind .myFrame.myVsFrame.myArchCombo <<ComboboxSelected>> {
wokdep:gui:SwitchArch
}
bind .myFrame.myVsFrame.myConfigCombo <<ComboboxSelected>> {
wokdep:gui:SwitchArch
}
.myFrame.mySrchEntry configure -validate all -validatecommand {
set ::PRODUCTS_PATH [file normalize "$::PRODUCTS_PATH_INPUT"]
#return [file exists "$::PRODUCTS_PATH"]
wokdep:gui:UpdateList
return 1
}
wokdep:gui:UpdateList

File diff suppressed because it is too large Load Diff

View File

@ -1,906 +0,0 @@
# =======================================================================
# Created on: 2014-03-21
# Created by: OMY
# Copyright (c) 1996-1999 Matra Datavision
# Copyright (c) 1999-2014 OPEN CASCADE SAS
#
# This file is part of Open CASCADE Technology software library.
#
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License version 2.1 as published
# by the Free Software Foundation, with special exception defined in the file
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
# distribution for complete text of the license and disclaimer of any warranty.
#
# Alternatively, this file may be used under the terms of Open CASCADE
# commercial license or contractual agreement.
# =======================================================================
# This script defines command gendoc compiling OCCT documents
# from *.md files to HTML pages
# =======================================================================
# load auxiliary tools
source [file join [file dirname [info script]] occaux.tcl]
# ======================================
# Common functions
# ======================================
# Prints help message
proc OCCDoc_PrintHelpMessage {} {
puts "\nUsage: gendoc \[-h\] {-refman|-overview} \[-html|-pdf|-chm\] \[-m=<list of modules>|-ug=<list of docs>\] \[-v\] \[-s=<search_mode>\] \[-mathjax=<path>\]"
puts ""
puts "Options are:"
puts ""
puts "choice of documentation to be generated:"
puts " -overview : To generate Overview and User Guides"
puts " (cannot be used with -refman)"
puts " -refman : To generate class Reference Manual"
puts " (cannot be used with -overview)"
puts ""
puts "choice of output format:"
puts " -html : To generate HTML files"
puts " (default, cannot be used with -pdf or -chm)"
puts " -pdf : To generate PDF files"
puts " (cannot be used with -refman, -html, or -chm)"
puts " -chm : To generate CHM files"
puts " (cannot be used with -html or -pdf)"
puts ""
puts "additional options:"
puts " -m=<modules_list> : List of OCCT modules (separated with comma),"
puts " for generation of Reference Manual"
puts " -ug=<docs_list> : List of MarkDown documents (separated with comma),"
puts " to use for generation of Overview / User Guides"
puts " -mathjax=<path> : To use local or alternative copy of MathJax"
puts " -s=<search_mode> : Specifies the Search mode of HTML documents"
puts " Can be: none | local | server | external"
puts " -h : Prints this help message"
puts " -v : Enables more verbose output"
}
# A command for User Documentation compilation
proc gendoc {args} {
# Parameters
set DOC_TYPE "REFMAN"
set GEN_MODE "HTML_ONLY"
set DOCFILES {}
set MODULES {}
set DOCLABEL ""
set VERB_MODE "NO"
set SEARCH_MODE "none"
set MATHJAX_LOCATION "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1"
set mathjax_js_name "MathJax.js"
set DOCTYPE_COMBO_FLAG 0
set GENMODE_COMBO_FLAG 0
set GENERATE_PRODUCTS_REFMAN "NO"
global available_docfiles; # The full list of md files for HTML or CHM generation
global available_pdf; # The full list of md files for PDF generation
global tcl_platform
global args_names
global args_values
global env
# Load list of docfiles
if { [OCCDoc_LoadFilesList] != 0 } {
puts "Error: File FILES_HTML.txt or FILES_PDF.txt was not found on this computer.\nAborting..."
return -1
}
# Parse CL arguments
if {[OCCDoc_ParseArguments $args] == 1} {
return -1
}
# Print help message if no arguments provided
if {[llength $args_names] == 0} {
OCCDoc_PrintHelpMessage
return 0
}
foreach arg_n $args_names {
if {$arg_n == "h"} {
OCCDoc_PrintHelpMessage
return 0
} elseif {$arg_n == "html"} {
if { ([ lsearch $args_names "refman" ] == -1) &&
([ lsearch $args_names "overview" ] == -1) } {
puts "Warning: Please specify -refman or -overview argument."
return -1
}
if { [ lsearch $args_names "refman" ] != -1 } {
continue
}
if { $GENMODE_COMBO_FLAG != 1 } {
set GEN_MODE "HTML_ONLY"
set GENMODE_COMBO_FLAG 1
} else {
puts "Error: Options -html, -pdf and -chm can not be combined."
return -1
}
} elseif {$arg_n == "chm"} {
if { ([ lsearch $args_names "refman" ] == -1) &&
([ lsearch $args_names "overview" ] == -1) } {
puts "Warning: Please specify -refman or -overview argument."
return -1
}
if { [ lsearch $args_names "refman" ] != -1 } {
continue
}
if { $GENMODE_COMBO_FLAG != 1 } {
set GEN_MODE "CHM_ONLY"
set GENMODE_COMBO_FLAG 1
} else {
puts "Error: Options -html, -pdf and -chm cannot be combined."
return -1
}
} elseif {$arg_n == "pdf"} {
if { ([ lsearch $args_names "refman" ] == -1) &&
([ lsearch $args_names "overview" ] == -1) } {
puts "Warning: Please specify -refman or -overview argument."
return -1
}
if { [ lsearch $args_names "refman" ] != -1 } {
continue
}
if { $GENMODE_COMBO_FLAG != 1 } {
set GEN_MODE "PDF_ONLY"
set GENMODE_COMBO_FLAG 1
} else {
puts "Error: Options -html, -pdf and -chm cannot be combined."
return -1
}
} elseif {$arg_n == "overview"} {
if { $DOCTYPE_COMBO_FLAG != 1 } {
set DOC_TYPE "OVERVIEW"
set DOCTYPE_COMBO_FLAG 1
} else {
puts "Error: Options -refman and -overview cannot be combined."
return -1
}
# Print ignored options
if { [ lsearch $args_names "m" ] != -1 } {
puts "\nInfo: The following options will be ignored: \n"
puts " * -m"
}
puts ""
} elseif {$arg_n == "refman"} {
if { $DOCTYPE_COMBO_FLAG != 1 } {
set DOC_TYPE "REFMAN"
set DOCTYPE_COMBO_FLAG 1
if { [file exists [OCCDoc_GetProdRootDir]/src/VAS/Products.tcl] } {
set GENERATE_PRODUCTS_REFMAN "YES"
}
} else {
puts "Error: Options -refman and -overview cannot be combined."
return -1
}
# Print ignored options
if { ([ lsearch $args_names "pdf" ] != -1) ||
([ lsearch $args_names "chm" ] != -1) ||
([ lsearch $args_names "ug" ] != -1) } {
puts "\nInfo: The following options will be ignored: \n"
if { [ lsearch $args_names "pdf" ] != -1 } {
puts " * -pdf"
}
if { [ lsearch $args_names "chm" ] != -1 } {
puts " * -chm"
}
if { [ lsearch $args_names "ug" ] != -1 } {
puts " * -ug"
}
puts ""
}
} elseif {$arg_n == "v"} {
set VERB_MODE "YES"
} elseif {$arg_n == "ug"} {
if { ([ lsearch $args_names "refman" ] != -1) } {
continue
}
if {$args_values(ug) != "NULL"} {
set DOCFILES $args_values(ug)
} else {
puts "Error in argument ug."
return -1
}
# Check if all chosen docfiles are correct
foreach docfile $DOCFILES {
if { [ lsearch $args_names "pdf" ] == -1 } {
# Check to generate HTMLs
if { [lsearch $available_docfiles $docfile] == -1 } {
puts "Error: File \"$docfile\" is not presented in the list of available docfiles."
puts " Please specify the correct docfile name."
return -1
}
} else {
# Check to generate PDFs
if { [lsearch $available_pdf $docfile] == -1 } {
puts "Error: File \"$docfile\" is not presented in the list of generic PDFs."
puts " Please specify the correct pdf name."
return -1
}
}
}
} elseif {$arg_n == "m"} {
if { [ lsearch $args_names "overview" ] != -1 } {
continue
}
if {$args_values(m) != "NULL"} {
set MODULES $args_values(m)
} else {
puts "Error in argument m."
return -1
}
} elseif {$arg_n == "s"} {
if { [ lsearch $args_names "pdf" ] != -1 } {
puts "Warning: search is not used with PDF and will be ignored."
continue
}
if {$args_values(s) != "NULL"} {
set SEARCH_MODE $args_values(s)
} else {
puts "Error in argument s."
return -1
}
} elseif {$arg_n == "mathjax"} {
if { [ lsearch $args_names "pdf" ] != -1 } {
puts "Warning: MathJax is not used with PDF and will be ignored."
}
set possible_mathjax_loc $args_values(mathjax)
if {[file exist [file join $possible_mathjax_loc $mathjax_js_name]]} {
set MATHJAX_LOCATION $args_values(mathjax)
puts "$MATHJAX_LOCATION"
} else {
puts "Warning: $mathjax_js_name is not found in $possible_mathjax_loc."
puts " MathJax will be used from $MATHJAX_LOCATION"
}
} else {
puts "\nWrong argument: $arg_n"
OCCDoc_PrintHelpMessage
return -1
}
}
# Check the existence of the necessary tools
set DOXYGEN_PATH ""
set GRAPHVIZ_PATH ""
set INKSCAPE_PATH ""
set PDFLATEX_PATH ""
set HHC_PATH ""
OCCDoc_DetectNecessarySoftware $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH $PDFLATEX_PATH
if {$DOXYGEN_PATH == ""} {
puts " Aborting..."
return -1
}
if {"$::tcl_platform(platform)" == "windows"} {
if { ($GEN_MODE == "CHM_ONLY") && ($HHC_PATH == "") } {
puts " Aborting..."
return -1
}
}
if { ($PDFLATEX_PATH == "") && ($GEN_MODE == "PDF_ONLY") } {
puts " Aborting..."
return -1
}
# If we do not specify list for docfiles with -m argument,
# we assume that we have to generate all docfiles
if { [llength $DOCFILES] == 0 } {
if { $GEN_MODE != "PDF_ONLY" } {
set DOCFILES $available_docfiles
} else {
set DOCFILES $available_pdf
}
}
puts ""
# Start main activities
if { $GEN_MODE != "PDF_ONLY" } {
if { [OCCDoc_GetProdRootDir] == ""} {
OCCDoc_Main $DOC_TYPE $DOCFILES $MODULES $GEN_MODE $VERB_MODE $SEARCH_MODE $MATHJAX_LOCATION $GENERATE_PRODUCTS_REFMAN $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
} else {
if { $DOC_TYPE == "REFMAN" } {
if { $MODULES != "" } {
foreach module $MODULES {
OCCDoc_Main $DOC_TYPE $DOCFILES $module $GEN_MODE $VERB_MODE $SEARCH_MODE $MATHJAX_LOCATION $GENERATE_PRODUCTS_REFMAN $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
}
} else {
OCCDoc_Main $DOC_TYPE $DOCFILES $MODULES $GEN_MODE $VERB_MODE $SEARCH_MODE $MATHJAX_LOCATION $GENERATE_PRODUCTS_REFMAN $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
}
} else {
foreach md $DOCFILES {
OCCDoc_Main $DOC_TYPE $md $MODULES $GEN_MODE $VERB_MODE $SEARCH_MODE $MATHJAX_LOCATION $GENERATE_PRODUCTS_REFMAN $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
}
}
}
} else {
puts "Generating OCCT User Guides in PDF format..."
foreach pdf $DOCFILES {
puts "\nInfo: Processing file $pdf"
# Some values are hardcoded because they are related only to PDF generation
OCCDoc_Main "OVERVIEW" [list $pdf] {} "PDF_ONLY" $VERB_MODE "none" $MATHJAX_LOCATION "NO" $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
}
puts "\n[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generation completed."
}
}
# Main procedure for documents compilation
proc OCCDoc_Main {docType {docfiles {}} {modules {}} generatorMode verboseMode searchMode mathjaxLocation generateProductsRefman DOXYGEN_PATH GRAPHVIZ_PATH INKSCAPE_PATH HHC_PATH} {
global available_docfiles
global available_pdf
set ROOTDIR [OCCDoc_GetRootDir [OCCDoc_GetProdRootDir]]
set INDIR [OCCDoc_GetDoxDir]
set OUTDIR $ROOTDIR/doc
set PDFDIR $OUTDIR/pdf
set UGDIR $PDFDIR/user_guides
set DGDIR $PDFDIR/dev_guides
set TAGFILEDIR $OUTDIR/refman
set HTMLDIR $OUTDIR/overview/html
set LATEXDIR $OUTDIR/overview/latex
set DOXYFILE $OUTDIR/OCCT.cfg
# OUTDIR for products documentation should be separate directories for each components
if { [OCCDoc_GetProdRootDir] != ""} {
if { $docType == "REFMAN" } {
if { "$modules" != "" } {
source "[OCCDoc_GetSourceDir [OCCDoc_GetProdRootDir]]/VAS/${modules}.tcl"
set doc_component_name [${modules}:documentation_name]
set OUTDIR $OUTDIR/$doc_component_name
}
} else {
if {[regexp {([^/]+)/([^/]+)/([^/]+)} $docfiles dump doc_type doc_component doc_name]} {
set PDFNAME [file rootname $doc_name]
set OUTDIR $OUTDIR/$doc_component
} else {
error "Could not parse input path to *.md file: \"${docfiles}\""
}
}
set HTMLDIR $OUTDIR/html
set LATEXDIR $OUTDIR/latex
set DOXYFILE $OUTDIR/OCCT.cfg
set TAGFILEDIR $OUTDIR/refman
}
# Create or cleanup the output folders
if { [string compare -nocase $generateProductsRefman "YES"] != 0 } {
if { ![file exists $OUTDIR] } {
file mkdir $OUTDIR
}
if { ![file exists $HTMLDIR] } {
file mkdir $HTMLDIR
}
if { [OCCDoc_GetProdRootDir] == ""} {
if { ![file exists $PDFDIR] } {
file mkdir $PDFDIR
}
if { ![file exists $UGDIR] } {
file mkdir $UGDIR
}
if { ![file exists $DGDIR] } {
file mkdir $DGDIR
}
}
if { $generatorMode == "PDF_ONLY" } {
if { [file exists $LATEXDIR] } {
file delete -force $LATEXDIR
}
file mkdir $LATEXDIR
}
}
if { $docType == "REFMAN" } {
if { ![file exists $TAGFILEDIR] } {
file mkdir $TAGFILEDIR
}
}
# is MathJax HLink?
set mathjax_relative_location $mathjaxLocation
if { [file isdirectory "$mathjaxLocation"] } {
if { $generatorMode == "HTML_ONLY" } {
# related path
set mathjax_relative_location [OCCDoc_GetRelPath $HTMLDIR $mathjaxLocation]
} elseif { $generatorMode == "CHM_ONLY" } {
# absolute path
set mathjax_relative_location [file normalize $mathjaxLocation]
}
}
if { $generateProductsRefman == "YES" } {
set DOCDIR "$OUTDIR/refman"
puts "\nGenerating OCC Products Reference Manual\n"
} else {
if { $docType == "REFMAN"} {
set DOCDIR "$OUTDIR/refman"
puts "\nGenerating Open CASCADE Reference Manual\n"
} elseif { $docType == "OVERVIEW" } {
if { [OCCDoc_GetProdRootDir] == ""} {
set DOCDIR "$OUTDIR/overview"
} else {
set DOCDIR "$OUTDIR"
}
set FORMAT ""
if { ($generatorMode == "HTML_ONLY") || ($generatorMode == "CHM_ONLY") } {
if { $generatorMode == "HTML_ONLY" } {
set FORMAT " in HTML format..."
} elseif { $generatorMode == "CHM_ONLY" } {
set FORMAT " in CHM format..."
}
puts "Generating OCCT User Guides$FORMAT\n"
}
} else {
puts "Error: Invalid documentation type: $docType. Can not process."
return -1
}
}
# Generate Doxyfile
puts "[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generating Doxyfile..."
if { [OCCDoc_MakeDoxyfile $docType $DOCDIR $TAGFILEDIR $DOXYFILE $generatorMode $docfiles $modules $verboseMode $searchMode $HHC_PATH $mathjax_relative_location $GRAPHVIZ_PATH [OCCDoc_GetProdRootDir]] == -1 } {
return -1
}
# Run doxygen tool
set starttimestamp [clock format [clock seconds] -format {%Y-%m-%d %H:%M}]
if { ($generatorMode == "HTML_ONLY") || ($docType == "REFMAN") } {
set LOGPREFIX "html_"
puts "$starttimestamp Generating HTML files..."
# Copy index file to provide fast access to HTML documentation
file copy -force $INDIR/resources/index.html $DOCDIR/index.html
} elseif { $generatorMode == "CHM_ONLY" } {
set LOGPREFIX "chm_"
puts "$starttimestamp Generating CHM file..."
} elseif { $generatorMode == "PDF_ONLY" } {
set LOGPREFIX "[file rootname [file tail [lindex $docfiles 0]]]_"
puts "$starttimestamp Generating PDF file..."
}
# Clean logfiles
set DOXYLOG $OUTDIR/${LOGPREFIX}doxygen_err.log
set DOXYOUT $OUTDIR/${LOGPREFIX}doxygen_out.log
file delete -force $DOXYLOG
file delete -force $DOXYOUT
set RESULT [catch {exec $DOXYGEN_PATH $DOXYFILE >> $DOXYOUT} DOX_ERROR]
if {$RESULT != 0} {
set NbErrors [regexp -all -line {^\s*[^\s]+} $DOX_ERROR]
if {$NbErrors > 0} {
puts "Warning: Doxygen reported $NbErrors messages."
puts "See log in $DOXYLOG"
set DOX_ERROR_FILE [open $DOXYLOG "a"]
if {$generatorMode == "PDF_ONLY"} {
puts $DOX_ERROR_FILE "\n===================================================="
puts $DOX_ERROR_FILE "Logfile for $docfiles"
puts $DOX_ERROR_FILE "====================================================\n"
}
puts $DOX_ERROR_FILE $DOX_ERROR
close $DOX_ERROR_FILE
}
}
# Close the Doxygen application
after 300
# Start Post Processing
set curtime [clock format [clock seconds] -format {%Y-%m-%d %H:%M}]
if { $docType == "REFMAN" } {
# Post Process generated HTML pages and draw dependency graphs
if {[OCCDoc_PostProcessor $DOCDIR] == 0} {
puts "$curtime Generation completed."
puts "\nInfo: doxygen log file is located in:"
puts "${DOXYOUT}."
puts "\nReference Manual is generated in \n$DOCDIR"
}
} elseif { $docType == "OVERVIEW" } {
# Start PDF generation routine
if { $generatorMode == "PDF_ONLY" } {
set OS $::tcl_platform(platform)
if { $OS == "unix" } {
set PREFIX ".sh"
} elseif { $OS == "windows" } {
set PREFIX ".bat"
}
# Prepare a list of TeX files, generated by Doxygen
cd $LATEXDIR
set TEXFILES [glob $LATEXDIR -type f -directory $LATEXDIR -tails "*.tex" ]
foreach path $TEXFILES {
if { [string compare -nocase $path $LATEXDIR] == 0 } {
set DEL_IDX [lsearch $TEXFILES $path]
if { $DEL_IDX != -1 } {
set TEXFILES [lreplace $TEXFILES $DEL_IDX $DEL_IDX]
}
}
}
set TEXFILES [string map [list refman.tex ""] $TEXFILES]
if {$verboseMode == "YES"} {
puts "Info: Preprocessing generated TeX files..."
}
OCCDoc_ProcessTex $TEXFILES $LATEXDIR $verboseMode
if {$verboseMode == "YES"} {
puts "Info: Converting SVG images to PNG format..."
}
if { $INKSCAPE_PATH != "" } {
OCCDoc_ProcessSvg $LATEXDIR $verboseMode
} else {
puts "Warning: SVG images will be lost in PDF documents."
}
if {$verboseMode == "YES"} {
puts "Info: Generating PDF file from TeX files..."
}
foreach TEX $TEXFILES {
# Rewrite existing REFMAN.tex file...
set TEX [lindex [split $TEX "."] 0]
if {$verboseMode == "YES"} {
puts "Info: Generating PDF file from $TEX..."
}
OCCDoc_MakeRefmanTex $TEX $LATEXDIR $verboseMode $available_pdf
if {"$::tcl_platform(platform)" == "windows"} {
set is_win "yes"
} else {
set is_win "no"
}
if {$verboseMode == "YES"} {
# ...and use it to generate PDF from TeX...
if {$is_win == "yes"} {
puts "Info: Executing $LATEXDIR/make.bat..."
} else {
puts "Info: Executing $LATEXDIR/Makefile..."
}
}
set PDFLOG $OUTDIR/${LOGPREFIX}pdflatex_err.log
set PDFOUT $OUTDIR/${LOGPREFIX}pdflatex_out.log
file delete -force $PDFLOG
file delete -force $PDFOUT
if {"$is_win" == "yes"} {
set RESULT [catch {eval exec [auto_execok $LATEXDIR/make.bat] >> "$PDFOUT"} LaTeX_ERROR]
} else {
set RESULT [catch {eval exec "make -f $LATEXDIR/Makefile" >> "$PDFOUT"} LaTeX_ERROR]
# Small workaround for *nix stations
set prev_loc [pwd]
cd $LATEXDIR
set RESULT [catch {eval exec "pdflatex refman.tex" >> "$PDFOUT"} LaTeX_ERROR]
cd $prev_loc
}
if {$RESULT != 0} {
set NbErrors [regexp -all -line {^\s*[^\s]+} $LaTeX_ERROR]
if {$NbErrors > 0} {
puts "Warning: PDFLaTeX reported $NbErrors messages.\nSee log in $PDFLOG"
set LaTeX_ERROR_FILE [open $PDFLOG "a+"]
puts $LaTeX_ERROR_FILE "\n===================================================="
puts $LaTeX_ERROR_FILE "Logfile of file $TEX:"
puts $LaTeX_ERROR_FILE "====================================================\n"
puts $LaTeX_ERROR_FILE $LaTeX_ERROR
close $LaTeX_ERROR_FILE
}
}
# ...and place it to the specific folder
if {![file exists "$LATEXDIR/refman.pdf"]} {
puts "Fatal: PDFLaTeX failed to create output file, stopping!"
return -1
}
set destFolder $PDFDIR
set parsed_string [split $TEX "_"]
if { [OCCDoc_GetProdRootDir] == ""} {
if { [lsearch $parsed_string "tutorial"] != -1 } {
set TEX [string map [list occt__ occt_] $TEX]
set destFolder $PDFDIR
} elseif { [lsearch $parsed_string "user"] != -1 } {
set TEX [string map [list user_guides__ ""] $TEX]
set destFolder $UGDIR
} elseif { [lsearch $parsed_string "dev"] != -1 } {
set TEX [string map [list dev_guides__ ""] $TEX]
set destFolder $DGDIR
}
} else {
set destFolder $OUTDIR
set TEX "$PDFNAME"
}
file rename -force $LATEXDIR/refman.pdf "$destFolder/$TEX.pdf"
puts "Generated $destFolder/$TEX.pdf"
}
} elseif { $generatorMode == "CHM_ONLY" } {
if { [OCCDoc_GetProdRootDir] == ""} {
file rename $OUTDIR/overview.chm $OUTDIR/occt_overview.chm
} else {
file rename -force $ROOTDIR/doc/overview.chm $OUTDIR/occt_overview.chm
}
}
cd $INDIR
if { $generatorMode == "HTML_ONLY" } {
puts "HTML documentation is generated in \n$DOCDIR"
} elseif { $generatorMode == "CHM_ONLY" } {
puts "Generated CHM documentation is in \n$OUTDIR/overview.chm"
}
}
# Remove temporary Doxygen files
set deleteList [glob -nocomplain -type f "*.tmp"]
foreach file $deleteList {
file delete $file
}
return 0
}
# Generates Doxygen configuration file for Overview documentation
proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMode ""} {DocFilesList {}} {ModulesList {}} verboseMode searchMode hhcPath mathjaxLocation graphvizPath productsPath} {
global module_dependency
set inputDir [OCCDoc_GetDoxDir [OCCDoc_GetProdRootDir]]
set TEMPLATES_DIR [OCCDoc_GetDoxDir]/resources
set occt_version [OCCDoc_DetectCasVersion]
# Delete existent doxyfile
file delete $doxyFileName
# Copy specific template to the target folder
if { $docType == "REFMAN" } {
file copy "$TEMPLATES_DIR/occt_rm.doxyfile" $doxyFileName
} elseif { $docType == "OVERVIEW" } {
if { $generatorMode == "HTML_ONLY" || $generatorMode == "CHM_ONLY" } {
file copy "$TEMPLATES_DIR/occt_ug_html.doxyfile" $doxyFileName
} elseif { $generatorMode == "PDF_ONLY"} {
file copy "$TEMPLATES_DIR/occt_ug_pdf.doxyfile" $doxyFileName
} else {
puts "Error: Unknown generation mode"
return -1
}
} else {
puts "Error: Cannot generate unknown document type"
return -1
}
set doxyFile [open $doxyFileName "a"]
# Write specific options
if { $docType == "REFMAN" } {
# always include optional components
set aHaveD3dBack ""
set aHaveGlesBack ""
set aHaveVtkBack ""
if { [info exists ::env(HAVE_D3D)] } { set aHaveD3dBack "$::env(HAVE_D3D)" }
if { [info exists ::env(HAVE_GLES2)] } { set aHaveGlesBack "$::env(HAVE_GLES2)" }
if { [info exists ::env(HAVE_VTK)] } { set aHaveVtkBack "$::env(HAVE_VTK)" }
set ::env(HAVE_D3D) "true"
set ::env(HAVE_GLES2) "true"
set ::env(HAVE_VTK) "true"
# Load lists of modules scripts
if { $productsPath == "" } {
set modules_scripts [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $productsPath]/OS/" *.tcl]
} else {
set modules_scripts [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $productsPath]/VAS/" *.tcl]
}
if { [llength $modules_scripts] != 0} {
foreach module_file $modules_scripts {
source $module_file
}
}
set ALL_MODULES [OCCDoc_GetModulesList $productsPath]
if { [llength $ModulesList] == 0 } {
# by default take all modules
set modules $ALL_MODULES
} else {
set modules $ModulesList
}
# Detect invalid names of modules
foreach module $modules {
if { $module == "" } {
continue
}
if {[lsearch $ALL_MODULES $module] == -1 } {
puts "Error: No module $module is known. Aborting..."
return -1
}
}
# Set context
set one_module [expr [llength $modules] == 1]
if { $one_module } {
set title "OCCT [$modules:name]"
set name $modules
} else {
set title "Open CASCADE Technology"
set name OCCT
}
OCCDoc_LoadData "${productsPath}"
# Add all dependencies of modules to the graph
set additional_modules {}
foreach module $modules {
set additional_modules [list {*}$additional_modules {*}$module_dependency($module)]
}
set modules [list {*}$modules {*}$additional_modules]
set modules [lsort -unique $modules]
# Get list of header files in the specified modules
set filelist {}
foreach module $modules {
if { $module == "" } {
continue
}
foreach tk [$module:toolkits] {
foreach pk [split [OCCDoc_GetPackagesList [OCCDoc_Locate $tk $productsPath]]] {
if { [llength $pk] != "{}" } {
lappend filelist [OCCDoc_GetHeadersList "p" "$pk" "$productsPath"]
}
}
}
}
# Filter out files Handle_*.hxx and *.lxx
set hdrlist {}
foreach fileset $filelist {
set hdrset {}
foreach hdr $fileset {
if { ! [regexp {Handle_.*[.]hxx} $hdr] && ! [regexp {.*[.]lxx} $hdr] } {
lappend hdrset $hdr
}
}
lappend hdrlist $hdrset
}
set filelist $hdrlist
set doxyFile [open $doxyFileName "a"]
puts $doxyFile "PROJECT_NAME = \"$title\""
puts $doxyFile "PROJECT_NUMBER = $occt_version"
puts $doxyFile "OUTPUT_DIRECTORY = $outDir/."
puts $doxyFile "GENERATE_TAGFILE = $outDir/${name}.tag"
if { [string tolower $searchMode] == "none" } {
puts $doxyFile "SEARCHENGINE = NO"
puts $doxyFile "SERVER_BASED_SEARCH = NO"
puts $doxyFile "EXTERNAL_SEARCH = NO"
} else {
puts $doxyFile "SEARCHENGINE = YES"
if { [string tolower $searchMode] == "local" } {
puts $doxyFile "SERVER_BASED_SEARCH = NO"
puts $doxyFile "EXTERNAL_SEARCH = NO"
} elseif { [string tolower $searchMode] == "server" } {
puts $doxyFile "SERVER_BASED_SEARCH = YES"
puts $doxyFile "EXTERNAL_SEARCH = NO"
} elseif { [string tolower $searchMode] == "external" } {
puts $doxyFile "SERVER_BASED_SEARCH = YES"
puts $doxyFile "EXTERNAL_SEARCH = YES"
} else {
puts "Error: Wrong search engine type: $searchMode."
close $doxyFile
return -1
}
}
puts $doxyFile "DOTFILE_DIRS = $outDir/html"
puts $doxyFile "DOT_PATH = $graphvizPath"
puts $doxyFile "INCLUDE_PATH = [OCCDoc_GetSourceDir $productsPath]"
# list of files to generate
set mainpage [OCCDoc_MakeMainPage $outDir $outDir/$name.dox $modules $productsPath]
puts $doxyFile ""
puts $doxyFile "INPUT = $mainpage \\"
foreach header $filelist {
puts $doxyFile " $header \\"
}
puts $doxyFile "MATHJAX_FORMAT = HTML-CSS"
puts $doxyFile "MATHJAX_RELPATH = ${mathjaxLocation}"
puts $doxyFile ""
# restore environment variables
set ::env(HAVE_D3D) "$aHaveD3dBack"
set ::env(HAVE_GLES2) "$aHaveGlesBack"
set ::env(HAVE_VTK) "$aHaveVtkBack"
} elseif { $docType == "OVERVIEW" } {
# Add common options for generation of Overview and User Guides
puts $doxyFile "PROJECT_NUMBER = $occt_version"
puts $doxyFile "OUTPUT_DIRECTORY = $outDir/."
puts $doxyFile "PROJECT_LOGO = [OCCDoc_GetDoxDir]/resources/occ_logo.png"
puts $doxyFile "EXAMPLE_PATH = [OCCDoc_GetSourceDir $productsPath]"
set PARAM_INPUT "INPUT ="
set PARAM_IMAGEPATH "IMAGE_PATH = [OCCDoc_GetDoxDir]/resources/ "
foreach docFile $DocFilesList {
set NEW_IMG_PATH "$inputDir/$docFile"
if { [string compare $NEW_IMG_PATH [OCCDoc_GetRootDir $productsPath]] != 0 } {
set img_string [file dirname $NEW_IMG_PATH]/images
if { [file exists $img_string] } {
append PARAM_IMAGEPATH " $img_string"
}
}
append PARAM_INPUT " " $inputDir/$docFile
}
puts $doxyFile $PARAM_INPUT
puts $doxyFile $PARAM_IMAGEPATH
# Add document type-specific options
if { $generatorMode == "HTML_ONLY"} {
# generate tree view
puts $doxyFile "GENERATE_TREEVIEW = YES"
# Set a reference to a TAGFILE
if { $tagFileDir != "" } {
if {[file exists $tagFileDir/OCCT.tag] == 1} {
#set tagPath [OCCDoc_GetRelPath $tagFileDir $outDir/html]
set tagPath $tagFileDir
puts $doxyFile "TAGFILES = $tagFileDir/OCCT.tag=../../refman/html"
}
}
# HTML Search engine options
if { [string tolower $searchMode] == "none" } {
puts $doxyFile "SEARCHENGINE = NO"
puts $doxyFile "SERVER_BASED_SEARCH = NO"
puts $doxyFile "EXTERNAL_SEARCH = NO"
} else {
puts $doxyFile "SEARCHENGINE = YES"
if { [string tolower $searchMode] == "local" } {
puts $doxyFile "SERVER_BASED_SEARCH = NO"
puts $doxyFile "EXTERNAL_SEARCH = NO"
} elseif { [string tolower $searchMode] == "server" } {
puts $doxyFile "SERVER_BASED_SEARCH = YES"
puts $doxyFile "EXTERNAL_SEARCH = NO"
} elseif { [string tolower $searchMode] == "external" } {
puts $doxyFile "SERVER_BASED_SEARCH = YES"
puts $doxyFile "EXTERNAL_SEARCH = YES"
} else {
puts "Error: Wrong search engine type: $searchMode."
close $doxyFile
return -1
}
}
} elseif { $generatorMode == "CHM_ONLY"} {
# specific options for CHM file generation
puts $doxyFile "GENERATE_TREEVIEW = NO"
puts $doxyFile "SEARCHENGINE = NO"
puts $doxyFile "GENERATE_HTMLHELP = YES"
puts $doxyFile "CHM_FILE = ../../overview.chm"
puts $doxyFile "HHC_LOCATION = \"$hhcPath\""
puts $doxyFile "DISABLE_INDEX = YES"
}
# Formula options
puts $doxyFile "MATHJAX_RELPATH = ${mathjaxLocation}"
}
close $doxyFile
return 0
}

File diff suppressed because it is too large Load Diff

View File

@ -1,918 +0,0 @@
# =======================================================================
# Created on: 2014-03-21
# Created by: OMY
# Copyright (c) 1996-1999 Matra Datavision
# Copyright (c) 1999-2014 OPEN CASCADE SAS
#
# This file is part of Open CASCADE Technology software library.
#
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License version 2.1 as published
# by the Free Software Foundation, with special exception defined in the file
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
# distribution for complete text of the license and disclaimer of any warranty.
#
# Alternatively, this file may be used under the terms of Open CASCADE
# commercial license or contractual agreement.
# =======================================================================
# This script contains auxiliary functions which can be used
# in documentation generation process
# =======================================================================
# ==============================================
# Commonly used functions
# ==============================================
# Parses arguments line like "-arg1=val1 -arg2=val2 ..." to array args_names and map args_values
proc OCCDoc_ParseArguments {arguments} {
global args_names
global args_values
set args_names {}
array set args_values {}
foreach arg $arguments {
if {[regexp {^(-)[a-z_]+$} $arg] == 1} {
set name [string range $arg 1 [string length $arg]-1]
lappend args_names $name
set args_values($name) "NULL"
continue
} elseif {[regexp {^(-)[a-z_]+=.+$} $arg] == 1} {
set equal_symbol_position [string first "=" $arg]
set name [string range $arg 1 $equal_symbol_position-1]
lappend args_names $name
set value [string range $arg $equal_symbol_position+1 [string length $arguments]-1]
# To parse a list of values for -m parameter
if { [string first "," $value] != -1 } {
set value [split $value ","];
}
set args_values($name) $value
} else {
puts "Error in argument $arg."
return 1
}
}
return 0
}
# Returns script parent folder
proc OCCDoc_GetDoxDir { {theProductsPath ""} } {
if { $theProductsPath == "" } {
return [file normalize [file dirname [info script]]/../dox]
} else {
return [file normalize $theProductsPath]/dox
}
}
# Returns products root folder
proc OCCDoc_GetProdRootDir {} {
if {[info exists ::env(PRODROOT)]} {
return [file normalize $::env(PRODROOT)]
}
}
# Returns OCCT root dir
proc OCCDoc_GetOCCTRootDir {} {
set path [OCCDoc_GetDoxDir]
return [file normalize $path/..]
}
# Returns root dir
proc OCCDoc_GetRootDir { {theProductsPath ""} } {
if { $theProductsPath == "" } {
return [OCCDoc_GetOCCTRootDir]
} else {
return [file normalize $theProductsPath]
}
}
# Returns OCCT include dir
proc OCCDoc_GetIncDir { {theProductsPath ""} } {
set path [OCCDoc_GetRootDir $theProductsPath]
return "$path/inc"
}
# Returns OCCT source dir
proc OCCDoc_GetSourceDir { {theProductsPath ""} } {
set path [OCCDoc_GetRootDir $theProductsPath]
return "$path/src"
}
# Returns name of the package from the current toolkit
proc OCCDoc_GetNameFromPath { thePath } {
set splitted_path [split $thePath "/" ]
set package_name [lindex $splitted_path end]
return $package_name
}
# Returns the relative path between two folders
proc OCCDoc_GetRelPath {thePathFrom thePathTo} {
if { [file isdirectory "$thePathFrom"] == 0 } {
return ""
}
set aPathFrom [file normalize "$thePathFrom"]
set aPathTo [file normalize "$thePathTo"]
set aCutedPathFrom "${aPathFrom}/dummy"
set aRelatedDeepPath ""
while { "$aCutedPathFrom" != [file normalize "$aCutedPathFrom/.."] } {
set aCutedPathFrom [file normalize "$aCutedPathFrom/.."]
# does aPathTo contain aCutedPathFrom?
regsub -all $aCutedPathFrom $aPathTo "" aPathFromAfterCut
if { "$aPathFromAfterCut" != "$aPathTo" } { # if so
if { "$aCutedPathFrom" == "$aPathFrom" } { # just go higher, for example, ./somefolder/someotherfolder
set aPathTo ".${aPathTo}"
} elseif { "$aCutedPathFrom" == "$aPathTo" } { # remove the last "/"
set aRelatedDeepPath [string replace $aRelatedDeepPath end end ""]
}
regsub -all $aCutedPathFrom $aPathTo $aRelatedDeepPath aPathToAfterCut
regsub -all "//" $aPathToAfterCut "/" aPathToAfterCut
return $aPathToAfterCut
}
set aRelatedDeepPath "$aRelatedDeepPath../"
}
return $thePathTo
}
# Returns OCCT version string from file Standard_Version.hxx (if available)
proc OCCDoc_DetectCasVersion {} {
set occt_ver 6.7.0
set occt_ver_add ""
set filename "[OCCDoc_GetSourceDir]/Standard/Standard_Version.hxx"
if { [file exists $filename] } {
set fh [open $filename "r"]
set fh_loaded [read $fh]
close $fh
regexp {[^/]\s*#\s*define\s+OCC_VERSION_COMPLETE\s+\"([^\s]*)\"} $fh_loaded dummy occt_ver
regexp {[^/]\s*#\s*define\s+OCC_VERSION_DEVELOPMENT\s+\"([^\s]*)\"} $fh_loaded dummy occt_ver_add
if { "$occt_ver_add" != "" } { set occt_ver ${occt_ver}.$occt_ver_add }
}
return $occt_ver
}
# Checks if the necessary tools exist
proc OCCDoc_DetectNecessarySoftware { DOXYGEN_PATH GRAPHVIZ_PATH INKSCAPE_PATH HHC_PATH PDFLATEX_PATH } {
upvar 1 DOXYGEN_PATH doxy_path
upvar 1 GRAPHVIZ_PATH graph_path
upvar 1 INKSCAPE_PATH inkscape_path
upvar 1 HHC_PATH hhc_path
upvar 1 PDFLATEX_PATH latex_path
set doxy_path ""
set graph_path ""
set inkscape_path ""
set latex_path ""
set hhc_path ""
set is_win "no"
if { "$::tcl_platform(platform)" == "windows" } {
set is_win "yes"
}
if {"$is_win" == "yes"} {
set exe ".exe"
set com ".com"
} else {
set exe ""
set com ""
}
set g_flag "no"
set d_flag "no"
set i_flag "no"
set h_flag "no"
set l_flag "no"
puts ""
set envPath $::env(PATH)
if { $is_win == "yes" } {
set searchPathsList [split $envPath ";"]
} else {
set searchPathsList [split $envPath ":"]
}
foreach path $searchPathsList {
if { ($is_win == "no") &&
(($path == "/usr/bin") || ($path == "/usr/local/bin")) } {
# Avoid searching in default bin location
continue
}
if {$d_flag == "no"} {
if { [file exists $path/doxygen$exe] } {
catch { exec $path/doxygen -V } version_string
set version [lindex [split $version_string "\n"] 0]
puts "Info: $version "
puts " found in $path."
set doxy_path "$path/doxygen$exe"
set d_flag "yes"
}
}
if {$g_flag == "no"} {
if { [file exists $path/dot$exe] } {
catch { exec $path/dot -V } version
puts "Info: $version "
puts " found in $path."
set graph_path "$path/dot$exe"
set g_flag "yes"
}
}
if {$i_flag == "no"} {
if { [file exists $path/inkscape$com] } {
catch { exec $path/inkscape -V } version
puts "Info: $version "
puts " found in $path."
set inkscape_path "$path/inkscape$com"
set i_flag "yes"
}
}
if {$l_flag == "no"} {
if { [file exists $path/pdflatex$exe] } {
catch { exec $path/pdflatex -version } version
set version [lindex [split $version "\n"] 0]
puts "Info: $version "
puts " found in $path."
set latex_path "$path/pdflatex$exe"
set l_flag "yes"
}
}
if { ("$is_win" == "yes") && ($h_flag == "no") } {
if { [file exists $path/hhc.exe] } {
puts "Info: hhc "
puts " found in $path."
set hhc_path "hhc$exe"
set h_flag "yes"
}
}
if { ($d_flag == "yes") &&
($i_flag == "yes") &&
($g_flag == "yes") &&
($l_flag == "yes") &&
(($is_win == "yes") &&
($h_flag == "yes")) } {
break
}
}
# On Windows search for hhc.exe in the default location
# if it has not been found yet
if { ("$is_win" == "yes") && ($h_flag == "no") } {
if { [info exists ::env(ProgramFiles\(x86\))] } {
set h_flag "yes"
set path "$::env(ProgramFiles\(x86\))\\HTML Help Workshop"
set hhc_path "$path\\hhc.exe"
puts "Info: hhc "
puts " found in $path."
} else {
if { [info exists ::env(ProgramFiles)] } {
set h_flag "yes"
set path "$::env(ProgramFiles)\\HTML Help Workshop"
set hhc_path "$path\\hhc.exe"
puts "Info: hhc"
puts " found in $path."
}
}
}
# On *nix-like platforms,
# check the default binary locations if the tools had not been found yet
if { $is_win == "no" &&
(($d_flag == "no") ||
($i_flag == "no") ||
($g_flag == "no") ||
($l_flag == "no")) } {
set default_path { "/usr/bin" "/usr/local/bin" }
foreach path $default_path {
if {$d_flag == "no"} {
if { [file exists $path/doxygen$exe] } {
catch { exec $path/doxygen -V } version_string
set version [lindex [split $version_string "\n"] 0]
puts "Info: $version "
puts " found in $path."
set doxy_path "$path/doxygen$exe"
set d_flag "yes"
}
}
if {$g_flag == "no"} {
if { [file exists $path/dot$exe] } {
catch { exec $path/dot -V } version
puts "Info: $version "
puts " found in $path."
set graph_path "$path/dot$exe"
set g_flag "yes"
}
}
if {$i_flag == "no"} {
if { [file exists $path/inkscape$exe] } {
catch { exec $path/inkscape -V } version
puts "Info: $version "
puts " found in $path."
set inkscape_path "$path/inkscape$exe"
set i_flag "yes"
}
}
if {$l_flag == "no"} {
if { [file exists $path/pdflatex$exe] } {
catch { exec $path/pdflatex -version } version
set version [lindex [split $version "\n"] 0]
puts "Info: $version "
puts " found in $path."
set latex_path "$path/pdflatex$exe"
set l_flag "yes"
}
}
}
}
# Check if tools have been found
if { $d_flag == "no" } {
puts "Warning: Could not find doxygen installed."
return -1
}
if { $g_flag == "no" } {
puts "Warning: Could not find graphviz installed."
}
if { $i_flag == "no" } {
puts "Warning: Could not find inkscape installed."
}
if { $l_flag == "no" } {
puts "Warning: Could not find pdflatex installed."
}
if { ("$::tcl_platform(platform)" == "windows") && ($h_flag == "no") } {
puts "Warning: Could not find hhc installed."
}
puts ""
}
# Convert SVG files to PDF format to allow including them to PDF
# (requires InkScape to be in PATH)
proc OCCDoc_ProcessSvg {latexDir verboseMode} {
set anSvgList [glob -nocomplain $latexDir/*.svg]
if { $anSvgList == {} } {
return
}
catch { exec inkscape -V } anInkVer
set isOldSyntax 0
if {[string match "Inkscape 0.*" $anInkVer]} { set isOldSyntax 1 }
foreach file $anSvgList {
if {$verboseMode == "YES"} {
puts "Info: Converting file $file..."
}
set pdffile "[file rootname $file].pdf"
if { $isOldSyntax == 1 } {
if { [catch {exec inkscape -z -D --file=$file --export-pdf=$pdffile} res] } {
#puts "Error: $res."
return
}
} else {
if { [catch {exec inkscape $file --export-area-drawing --export-type=pdf --export-filename=$pdffile} res] } {
#puts "Error: $res."
return
}
}
}
}
# ==============================================
# Reference Manual-specific functions
# ==============================================
# Finds dependencies between all modules
proc OCCDoc_CreateModulesDependencyGraph {dir filename modules mpageprefix} {
global module_dependency
if {![catch {open $dir/$filename.dot "w"} file]} {
puts $file "digraph $filename"
puts $file "\{"
foreach mod $modules {
if { $mod == "" } {
continue
}
puts $file "\t$mod \[ URL = \"[string tolower $mpageprefix$mod.html]\" \]"
foreach mod_depend $module_dependency($mod) {
puts $file "\t$mod_depend -> $mod \[ dir = \"back\", color = \"midnightblue\", style = \"solid\" \]"
}
}
puts $file "\}"
close $file
return $filename
}
}
# Finds dependencies between all toolkits in module
proc OCCDoc_CreateModuleToolkitsDependencyGraph {dir filename modulename tpageprefix} {
global toolkits_in_module
global toolkit_dependency
global toolkit_parent_module
if {![catch {open $dir/$filename.dot "w"} file]} {
puts $file "digraph $filename"
puts $file "\{"
foreach tk $toolkits_in_module($modulename) {
puts $file "\t$tk \[ URL = \"[string tolower $tpageprefix$tk.html]\"\ ]"
foreach tkd $toolkit_dependency($tk) {
if { [info exists toolkit_parent_module($tkd)] } {
if {$toolkit_parent_module($tkd) == $modulename} {
puts $file "\t$tkd -> $tk \[ dir = \"back\", color = \"midnightblue\", style = \"solid\" \]"
}
}
}
}
puts $file "\}"
close $file
return $filename
}
}
# Finds dependencies between the current toolkit and other toolkits
proc OCCDoc_CreateToolkitDependencyGraph {dir filename toolkitname tpageprefix} {
global toolkit_dependency
if {![catch {open $dir/$filename.dot "w"} file]} {
puts $file "digraph $filename"
puts $file "\{"
puts $file "\t$toolkitname \[ URL = \"[string tolower $tpageprefix$toolkitname.html]\"\, shape = box ]"
foreach tkd $toolkit_dependency($toolkitname) {
puts $file "\t$tkd \[ URL = \"[string tolower $tpageprefix$tkd.html]\"\ , shape = box ]"
puts $file "\t$toolkitname -> $tkd \[ color = \"midnightblue\", style = \"solid\" \]"
}
if {[llength $toolkit_dependency($toolkitname)] > 1} {
puts $file "\taspect = 1"
}
puts $file "\}"
close $file
return $filename
}
}
# Fills arrays of modules, toolkits, dependency of modules/toolkits etc
proc OCCDoc_LoadData { {theProductsDir ""} } {
global toolkits_in_module
global toolkit_dependency
global toolkit_parent_module
global module_dependency
if { $theProductsDir == ""} {
set modules_files [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $theProductsDir]/OS/" *.tcl]
} else {
set modules_files [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $theProductsDir]/VAS/" *.tcl]
}
foreach module_file $modules_files {
source $module_file
}
set modules [OCCDoc_GetModulesList $theProductsDir]
foreach mod $modules {
if { $mod == "" } {
continue
}
# Get toolkits of current module
set toolkits_in_module($mod) [$mod:toolkits]
# Get all dependence of current toolkit
foreach tk $toolkits_in_module($mod) {
# set parent module of current toolkit
set toolkit_parent_module($tk) $mod
set exlibfile [open "[OCCDoc_GetSourceDir $theProductsDir]/$tk/EXTERNLIB" r]
set exlibfile_data [read $exlibfile]
set exlibfile_data [split $exlibfile_data "\n"]
set toolkit_dependency($tk) {}
foreach dtk $exlibfile_data {
if { ([string first "TK" $dtk 0] == 0) ||
([string first "P" $dtk 0] == 0) } {
lappend toolkit_dependency($tk) $dtk
}
}
close $exlibfile
}
}
# Get modules dependency
foreach mod $modules {
set module_dependency($mod) {}
foreach tk $toolkits_in_module($mod) {
foreach tkd $toolkit_dependency($tk) {
if { [info exists toolkit_parent_module($tkd)] } {
if { $toolkit_parent_module($tkd) != $mod &&
[lsearch $module_dependency($mod) $toolkit_parent_module($tkd)] == -1} {
lappend module_dependency($mod) $toolkit_parent_module($tkd)
}
}
}
}
}
}
# Returns list of packages of the given toolkit
proc OCCDoc_GetPackagesList { theToolKitPath } {
set packages_list {}
# Open file with list of packages of the given toolkit
set fileid [open "$theToolKitPath/PACKAGES" "r"]
while { [eof $fileid] == 0 } {
set str [gets $fileid]
if { $str != "" } {
lappend packages_list $str
}
}
close $fileid
return $packages_list
}
# Returns list of modules from UDLIST
proc OCCDoc_GetModulesList { {theProductsDir ""} } {
if { $theProductsDir == "" } {
source "[OCCDoc_GetSourceDir $theProductsDir]/OS/Modules.tcl"
# load a command from this file
set modules [OS:Modules]
} else {
source "[OCCDoc_GetSourceDir $theProductsDir]/VAS/Products.tcl"
# load a command from this file
set modules [VAS:Products]
set modules [lsearch -not -all -inline $modules "VAS"]
}
return $modules
}
# Returns list of desired files in the specified location
proc OCCDoc_GetHeadersList { theDesiredContent thePackageName {theProductsDir ""} } {
# Get list of header files with path
set files_list [split [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $theProductsDir]/$thePackageName" "${thePackageName}.hxx" "${thePackageName}_*.hxx"]]
# Get content according to desired type ('p' for path and 'f' for filenames only)
if { $theDesiredContent == "p" } {
return $files_list
} elseif { $theDesiredContent == "f" } {
# Cut paths from filenames
foreach file $files_list {
set elem_index [lsearch $files_list $file]
lset files_list $elem_index [OCCDoc_GetNameFromPath [lindex $files_list $elem_index]]
}
return $files_list
}
}
# Returns location of the toolkit
proc OCCDoc_Locate { theToolKitName {theProductsDir ""} } {
set tk_dir "[OCCDoc_GetSourceDir $theProductsDir]/[OCCDoc_GetNameFromPath $theToolKitName]"
return $tk_dir
}
# Gets contents of the given html node (for Post-processing)
proc OCCDoc_GetNodeContents {node props html} {
set openTag "<$node$props>"
set closingTag "</$node>"
set start [string first $openTag $html]
if {$start == -1} {
return ""
}
set start [expr $start + [string length $openTag]]
set end [string length $html]
set html [string range $html $start $end]
set start [string first $closingTag $html]
set end [string length $html]
if {$start == -1} {
return ""
}
set start [expr $start - 1]
return [string range $html 0 $start]
}
# Generates main page file describing module structure
proc OCCDoc_MakeMainPage {outDir outFile modules {theProductsDir ""} } {
global env
set one_module [expr [llength $modules] == 1]
set fd [open $outFile "w"]
set module_prefix "module_"
set toolkit_prefix "toolkit_"
set package_prefix "package_"
if { ! [file exists "$outDir/html"] } {
file mkdir "$outDir/html"
}
OCCDoc_LoadData $theProductsDir
# Main page: list of modules
if { ! $one_module } {
puts $fd "/**"
puts $fd "\\mainpage Open CASCADE Technology"
foreach mod $modules {
puts $fd "\\li \\subpage [string tolower $module_prefix$mod]"
}
# insert modules relationship diagram
puts $fd "\\dotfile [OCCDoc_CreateModulesDependencyGraph $outDir/html schema_all_modules $modules $module_prefix]"
puts $fd "**/\n"
}
# One page per module: list of toolkits
set toolkits {}
foreach mod $modules {
if { $mod == "" } {
continue
}
puts $fd "/**"
if { $one_module } {
puts $fd "\\mainpage OCCT Module [$mod:name]"
} else {
puts $fd "\\page [string tolower module_$mod] Module [$mod:name]"
}
foreach tk [lsort [$mod:toolkits]] {
lappend toolkits $tk
puts $fd "\\li \\subpage [string tolower $toolkit_prefix$tk]"
}
puts $fd "\\dotfile [OCCDoc_CreateModuleToolkitsDependencyGraph $outDir/html schema_$mod $mod $toolkit_prefix]"
puts $fd "**/\n"
}
# One page per toolkit: list of packages
set packages {}
foreach tk $toolkits {
puts $fd "/**"
puts $fd "\\page [string tolower toolkit_$tk] Toolkit $tk"
foreach pk [lsort [OCCDoc_GetPackagesList [OCCDoc_Locate $tk $theProductsDir]]] {
lappend packages $pk
set u [OCCDoc_GetNameFromPath $pk]
puts $fd "\\li \\subpage [string tolower $package_prefix$u]"
}
puts $fd "\\dotfile [OCCDoc_CreateToolkitDependencyGraph $outDir/html schema_$tk $tk $toolkit_prefix]"
puts $fd "**/\n"
}
# One page per package: list of classes
foreach pk $packages {
set u [OCCDoc_GetNameFromPath $pk]
puts $fd "/**"
puts $fd "\\page [string tolower $package_prefix$u] Package $u"
foreach hdr [lsort [OCCDoc_GetHeadersList "f" "$pk" "$theProductsDir"]] {
if { ! [regexp {^Handle_} $hdr] && [regexp {(.*)[.]hxx} $hdr str obj] } {
puts $fd "\\li \\subpage $obj"
}
}
puts $fd "**/\n"
}
close $fd
return $outFile
}
# Parses generated files to add a navigation path
proc OCCDoc_PostProcessor {outDir} {
puts "[clock format [clock seconds] -format {%Y.%m.%d %H:%M}] Post-process is started ..."
append outDir "/html"
set files [glob -nocomplain -type f $outDir/package_*]
if { $files != {} } {
foreach f [lsort $files] {
set packageFilePnt [open $f r]
set packageFile [read $packageFilePnt]
set navPath [OCCDoc_GetNodeContents "div" " id=\"nav-path\" class=\"navpath\"" $packageFile]
set packageName [OCCDoc_GetNodeContents "div" " class=\"title\"" $packageFile]
regsub -all {<[^<>]*>} $packageName "" packageName
# add package link to nav path
set first [expr 1 + [string last "/" $f]]
set last [expr [string length $f] - 1]
set packageFileName [string range $f $first $last]
set end [string first "</ul>" $navPath]
set end [expr $end - 1]
set navPath [string range $navPath 0 $end]
append navPath " <li class=\"navelem\"><a class=\"el\" href=\"$packageFileName\">$packageName</a> </li>\n </ul>"
# get list of files to update
set listContents [OCCDoc_GetNodeContents "div" " class=\"textblock\"" $packageFile]
set listContents [OCCDoc_GetNodeContents "ul" "" $listContents]
set lines [split $listContents "\n"]
foreach line $lines {
if {[regexp {href=\"([^\"]*)\"} $line tmpLine classFileName]} {
# check if anchor is there
set anchorPos [string first "#" $classFileName]
if {$anchorPos != -1} {
set classFileName [string range $classFileName 0 [expr $anchorPos - 1]]
}
# read class file
set classFilePnt [open $outDir/$classFileName r+]
set classFile [read $classFilePnt]
# find position of content block
set contentPos [string first "<div class=\"header\">" $classFile]
set navPart [string range $classFile 0 [expr $contentPos - 1]]
# position where to insert nav path
set posToInsert [string last "</div>" $navPart]
set prePart [string range $classFile 0 [expr $posToInsert - 1]]
set postPart [string range $classFile $posToInsert [string length $classFile]]
set newClassFile ""
append newClassFile $prePart " <div id=\"nav-path\" class=\"navpath\">" $navPath \n " </div>" \n $postPart
# write updated content
seek $classFilePnt 0
puts $classFilePnt $newClassFile
close $classFilePnt
}
}
close $packageFilePnt
}
return 0
} else {
puts "no files found"
return 1
}
}
# ======================================
# User Guides-specific functions
# ======================================
# Loads a list of docfiles from file FILES.txt
proc OCCDoc_LoadFilesList {} {
set INPUTDIR [OCCDoc_GetDoxDir [OCCDoc_GetProdRootDir]]
global available_docfiles
set available_docfiles {}
# Read data from file
if { [file exists "$INPUTDIR/FILES_HTML.txt"] == 1 } {
set FILE [open "$INPUTDIR/FILES_HTML.txt" r]
while {1} {
set line [string trim [gets $FILE]]
# trim possible comments starting with '#'
set line [regsub {\#.*} $line {}]
if {$line != ""} {
lappend available_docfiles $line
}
if {[eof $FILE]} {
close $FILE
break
}
}
} else {
return -1
}
global available_pdf
set available_pdf {}
# Read data from file
if { [file exists "$INPUTDIR/FILES_PDF.txt"] } {
set FILE [open "$INPUTDIR/FILES_PDF.txt" r]
while {1} {
set line [string trim [gets $FILE]]
# Trim possible comments starting with '#'
set line [regsub {\#.*} $line {}]
if {$line != ""} {
lappend available_pdf $line
}
if {[eof $FILE]} {
close $FILE
break
}
}
} else {
return -1
}
return 0
}
# Writes new TeX file for conversion from tex to pdf for a specific doc
proc OCCDoc_MakeRefmanTex {fileName latexDir verboseMode latexFilesList} {
if { $verboseMode == "YES" } {
puts "Info: Making refman.tex file for $fileName..."
}
set DOCNAME "$latexDir/refman.tex"
if {[file exists $DOCNAME] == 1} {
file delete -force $DOCNAME
}
# Copy template file to latex folder
if { "[OCCDoc_GetProdRootDir]" != "" } {
file copy "[OCCDoc_GetDoxDir [OCCDoc_GetProdRootDir]]/resources/prod_pdf_template.tex" $DOCNAME
} else {
file copy "[OCCDoc_GetDoxDir]/resources/occt_pdf_template.tex" $DOCNAME
}
# Get templatized data
set texfile [open $DOCNAME "r"]
set texfile_loaded [read $texfile]
close $texfile
# Replace dummy values
set year [clock format [clock seconds] -format {%Y}]
set month [clock format [clock seconds] -format {%B}]
set texfile [open $DOCNAME "w"]
set casVersion [OCCDoc_DetectCasVersion]
# Get name of the document
set docLabel ""
foreach aFileName $latexFilesList {
# Find the file in FILES_PDF.txt
set parsedFileName [file rootname [lindex [split $aFileName "/" ] end]]
if { [regexp "${parsedFileName}$" $fileName] } {
set filepath "[OCCDoc_GetDoxDir [OCCDoc_GetProdRootDir]]/$aFileName"
if { [file exists $filepath] } {
set MDFile [open $filepath "r"]
set label [split [gets $MDFile] "\{"]
set docLabel [lindex $label 0]
close $MDFile
break
}
}
}
set occtlogo_path "[OCCDoc_GetDoxDir]/resources/occt_logo.png"
set occlogo_path "[OCCDoc_GetDoxDir]/resources/occ_logo.png"
set copyright_path "[OCCDoc_GetDoxDir [OCCDoc_GetProdRootDir]]/resources/prod_pdf_template.tex"
set texfile_loaded [string map [list DEFDOCLABEL "$docLabel" DEFCASVERSION "$casVersion" DEFFILENAME "$fileName" DEFYEAR "$year" DEFMONTH "$month" DEFCOPYRIGHT "$copyright_path" DEFLOGO "$occtlogo_path" DEFOCCLOGO "$occlogo_path" DEFTITLE ""] $texfile_loaded]
# Get data
puts $texfile $texfile_loaded
close $texfile
}
# Postprocesses generated TeX files
proc OCCDoc_ProcessTex {{texFiles {}} {latexDir} verboseMode} {
foreach TEX $texFiles {
if {$verboseMode == "YES"} {
puts "Info: Preprocessing file $TEX..."
}
if {![file exists $TEX]} {
puts "Error: file $TEX does not exist."
return -1
}
set IN_F [open "$TEX" "r"]
set TMPFILENAME "$latexDir/temp.tex"
set OUT_F [open $TMPFILENAME w]
while {1} {
set line [gets $IN_F]
if { [string first "\\includegraphics" $line] != -1 } {
# replace svg extension by pdf
set line [regsub {[.]svg} $line ".pdf"]
# Center images in TeX files
set line "\\begin{center}\n $line\n\\end{center}"
} elseif { [string first "\\subsection" $line] != -1 } {
# Replace \subsection with \section tag
regsub -all "\\\\subsection" $line "\\\\section" line
} elseif { [string first "\\subsubsection" $line] != -1 } {
# Replace \subsubsection with \subsection tag
regsub -all "\\\\subsubsection" $line "\\\\subsection" line
} elseif { [string first "\\paragraph" $line] != -1 } {
# Replace \paragraph with \subsubsection tag
regsub -all "\\\\paragraph" $line "\\\\subsubsection" line
}
puts $OUT_F $line
if {[eof $IN_F]} {
close $IN_F
close $OUT_F
break
}
}
file delete -force $TEX
file rename $TMPFILENAME $TEX
}
}

View File

@ -1,5 +0,0 @@
/*/*.pro
/*/*/*.pro
*.pro.user
custom.pri
custom.auto.pri

View File

@ -1,165 +0,0 @@
# This is project defines C++ compilation rules for building an OCCT Toolkit.
exists(custom.auto.pri) { include(custom.auto.pri) }
exists(custom.pri) { include(custom.pri) }
# Disable some dummy Qt defaults
QT -= core gui
CONFIG -= qt app_bundle
CONFIG -= qml_debug
CONFIG -= debug_and_release
OccGitRoot = $$_PRO_FILE_PWD_/../../../..
# Define compilation flags
CONFIG += warn_on
QMAKE_CFLAGS_WARN_ON = -Wall -Wextra
QMAKE_CXXFLAGS_WARN_ON = -Wall -Wextra
win32 {
QMAKE_CFLAGS_WARN_ON = -W4
QMAKE_CXXFLAGS_WARN_ON = -W4
QMAKE_CXXFLAGS_EXCEPTIONS_ON = /EHa
QMAKE_CXXFLAGS_STL_ON = /EHa
QMAKE_CXXFLAGS += -fp:precise
#QMAKE_CXXFLAGS -= -Zc:throwingNew
#QMAKE_CXXFLAGS -= -Zc:rvalueCast
QMAKE_LFLAGS += -INCREMENTAL:NO
CONFIG(debug, debug|release) {
QMAKE_CXXFLAGS += -Od
QMAKE_CXXFLAGS += -Ob1
}
DEFINES -= WIN32
DEFINES -= WIN64
DEFINES += _CRT_SECURE_NO_WARNINGS
DEFINES += _CRT_NONSTDC_NO_DEPRECATE
DEFINES += _SCL_SECURE_NO_WARNINGS
} else {
CONFIG += c++11
clang {
QMAKE_CFLAGS_WARN_ON += -Wshorten-64-to-32
QMAKE_CXXFLAGS_WARN_ON += -Wshorten-64-to-32
}
QMAKE_CFLAGS += -fexceptions
QMAKE_CXXFLAGS += -fexceptions
QMAKE_CXXFLAGS += -fvisibility=default
DEFINES += OCC_CONVERT_SIGNALS
mac {
iphoneos {
QMAKE_IOS_DEPLOYMENT_TARGET = 8.0
} else {
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.14
}
} else:gcc {
# ask linker to report missing library dependencies
QMAKE_LFLAGS += -Wl,-z,defs
}
}
!CONFIG(debug, debug|release) {
# disable exceptions in Release builds
DEFINES += No_Exception
HAVE_RelWithDebInfo {
win32 {
CONFIG += force_debug_info
}
}
}
# Define output folder depending on compiler name
MY_BITNESS = 32
equals(QMAKE_TARGET.arch, x86_64) | equals(QMAKE_HOST.arch, x86_64) { MY_BITNESS = 64 }
equals(ANDROID_TARGET_ARCH, arm64-v8a) { MY_BITNESS = 64 }
has64Target = $$find(QMAKE_TARGET.arch, "x64")
count(has64Target, 1) { MY_BITNESS = 64 }
MY_PLATFORM = platform
CONFIG(iphonesimulator, iphoneos|iphonesimulator) { MY_PLATFORM = iphonesimulator
} else:CONFIG(iphoneos, iphoneos|iphonesimulator) { MY_PLATFORM = iphoneos
} else:android { MY_PLATFORM = android-$$ANDROID_TARGET_ARCH
} else:win32 { MY_PLATFORM = win$$MY_BITNESS
} else:mac { MY_PLATFORM = mac
} else:linux { MY_PLATFORM = lin
} else:unix { MY_PLATFORM = unix
} else { warning (Unknown platform. "$$MY_PLATFORM" is used) }
MY_COMPILER = compiler
MY_VC_VER = 0
android-g++ {
MY_COMPILER = gcc
} else:clang {
MY_COMPILER = clang
} else:gcc {
MY_COMPILER = gcc
} else:win32-msvc2010 {
MY_COMPILER = vc10
MY_VC_VER = 10
} else:win32-msvc2012 {
MY_COMPILER = vc11
MY_VC_VER = 11
} else:win32-msvc2013 {
MY_COMPILER = vc12
MY_VC_VER = 12
} else:win32-msvc2015 {
MY_COMPILER = vc14
MY_VC_VER = 14
} else:win32-msvc2017 {
MY_COMPILER = vc14
MY_VC_VER = 14
} else:win32-msvc {
MY_COMPILER = vc14
MY_VC_VER = 14
aMsvcVer = $$(VisualStudioVersion)
equals(aMsvcVer, 14.0){
# VS2015, vc140
} else:equals(aMsvcVer, 15.0){
# VS2015, vc141
} else:equals(aMsvcVer, 16.0){
# VS2019, vc142
} else:equals(aMsvcVer, 17.0){
# VS2022, vc143
} else {
warning (Unknown msvc version. "$$MY_COMPILER" is used)
}
} else {
warning (Unknown compiler. "$$MY_COMPILER" is used)
}
MY_PLATFORM_AND_COMPILER = $$MY_PLATFORM/$$MY_COMPILER
#warning (The platform is "$$MY_PLATFORM"; bitness is "$$MY_BITNESS"; compiler is "$$MY_COMPILER")
CONFIG(debug, debug|release) { MY_BUILDTYPE = d }
DESTDIR = $$OccGitRoot/$${MY_PLATFORM_AND_COMPILER}/lib$${MY_BUILDTYPE}
win32 {
DESTDIR = $$OccGitRoot/win$${MY_BITNESS}/vc$${MY_VC_VER}/bin$${MY_BUILDTYPE}
aLibDest = $$DESTDIR/../lib$${MY_BUILDTYPE}
#DLLDESTDIR = $$DESTDIR/../bin$${MY_BUILDTYPE}
# dummy target creating lib/libd folder
occtkgen_libfolder.input = $$_PRO_FILE_PWD_/../../OcctDummy.in
occtkgen_libfolder.output = $$aLibDest/dummy.tmp
occtkgen_libfolder.config = verbatim
QMAKE_SUBSTITUTES += occtkgen_libfolder
LIBS += -L$$aLibDest
equals(TEMPLATE, lib) {
QMAKE_CLEAN += $$DESTDIR/$${TARGET}.dll
QMAKE_CLEAN += $$aLibDest/$${TARGET}.lib
QMAKE_CLEAN += $$aLibDest/$${TARGET}.exp
} else {
QMAKE_CLEAN += $$DESTDIR/$${TARGET}.exe
}
QMAKE_CLEAN += $$DESTDIR/$${TARGET}.pdb
QMAKE_LFLAGS += -PDB:"$$DESTDIR/$${TARGET}.pdb"
QMAKE_LFLAGS += -IMPLIB:"$$aLibDest/$${TARGET}.lib"
} else {
LIBS += -L$$DESTDIR
equals(TEMPLATE, app) {
DESTDIR = $$OccGitRoot/$${MY_PLATFORM_AND_COMPILER}/bin$${MY_BUILDTYPE}
}
}
OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}/$${TARGET}

View File

@ -1,42 +0,0 @@
# This is a project template file defining an OCCT Module.
# This project should be included with predefined OCC_MODULE_NAME variable.
TEMPLATE = subdirs
exists(custom.auto.pri) { include(custom.auto.pri) }
exists(custom.pri) { include(custom.pri) }
# Iterate over Toolkits within current Module and generate sub-project per Toolkit
aModuleList = $$cat(../MODULES, lines)
for (aModuleIter, aModuleList) {
#aTkList = $$list($$aModuleIter) - this doesn't work, qmake bug?
aModule = $$first($$list($$aModuleIter))
equals (aModule, $$OCC_MODULE_NAME) {
for (aToolKit, $$list($$aModuleIter)) {
toSkipToolkit = 0
equals (aToolKit, $$OCC_MODULE_NAME) { toSkipToolkit = 1 }
!HAVE_VTK:equals (aToolKit, "TKIVtk") { toSkipToolkit = 1 }
!HAVE_VTK:equals (aToolKit, "TKIVtkDraw") { toSkipToolkit = 1 }
#!HAVE_OPENGL: equals (aToolKit, "TKOpenGl") { toSkipToolkit = 1 }
#!HAVE_OPENGL: equals (aToolKit, "TKOpenGlTest") { toSkipToolkit = 1 }
!HAVE_GLES2: equals (aToolKit, "TKOpenGles") { toSkipToolkit = 1 }
!HAVE_GLES2: equals (aToolKit, "TKOpenGlesTest") { toSkipToolkit = 1 }
!win32: equals (aToolKit, "TKD3DHost") { toSkipToolkit = 1 }
!win32: equals (aToolKit, "TKD3DHostTest") { toSkipToolkit = 1 }
equals (toSkipToolkit, 0) {
#warning(aToolKit($$OCC_MODULE_NAME)=$$aToolKit)
eval(occtkgen_$${aToolKit}.input = $$_PRO_FILE_PWD_/../OccToolkit.pro.in)
eval(occtkgen_$${aToolKit}.output = $$_PRO_FILE_PWD_/$${aToolKit}/$${aToolKit}.pro)
eval(occtkgen_$${aToolKit}.config = verbatim)
eval(QMAKE_SUBSTITUTES += occtkgen_$${aToolKit})
SUBDIRS += $${aToolKit}
aModExtList = $$cat(../../src/$${aToolKit}/EXTERNLIB, lines)
aTkDepends = $${aToolKit}.depends
for (aModExtIter, aModExtList) {
contains ($$list($$aModuleIter), $$aModExtIter) { eval ($${aTkDepends} += $$aModExtIter) }
}
#warning($$aToolKit depends on: $$reverse($${aTkDepends}))
}
}
}
}

View File

@ -1,2 +0,0 @@
OCC_MODULE_NAME = \$\$TARGET
include(../OccModule.pri)

View File

@ -1,166 +0,0 @@
# This is a project template file defining an OCCT Toolkit.
# This project should be included with predefined OCC_TOOLKIT_NAME variable.
TEMPLATE = lib
!exists(../../src/$$OCC_TOOLKIT_NAME/PACKAGES) {
TEMPLATE = app
CONFIG += console
}
win32 {
# do not append version to DLL name
CONFIG += skip_target_version_ext
}
include(OccCppConfig.pri)
aSrcRoot = $$OccGitRoot/src
aHxxRoot = $$OccGitRoot/inc
INCLUDEPATH += $$aHxxRoot
# CSF variables
HAVE_FREETYPE { CSF_FREETYPE = -lfreetype }
CSF_TclLibs = -ltcl8.6
CSF_TclTkLibs = -ltk8.6
HAVE_FREEIMAGE { CSF_FreeImagePlus = -lfreeimage } else:win32 { CSF_FreeImagePlus = -lwindowscodecs -lole32 }
HAVE_FFMPEG { CSF_FFmpeg = -lavcodec -lavformat -lswscale -lavutil }
HAVE_TBB { CSF_TBB = -ltbb -ltbbmalloc }
HAVE_ZLIB { CSF_ZLIB = -lzlib }
HAVE_LIBLZMA { CSF_LIBLZMA = -lliblzma }
HAVE_DRACO { CSF_Draco = -ldraco }
win32 {
CSF_kernel32 = -lkernel32
CSF_advapi32 = -ladvapi32
CSF_gdi32 = -lgdi32
CSF_user32 = -luser32 -lcomdlg32
CSF_shell32 = -lShell32
CSF_opengl32 = -lopengl32
CSF_wsock32 = -lwsock32
CSF_netapi32 = -lnetapi32
CSF_OpenGlLibs = -lopengl32
CSF_OpenGlesLibs = -llibEGL -llibGLESv2
CSF_psapi = -lPsapi
CSF_winmm = -lwinmm
CSF_d3d9 = -ld3d9
CSF_TclLibs = -ltcl86
CSF_TclTkLibs = -ltk86
CSF_TBB =
} else:mac {
CSF_dl = -ldl
CSF_objc = -lobjc
CSF_OpenGlLibs = -framework OpenGL
CSF_OpenGlesLibs = -framework OpenGLES
iphoneos {
CSF_Appkit = -framework UIKit
} else {
CSF_Appkit = -framework AppKit
}
CSF_IOKit = -framework IOKit
CSF_TclLibs = -framework Tcl
CSF_TclTkLibs = -framework Tk
} else {
CSF_dl = -ldl
CSF_ThreadLibs = -lpthread -lrt
CSF_OpenGlesLibs = -lEGL -lGLESv2
CSF_TclTkLibs = -ltk8.6
HAVE_XLIB {
CSF_OpenGlLibs = -lGL
CSF_XwLibs = -lX11
} else {
CSF_OpenGlLibs = -lGL -lEGL
}
HAVE_FREETYPE { CSF_fontconfig = -lfontconfig }
}
for (aCfgIter, CONFIG) {
aRes = $$find(aCfgIter, "^HAVE_")
!equals(aCfgIter, "HAVE_GLES2") {
count(aRes, 1) {
DEFINES += $$aCfgIter
}
}
}
# Define the list of standard OCCT file extensions
aHxxRegex = ^.*\.(hxx|h|lxx|gxx)$
aPxxRegex = ^.*\.(pxx)$
aCxxRegex = ^.*\.(cxx|cpp|c)$
mac { aCxxRegex = ^.*\.(cxx|cpp|c|m|mm)$ }
# Auxiliary function for probing file extension
defineTest (occCheckExtension) {
aProbe = $$find(1, "$$2")
count(aProbe, 1) { return(true) } else { return(false) }
}
# Auxiliary function for probing compilable files
defineTest (occIsCxxFile) { occCheckExtension ($$1, $$aCxxRegex) { return(true) } else { return(false) } }
# Auxiliary function for probing header files
defineTest (occIsHxxFile) { occCheckExtension ($$1, $$aHxxRegex) { return(true) } else { return(false) } }
aTkFiles = $$cat($$aSrcRoot/$$OCC_TOOLKIT_NAME/FILES, lines)
aTkFiles += CMakeLists.txt
aPackages = $$cat($$aSrcRoot/$$OCC_TOOLKIT_NAME/PACKAGES, lines)
anExternLibs = $$cat($$aSrcRoot/$$OCC_TOOLKIT_NAME/EXTERNLIB, lines)
for (aTkFileIter, aTkFiles) { OTHER_FILES += $$aSrcRoot/$$OCC_TOOLKIT_NAME/$$aTkFileIter }
for (anExternLib, anExternLibs) {
hasCsf = $$find(anExternLib, CSF_)
count(hasCsf, 1) {
aList = $$split($$anExternLib, "\n")
LIBS += $$aList
equals(anExternLib, "CSF_OpenGlLibs") {
DEFINES += "HAVE_OPENGL"
}
equals(anExternLib, "CSF_OpenGlesLibs") {
DEFINES += "HAVE_GLES2"
}
} else {
LIBS += -l$$anExternLib
}
}
# Iterate over Packages and add compilable files into this project
isEmpty (aPackages) { aPackages = $$OCC_TOOLKIT_NAME }
for (aPackage, aPackages) {
aPackageFolder = $$aSrcRoot/$$OCC_TOOLKIT_NAME/$$aPackage
aPackageFiles = $$cat($$aSrcRoot/$$aPackage/FILES, lines)
for (aFileIter, aPackageFiles) {
occIsCxxFile($$aFileIter) {
SOURCES += $$aSrcRoot/$$aPackage/$$aFileIter
}
}
}
!win32 {
aVerList = $$split(VERSION, ".")
aVerMaj = $$member(aVerList, 0)
aVerMin = $$member(aVerList, 1)
aVerMic = $$member(aVerList, 2)
equals(TEMPLATE, app) {
QMAKE_CLEAN += $$DESTDIR/$${TARGET}
} else {
mac {
# override qmake soname versionong logic
QMAKE_LFLAGS_SONAME =
QMAKE_LFLAGS += -Wl,-soname=lib$${TARGET}.dylib.$${aVerMaj}.$${aVerMin}
# extend clean with versioned .dylib files
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.$${aVerMin}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.$${aVerMin}.$${aVerMic}.dylib
} else {
# override qmake soname versionong logic
QMAKE_LFLAGS_SONAME =
QMAKE_LFLAGS += -Wl,-soname=lib$${TARGET}.so.$${aVerMaj}.$${aVerMin}
# extend clean with versioned .so files
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}.$${aVerMin}
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}.$${aVerMin}.$${aVerMic}
}
}
}

View File

@ -1,2 +0,0 @@
OCC_TOOLKIT_NAME = \$\$TARGET
include(../../OccToolkit.pri)

View File

@ -1,45 +0,0 @@
# This is an experimental Solution project for building entire OCCT framework using qmake.
# It can be also used for just source code navigation in Qt Creator without actually building OCCT.
# Note, as this is an experimental project, compiler flags might differ from official builds - use it on your own risk!
# Building OCCT using CMake is a preferred solution.
#
# This project GENERATES sub-projects (OCCT modules) dynamically, so to start using it:
# - Launch genconf, select Project Format "Qt Project" and configure dependencies; this will also generate "custom.auto.pri".
# - Launch genproj to fill in "inc" folder with links to header files.
# - Open project in Qt Creator, and call "Run qmake".
# - Close the project in Qt Creator, open it again so that you should see the sub-modules in Project tree; call "Run qmake" again.
# - "Run qmake" and perform Build.
#
# Within Debian-based Linux repository Qt Creator can be installed like this:
# > sudo apt-get install qtcreator qtbase5-dev
TEMPLATE = subdirs
exists(custom.auto.pri) { include(custom.auto.pri) }
exists(custom.pri) { include(custom.pri) }
OTHER_FILES += OccModule.pro.in \
OcctHeaderLink.hxx.in \
OccToolkit.pro.in \
OccCppConfig.pri \
OccModule.pri \
OccToolkit.pri \
custom.pri.template
# Iterate over Modules and generate sub-projects
aSolModuleList = $$cat(../MODULES, lines)
for (aSolModuleIter, aSolModuleList) {
aSolModule = $$first($$list($$aSolModuleIter))
eval(occtkgen_$${aSolModule}.input = $$_PRO_FILE_PWD_/OccModule.pro.in)
eval(occtkgen_$${aSolModule}.output = $$_PRO_FILE_PWD_/$${aSolModule}/$${aSolModule}.pro)
eval(occtkgen_$${aSolModule}.config = verbatim)
eval(QMAKE_SUBSTITUTES += occtkgen_$${aSolModule})
SUBDIRS += $${aSolModule}
}
# These dependencies are manually defined
ModelingData.depends = FoundationClasses
ModelingAlgorithms.depends = FoundationClasses ModelingData
Visualization.depends = FoundationClasses ModelingData ModelingAlgorithms
ApplicationFramework.depends = FoundationClasses ModelingData ModelingAlgorithms Visualization
DataExchange.depends = FoundationClasses ModelingData ModelingAlgorithms ApplicationFramework
Draw.depends = FoundationClasses ModelingData ModelingAlgorithms ApplicationFramework DataExchange Visualization

View File

View File

@ -1 +0,0 @@
#include \"../src/$${OCCT_PACKAGE}/$${OCCT_HEADER}\"

View File

@ -1,17 +0,0 @@
PRODUCTS_PATH = c:/3rdparty/vc14
#CONFIG += HAVE_FREEIMAGE
#CONFIG += HAVE_FFMPEG
#CONFIG += HAVE_TBB
#CONFIG += HAVE_GLES2
#CONFIG += HAVE_D3D
#CONFIG += HAVE_VTK
aFreeType = $$PRODUCTS_PATH/freetype-2.5.5-vc14-64
aTclTk = $$PRODUCTS_PATH/tcltk-86-64
INCLUDEPATH += $$aFreeType/include
LIBS += -L$$aFreeType/lib
INCLUDEPATH += $$aTclTk/include
LIBS += -L$$aTclTk/lib

View File

@ -1,39 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorCodeStyle>
<!-- Written by QtCreator 3.6.1, 2016-05-19T14:46:43. -->
<qtcreator>
<data>
<variable>CodeStyleData</variable>
<valuemap type="QVariantMap">
<value type="bool" key="AlignAssignments">true</value>
<value type="bool" key="AutoSpacesForTabs">false</value>
<value type="bool" key="BindStarToIdentifier">false</value>
<value type="bool" key="BindStarToLeftSpecifier">true</value>
<value type="bool" key="BindStarToRightSpecifier">false</value>
<value type="bool" key="BindStarToTypeName">true</value>
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
<value type="bool" key="IndentAccessSpecifiers">false</value>
<value type="bool" key="IndentBlockBody">true</value>
<value type="bool" key="IndentBlockBraces">false</value>
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentClassBraces">false</value>
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
<value type="bool" key="IndentEnumBraces">false</value>
<value type="bool" key="IndentFunctionBody">true</value>
<value type="bool" key="IndentFunctionBraces">false</value>
<value type="bool" key="IndentNamespaceBody">true</value>
<value type="bool" key="IndentNamespaceBraces">false</value>
<value type="int" key="IndentSize">2</value>
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentSwitchLabels">true</value>
<value type="int" key="PaddingMode">2</value>
<value type="bool" key="SpacesForTabs">true</value>
<value type="int" key="TabSize">2</value>
</valuemap>
</data>
<data>
<variable>DisplayName</variable>
<value type="QString">occt</value>
</data>
</qtcreator>

View File

@ -33,7 +33,6 @@ set "BUILD_ModelingAlgorithms=ON"
set "BUILD_Visualization=ON"
set "BUILD_ApplicationFramework=ON"
set "BUILD_DataExchange=ON"
set "BUILD_DETools=OFF"
rem Optional 3rd-party libraries to enable
set "USE_FREETYPE=ON"
@ -67,8 +66,9 @@ if ["%toCMake%"] == ["1"] (
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
set "aGitBranch="
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
rem Get OCCT version
call "%~dp0build_common.bat"
set "aGitBranch="
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
for %%s in (%anNdkAbiList%) do (
@ -167,7 +167,6 @@ if ["%toCMake%"] == ["1"] (
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
-D BUILD_MODULE_DETools:BOOL="OFF" ^
-D BUILD_MODULE_Draw:BOOL="OFF" ^
-D BUILD_DOC_Overview:BOOL="OFF" ^
-D USE_FREETYPE:BOOL="%USE_FREETYPE%" ^

View File

@ -27,7 +27,6 @@ rem set "BUILD_ModelingAlgorithms=ON"
rem set "BUILD_Visualization=ON"
rem set "BUILD_ApplicationFramework=ON"
rem set "BUILD_DataExchange=ON"
rem set "BUILD_MODULE_DETools=OFF"
rem Optional 3rd-party libraries to enable
rem set "USE_RAPIDJSON=ON"

View File

@ -0,0 +1,8 @@
@echo OFF
rem Extract version info from version.cmake
for /f tokens^=2^ delims^=^" %%i in ('findstr OCC_VERSION_DEVELOPMENT "%~dp0\..\cmake\version.cmake"') do ( set "anOcctVerSuffix=%%i" )
for /f tokens^=3 %%i in ('findstr OCC_VERSION_MAJOR "%~dp0\..\cmake\version.cmake"') do ( set "OCC_VERSION_MAJOR=%%i" )
for /f tokens^=3 %%i in ('findstr OCC_VERSION_MINOR "%~dp0\..\cmake\version.cmake"') do ( set "OCC_VERSION_MINOR=%%i" )
for /f tokens^=3 %%i in ('findstr OCC_VERSION_MAINTENANCE "%~dp0\..\cmake\version.cmake"') do ( set "OCC_VERSION_MAINTENANCE=%%i" )
set "anOcctVersion=%OCC_VERSION_MAJOR%.%OCC_VERSION_MINOR%.%OCC_VERSION_MAINTENANCE%"

View File

@ -0,0 +1,30 @@
#!/bin/bash
# Ensure script dir is defined
if [ -z "$aScriptDir" ]; then
aScriptDir=$(dirname "$0")
fi
# Check if version file exists
versionFile="$aScriptDir/../cmake/version.cmake"
if [ ! -f "$versionFile" ]; then
echo "Error: version.cmake not found"
exit 1
fi
# Extract version info from version.cmake
OCC_VERSION_MAJOR=$(awk '/set.*OCC_VERSION_MAJOR/ {print $3}' "$versionFile")
OCC_VERSION_MINOR=$(awk '/set.*OCC_VERSION_MINOR/ {print $3}' "$versionFile")
OCC_VERSION_MAINTENANCE=$(awk '/set.*OCC_VERSION_MAINTENANCE/ {print $3}' "$versionFile")
anOcctVerSuffix=$(awk '/set.*OCC_VERSION_DEVELOPMENT/ {
if (NF > 2) {
gsub(/[)" ]/, "", $3)
print $3
} else {
print ""
}
}' "$versionFile")
# Combine version string
anOcctVersion="${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}"

View File

@ -16,7 +16,6 @@ rem set "BUILD_DIR=build-vs%VS%-%VSPLATFORM%"
rem set "INSTALL_DIR=%SrcRoot%\install"
rem set BUILD_DOC_Overview=OFF
rem set BUILD_Inspector=OFF
rem set BUILD_LIBRARY_TYPE=Shared
rem set BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
rem set BUILD_WITH_DEBUG=OFF
@ -28,12 +27,8 @@ rem Use semicolon-separated list of toolkits if you want to disable all modules
rem and build only some toolkits.
rem set BUILD_ADDITIONAL_TOOLKITS=
rem Set a directory recognized as a patch for OCCT.
rem set BUILD_PATCH=
rem set BUILD_MODULE_ApplicationFramework=ON
rem set BUILD_MODULE_DataExchange=ON
rem set BUILD_MODULE_DETools=OFF
rem set BUILD_MODULE_Draw=ON
rem set BUILD_MODULE_ModelingAlgorithms=ON
rem set BUILD_MODULE_ModelingData=ON

View File

@ -11,7 +11,6 @@ FREETYPE_DIR="$OCCT3RDPARTY/freetype-2.7.1"
#INSTALL_DIR="$SrcRoot/install"
#BUILD_DOC_Overview=OFF
#BUILD_Inspector=OFF
#BUILD_LIBRARY_TYPE=Shared
#BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
#BUILD_WITH_DEBUG=OFF
@ -21,12 +20,8 @@ FREETYPE_DIR="$OCCT3RDPARTY/freetype-2.7.1"
# and build only some toolkits.
#BUILD_ADDITIONAL_TOOLKITS=
# Set a directory recognized as a patch for OCCT.
#BUILD_PATCH=
#BUILD_MODULE_ApplicationFramework=ON
#BUILD_MODULE_DataExchange=ON
#BUILD_MODULE_DETools=OFF
#BUILD_MODULE_Draw=ON
#BUILD_MODULE_ModelingAlgorithms=ON
#BUILD_MODULE_ModelingData=ON

View File

@ -17,9 +17,7 @@ set "INSTALL_DIR=%SrcRoot%\install"
set BUILD_ADDITIONAL_TOOLKITS=
set BUILD_DOC_Overview=OFF
set BUILD_Inspector=OFF
set BUILD_LIBRARY_TYPE=Shared
set BUILD_PATCH=
set BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
set BUILD_WITH_DEBUG=OFF
set BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
@ -28,7 +26,6 @@ set BUILD_FORCE_RelWithDebInfo=OFF
set BUILD_MODULE_ApplicationFramework=ON
set BUILD_MODULE_DataExchange=ON
set BUILD_MODULE_DETools=OFF
set BUILD_MODULE_Draw=ON
set BUILD_MODULE_ModelingAlgorithms=ON
set BUILD_MODULE_ModelingData=ON
@ -59,17 +56,14 @@ cmake -G "%arch_compile%" ^
-D 3RDPARTY_DIR:STRING="%OCCT3RDPARTY%" ^
-D BUILD_ADDITIONAL_TOOLKITS:STRING="%BUILD_ADDITIONAL_TOOLKITS%" ^
-D BUILD_DOC_Overview:BOOL=%BUILD_DOC_Overview% ^
-D BUILD_Inspector:BOOL=%BUILD_Inspector% ^
-D BUILD_LIBRARY_TYPE:STRING=%BUILD_LIBRARY_TYPE% ^
-D BUILD_MODULE_ApplicationFramework:BOOL=%BUILD_MODULE_ApplicationFramework% ^
-D BUILD_MODULE_DataExchange:BOOL=%BUILD_MODULE_DataExchange% ^
-D BUILD_MODULE_DETools:BOOL=%BUILD_MODULE_DETools% ^
-D BUILD_MODULE_Draw:BOOL=%BUILD_MODULE_Draw% ^
-D BUILD_MODULE_FoundationClasses:BOOL=ON ^
-D BUILD_MODULE_ModelingAlgorithms:BOOL=%BUILD_MODULE_ModelingAlgorithms% ^
-D BUILD_MODULE_ModelingData:BOOL=%BUILD_MODULE_ModelingData% ^
-D BUILD_MODULE_Visualization:BOOL=%BUILD_MODULE_Visualization% ^
-D BUILD_PATCH:PATH="%BUILD_PATCH%" ^
-D BUILD_RELEASE_DISABLE_EXCEPTIONS:BOOL=%BUILD_RELEASE_DISABLE_EXCEPTIONS% ^
-D BUILD_WITH_DEBUG:BOOL=%BUILD_WITH_DEBUG% ^
-D BUILD_ENABLE_FPE_SIGNAL_HANDLER:BOOL=%BUILD_ENABLE_FPE_SIGNAL_HANDLER% ^

View File

@ -22,16 +22,13 @@ INSTALL_DIR_LIB=lin64/gcc/lib$DEB
BUILD_ADDITIONAL_TOOLKITS=
BUILD_DOC_Overview=OFF
BUILD_Inspector=OFF
BUILD_LIBRARY_TYPE=Shared
BUILD_PATCH=
BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
BUILD_WITH_DEBUG=OFF
BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
BUILD_MODULE_ApplicationFramework=ON
BUILD_MODULE_DataExchange=ON
BUILD_MODULE_DETools=OFF
BUILD_MODULE_Draw=ON
BUILD_MODULE_ModelingAlgorithms=ON
BUILD_MODULE_ModelingData=ON
@ -60,17 +57,14 @@ cmake -G "Unix Makefiles" \
-D 3RDPARTY_FREETYPE_DIR:PATH="$FREETYPE_DIR" \
-D BUILD_ADDITIONAL_TOOLKITS:STRING="$BUILD_ADDITIONAL_TOOLKITS" \
-D BUILD_DOC_Overview:BOOL=$BUILD_DOC_Overview \
-D BUILD_Inspector:BOOL=$BUILD_Inspector \
-D BUILD_LIBRARY_TYPE:STRING=$BUILD_LIBRARY_TYPE \
-D BUILD_MODULE_ApplicationFramework:BOOL=$BUILD_MODULE_ApplicationFramework \
-D BUILD_MODULE_DataExchange:BOOL=$BUILD_MODULE_DataExchange \
-D BUILD_MODULE_DETools:BOOL=$BUILD_MODULE_DETools \
-D BUILD_MODULE_Draw:BOOL=$BUILD_MODULE_Draw \
-D BUILD_MODULE_FoundationClasses:BOOL=ON \
-D BUILD_MODULE_ModelingAlgorithms:BOOL=$BUILD_MODULE_ModelingAlgorithms \
-D BUILD_MODULE_ModelingData:BOOL=$BUILD_MODULE_ModelingData \
-D BUILD_MODULE_Visualization:BOOL=$BUILD_MODULE_Visualization \
-D BUILD_PATCH:PATH="$BUILD_PATCH" \
-D BUILD_RELEASE_DISABLE_EXCEPTIONS:BOOL=$BUILD_RELEASE_DISABLE_EXCEPTIONS \
-D BUILD_WITH_DEBUG:BOOL=$BUILD_WITH_DEBUG \
-D BUILD_ENABLE_FPE_SIGNAL_HANDLER:BOOL=$BUILD_ENABLE_FPE_SIGNAL_HANDLER \

View File

@ -34,7 +34,6 @@ export BUILD_ModelingAlgorithms=ON
export BUILD_Visualization=ON
export BUILD_ApplicationFramework=ON
export BUILD_DataExchange=ON
export BUILD_DETools=OFF
export USE_FREETYPE=ON
export USE_FREEIMAGE=OFF
@ -49,8 +48,7 @@ if [[ -f "${aScriptDir}/ios_custom.sh" ]]; then
source "${aScriptDir}/ios_custom.sh"
fi
anOcctVerSuffix=`grep -e "#define OCC_VERSION_DEVELOPMENT" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
anOcctVersion=`grep -e "#define OCC_VERSION_COMPLETE" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
source "${aScriptDir}/build_common.sh"
aGitBranch=`git symbolic-ref --short HEAD`
YEAR=$(date +"%Y")
@ -149,7 +147,6 @@ function buildArch {
-D BUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
-D BUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
-D BUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
-D BUILD_MODULE_DETools:BOOL="${BUILD_DETools}" \
-D BUILD_MODULE_Draw:BOOL="OFF" \
-D BUILD_DOC_Overview:BOOL="OFF" \
"$aCasSrc" 2>&1 | tee -a "$aLogFile"

View File

@ -20,7 +20,6 @@ export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-ios"
#export BUILD_Visualization=ON
#export BUILD_ApplicationFramework=ON
#export BUILD_DataExchange=ON
#export BUILD_DETools=OFF
#export USE_RAPIDJSON=ON
#export USE_DRACO=ON

View File

@ -34,7 +34,6 @@ export BUILD_ModelingAlgorithms=ON
export BUILD_Visualization=ON
export BUILD_ApplicationFramework=ON
export BUILD_DataExchange=ON
export BUILD_DETools=OFF
export BUILD_Draw=ON
export USE_FREETYPE=ON
@ -51,8 +50,7 @@ if [[ -f "${aScriptDir}/macos_custom.sh" ]]; then
source "${aScriptDir}/macos_custom.sh"
fi
anOcctVerSuffix=`grep -e "#define OCC_VERSION_DEVELOPMENT" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
anOcctVersion=`grep -e "#define OCC_VERSION_COMPLETE" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
source "${aScriptDir}/build_common.sh"
aGitBranch=`git symbolic-ref --short HEAD`
YEAR=$(date +"%Y")
@ -146,7 +144,6 @@ function buildArch {
-D BUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
-D BUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
-D BUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
-D BUILD_MODULE_DETools:BOOL="${BUILD_DETools}" \
-D BUILD_MODULE_Draw:BOOL="${BUILD_Draw}" \
-D BUILD_DOC_Overview:BOOL="OFF" \
"$aCasSrc" 2>&1 | tee -a "$aLogFile"

View File

@ -19,7 +19,6 @@ export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-macos"
#export BUILD_Visualization=ON
#export BUILD_ApplicationFramework=ON
#export BUILD_DataExchange=ON
#export BUILD_DETools=OFF
#export BUILD_Draw=ON
#export USE_RAPIDJSON=ON

View File

@ -32,7 +32,6 @@ set "BUILD_ModelingAlgorithms=ON"
set "BUILD_Visualization=ON"
set "BUILD_ApplicationFramework=ON"
set "BUILD_DataExchange=ON"
set "BUILD_DETools=OFF"
set "BUILD_Draw=ON"
rem Optional 3rd-party libraries to enable
@ -53,9 +52,8 @@ if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
call "%~dp0build_common.bat"
set "aGitBranch="
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
set "aBuildType=Release"
@ -156,7 +154,6 @@ if ["%toCMake%"] == ["1"] (
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
-D BUILD_MODULE_DETools:BOOL="%BUILD_DETools%" ^
-D BUILD_MODULE_Draw:BOOL="%BUILD_Draw%" ^
-D 3RDPARTY_TCL_DIR:PATH="%aTclTk%" ^
-D 3RDPARTY_TCL_INCLUDE_DIR:FILEPATH="%aTclTk%/include" ^

View File

@ -22,7 +22,6 @@ rem set "BUILD_ModelingAlgorithms=ON"
rem set "BUILD_Visualization=ON"
rem set "BUILD_ApplicationFramework=ON"
rem set "BUILD_DataExchange=ON"
rem set "BUILD_DETools=OFF"
rem set "BUILD_Draw=ON"
rem set "USE_RAPIDJSON=ON"

View File

@ -32,7 +32,6 @@ set "BUILD_ModelingAlgorithms=ON"
set "BUILD_Visualization=ON"
set "BUILD_ApplicationFramework=ON"
set "BUILD_DataExchange=ON"
set "BUILD_DETools=OFF"
set "BUILD_Draw=OFF"
rem Optional 3rd-party libraries to enable
@ -55,8 +54,8 @@ if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
set "aGitBranch="
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
call "%~dp0build_common.bat"
set "aGitBranch="
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
set "aBuildType=Release"
@ -176,7 +175,6 @@ if ["%toCMake%"] == ["1"] (
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
-D BUILD_MODULE_DETools:BOOL="%BUILD_DETools%" ^
-D BUILD_MODULE_Draw:BOOL="%BUILD_Draw%" ^
-D BUILD_DOC_Overview:BOOL="OFF" ^
-D USE_FREETYPE:BOOL="%USE_FREETYPE%" ^

View File

@ -20,7 +20,6 @@ export BUILD_ModelingAlgorithms=ON
export BUILD_Visualization=ON
export BUILD_ApplicationFramework=ON
export BUILD_DataExchange=ON
export BUILD_DETools=OFF
if [ -f "${aScriptDir}/wasm_custom.sh" ] ; then
. "${aScriptDir}/wasm_custom.sh"
@ -75,7 +74,6 @@ echo cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
-DBUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
-DBUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
-DBUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
-DBUILD_MODULE_DETools:BOOL="${BUILD_DETools}" \
-DBUILD_MODULE_Draw:BOOL="OFF" \
-DBUILD_DOC_Overview:BOOL="OFF" "${aSrcRoot}"
@ -94,7 +92,6 @@ cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
-DBUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
-DBUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
-DBUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
-DBUILD_MODULE_DETools:BOOL="${BUILD_DETools}" \
-DBUILD_MODULE_Draw:BOOL="OFF" \
-DBUILD_DOC_Overview:BOOL="OFF" "${aSrcRoot}"

Some files were not shown because too many files have changed in this diff Show More