make sure to not only build but also install opencascade in a specific directory to get all the correct files.
Yes it is present in
D:\Work2\OCCT\build\CMakeFiles\Export\272ceadb8458515b2ae4b5630a6029cc
That doesn’t sound right to me. Which compiler toolchain did you use? You have to configure, generate and then build the code.
I used Visual Studio 17 2022 Community Edition and while installation selected Desktop development with C++.
selected Desktop development with C++.
I’m not sure what that means. How long did the build take to complete?
It took 2-3 minutes…
Found OpenCASCADE (D:/Work2/OCCT/build) is missing the following required
targets: TKDESTEP, TKDEIGES, TKernel, TKMath, TKMesh, TKBRep, TKXSBase,
TKLCAF, TKXCAF
Also I found folders with these names(TKDESTEP, TKDEIGES, …) in OCCT/build/src
That’s not possible. C++ is not an interpreted language. You have to compile it.
I see you’re using cmake-gui.
You have to cofigure, generate and then open project to build it in Visual Studio.
Apologies I did not understand the question properly… Configure and Generate took around 2 minutes, and I did Open Project and built it in Visual Studio it took around 10 minutes.
I have built it
Which version of OpenCascade are you building?
The OCCT libs were reorganised in version 7.8 so I would suggest you build version 7.7 for VTK integration…
I am building 7.8.0
Sure I will try with 7.7
Hi, I built the OpenCascade 7.7.2 and got the same errors…
Screenshot from VS while building OCC
Hi, Mathieu I have installed the OpenCascade by clicking Build on INSTALL in Visual Studio and got it in a specific folder…
Nice, then point to the OCCT_DIR to the directory containiing the -config.txt
files.
@FrontEnd_Dev I just tried this by pointing OpenCascade_DIR to my own OCCT build folder and then to my OCCT install folder.
I’m seeing the exact same errors during CMake configuration.
CMake Error at D:/3RD_PARTY/Build_OpenCascade-7.7.0_64/OpenCASCADEConfig.cmake:101 (include):
include could not find requested file:
D:/3RD_PARTY/Build_OpenCascade-7.7.0_64/OpenCASCADEDrawTargets.cmake
Call Stack (most recent call first):
CMake/vtkModule.cmake:5351 (find_package)
IO/OCCT/CMakeLists.txt:1 (vtk_module_find_package)
@mwestphal There seems to be a problem with the CMake settings in VTK for OpenCascade
By copying the OpenCascade*Targets.cmake files from
D:\3RD_PARTY\Build_OpenCascade-7.7.0_64\CMakeFiles\Export\cmake
back to
D:\3RD_PARTY\Build_OpenCascade-7.7.0_64
I was able to configure VTK with OCCT correctly.
Hi, Todd. Sorry for asking for a dumb question…
For OCCT, do I need to just Build Solution or Build-INSTALL too…
Build Solution
INSTALL-Build
or Please can you note down all the steps you did for OCCT and VTK to get working in your machine…
When you build INSTALL in Visual Studio it will automatically build ALL_BUILD as well.
INSTALL copies all the generated *.lib
and *.dll
files into the folder you specified as INSTALL_DIR in cmake when configuring OpenCascade.
I suppose VTK cmake expects OpenCASCADE_DIR
to point to the OCCT install folder, rather than the build folder, so that the VTK project can link the *.lib files after compiling, but there is something wrong with the cmake settings so that it does not find the OpenCASCADE*Targets.cmake
files there.
What I did was I set OpenCASCADE_DIR
to
D:\3RD_PARTY\Build_OpenCascade-7.7.0_64
and copied the OpenCASCADE*Targets.cmake
files back from a sub-folder. That allowed the VTK configuration step to finish. But I don’t think that is the correct approach.
Hi @toddy thanks for the detailed response… When building vtk and OCCT for python are there any flags to be check✅ or kept YES in CMake GUI when building
- OpenCascade
- VTK
While building VTK, as per the documentation VTK_MODULE_ENABLE_VTK_IOOCCT I have made it YES
Herein lies the problem I think. I had a look at my Linux build of OpenCascade and the path to the OpenCASCADE*Targets.cmake
files is different from Windows.
$Build\CMakeFiles\Export\cmake
versus
$Build/CMakeFiles/Export/lib/cmake/opencascade
Likewise for the install folder
$Install\cmake
versus
$Install/lib/cmake/opencascade