How to set up cmake for custom program using OCCT?

Hi, I am trying to write my own application using OCCT on Ubuntu. How do you guys set up your cmake to compile everything? especially,if I am only interested in the StepProcessor and the Modelling data module. I am trying to use the find_package command in cmake. But I am afraid I am new at this. any tutorial out there?

 

cheers

 

Catriel Carbonera's picture

Hi Mark,

I cannot answer your question, but am wondering if you have figured out how to extract a subset of OpenCascade that is independent of all graphics package. I am also interested in building an application. In particular, I want a console application.

Thanks,

CC

marc wang's picture

Hi sorry for the late response,

I currently have this cmake file. It is supposed to only  build the module I have specified but unfortunately I get the following error

WARNING: Target "OpenCascadeLearning" requests linking to directory "/usr/local/lib". Targets may link only to libraries. CMake is dropping the item.

Attachments: 
Forum supervisor's picture

Dear Marc,

You should define the full library path (not just the directory) for cmake target_link_libraries to find the library. 

You can find proper examples of CMakeLists.txt in OCCT Samples (occt\samples\mfc).

Best regards, FSR